public static function load($argc, $argv) { Config::loadConfig(); self::phpEnviromentInit(); Log::init(Config::$CORE['os_type'], GlobalState::$TYPE, Config::$CORE['logging_in_cloud_mode']); Log::writeInfo("Start CodeRunner.", $target = 'file'); EventDefinitionHolder::getInstance()->load(); if (GlobalState::$TYPE === 'LOCAL') { self::checkForInputKeys($argc, $argv); self::checkDefaultKeys(); ClassManager::analyze(); self::printGreeting(); } else { self::checkInputKeysForCloud($argc, $argv); } $code_runner = new CodeRunner(); $code_runner->loadMessageProcessor(); $code_runner->start(); }
<?php //enable the display of errors //error_reporting(E_ALL); //ini_set('display_errors', true); use backendless\core\lib\Autoload; use backendless\core\RedisManager; use backendless\core\Config; // define short constants define('DS', DIRECTORY_SEPARATOR); define('BP', dirname(dirname(__FILE__))); //include file with backendkess autoloader include "lib" . DS . "Autoload.php"; //include file with predis autoloader include "lib" . DS . "predis" . DS . "autoload.php"; // initialize app autoloading Autoload::register(); Autoload::addNamespace('backendless\\core', BP . DS . 'core'); Config::loadConfig(); $predis = RedisManager::getInstance()->getRedis(); $debug_id = $argv[1]; for (;;) { $predis->expire($debug_id, 60); sleep(45); }