PHP code example of cfwme / selfupdate

1. Go to this page and download the library: Download cfwme/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/ */

    

cfwme / 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 {$_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