Skip to content

Commit

Permalink
New Symfony 4 bin/composer directory structure (#9)
Browse files Browse the repository at this point in the history
* New Symfony 4 bin/composer directory structure

Hi thanks for this helpful bundle. The update script anticipates the need to use 'bin' rather than 'app' but the method useNewDirectoryStructure is looking for symfony-var-dir option.  I added the symfony-bin-dir directory as an explicit option and the useNewDirectoryStructure method to look for that.  I think this will help keep the script working with projects independent of 'symfony-var-dir' .  Thanks!

* Update ScriptHandler.php

* Update ScriptHandler.php

* Update README.md

Took a deeper dive on this and it turns out we can just call the Command directly.  Updated the docs, thank you.

* Update README.md
  • Loading branch information
ChrisKinnan authored and peter-gribanov committed Jul 30, 2019
1 parent bb3cd97 commit bd4e571
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,19 @@ Add to your `composer.json` event callbacks in a `scripts` section:
}
```

**Symfony >4 Flex**

Add the command "geoip2:update": "symfony-cmd" to your autoscripts

```json
{
"scripts": {
"auto-scripts": {
"geoip2:update": "symfony-cmd"
},
}
}
```

## License

Expand Down
4 changes: 2 additions & 2 deletions src/Composer/ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ScriptHandler
* to forthcoming listeners.
*/
private static $options = [
'symfony-app-dir' => 'app',
'symfony-app-dir' => 'app'
];

/**
Expand Down Expand Up @@ -151,7 +151,7 @@ private static function hasDirectory(Event $event, $config_name, $path, $action_
*/
private static function useNewDirectoryStructure(array $options)
{
return isset($options['symfony-var-dir']) && is_dir($options['symfony-var-dir']);
return isset($options['symfony-bin-dir']) && is_dir($options['symfony-bin-dir']);
}

/**
Expand Down

0 comments on commit bd4e571

Please sign in to comment.