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


PHP Core::getInstance方法代碼示例

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


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

示例1: __construct

 function __construct()
 {
     $this->__core = Core::getInstance();
     $this->__lib = $this->__core->getLib();
     $this->__uri = $this->__core->getUri();
     $this->__req = $this->__core->getRequest();
 }
開發者ID:dalinhuang,項目名稱:StudentManage,代碼行數:7,代碼來源:page.php

示例2: main

 function main($url = null)
 {
     if (strtolower($_SERVER["REQUEST_METHOD"]) == "get") {
         //todo : if request method is get,
         require_once APPPATH . 'views' . DS . 'templates' . DS . 'template_login.php';
     } else {
         //todo : if request method is post
         //todo : should we set session time out?
         if (isset($_POST["email"]) && isset($_POST["password"])) {
             $email = $_POST["email"];
             $password = $_POST["password"];
             $member = Core::getInstance("Member_md")->getMember($email, $password);
             if ($member) {
                 //todo : redirect main page
                 $_SESSION["member"] = $member[0];
                 $SID = session_id();
                 echo '1 : ', $SID;
                 $this->redirect("/term");
                 //require_once APPPATH.'views'.DS.'templates'.DS.'template_term_list.php';
             } else {
                 //todo : invalid user information,
             }
         }
     }
 }
開發者ID:ThrownDice,項目名稱:UB,代碼行數:25,代碼來源:Login.php

示例3: getPersistenceObject

 function getPersistenceObject()
 {
     $loader = \Core::getInstance()->getLoader();
     if ($loader->has($this->_persistenceObject)) {
         return $loader->get($this->_persistenceObject);
     }
 }
開發者ID:Kinetical,項目名稱:Kinesis,代碼行數:7,代碼來源:ReflectionClass.php

示例4: execRouterHook

 public static function execRouterHook(_Core_Request $request, &$class, &$method, array &$chunks, &$templateEngine)
 {
     if (JS_MINIFY) {
         $templateEngine->append('js', 'global-min.js');
     } else {
         foreach (file(SYS_DIR_INC . 'assets/js.list') as $js) {
             $templateEngine->append('js', $js);
         }
     }
     if (IS_DEMO) {
         $templateEngine->append('js', 'demo_message.js');
     }
     /**
      * Динамическое подключение js файлов
      * в зависимости от модуля
      *
      */
     $jsArr = array();
     $urlArr = explode('/', $request->uri, 3);
     // первый элемент
     array_shift($urlArr);
     $module = strtolower(array_shift($urlArr));
     if (array_key_exists($module, Core::getInstance()->js)) {
         $jsArr = Core::getInstance()->js[$module];
     }
     foreach ($jsArr as $jsFile) {
         $templateEngine->append('js', $jsFile . '.js');
     }
 }
開發者ID:ru-easyfinance,項目名稱:EasyFinance,代碼行數:29,代碼來源:Js.php

示例5: __construct

 /**
  * Controller constructor
  * @param [type] $view [description]
  */
 public function __construct($view = null)
 {
     if ($view) {
         $this->view = $view;
     }
     $this->view = Core::getInstance("View");
 }
開發者ID:ThrownDice,項目名稱:UB,代碼行數:11,代碼來源:Controller.php

示例6: add

 function add($name, $schema)
 {
     $dataSet = \Core::getInstance()->getDatabase()->getDataSet();
     if ($schema instanceof \DBAL\Data\Model) {
         $dataSet->addModel($schema);
     }
     return parent::add($name, $schema);
 }
開發者ID:Kinetical,項目名稱:Kinesis,代碼行數:8,代碼來源:Loader.php

示例7: __construct

 public function __construct($templateEngine, _Core_Request $request)
 {
     //Проверяем авторизован ли пользователь. Если нет - редиректим на логин
     if (!Core::getInstance()->CurrentUserIsAuthorized()) {
         header('Location: /login/');
     }
     parent::__construct($templateEngine, $request);
 }
