PHP code example of node-link / cakephp-git-deploy

1. Go to this page and download the library: Download node-link/cakephp-git-deploy 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/ */

    

node-link / cakephp-git-deploy example snippets



// In src/Application.php. Requires at least 3.6.0
use Cake\Http\BaseApplication;

class Application extends BaseApplication
{
    public function bootstrap()
    {
        parent::bootstrap();

        // Load the plugin
        $this->addPlugin('NodeLink/GitDeploy');
    }
}


// In config/bootstrap.php

use Cake\Core\Plugin;

Plugin::load('NodeLink/GitDeploy', ['bootstrap' => true, 'routes' => true]);


return [
    'GitDeploy' => [
        'enable' => filter_var(env('GIT_DEPLOY_ENABLE', false), FILTER_VALIDATE_BOOLEAN),
        'token' => env('GIT_DEPLOY_TOKEN', 'secret'),
        'branch' => env('GIT_DEPLOY_BRANCH', 'master'),
        'git_path' => env('GIT_DEPLOY_GIT_PATH', '/usr/bin/git'),
        'composer_path' => env('GIT_DEPLOY_COMPOSER_PATH', '/usr/local/bin/composer')
    ],
];