Initial commit: apps.prometeysev.ru

This commit is contained in:
root committed 2026-10-22 00:22:57 +03:00
commit 96ccabcd8b
6561 files changed
+1270349

No files matched your search

+41
View File
@@ -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;
}