PHP code example of yii2tech / selfupdate

1. Go to this page and download the library: Download yii2tech/selfupdate library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yii2tech / selfupdate example snippets


return [
    'controllerMap' => [
        'self-update' => 'yii2tech\selfupdate\SelfUpdateController'
    ],
    // ...
];



return [
    // list of email addresses, which should be used to send execution reports
    'emails' => [
        '[email protected]',
    ],
    // Mailer component to be used
    'mailer' => 'mailer',
    // Mutex component to be used
    'mutex' => 'mutex',
    // path to project root directory (VCS root directory)
    'projectRootPath' => '@app',
    // web path stubs configuration
    'webPaths' => [
        [
            'path' => '@app/web',
            'link' => '@app/httpdocs',
            'stub' => '@app/webstub',
        ],
    ],
    // cache components to be flushed
    'cache' => [
        'cache'
    ],
    // temporary directories, which should be cleared after project update
    'tmpDirectories' => [
        '@app/web/assets',
        '@runtime/URI',
        '@runtime/HTML',
        '@runtime/debug',
    ],
    // list of shell commands, which should be executed after project update
    'afterUpdateCommands' => [
        'php ' . escapeshellarg($_SERVER['SCRIPT_FILENAME']) . ' migrate/up --interactive=0',
    ],
];

return [
    'controllerMap' => [
        'self-update' => [
            'class' => 'yii2tech\selfupdate\SelfUpdateController',
            'configFile' => '@app/config/self-update.php',
        ]
    ],
    // ...
];

php composer.phar 

yii self-update @app/config/self-update.php