開發者ID:ru-easyfinance,項目名稱:EasyFinance,代碼行數:8,代碼來源:User.php

示例8: execute

 protected function execute(&$source = null)
 {
     $result = parent::execute($source);
     if ($source instanceof \DBAL\Data\Source) {
         $core = \Core::getInstance();
         $core->getDatabase()->Models->Data = \Util\Arrays\names($source->Data);
     }
     return $result;
 }
開發者ID:Kinetical,項目名稱:Kinesis,代碼行數:9,代碼來源:Entity.php

示例9: getEntity

 function getEntity()
 {
     $core = \Core::getInstance();
     if (is_null($this->entity)) {
         $this->entity = $core->Database->Models[$this->EntityName];
     }
     //TODO: entity by entityname if blank
     return $this->entity;
 }
開發者ID:Kinetical,項目名稱:Kinesis,代碼行數:9,代碼來源:Relationship.php

示例10: __construct

 /**
  * Конструктор
  *
  */
 public final function __construct($templateEngine, _Core_Request $request)
 {
     parent::__construct($templateEngine, $request);
     // Если эксперт - редирект на дефолтную для экспертов
     if (Core::getInstance()->user->getType() == 1) {
         header('Location: /expert/');
         exit;
     }
 }
開發者ID:ru-easyfinance,項目名稱:EasyFinance,代碼行數:13,代碼來源:UserCommon.php

示例11: __construct

 /**
  * Конструктор класса
  * @return void
  */
 function __construct()
 {
     if (is_null(Core::getInstance()->db)) {
         Core::getInstance()->initDB();
     }
     $this->db = Core::getInstance()->db;
     // Загружаем список валют
     $this->loadCurrency();
 }
開發者ID:ru-easyfinance,項目名稱:EasyFinance,代碼行數:13,代碼來源:currency.class.php

示例12: delete_service_mail

 /**
  * Удаляет у пользователя служебную почту
  */
 function delete_service_mail()
 {
     $user = Core::getInstance()->user;
     if ($this->model->deleteServiceMail($user)) {
         $this->tpl->assign('result', array('text' => 'Ящик успешно удалён'));
     } else {
         $this->tpl->assign('error', array('text' => 'Ошибка при удалении ящика'));
     }
 }
開發者ID:ru-easyfinance,項目名稱:EasyFinance,代碼行數:12,代碼來源:profile.controller.php

示例13: __construct

 /**
  * Initialize application and parse input parameters
  *
  */
 public function __construct()
 {
     $this->_app = Core::getInstance(array('app' => 'shell', 'document_root' => dirname(__FILE__) . '/', 'app_root' => dirname(__FILE__) . '/../app/'));
     $this->_factory = FactoryModel::getInstance();
     $this->_applyPhpVariables();
     $this->_parseArgs();
     $this->_validate();
     $this->_showHelp();
 }
開發者ID:alex311982,項目名稱:crawler,代碼行數:13,代碼來源:abstract.php

示例14: write

 /**
  * 寫入記錄
  * @param string $message
  * @param string $level
  */
 public static function write($message, $level = self::ERR)
 {
     if (!self::$status) {
         self::getConfig();
     }
     $now = date(self::$config['time_format']);
     $message = Core::getInstance()->getHook()->apply("Log_write", $message, $level);
     error_log("[{$now}] " . URL_NOW . "; {$level}: {$message}\r\n", self::$config['type'], self::$config['destination'], self::$config['headers']);
 }
開發者ID:CCluv,項目名稱:php-framework-module,代碼行數:14,代碼來源:log.php

示例15: getCurrent

 public static function getCurrent()
 {
     $user = null;
     //Временный хак под старый класс
     if (Core::getInstance()->user->getId()) {
         $user = Core::getInstance()->user;
     }
     return $user;
 }
開發者ID:ru-easyfinance,項目名稱:EasyFinance,代碼行數:9,代碼來源:_User.php


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