PHP code example of notamedia / yii2-locker

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

    

notamedia / yii2-locker example snippets


return [
    //....
    'components' => [
        //....
        'lockManager' => [
            'class' => LockManager::class,
            'lockTime' => [
                LockManager::DEFAULT_LOCK_TIME_KEY => 900,
            ]
        ],
        //....
    ],
    //....
];

return [
    //....
    'lock' => [
        'class' => LockAction::class,
        'modelClass' => $this->modelClass,
        'checkAccess' => [$this, 'checkAccess']
    ],
    'unlock' => [
        'class' => UnlockAction::class,
        'modelClass' => $this->modelClass,
        'checkAccess' => [$this, 'checkAccess'],
    ],
    //....
];

return [
    //....
    [
        'class' => LockControlFilter::class,
        'only' => ['update']
    ],
    //....
];

'controllerMap' => [
    //...
    'migrate' => [
        'class' => MigrateController::class,
        'migrationNamespaces' => [
            'notamedia\locker\migrations',
        ],
        //...
    ],
    //...
 ]

class mxxxxxx_xxxxxx_create_table_lock extends m000000_000000_create_table_lock