Restoration



Version 4.0.0 and earlier Restorations / directory usage has been removed. The reason for this is that it is possible to build multiple projects in version 4.0.1 and above, so project tests should be done in the same run. Restoration settings are also included in each application. So the restoration settings are now in Config / Project.php file.

 

 

# Section Headings


# Configuration

# Controller Restoration ( ZN >= 4.3.0 )

# Restore Sabiti

# Project Restoration ( ZN >= 5.3.8 )

# Start Restoration
# End Restoration

 

 

# Configuration


Restoration settings are made through the following configuration file. The settings contained in this configuration file are given below.

Configuration File: Config / Project.php
String $ mode = '' This setting must be set to 'restoration' to initiate restoration operations .
Mixed $ machinesIP = [] The computer's IP information is specified on which computers the restore operations will be performed. If more than one IP address is entered, it can be specified in the array type.
Mixed $ pages = [] The pages that are being repaired are specified. If it is a single page, you can assign a string . If more than one page is specified, the pages that are repaired by sequence are specified in the array. If all pages are being repaired, the string "all" is used. This should be done if there is an error on the page that should not be forgotten and if users are encountering this error. Otherwise it is not wise to set the page to be redirected to the working page. When the page being repaired is visited, the page of the page is specified if the page is intended for the users.
String $ Routepag to When any of the pages specified in the Restoration Pages setting are requested, they are directed to the page where this setting is specified. This partition is not the page name that should be typed in controller / function information.

 

 

# Controller Restoration ( ZN >= 4.3.0 )


In a published progeny, when you make code adjustments on some controllers, you can make sure that users are directed to a different page instead of having to wait for the results for those edits. The const restore constant is used for this.

Restore Sabiti
machinesıp Which IP / IPS addresses will work. If more than one ip is specified, the array is used.
functions Which functions are to be worked on. You can specify array for more than one function or all for all .
routepag to Which controller / function will go if the users visit these pages .
<?php namespace ProjectControllers;

class Simplicity extends Controller
{
    const restore =


    [
        'machinesIP' => '127.0.0.2',   // Array or String
        'functions'  => 'main',        // Array or String
        'routePage'  => 'home/restore' // Route Controller/Function
    ];

    public function main(String $params = NULL)
    {

    }

    public function restore()
    {
        echo 'System Restore!';
    }
}

 

 

# Project Restoration ( ZN >= 5.3.8 )


General project restoration is to prevent users from being affected by the work done on a project that is on the main purpose. Project restoration takes a copy from the original project and allows developers to continue working on the original while still allowing the developer to work on that copy. Thus, code manipulation does not affect users at all. Changes are made to the original after the edits are finished. A few simple console commands are used for this.

Start Restoration

You can use the following console command to start the restoration.

php zerocore start-restoration ProjectDirectory

You can further shorten this command by using the Devtools terminal.

start-restoration ProjectDirectory

There are 3 directories in the peer copy created with this command . These are :Controllers / , Views / and Storage / directories are.

Copying All Directories

To create the copy of all directories, you need to edit your console command as follows.

start-restoration ProjectDirectory full

Coexistence of Specified Directories

If instead of all the directories mentioned above you can provide the standard 3 directories in the same directory as the other directories you want. For this we are organizing our command as follows.

start-restoration ProjectDirectory Models Config Routes

After running the above command Controllers / , Views / , Storage / next to their index Models / , Config / and Routes / directories will also be included.

Running a Peer Copy

After the restoration process is started Projects / restoreprojectdirectory /you can see that the named co-worker has been created. Normally you can access the co-worker working on the URL through Restorethe prefix in the written directory.

Run: localhost / RestoreProjectDirectory
Finishing Restoration

Once the edits are finished, you can use the following command to apply the changes to the original project.

end-restoration ProjectDirectory

The above command moves the changes in the last peer copy to the original project. However, the copy is not deleted. At the same time, if you want the peer copy to be deleted after the process, you need to edit the command as follows.

Migration and deletion of peer copy

It is used to delete the coexist after it has been applied to the original project.

end-restoration-delete ProjectDirectory

The above command will delete the peer copy once the migration is complete.