当前位置: 首页>>代码示例>>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;未经允许,请勿转载。