cdev helps you configure your repository to run on virtual environments. It provides a consistent approach to configure, start, stop and destroy environments There are also a smattering of site commands for popular frameworks
This will install the phar to the ~/.cdev directory, and create an alias at /usr/local/bin/cdev
curl -s https://garethmidwood.github.io/cdev/install | bash -s
# confirm installation
which cdev
cdev will update itself to the latest version when you run
cdev self-update
PHP 5.6 or higher
Global config is used as default values for project configuration.
cdev global:configure
In order to use cdev on a project you must first configure it:
git clone git@your:repo.git
cd project/dir
cdev configure
cd project/dir
cdev env:start
cd project/dir
cdev env:stop
cd project/dir
cdev env:nuke
# from anywhere
cdev env:cleanup
cd project/dir
cdev env:ssh
cd project/dir
cdev env:db
All contributions are welcome, please submit a pull request!
The repository is packaged with a local-build.sh
script that will generate a cdev-local
app for you to test your changes.
git clone [email protected]:garethmidwood/cdev.git cdev && cd cdev
# install dependencies
cd src && composer install && cd -
# You must have box installed. See https://github.com/box-project/box2
# Allow phar files to be created
# file: php.ini
[Phar]
; http://php.net/phar.readonly
phar.readonly = Off
# build a local copy of cdev for testing
# this will build and copy the file to /usr/local/bin/cdev-local
./local-build.sh
# check it worked
which cdev-local
# should output /usr/local/bin/cdev-local
Some configuration options require the user to choose which class they want to use (e.g. environment, framework, storage). If you want to create a new collection you must do a few things:
- Create collection class in
Creode\Collections
namespace - If your collection is bundled with options already then you need to add them with
addItem()
(see framework collection for an example) - Create a register function (e.g.
registerStorage()
) in the plugin manager - Add a folder in the
Creode
director, this folder will be the name of your namespace and must be capitalized. - Add your option classes in their own folder within your new namespace.
- If your classes have their own configuration then create a
Command
directory within the option dir, add a setup command in here - Update
Cdev\ConfigureCommand
, add a search and a replacement value insaveServicesXml
for your new config option - Add the same search value into
templates/services.env.xml
. This template will be used when a configuration is saved