Cli command to generate a basic PHP project structure.
Construct should be installed globally through composer.
composer global require "jonathantorres/construct=~1.0"Make sure that ~/.composer/vendor/bin is on your $PATH. This way the construct executable can be located.
Just run construct generate with your vendor/package declaration and it will create a basic php project on the package directory. For example, if you run construct generate jonathantorres/logger it will generate a basic project structure inside the logger folder.
construct generate jonathantorres/loggerThe current project structure will be the following:
├── logger/
│ ├── src/
│ │ ├── Logger.php
│ ├── tests/
│ │ ├── LoggerTest.php
│ ├── .gitignore
│ ├── .travis.yml
│ ├── composer.json
│ ├── phpunit.xml
│ ├── README.md
This is a good starting point. You can continue your work from there.
The --test option will allow you to select a testing framework. One of the following is available at the moment: phpunit, phpspec, codeception or behat. phpunit is currently the default.
construct generate jonathantorres/logger --test=codeceptionYou can also use the short code -t
construct generate jonathantorres/logger -t codeceptionJust run vendor/bin/phpunit from your project root directory.