Command line tools for ubiquity-framework
, (*1)
Command line tools for Ubiquity framework, (*3)
Install Composer in a common location or in your project:, (*4)
curl -s http://getcomposer.org/installer | php
Run the composer installer :, (*5)
composer global require phpmv/ubiquity-devtools
Make sure to place the ~/.composer/vendor/bin
directory in your PATH so the Ubiquity executable can be located by your system., (*6)
To confirm Ubiquity was successfully installed, type Ubiquity version
:, (*7)
, (*8)
If you get the message Ubiquity command not found
Add composer's bin
directory to the system path
%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
to the system PATH variable
export PATH="$HOME/.composer/vendor/bin:$PATH"
into your ~/.bash_profile
(Mac OS users) or into your ~/.bashrc
(Linux users).
To get a list of available commands just run in console:, (*10)
Ubiquity help
This command should display something similar to:, (*11)
Ubiquity devtools (1.3.6) โ init-cache [] => ยท Init the cache for models, router, rest. ยท Aliases : init_cache,init:cache,initCache ยท Parameters : -t shortcut of --type Defines the type of cache to create. Possibles values : all,controllers,acls,rest,models Default : [all] ร Samples : Init all caches ยท Ubiquity init-cache Init models cache ยท Ubiquity init-cache -t=models โ clear-cache [] => ยท Clear models cache. ยท Aliases : clear_cache,clear:cache,clearCache ยท Parameters : -t shortcut of --type Defines the type of cache to reset. Possibles values : all,annotations,controllers,rest,models,queries,views Default : [all] ร Samples : Clear all caches ยท Ubiquity clear-cache -t=all Clear models cache ยท Ubiquity clear-cache -t=models โ controller [controllerName] => ยท Creates a new controller. ยท Aliases : create_controller,create:controller,create-controller,createController ยท Parameters : -v shortcut of --views creates an associated view folder and index.html Possibles values : true,false Default : [false] -o shortcut of --domain The domain in which to create the controller. ร Samples : Creates a controller ยท Ubiquity controller UserController with its associated view ยท Ubiquity controller UserController -v Creates a controller in the orga domain ยท Ubiquity controller OrgaController -o=orga โ action [controller.action] => ยท Creates a new action in a controller. ยท Aliases : new-action,new_action,new:action,newAction ยท Parameters : -p shortcut of --params The action parameters (or arguments) -r shortcut of --route The associated route path -v shortcut of --create-view Creates the associated view Possibles values : true,false Default : [false] -o shortcut of --domain The domain in which the controller is. ร Samples : Adds the action all in controller Users ยท Ubiquity action Users.all Adds the action display in controller Users with a parameter ยท Ubiquity action Users.display -p=idUser and associates a route to it ยท Ubiquity action Users.display -p=idUser -r=/users/display/{idUser} with multiple parameters ยท Ubiquity action Users.search -p=name,address and create the associated view ยท Ubiquity action Users.search -p=name,address -v โ auth [authControllerName] => ยท Creates a new controller for authentification. ยท Aliases : auth-controller,auth_controller,auth:controller,authController ยท Parameters : -e shortcut of --extends The base class of the controller (must derived from AuthController) Default : [Ubiquity\controllers\auth\AuthController] -t shortcut of --templates The templates to modify Possibles values : index,info,noAccess,disconnected,message,baseTemplate Default : [index,info,noAccess,disconnected,message,baseTemplate] -p shortcut of --path The associated route -o shortcut of --domain The domain in which to create the controller. ร Samples : Creates a new controller for authentification ยท Ubiquity auth AdminAuthController and associates a route to it ยท Ubiquity auth AdminAuthController -p=/admin/auth allows customization of index and info templates ยท Ubiquity auth AdminAuthController -t=index,info โ crud-index [crudControllerName] => ยท Creates a new index-CRUD controller. ยท Aliases : crud-index-controller,crud_index,crud:index,crudIndex ยท Parameters : -d shortcut of --datas The associated Datas class Possibles values : true,false Default : [true] -v shortcut of --viewer The associated Viewer class Possibles values : true,false Default : [true] -e shortcut of --events The associated Events class Possibles values : true,false Default : [true] -t shortcut of --templates The templates to modify Possibles values : index,form,display,item,itemHome Default : [index,form,display,home,itemHome] -p shortcut of --path The associated route Default : [{resource}] -o shortcut of --domain The domain in which to create the controller. ร Samples : Creates an index crud controller ยท Ubiquity crud-index MainCrud -p=crud/{resource} allows customization of index and form templates ยท Ubiquity index-crud MainCrud -t=index,form โ crud [crudControllerName] => ยท Creates a new CRUD controller. ยท Aliases : crud_controller,crud:controller,crud-controller,crudController ยท Parameters : -r shortcut of --resource The model used -d shortcut of --datas The associated Datas class Possibles values : true,false Default : [true] -v shortcut of --viewer The associated Viewer class Possibles values : true,false Default : [true] -e shortcut of --events The associated Events class Possibles values : true,false Default : [true] -t shortcut of --templates The templates to modify Possibles values : index,form,display Default : [index,form,display] -p shortcut of --path The associated route -o shortcut of --domain The domain in which to create the controller. ร Samples : Creates a crud controller for the class models\User ยท Ubiquity crud CrudUsers -r=User and associates a route to it ยท Ubiquity crud CrudUsers -r=User -p=/users allows customization of index and form templates ยท Ubiquity crud CrudUsers -r=User -t=index,form Creates a crud controller for the class models\projects\Author ยท Ubiquity crud Authors -r=models\projects\Author โ new-class [name] => ยท Creates a new class. ยท Aliases : new_class,new:class,newClass,class ยท Parameters : -p shortcut of --parent The class parent. ร Samples : Creates a new class ยท Ubiquity class services.OrgaRepository โ create-theme [themeName] => ยท Creates a new theme or installs an existing one. ยท Aliases : create_theme,create:theme,createTheme ยท Parameters : -x shortcut of --extend If specified, inherits from an existing theme (bootstrap,semantic or foundation). Possibles values : bootstrap,semantic,foundation -o shortcut of --domain The domain in which to create the theme. ร Samples : Creates a new theme custom ยท Ubiquity create-theme custom Creates a new theme inheriting from Bootstrap ยท Ubiquity theme myBootstrap -x=bootstrap โ theme [themeName] => ยท Installs an existing theme or creates a new one if the specified theme does not exists. ยท Aliases : install_theme,install-theme,install:theme,installTheme ยท Parameters : -o shortcut of --domain The domain in which to install the theme. ร Samples : Creates a new theme custom ยท Ubiquity theme custom Install bootstrap theme ยท Ubiquity theme bootstrap โ project [projectName] => ยท Creates a new #ubiquity project. ยท Aliases : new,create_project ยท Parameters : -b shortcut of --dbName Sets the database name. -s shortcut of --serverName Defines the db server address. Default : [127.0.0.1] -p shortcut of --port Defines the db server port. Default : [3306] -u shortcut of --user Defines the db server user. Default : [root] -w shortcut of --password Defines the db server password. -h shortcut of --themes Install themes. Possibles values : semantic,bootstrap,foundation -m shortcut of --all-models Creates all models from database. -a shortcut of --admin Adds UbiquityMyAdmin tool. Possibles values : true,false Default : [false] -i shortcut of --siteUrl Sets the site base URL. -e shortcut of --rewriteBase Sets .htaccess file rewriteBase. ร Samples : Creates a new project ยท Ubiquity new blog With admin interface ยท Ubiquity new blog -a and models generation ยท Ubiquity new blog -a -m -b=blogDB โ serve [] => ยท Start a web server. ยท Parameters : -h shortcut of --host Sets the host ip address. Default : [127.0.0.1] -p shortcut of --port Sets the listen port number. Default : [8090] -n shortcut of --nolr Starts without live-reload. -l shortcut of --lrport Sets the live-reload listen port number. Default : [35729] -t shortcut of --type Sets the server type. Possibles values : php,react,swoole,roadrunner Default : [php] ร Samples : Starts a php server at 127.0.0.1:8090 ยท Ubiquity serve Starts a reactPHP server at 127.0.0.1:8080 ยท Ubiquity serve -t=react โ livereload [path] => ยท Start the live reload server. ยท Aliases : live-reload,live ยท Parameters : -p shortcut of --port Sets the listen port number. Default : [35729] -e shortcut of --exts Specify extentions to observe . Default : [php,html] -x shortcut of --exclusions Exclude file matching pattern . Default : [cache/,logs/] ร Samples : Starts the live-reload server at 127.0.0.1:35729 ยท Ubiquity live-reload Starts the live-reload server at 127.0.0.1:35800 excluding logs directory ยท Ubiquity live-reload -p=35800 -x=logs/ โ bootstrap [command] => ยท Executes a command created in app/config/_bootstrap.php file for bootstraping the app. ยท Aliases : boot ร Samples : Bootstrap for dev mode ยท Ubiquity bootstrap dev Bootstrap for prod mode ยท Ubiquity bootstrap prod โ help [?] => ยท Get some help about a dev-tools command. ร Samples : Get some help about crud ยท Ubiquity help crud โ version [] => ยท Return PHP, Framework and dev-tools versions. โ model [modelName] => ยท Generates models from scratch. ยท Aliases : create_model,create:model,create-model,createModel,new_model,new:model,new-model,newModel ยท Parameters : -d shortcut of --database The database connection to use Default : [default] -o shortcut of --domain The domain in which to create the model. -k shortcut of --autoincPk The default primary key defined as autoinc. Default : [id] ร Samples : ยท Ubiquity model User ยท Ubiquity model Author -d=projects ยท Ubiquity model Group,User -o=orga โ genModel [tableName] => ยท Generates a new model from an existing table. ยท Aliases : gen_model,gen:model,gen-model,genModel ยท Parameters : -d shortcut of --database The database connection to use Default : [default] -a shortcut of --access The default access to the class members Default : [private] -o shortcut of --domain The domain in which to create the model. ร Samples : ยท Ubiquity genModel User ยท Ubiquity genModel Author -d=projects ยท Ubiquity genModel Author -d=projects -a=protected โ all-models [] => ยท Generates all models from database. ยท Aliases : create-all-models,all_models,all:models,allModels ยท Parameters : -d shortcut of --database The database connection to use (offset) Default : [default] -a shortcut of --access The default access to the class members Default : [private] -o shortcut of --domain The domain in which to create the models. ร Samples : ยท Ubiquity all-models ยท Ubiquity all-models -d=projects ยท Ubiquity all-models -d=projects -a=protected โ info-migrations [] => ยท Returns the migration infos. ยท Aliases : info_migrations,info:migrations,infoMigrations ยท Parameters : -d shortcut of --database The database offset. Default : [default] -o shortcut of --domain The domain in which the database models are. ร Samples : Display all migrations for the default database ยท Ubiquity info:migrations โ migrations [] => ยท Display and execute the database migrations. ยท Aliases : migrations,migrate ยท Parameters : -d shortcut of --database The database offset. Default : [default] -o shortcut of --domain The domain in which the database models are. ร Samples : Display and execute all migrations for the default database ยท Ubiquity migrations โ dao [command] => ยท Executes a DAO command (getAll,getOne,count,uGetAll,uGetOne,uCount). ยท Aliases : DAO ยท Parameters : -r shortcut of --resource The model used -c shortcut of --condition The where part of the query -i shortcut of --included The associated members to load (boolean or array: client.*,commands) -p shortcut of --parameters The parameters for a parameterized query -f shortcut of --fields The fields to display in the response -o shortcut of --domain The domain in which the models are. ร Samples : Returns all instances of models\User ยท Ubiquity dao getAll -r=User Returns all instances of models\User and includes their commands ยท Ubiquity dao getAll -r=User -i=commands Returns the User with the id 5 ยท Ubiquity dao getOne -c="id=5"-r=User Returns the list of users belonging to the "Brittany" or "Normandy" regions ยท Ubiquity uGetAll -r=User -c="region.name= ? or region.name= ?" -p=Brittany,Normandy โ self-update [] => ยท Updates Ubiquity framework for the current project. โ composer [command] => ยท Executes a composer command. ยท Aliases : compo ร Samples : composer update ยท Ubiquity composer update composer update with no-dev ยท Ubiquity composer nodev composer optimization for production ยท Ubiquity composer optimize โ admin [] => ยท Add UbiquityMyAdmin webtools to the current project. โ rest [restControllerName] => ยท Creates a new REST controller. ยท Aliases : rest-controller,rest:controller,rest_controller,restController ยท Parameters : -r shortcut of --resource The model used -p shortcut of --path The associated route -o shortcut of --domain The domain in which to create the controller. ร Samples : Creates a REST controller for the class models\User ยท Ubiquity rest RestUsers -r=User -p=/rest/users โ restapi [restControllerName] => ยท Creates a new REST API controller. ยท Aliases : restapi-controller,restapi:controller,restapi_controller,restapiController ยท Parameters : -p shortcut of --path The associated route -o shortcut of --domain The domain in which to create the controller. ร Samples : Creates a REST API controller ยท Ubiquity restapi -p=/rest โ info-routes [] => ยท Display the cached routes. ยท Aliases : info:r,info_routes,info:routes,infoRoutes ยท Parameters : -t shortcut of --type Defines the type of routes to display. Possibles values : all,routes,rest -l shortcut of --limit Specifies the number of routes to return. -o shortcut of --offset Specifies the number of routes to skip before starting to return. -s shortcut of --search Search routes corresponding to a path. -m shortcut of --method Allows to specify a method with search attribute. Possibles values : get,post,put,delete,patch ร Samples : All routes ยท Ubiquity info:routes Rest routes ยท Ubiquity info:routes -type=rest Only the routes with the method post ยท Ubiquity info:routes -type=rest -m=-post โ info-model [?infoType] => ยท Returns the model meta datas. ยท Aliases : info_model,info:model,infoModel ยท Parameters : -s shortcut of --separate If true, returns each info in a separate table Possibles values : true,false Default : [false] -m shortcut of --model The model on which the information is sought. -f shortcut of --fields The fields to display in the table. -o shortcut of --domain The domain in which the models is. ร Samples : Gets metadatas for User class ยท Ubiquity info:model -m=User โ info-models [] => ยท Returns the models meta datas. ยท Aliases : info_models,info:models,infoModels ยท Parameters : -d shortcut of --database The database connection to use (offset) Default : [default] -m shortcut of --models The models on which the information is sought. -f shortcut of --fields The fields to display in the table. -o shortcut of --domain The domain in which the models are. ร Samples : Gets metadatas for all models in default db ยท Ubiquity info:models Gets metadatas for all models in messagerie db ยท Ubiquity info:models -d=messagerie Gets metadatas for User and Group models ยท Ubiquity info:models -m=User,Group Gets all primary keys for all models ยท Ubiquity info:models -f=#primaryKeys โ info-validation [?memberName] => ยท Returns the models validation info. ยท Aliases : info_validation,info:validation,infoValidation,info_validators,info-validators,info:validators,infoValidators ยท Parameters : -s shortcut of --separate If true, returns each info in a separate table Possibles values : true,false Default : [false] -m shortcut of --model The model on which the information is sought. -o shortcut of --domain The domain in which the models is. ร Samples : Gets validators for User class ยท Ubiquity info:validation -m=User Gets validators for User class on member firstname ยท Ubiquity info:validation firstname -m=User โ config [] => ยท Returns the config informations from app/config/config.php. ยท Aliases : info_config,info-config,info:config,infoConfig ยท Parameters : -f shortcut of --fields The fields to display. ร Samples : Display all config vars ยท Ubiquity config Display database config vars ยท Ubiquity config -f=database โ config-set [] => ยท Modify/add variables and save them in app/config/config.php. Supports only long parameters with --. ยท Aliases : set_config,set-config,set:config,setConfig ร Samples : Assigns a new value to siteURL ยท Ubiquity config:set --siteURL=http://127.0.0.1/quick-start/ Change the database name and port ยท Ubiquity config:set --database.dbName=blog --database.port=3307 โ mailer [part] => ยท Displays mailer classes, mailer queue or mailer dequeue. ร Samples : Display mailer classes ยท Ubiquity mailer classes Display mailer messages in queue(To send) ยท Ubiquity mailer queue Display mailer messages in dequeue(sent) ยท Ubiquity mailer dequeue โ new-mail [name] => ยท Creates a new mailer class. ยท Aliases : new_mail,new:mail,newMail ยท Parameters : -p shortcut of --parent The class parent. Default : [\Ubiquity\mailer\AbstractMail] -v shortcut of --view Add the associated view. ร Samples : Creates a new mailer class ยท Ubiquity newMail InformationMail โ send-mail [] => ยท Send message(s) from queue. ยท Aliases : send-mails,send_mails,send:mails,sendMails ยท Parameters : -n shortcut of --num If specified, Send the mail at the position n in queue. ร Samples : Send all messages to send from queue ยท Ubiquity semdMails Send the first message in queue ยท Ubiquity sendMail 1 โ create-command [commandName] => ยท Creates a new custom command for the devtools. ยท Aliases : create_command,create:command,createCommand ยท Parameters : -v shortcut of --value The command value (first parameter). -p shortcut of --parameters The command parameters (comma separated). -d shortcut of --description The command description. -a shortcut of --aliases The command aliases (comma separated). ร Samples : Creates a new custom command ยท Ubiquity create-command custom โ acl-init [] => ยท Initialize Acls defined with annotations in controllers. ยท Aliases : acl_init,acl:init,aclInit ร Samples : Initialize Acls ยท Ubiquity aclInit โ acl-display [] => ยท Display Acls defined with annotations in controllers. ยท Aliases : acl_display,acl:display,aclDisplay ยท Parameters : -v shortcut of --value The ACL part to display. Possibles values : all,role,resource,permission,map,acl Default : [acl] ร Samples : Display all defined roles with ACL annotations ยท Ubiquity aclDisplay role โ new-key [cypher] => ยท Generate a new encryption key using a cipher. ยท Aliases : new_key,new:key,newKey ร Samples : Generate a key for AES-128 ยท Ubiquity new-key 128 โ domain [name] => ยท Creates a new domain (for a Domain Driven Design approach). ยท Aliases : new-domain,new_domain,new:domain,newDomain ยท Parameters : -b shortcut of --base The base folder for domains. Default : [domains] ร Samples : Creates a new domain users ยท Ubiquity domain users
Once installed, the simple Ubiquity new
command will create a fresh micro installation in the directory you specify. For instance, Micro new blog
would create a directory named blog containing an Ubiquity project:, (*12)
Ubiquity new blog
You can see more options about installation by reading the Project creation section., (*13)
You can test with the php web server, from the root folder of your web application, run :, (*14)
Ubiquity serve
make sure that the database is configured properly in app/config/config.php file :, (*15)
Ubiquity config -f=database
, (*16)
Execute the command, make sure you are also in the project folder or one of its subfolders :, (*17)
Ubiquity all-models