public function actionLog() { //for ($i = 0; $i < 1000; $i++) { YcfCore::$log->log('hello ycf' . time(), 'info'); YcfCore::$log->log('hello 123' . time(), 'info'); YcfCore::$log->log('hello 123' . time(), 'info'); YcfCore::$log->log('hello 123' . time(), 'info'); YcfCore::end("Greet, Klcoze!"); //} }
<?php date_default_timezone_set('Asia/Shanghai'); define('DEBUG', true); define('DS', DIRECTORY_SEPARATOR); define('ROOT_PATH', realpath(dirname(__FILE__)) . DS); define('YCF_BEGIN_TIME', microtime(true)); //echo 'worker start....'; require 'vendor/autoload.php'; use Ycf\Core\YcfCore; $ycf = new YcfCore(); $ycf->init(); $ycf->run();
public function onTask($serv, $task_id, $from_id, $data) { $ycf = new YcfCore(); $ycf->init(); return ModelTask::run($serv, $task_id, $from_id, $data); }
<?php date_default_timezone_set('Asia/Shanghai'); define('DEBUG', true); define('YCF_BEGIN_TIME', microtime(true)); define('DS', DIRECTORY_SEPARATOR); define('ROOT_PATH', realpath(dirname(__FILE__)) . DS); require 'vendor/autoload.php'; use Ycf\Core\YcfCore; YcfCore::run();
function __construct() { $this->_redis = YcfCore::load('_redis'); }
function __construct() { $this->_db = YcfCore::load('_db'); }