Initial commit: apps.supersamsev.ru
This commit is contained in:
commit
54475e7d3d
17284 files changed
+98268
No files matched your search
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use App\Application;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Exception\MissingPluginException;
|
||||
use Cake\Core\Plugin;
|
||||
|
||||
|
||||
Configure::write('Log.error.file', 'cli-error');
|
||||
|
||||
try {
|
||||
Application::addPlugin('Bake');
|
||||
} catch (MissingPluginException $e) {
|
||||
|
||||
}
|
||||
|
||||
Application::addPlugin('Migrations');
|
||||
|
||||
function isLocked($lock_file) {
|
||||
# If lock file exists, check if stale. If exists and is not stale, return TRUE
|
||||
# Else, create lock file and return FALSE.
|
||||
|
||||
if( file_exists( $lock_file ) ) {
|
||||
# check if it's stale
|
||||
$lockingPID = trim( file_get_contents( $lock_file ) );
|
||||
|
||||
# Get all active PIDs.
|
||||
$pids = explode( "\n", trim( `ps -e | awk '{print $1}'` ) );
|
||||
|
||||
# If PID is still active, return true
|
||||
if( in_array( $lockingPID, $pids ) ) return true;
|
||||
|
||||
# Lock-file is stale, so kill it. Then move on to re-creating it.
|
||||
//echo "Removing stale lock file.\n";
|
||||
unlink( $lock_file );
|
||||
}
|
||||
|
||||
file_put_contents( $lock_file, getmypid() . "\n" );
|
||||
return false;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user