當前位置: 首頁>>代碼示例>>PHP>>正文


PHP kernel::is_online方法代碼示例

本文整理匯總了PHP中kernel::is_online方法的典型用法代碼示例。如果您正苦於以下問題:PHP kernel::is_online方法的具體用法?PHP kernel::is_online怎麽用?PHP kernel::is_online使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在kernel的用法示例。


在下文中一共展示了kernel::is_online方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 function __construct()
 {
     if (!kernel::is_online()) {
         die('error');
     }
     cacheobject::init();
     self::$is_start = true;
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:8,代碼來源:service.php

示例2: __construct

 function __construct()
 {
     if (!kernel::is_online()) {
         die('error');
     } else {
         @(include APP_DIR . '/base/defined.php');
     }
     cachemgr::init();
     cacheobject::init();
     self::$is_start = true;
 }
開發者ID:sss201413,項目名稱:ecstore,代碼行數:11,代碼來源:service.php

示例3: __construct

 function __construct()
 {
     if (!kernel::is_online()) {
         die('error');
     } else {
         require ROOT_DIR . '/config/config.php';
         @(include APP_DIR . '/base/defined.php');
     }
     cachemgr::init();
     cacheobject::init();
 }
開發者ID:syjzwjj,項目名稱:quyeba,代碼行數:11,代碼來源:service.php

示例4: process

 public function process($path)
 {
     if (!kernel::is_online()) {
         die('error');
     } else {
         require ROOT_DIR . '/config/config.php';
         @(include APP_DIR . '/base/defined.php');
     }
     if ($path == '/api') {
         $this->process_rpc();
     } else {
         $args = explode('/', substr($path, 5));
         $service_name = 'api.' . array_shift($args);
         $method = array_shift($args);
         foreach ($args as $i => $v) {
             if ($i % 2) {
                 $params[$k] = str_replace('%2F', '/', $v);
             } else {
                 $k = $v;
             }
         }
         kernel::service($service_name)->{$method}($params);
     }
 }
開發者ID:dalinhuang,項目名稱:shopexts,代碼行數:24,代碼來源:service.php

示例5: has_conflict_apps

 public function has_conflict_apps($apps, &$conflict_apps)
 {
     if (!kernel::is_online()) {
         return false;
     }
     if (is_string($apps)) {
         $apps = array($apps);
     }
     $queue = array();
     $installed_queue = array();
     $install_apps = array();
     $installed_apps = array();
     foreach ($apps as $app_id) {
         $install_apps[$app_id] = array();
         $this->check_conflicts_install($app_id, $queue);
     }
     $rows = kernel::database()->select('select app_id from sdb_base_apps where status != "uninstalled"');
     foreach ($rows as $row) {
         $installed_apps[$row['app_id']] = array();
         $this->check_conflicts_install($row['app_id'], $installed_queue);
     }
     $conflict_one = array_intersect_key($queue, $installed_apps);
     $conflict_two = array_intersect_key($installed_queue, $install_apps);
     $conflict_apps = array_merge($conflict_one, $conflict_two);
     return count($conflict_apps) ? true : false;
 }
開發者ID:sss201413,項目名稱:ecstore,代碼行數:26,代碼來源:manage.php

示例6: input_element

 function input_element($type, $params = false)
 {
     if (!base_component_ui::$inputer) {
         if (kernel::is_online()) {
             base_component_ui::$inputer = kernel::servicelist('html_input');
         } else {
             base_component_ui::$inputer = array('base_view_input' => new base_view_input());
         }
     }
     if ($params === false) {
         foreach (base_component_ui::$inputer as $inputer) {
             $inputer->app = $this->app;
             if (method_exists($inputer, 'input_' . $type)) {
                 return true;
             }
         }
     } else {
         foreach (base_component_ui::$inputer as $inputer) {
             $inputer->app = $this->app;
             if (method_exists($inputer, 'input_' . $type)) {
                 $html = $inputer->{'input_' . $type}($params);
             }
         }
         return $html;
     }
     return false;
 }
開發者ID:dalinhuang,項目名稱:shopexts,代碼行數:27,代碼來源:ui.php

示例7: filemtime

 function &load($check_lastmodified = true)
 {
     $real_table_name = $this->real_table_name();
     if ($this->_define[$real_table_name]) {
         return $this->_define[$real_table_name];
     }
     if (kernel::is_online() && !($this->target_app->app_id == 'base' && $this->key() == 'kvstore')) {
         if (defined('CUSTOM_CORE_DIR') && file_exists(CUSTOM_CORE_DIR . '/' . $this->target_app->app_id . '/dbschema/' . $this->key . '.php')) {
             $define_lastmodified = $check_lastmodified ? filemtime(CUSTOM_CORE_DIR . '/' . $this->target_app->app_id . '/dbschema/' . $this->key . '.php') : null;
         } else {
             $define_lastmodified = $check_lastmodified ? filemtime($this->target_app->app_dir . '/dbschema/' . $this->key . '.php') : null;
         }
         $define_flag = base_kvstore::instance('tbdefine')->fetch($this->target_app->app_id . $this->key, $define, $define_lastmodified);
     } else {
         $define_flag = false;
     }
     if ($define_flag === false) {
         if (defined('CUSTOM_CORE_DIR') && file_exists(CUSTOM_CORE_DIR . '/' . $this->target_app->app_id . '/dbschema/' . $this->key . '.php')) {
             require CUSTOM_CORE_DIR . '/' . $this->target_app->app_id . '/dbschema/' . $this->key . '.php';
         } else {
             require $this->target_app->app_dir . '/dbschema/' . $this->key . '.php';
         }
         $define =& $db[$this->key()];
         $this->_define[$real_table_name] =& $define;
         foreach ($define['columns'] as $k => $v) {
             if ($v['pkey']) {
                 $define['idColumn'][$k] = $k;
             }
             if ($v['is_title']) {
                 $define['textColumn'][$k] = $k;
             }
             if ($v['in_list']) {
                 $define['in_list'][] = $k;
                 if ($v['default_in_list']) {
                     $define['default_in_list'][] = $k;
                 }
             }
             $define['columns'][$k] = $this->_prepare_column($k, $v);
             if (isset($v['pkey']) && $v['pkey']) {
                 $define['pkeys'][$k] = $k;
             }
         }
         if (!$define['idColumn']) {
             $define['idColumn'] = key($define['columns']);
         } elseif (count($define['idColumn']) == 1) {
             $define['idColumn'] = current($define['idColumn']);
         }
         if (!$define['textColumn']) {
             $keys = array_keys($define['columns']);
             $define['textColumn'] = $keys[1];
         } elseif (count($define['idColumn']) == 1) {
             $define['textColumn'] = current($define['textColumn']);
         }
         if (kernel::is_online() && !($this->target_app->app_id == 'base' && $this->key() == 'kvstore')) {
             base_kvstore::instance('tbdefine')->store($this->target_app->app_id . $this->key, $define);
         }
     }
     return $define;
 }
開發者ID:syjzwjj,項目名稱:quyeba,代碼行數:59,代碼來源:dbtable.php

示例8: status

 function status()
 {
     if (kernel::is_online()) {
         if ($this->app_id == 'base') {
             if (!kernel::database()->select('SHOW TABLES LIKE "' . kernel::database()->prefix . 'base_apps"')) {
                 return 'uninstalled';
             }
         }
         $row = @kernel::database()->selectrow('select status from sdb_base_apps where app_id="' . $this->app_id . '"');
         return $row ? $row['status'] : 'uninstalled';
     } else {
         return 'uninstalled';
     }
 }
開發者ID:dalinhuang,項目名稱:shopexts,代碼行數:14,代碼來源:app.php

示例9: store

 public function store($key, $value, $ttl = 0)
 {
     self::$__store_count++;
     if (!(defined('WITHOUT_KVSTORE_PERSISTENT') && constant('WITHOUT_KVSTORE_PERSISTENT')) && self::$__persistent && get_class($this->get_controller()) != 'base_kvstore_mysql' && kernel::is_online()) {
         $this->persistent($key, $value, $ttl);
     }
     logger::debug('kvstore:' . self::$__fetch_count . '.' . ' instance:' . $this->get_prefix() . ' store key:' . $key);
     return $this->get_controller()->store($key, $value, $ttl);
 }
開發者ID:sss201413,項目名稱:ecstore,代碼行數:9,代碼來源:kvstore.php

示例10: filemtime

 public function &load($check_lastmodified = true)
 {
     $real_table_name = $this->real_table_name();
     if (!static::$_define[$real_table_name]) {
         if (defined('CUSTOM_CORE_DIR')) {
             $customSchemaPath = CUSTOM_CORE_DIR . '/' . $this->target_app->app_id . '/dbschema/' . $this->key . '.php';
             if (file_exists($customSchemaPath)) {
                 $path = $customSchemaPath;
             }
         }
         if (!$path) {
             $path = $this->target_app->app_dir . '/dbschema/' . $this->key . '.php';
         }
         $lastModified = $check_lastmodified ? filemtime($path) : null;
         // 當未安裝時 或者 涉及到base kvstore 或者取不到數據
         if (!kernel::is_online() || $this->target_app->app_id == 'base' && $this->key() == 'kvstore') {
             $define = $this->loadDefine($path);
         } else {
             if (!base_kvstore::instance('tbdefine')->fetch($this->target_app->app_id . $this->key, $define, $lastModified)) {
                 $define = $this->loadDefine($path);
                 base_kvstore::instance('tbdefine')->store($this->target_app->app_id . $this->key, $define);
             }
         }
         static::$_define[$real_table_name] = $define;
     }
     return static::$_define[$real_table_name];
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:27,代碼來源:dbtable.php

示例11: store

 public function store($key, $value, $ttl = 0)
 {
     self::$__store_count++;
     $persistent = config::get('kvstore.persistent', true);
     if ($persistent && self::$__persistent && get_class($this->get_controller()) != 'base_kvstore_mysql' && kernel::is_online()) {
         $this->persistent($key, $value, $ttl);
     }
     logger::debug('kvstore:' . self::$__fetch_count . '.' . ' instance:' . $this->get_prefix() . ' store key:' . $key);
     return $this->get_controller()->store($key, $value, $ttl);
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:10,代碼來源:kvstore.php

示例12: store

 public function store($key, $value, $ttl = 0)
 {
     self::$__store_count++;
     if (!(defined('WITHOUT_KVSTORE_PERSISTENT') && constant('WITHOUT_KVSTORE_PERSISTENT')) && self::$__persistent && get_class($this->get_controller()) != 'base_kvstore_mysql' && kernel::is_online()) {
         $this->persistent($key, $value, $ttl);
     }
     return $this->get_controller()->store($key, $value, $ttl);
 }
開發者ID:syjzwjj,項目名稱:quyeba,代碼行數:8,代碼來源:kvstore.php

示例13: status

 function status()
 {
     if (kernel::is_online()) {
         try {
             $row = app::get('base')->database()->executeQuery('select status from base_apps where app_id = ?', [$this->app_id])->fetch();
             return $row['status'] ? $row['status'] : 'uninstalled';
         } catch (Exception $e) {
             return 'uninstalled';
         }
     } else {
         return 'uninstalled';
     }
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:13,代碼來源:app.php

示例14: has_conflict_apps

 public function has_conflict_apps($apps, &$conflict_apps)
 {
     if (!kernel::is_online()) {
         return false;
     }
     if (is_string($apps)) {
         $apps = array($apps);
     }
     $queue = array();
     $installed_queue = array();
     $install_apps = array();
     $installed_apps = array();
     foreach ($apps as $app_id) {
         $install_apps[$app_id] = array();
         $this->check_conflicts_install($app_id, $queue);
     }
     try {
         $rows = app::get('base')->database()->executeQuery('select app_id from base_apps where status <> "uninstalled"')->fetchAll();
     } catch (Exception $e) {
         $rows = array();
     }
     foreach ($rows as $row) {
         $installed_apps[$row['app_id']] = array();
         $this->check_conflicts_install($row['app_id'], $installed_queue);
     }
     $conflict_one = array_intersect_key($queue, $installed_apps);
     $conflict_two = array_intersect_key($installed_queue, $install_apps);
     $conflict_apps = array_merge($conflict_one, $conflict_two);
     return count($conflict_apps) ? true : false;
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:30,代碼來源:manage.php

示例15: persistent

 public function persistent($key, $value, $ttl = 0)
 {
     if (get_class($this->get_controller()) != 'base_kvstore_mysql' && kernel::is_online()) {
         kernel::single('base_kvstore_mysql', $this->get_prefix())->store($key, $value, $ttl);
         //todo: 持久化
     }
 }
開發者ID:dalinhuang,項目名稱:shopexts,代碼行數:7,代碼來源:kvstore.php


注:本文中的kernel::is_online方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。