本文整理汇总了PHP中kernel::set_online方法的典型用法代码示例。如果您正苦于以下问题:PHP kernel::set_online方法的具体用法?PHP kernel::set_online怎么用?PHP kernel::set_online使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kernel
的用法示例。
在下文中一共展示了kernel::set_online方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: post_install
function post_install()
{
kernel::single('base_application_manage')->sync();
kernel::set_online(true);
$rpc_server = array('node_id' => '1', 'node_url' => MATRIX_URL, 'node_name' => 'Global Matrix', 'node_api' => '/matrix', 'link_status' => 'active');
app::get('base')->model('network')->replace($rpc_server, array('node_id' => 1));
}
示例2: get_active_node_id
private function get_active_node_id()
{
kernel::set_online(true);
if (file_exists(ROOT_DIR . '/config/config.php')) {
$obj_buildin = kernel::single('base_shell_buildin');
$obj_buildin->command_active_node_id('ceti_node_id');
} else {
echo 'config file?';
}
}
示例3: post_install
function post_install()
{
kernel::single('base_application_manage')->sync();
kernel::set_online(true);
$rpc_global_server = array('node_id' => base_mdl_network::MATRIX_ASYNC, 'node_url' => config::get('link.matrix_async_url'), 'node_name' => 'Global Matrix', 'node_api' => '', 'link_status' => 'active');
app::get('base')->model('network')->replace($rpc_global_server, array('node_id' => base_mdl_network::MATRIX_ASYNC), true);
$rpc_realtime_server = array('node_id' => base_mdl_network::MATRIX_REALTIME, 'node_url' => config::get('link.matrix_realtime_url'), 'node_name' => 'Realtime Matrix', 'node_api' => '', 'link_status' => 'active');
app::get('base')->model('network')->replace($rpc_realtime_server, array('node_id' => base_mdl_network::MATRIX_REALTIME), true);
$rpc_service_server = array('node_id' => base_mdl_network::MATRIX_SERVICE, 'node_url' => config::get('link.matrix_service_url'), 'node_name' => 'Service Matrix', 'node_api' => '', 'link_status' => 'active');
app::get('base')->model('network')->replace($rpc_service_server, array('node_id' => base_mdl_network::MATRIX_SERVICE), true);
}
示例4: install
public function install($app_id, $options = null, $auto_enable = 1)
{
$app = app::get($app_id);
if (!file_exists(APP_DIR . '/' . $app_id . '/app.xml')) {
if (!$this->download($app_id)) {
logger::info('Application package can not be download.');
return false;
}
}
$rows = kernel::database()->select('select * from sdb_base_apps where app_id="' . $app_id . '"');
if (isset($rows[0]) && $rows[0]['status'] != "uninstalled") {
logger::info('Application package Already installed');
return false;
}
$app_info = $app->define('main_app');
$app_exclusion = app::get('base')->getConf('system.main_app');
if ($app_info['value'] == 'true') {
if ($app_info['exclusion'] == 'true') {
if ($app_exclusion['value'] == 'true' && $app_exclusion['exclusion'] == 'true' && $app_exclusion['app_id'] != $app_id) {
logger::info('Application ' . $app_id . ' exclusioned ' . $app_exclusion['app_id'] . '.');
return false;
}
}
$app_info['app_id'] = $app_id;
$app_exclusion = app::get('base')->setConf('system.main_app', $app_info);
}
$app_self_detector = null;
kernel::database()->exec('update sdb_base_apps set status="installing" where app_id="' . $app_id . '" and status="uninstalled" ');
$app->runtask('pre_install', $options);
kernel::single('base_application_dbtable')->clear_by_app($app_id);
//清除冗余表信息
foreach ($this->content_detector($app_id) as $detector) {
foreach ($detector->detect($app) as $name => $item) {
$item->install();
}
kernel::set_online(true);
base_kvstore::instance('system')->store('service_last_modified.' . get_class($detector) . '.' . $app_id, $detector->last_modified($app_id));
}
//todo:clear service cache... 如果以后做了缓存的话...
//用自己新安装的资源探测器,安装自己的资源
foreach (kernel::servicelist('app_content_detector') as $k => $detector) {
if ($detector->app->app_id == $app_id) {
//遍历所有已经安装的app
foreach ($detector->detect($app) as $name => $item) {
$item->install();
}
base_kvstore::instance('system')->store('service_last_modified.' . get_class($detector) . '.' . $app_id, $detector->last_modified($app_id));
}
}
app::get('base')->model('apps')->replace(array('status' => 'installed', 'app_id' => $app_id, 'dbver' => $app->define('version')), array('app_id' => $app_id));
$deploy_info = base_setup_config::deploy_info();
foreach ((array) $deploy_info['setting'] as $set) {
if ($set['app'] == $app_id) {
$app->setConf($set['key'], $set['value']);
}
}
$app->runtask('post_install', $options);
if ($auto_enable) {
$this->enable($app_id);
}
//app submit servicelist
$params['certificate_id'] = $app_id;
$params['app_id'] = $app_id;
// $rst = app::get($app_id)->matrix()->set_callback('dev_sandbox','show',array(1,2,3,'aa'=>time()))
// ->call('node.addshop',$app_id);
logger::info('Application ' . $app_id . ' installed... ok.');
}
示例5: install_app
public function install_app()
{
kernel::set_online(true);
$app = $_GET['app'];
if (file_exists(ROOT_DIR . '/config/config.php')) {
$shell = new base_shell_webproxy();
$shell->input = $_POST['options'];
$shell->exec_command('install -r ' . $app);
} else {
echo 'config file?';
}
}
示例6: install_demodata
public function install_demodata()
{
kernel::set_online(true);
//todo: config check
$shell = new base_shell_webproxy();
$shell->input = $_POST['options'];
$shell->exec_command('install_demodata -r demodata');
}
示例7: get_active_node_id
private function get_active_node_id()
{
kernel::set_online(true);
$obj_buildin = kernel::single('base_shell_buildin');
$obj_buildin->command_active_node_id('ceti_node_id');
}