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)