dev-master
9999999-devStrukt Project
MIT
The Requires
by Moderator
Strukt Project
composer create-project strukt/strukt:1.1.5-alpha --prefer-dist
Listing console commands:, (*2)
./xcli -l
./xcli app:make payroll
The file structure generated should look as below:, (*3)
app โโโ src โโโ Payroll โโโ AuthModule โย ย โโโ Controller โย ย โย ย โโโ User.php โย ย โโโ Form โย ย โย ย โโโ User.php โย ย โโโ PayrollAuthModule.php โย ย โโโ Router โย ย โย ย โโโ Auth.php โย ย โย ย โโโ Index.php โย ย โโโ Tests โย ย โโโ UserTest.php โโโ User.php
There is a default module i.e AuthModule
when you generate an application. Folders generate in a module can be changed in cfg/module.ini
this also indicates part of alias used to access classes/objects. You'll also find a config file cfg/app.ini
that holds the active applications name., (*4)
When an application or module is created/generated they are loaded by running the command below, otherwise strukt won't detect them:, (*5)
./xcli app:reload
The above command will create a App/Loader.php
in the lib/
folder at the root of your project. This file should NEVER be edited because everything will be overwritten once the above command is run., (*6)
Command syntax for generating a module:, (*7)
./xcli make:module <app_name> <module_name> <module_alias>
Example command:, (*8)
./xcli make:module payroll human_resource hr
Now the file structure should look as below:, (*9)
app/ โโโ src โโโ Payroll โโโ AuthModule โโโ HumanResourceModule
Remember to run the make:reload
command to load the module., (*10)
strukt-strukt
uses psysh., (*11)
$ ./xcli shell:exec >>> ls Variables: $core, $reg >>> $core->get("au.ctr.User")->getAll() => "AuthModule\Controller\User::getAll Not Yet Implemented!" >>> $core->get("User") => Payroll\User {#...
View middlewares
and providers
, (*12)
View console
middlewares., (*13)
./xcli sys:ls middlewares
View index.php
middlewares, (*14)
./xcli sys:ls middlewares --idx
You can also view providers
by replacing middlewares
, (*15)
Enable and disable commands
, middlewares
and providers
, (*16)
Example:, (*17)
./xcli sys:util enable commands pub-make
./xcli app:exec
Uses .env
server_{var}
to run application., (*18)
The make:router
and make:module
commands will not appear on cli console until you run app:make
and app:reload
commands firstly and respectively., (*19)
IMPORTANT: The folder .tpl/
in the root of the project contains sgf/
folder that has class template files used to generate the application its modules and migrations. Ensure to not change it until you've understood
strukt-generator, (*20)
Have a good one!, (*21)
Strukt Project
MIT