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; use backendless\core\lib\Log; use backendless\core\CodeRunnerLoader; // 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(); CodeRunnerLoader::phpEnviromentInit(); Log::init("LOCAL", false, Config::$CORE['os_type']); $predis = RedisManager::getInstance()->getRedis(); $predis->rpush(Config::$APPLICATION_ID, Config::$CORE['local_shutdown_code']); $predis->expire(Config::$APPLICATION_ID, 5); echo "\n"; Log::writeInfo("CodeRunner Backendless debugging utility stopped!\n", $target = "console");
<?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; use backendless\core\lib\Log; use backendless\core\CodeRunnerLoader; // 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(); CodeRunnerLoader::phpEnviromentInit(); Log::init(Config::$CORE['os_type'], "LOCAL", false); $predis = RedisManager::getInstance()->getRedis(); $predis->rpush(Config::$APPLICATION_ID, Config::$CORE['local_shutdown_code']); $predis->expire(Config::$APPLICATION_ID, 5); echo "\n"; Log::writeInfo("CodeRunner Backendless debugging utility stopped!\n", $target = "console");