Console Commands ({{ZN >= 4.3.0}})



( ZN >= 4.3.0 )

It has been developed to run commands on the operating systems through the terminal.

 

# Syntax


php ZeroCore [Project-name] commander [Parameters]
Php way. The path to the ZeroCore file on the root directory. ZN FE and ZN are used in OE distributionswhere it isnecessary to run a command on a different project other thanthe predefined project directory ( Frontend )in the Projects / directory.  Any of the commands. Parameters if any.

General Commands ( ZN> = 4.3.0 )

Below are the commands that enable you to reach all the system-wide constructs. 

php ZeroCore [project-name projectname] run-uri controller / function / p1 / p2 ... / pn
php ZeroCore [project-name projectname] run-controller controller / function
php ZeroCore [project-name projectname] r-class controller: function p1 p2 ... pN
php zerocore [project-name ProjectName] run-model model: function p1 p2 p3 ... pN   
php zerocore [project-name ProjectName] run-function function p1 p2 p 3 ... pN
php zerocore[project-name projectname] r-command commander: method p1, p2 p 3 ... PN
php ZeroCore [project-name projectname] run-external-command commander: method p1, p2 p 3 ... PN

Version Upgrading Commands ( ZN> = 5.3.0 )

The following is the ZN Framework release upgrade commands.

php zerocore upgrade

Scheduled Task Commands ( ZN> = 5.1.0 )

Below are scheduled task management commands with Crontab.

php zerocore [project-name ProjectName] run-cron controller / method time1 value1 ...
php zerocore [project-name ProjectName] cron-list
php zerocore [project-name ProjectName]

Formatting Instructions ( ZN> = 5.3.0 )

Below are the commands that use the capabilities of the generate library.

php zerocore create-project project name
php zerocore delete-project project name
php zerocore [project-name ProjectName] create-controller controller name
php zerocore [project-name ProjectName] delete-controller controller name
php zerocore [project-name ProjectName] create-model model name
php zerocore [project-name ProjectName] create-grand-model model name
php zerocore [project-name ProjectName] delete-model model name
php zerocore [project-name ProjectName] create-grand-vision [database name]
php zerocore [project-name ProjectName] delete-grand-vision [database name]
php zerocore [project-name ProjectName] generate-databases
php zerocore [project-name ProjectName] clean-cache

Running Command Files ( ZN> = 5.3.5 )

Below run-commandare the commands that form the short form of use.Commands / to use the classes in the directory.

php zerocore [project-name ProjectName] command: method p1 p2 ... pN
php zerocore[project-name ProjectName] External \ command:

Terminal Commands ( ZN> = 5.3.4 )

You can use standard terminal commands that are outside the above usage.

composer require monolog / monolog

 

# run-uri / run-controller ( ZN> = 4.3.0 )


Used to run the controller from the console.

php zercore run-uri comments/view

If you want to request a different project controller, you can use it as follows.

php zerocore project-name OthersProject run-uri comments/view

 

# run-class / run-model ( ZN> = 4.3.0 )


Used to run the library from the console.

php zerocore run-class Migration:create Blog 1
php zerocore run-class MigrateBlog:up
php zerocore run-class MigrateBlog:down
php zercore run-class Migation:delete Blog

 

# run-function ( ZN >= 4.3.0 )


It is used to operate the function from the console.

php zerocore run-function exampleFunction

 

# run-command ( ZN> = 4.3.1 )


It is used to run command classes under the Projects / ProjectDirectory / Commands / directory using the console . If you try to run it through the controller, you will get an error. This structure works only on console requests.

File: Commands / ExampleCommand.php
<?php namespace Project\Commands;

use Email;

class ExampleCommand extends Command
{
   public function run($to)
   {
        Email::to($to)->send('Subject', 'Message');
   }
}
php zerocore run-command ExampleCommand:run example@example.com

Short Use ( ZN> = 5.3.0 )

The above is the short form of use.

php zerocore ExampleCommand:run example@example.com

 

# run-external-command ( ZN> = 4.3.1 )


It is used to run command classes under the Projects / ProjectDirectory / Commands / directory using the console . If you try to run it through the controller, you will get an error. This structure works only on console requests.

File: External / Commands / ExampleCommand.php
<?php namespace External\Commands;

use Email;

class ExampleCommand extends Command
{
   public function run($to)
   {
        Email::to($to)->send('Subject', 'Message');
   }
}
php zerocore run-external-command ExampleCommand:run example@example.com

Short Use ( ZN> = 5.3.0 )

The above is the short form of use.

php zerocore External\ExampleCommand:run example@example.com

 

# upgrade ( ZN> = 5.3.0 )


Used to update the Framework. If the update is successful, it sends a message. If it is not successful, it will not produce any output.

php zerocore upgrade

 

 

# run-cron ( ZN >= 5.1.0 )


It is used to run the Crontab library and its methods. With this commandcontroller, command, and url operated.

php zerocore run-cron home/main month october day saturday clock 12:00
php zerocore run-cron EmailCommand:sendMail daily
php zerocore run-cron http://example.com/ day monday clock 10:30

 

# cron-list ( ZN >= 5.1.0 )


Gives a list of scheduled tasks.

php zerocore cron-list

 

# remove-cron ( ZN> = 5.1.0 )


Used to delete the scheduled task. Deletion will be deletedcron-listWherein ID .

php zerocore remove-cron 1

 

# create-project ( ZN> = 5.3.0 )


Used to open a new project in the Projects / directory in Multi-edition .

php zerocore create-project NewProject

 

# delete-project ( ZN> = 5.3.0 )


Used to delete the specified project in the Projects / directory in Multi-edition .

php zerocore delete-project NewProject

 

# create-controller ( ZN> = 5.3.0 )


Used to create a controller. The project name is not specified, the default project directory ( usually Frontend / ) located withinControllers / This is done in the directory.

php zerocore create-controller MyController

Creating a Controller in Another Project Directory

To create this control in a different project directory other than the default project, the command is edited as follows.

php zerocore project-name Backend create-controller MyController

 

# delete-controller ( ZN> = 5.3.0 )


Used to delete the controller.

php zerocore delete-controller MyController

 

# create-model ( ZN> = 5.3.0 )


Used to create a model. The project name is not specified, the default project directory ( usually Frontend / ) located withinmodels / This is done in the directory.

php zerocore create-model MyModel

Creating a Model in Another Project Directory

To create this model in a different project directory other than the default project, the command is edited as follows.

php zerocore project-name Backend create-model MyModel

 

# create-grand-model ( ZN> = 5.3.0 )


Used to create Grand Model. The model class is created by extending it with the GrandModel class.

php zerocore create-grand-model MyModelGrand

 

# delete-model ( ZN >= 5.3.0 )


Used to delete the model.

php zerocore delete-model MyModel

 

# create-grand-vision ( ZN> = 5.3.0 )


It is used to create GrandModel classes with the same name as all tables of the database. If the database name is not specified, the database name that is set by default is assumed.

php zerocore create-grand-vision

Specify Database

Used to create model files from tables belonging to another database other than the default database.

php zerocore create-grand-vision OtherDatabase

 

# delete-grand-vision ( ZN >= 5.3.0 )


Used to delete created vision models.

php zerocore delete-grand-vision OtherDatabase

 

# generate-databases ( ZN> = 5.3.0 )


Databases / directory to be processed.

php zerocore generate-databases

 

# clean-cache ( ZN> = 5.3.0 )


STORAT A / Cache / directory.

php zerocore clean-cache