Skip to content

Commit

Permalink
use 0640 fileperms as is default in trellis
Browse files Browse the repository at this point in the history
make dumpFile call compatible with Symfony Filesystem 3.x.

See honeybee/trellis#27
  • Loading branch information
graste committed Aug 29, 2016
1 parent 9d98c17 commit 7e270d1
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
class MappingGeneratorPlugin implements PluginInterface
{
const FILE_MODE = 0644;
const FILE_MODE = 0640;

protected static $es_type_map = [
'asset' => 'object',
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7e270d1

Please sign in to comment.