From 7e270d10e40bdfb6dd0ea88c9f2bf5f1f4439682 Mon Sep 17 00:00:00 2001 From: Steffen Gransow Date: Mon, 29 Aug 2016 11:23:27 +0000 Subject: [PATCH] use 0640 fileperms as is default in trellis make dumpFile call compatible with Symfony Filesystem 3.x. See honeybee/trellis#27 --- .../Elasticsearch/MappingGeneratorPlugin.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/app/lib/Agavi/CodeGen/Trellis/Plugin/Elasticsearch/MappingGeneratorPlugin.php b/app/lib/Agavi/CodeGen/Trellis/Plugin/Elasticsearch/MappingGeneratorPlugin.php index 23dcd0b6..364813c1 100644 --- a/app/lib/Agavi/CodeGen/Trellis/Plugin/Elasticsearch/MappingGeneratorPlugin.php +++ b/app/lib/Agavi/CodeGen/Trellis/Plugin/Elasticsearch/MappingGeneratorPlugin.php @@ -15,7 +15,7 @@ */ class MappingGeneratorPlugin implements PluginInterface { - const FILE_MODE = 0644; + const FILE_MODE = 0640; protected static $es_type_map = [ 'asset' => 'object', @@ -63,16 +63,10 @@ public function execute(EntityTypeSchema $type_schema) $index_name = $this->options->get('index_name'); $type_name = $this->options->get('type_name'); - $this->file_system->dumpFile( - $this->options['deploy_path'], - json_encode( - [ - 'properties' => (object)$type_properties - ], - JSON_PRETTY_PRINT - ), - self::FILE_MODE - ); + $json = json_encode([ 'properties' => (object)$type_properties ], JSON_PRETTY_PRINT); + + $this->file_system->dumpFile($this->options['deploy_path'], $json); + $this->file_system->chmod($this->options['deploy_path'], self::FILE_MODE); } protected function buildTypePropertiesMapping(EntityTypeDefinition $type_definition)