mi
which is an helpful command to modify or update
the developers' project app. This command can also be used for generating classes or files needed within the application.
In this page, we will learn about some useful cli commands that can make the development of project applications easier.
mi
commands are listed below with their descriptions
php mi add:window <dir?><windowName> <extends?> [-O?];
where:
name => name of controller file
path => optional path to contoller file
Ex1: php mi add:window Info //add class windows\Info.
Ex2: php mi add:window Info.User //add class windows\Info\User.
Ex3: php mi add:window Info.User UserFrame //add class windows\Info\User, extend to Frames\UserFrame.
Ex4: php mi add:window Info UserFrame -O //add class windows\Info, extend to Frames\UserFrame, overwrite any previous file.
php mi add:frame <path> [-O?]
where:
path => path to frame file within Frames directory
[-O] => overwrite old file (optional)
Ex1: php mi add:frame Info //add windows/Frames/Info.php.
Ex2: php mi add:frame Info.UserFrame //add windows/Frames/Info/UserFrame.php .
Ex3: php mi add:frame Info.UserFrame -O //add windows/Info/UserFrame.php overwrite any previous file.
php mi add:route <path> <extends?> [-O?]
where:
path => path of route file within window/Routes directory
extends => extend to frame file
-O => Overwrite any existing file.
Ex1: php mi add:route MyRoute //add windows/Routes/MyRoute.php.
Ex2: php mi add:route Loc.MyRoute //add windows/Routes/Loc/MyRoute.php.
Ex3: php mi add:route Loc.MyRoute UserFrame //add windows/Routes/Loc/MyRoute.php extend to Frames\UserFrame.
Ex4: php mi add:route Loc.MyRoute UserFrame -O //add windows/Routes/Loc/MyRoute.php extend to Frames\UserFrame overwrite any previous file.
php mi add:api [name] [extends?] [\Dir?] [-O?]
where:
name => name of api route
extends? => extend to a frame class
\Dir => directory of api route
-O => overwrite any previous file
Ex1: php mi add:api Info //add windows/Routes/Info.php.
Ex2: php mi add:api Info \Loc //add windows/Routes/Info.php, add windows/Routes/Loc/InfoAPI.php.
Ex3: php mi add:api Info UserFrame //add windows/Routes/Info.php extend to Frames\UserFrame.
Ex4: php mi add:api Info UserFrame -O //add windows/Routes/Info.php extend to Frames\UserFrame overwrite any previous file.
Ex5: php mi add:api Info UserFrame \Loc -O //add windows/Routes/Info.php extend to Frames\UserFrame, add windows/Routes/Loc/InfoAPI.php, overwrite any previous file.
"create_"
are assumed to be for creating tables while those with starting "alter_"
are assumed to be for altering tables.
All migration files are generated and added directly to the migrations/
directory. The migration file name is also used as the class name. This means that
only names accepted for naming classes should be used.
php mi add:migrator name
where:
name => name of migration file
php mi add:model <path> [-O?]
where:
path => path to model file within the windows/Models directory.
-O => overwrite any previous file.
Ex1: php mi add:model UserModel //add windows/Models/UserModel.php
Ex2: php mi add:model Access.UserModel //add windows/Models/Access/UserModel.php
Ex3: php mi add:model Access.UserModel -O //add windows/Models/Access/UserModel.php, overwrite previous file
windows/Rex
directory.
Path supplied can be in form of dots or slashes. When adding the file name,
only name should be added without any file extension. The type of rex file can be supplied
using the column directive. However if no type is defined, then the rex file will assume a default
extension of php
.
php mi add:rex <pathname>.<filename><:ext?>
where:
filename => name of rex file
pathname => optional path to contoller file
:ext => options [:css|:js|:php]
Ex1: php mi add:rex index //add windows/Rex/index.rex.php
Ex2: php mi add:rex index:css //add windows/Rex/index.rex.css
Ex3: php mi add:rex index:js //add windows/Rex/index.rex.js
Ex4: php mi add:rex build.index:css //add windows/Rex/build/index.rex.css
php mi backup project
backup/
directory that
is reserved for backups. It is essential to trend carefully when applying this command since all the backups removed
cannot be recovered.
php mi backup :clear
php mi clean storage
php mi config:all
Note: database connection parameters must always be wrapped within quotes.
php mi config:dbonline "dbname dbuser dbpass dbserver dbport dbsocket"
where:
dbname => database name
dbuser => database username
dbpass => database password
dbserver => database server
dbport => database port
dbsocket => database socket
NOTE: Empty values are replaced with dash (i.e "-")
Ex: php mi config:dbonline "tester root - localhost 3306" //set online database connection parameters
dbonline
, the dboffline
is used to configures the online database
connection parameters. The offline connection parameters are also triggered to be used to connect to database
locally.
php mi config:dboffline "dbname dbuser dbpass dbserver dbport dbsocket"
where:
dbname => database name
dbuser => database username
dbpass => database password
dbserver => database server
dbport => database port
dbsocket => database socket
NOTE: Empty values are replaced with dash (i.e "-")
Ex: php mi config:dboffline "tester root - localhost 3306" //set offline database connection parameters
php mi config:dboffline "mydatabase root - localhost 3307 -" where: mydatabase => database name root => database username - => database password (empty) localhost => database server 3307 => database port - => socket (empty)
icore/.env
environment keys.
php mi config:env key value
where:
key : key to be configured
value : value of key
Ex: php mi config:env API_KEY some_value
php mi config:usersTable tablename
where:
tablename => name of database table
Ex: php mi config:userTable users //set database user info table
php mi config:cookieField tablename
where:
tablename => name of database table
Ex: php mi config:cookieField cookie //set cookie column in user info table
php mi config:idField column
where:
column => name id column
Ex: php mi config:idField email //set user id column name in user table
<?= Res::import() >
, Res()
), the resource class
will build meta tags using the configuration set in icore/filemeta.php
file and the predefined meta tags will be added only once to the webpage.
php mi config:meta [on|off]
where:
on => switches automatic importation on
off => switches automatic importation off
Ex: php mi config:meta on //set meta tags autoloading from icore/filemeta.php configuration on
cli
directive shows a list of available cli commands. When the -lists
directive is applied, more details of cli commands are displayed.
php mi cli [-lists]
where:
-list => optional directive to display more information on cli commands
Ex: php mi cli -lists
php mi features
where:
features => shows a list of available features
info
command is used to show a description of a particular command.
php mi info <command>
where:
command => cli command name (e.g add:window)
Ex1: php mi info add:window //displays description for "add:window" command
Ex2: php mi info add:routes //displays description for "add:routes" command
Ex3: php mi info "watch status" //displays description for "watch status" command
You can view a list of available commands using php mi cli -lists
php mi install [db|dbname] [folder?]
where:
db => test the database connection parameters defined in "icore/dbconfig.php" file
dbname => creates default database name supplied in "icore/dbconfig.php" file using the defined connection parameters
folder => refers to an optional custom folder name in project root that contains an "icore/dbconfig.php" file with connection parameters.
php mi migrate [up|down|status]
where:
up => step up the migration files
down => step down the migration files
status => fetches the migration status table.
mi migrate down 4
will step down the migration files in four times.
This means that only the last 4 recent migration files will be affected while others will be ignored.
php mi project <project_name>
where:
project_name => name of new project application
Ex: php mi project lumen //create separate project name "lumen"
php mi support
php mi version
php mi watch [online|offline|disabled|status]
where:
online => sets watch for both offline and online environments
offline => sets watch for offline environment only
disabled => disables the watch entirely for both environments
status => get the current configuration status of watch
Ex1: php mi watch online //set watch to online and offline environments
Ex2: php mi watch offline //set watch to offline environment
Ex3: php mi watch disabled //set watch to disabled mode
Ex4: php mi watch status //get current watch status.
wiz
also allows pasting of code lines on the command line. In order to execute commands, developer must end code with a newline followed by
semicolon delimiter and then an enter. This tells the wiz to run or process the code. If the delimiter is not added on a separate line,
the wiz will just assume that the delimiter is part of the code and will not execute it.
php mi :wiz