当前位置: 首页>>代码示例>>PHP>>正文


PHP Kernel::getInstance方法代码示例

本文整理汇总了PHP中Kernel::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Kernel::getInstance方法的具体用法?PHP Kernel::getInstance怎么用?PHP Kernel::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kernel的用法示例。


在下文中一共展示了Kernel::getInstance方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($string, $lang)
 {
     $config = \Kernel::getInstance()->config['translate'];
     $this->baseUrl = $config['baseUrl'];
     $this->baseUrl .= 'key=' . $config['key'];
     $this->baseUrl .= '&text=' . $string;
     $this->baseUrl .= '&lang=' . $lang;
     $this->sendRequest();
 }
开发者ID:alexdevid,项目名称:google-parsing,代码行数:9,代码来源:Translation.php

示例2: putArticle

 /**
  * @param $id
  * @return string
  * @throws ResourceNotFoundException
  * @throws \Propel\Runtime\Exception\PropelException
  */
 public function putArticle($id)
 {
     $article = ArticleQuery::create()->findPk($id);
     if (!$article) {
         throw new ResourceNotFoundException($id);
     }
     $data = \Kernel::getInstance()->app->request()->post();
     $article->fromArray($data);
     return $this->response(['success' => (bool) $article->save()]);
 }
开发者ID:alexdevid,项目名称:slim-rest,代码行数:16,代码来源:ArticleController.php

示例3: __construct

 public function __construct()
 {
     $config = \Kernel::getInstance()->config['search'];
     $params = Yaml::parse(file_get_contents(\Kernel::getInstance()->getRootDir() . 'config/search.yml'));
     $this->countries = $params['countries'];
     $this->localUrl = $config['localUrl'];
     $this->baseUrl = $config['baseUrl'];
     $this->baseUrl .= '&key=' . $config['key'] . '&cx=' . $config['cx'];
     $this->baseUrl .= '&num=' . $this->num;
     $this->baseUrl .= isset($config['fields']) || $config['fields'] ? '&fields=' . $config['fields'] : '';
 }
开发者ID:alexdevid,项目名称:google-parsing,代码行数:11,代码来源:Search.php

示例4: getInstance

 public static function getInstance()
 {
     self::$Logger = Logger::getLogger('system.services.MMap.MMapMsg');
     return parent::getInstance(__CLASS__);
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:5,代码来源:MMapPath.php

示例5: getKernel

 /**
  * @return \Kernel
  */
 public function getKernel()
 {
     return \Kernel::getInstance();
 }
开发者ID:alexdevid,项目名称:slim-rest,代码行数:7,代码来源:Controller.php

示例6: getInstance

 public static function getInstance()
 {
     return parent::getInstance(__CLASS__);
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:4,代码来源:MMapScreen.php

示例7: getInstance

 public static function getInstance()
 {
     return parent::getInstance(DEFAULT_MEMORYMANAGER);
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:4,代码来源:MemoryManager.php

示例8: __construct

 public function __construct()
 {
     $this->fixture = Kernel::getInstance('MemorySession');
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:4,代码来源:MemorySessionTest.php

示例9: getInstance

 public static function getInstance()
 {
     if (!self::$IsManagerLoaded) {
         self::$Logger = Logger::getLogger('system.services.Sharing.SharingManager');
         require SERVICE_SHARING_SHARINGMANAGERS_MANAGERS_PATH . '/' . SERVICE_SHARING_MANAGERCLASSNAME . '.php';
         self::$IsManagerLoaded = true;
     }
     return parent::getInstance(SERVICE_SHARING_MANAGERCLASSNAME);
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:9,代码来源:SharingManager.php

示例10: error_reporting

<?php

error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
ini_set('include_path', '/www/aaron');
set_include_path('/www/aaron');
header('Content-type:text/html; charset=utf-8');
require 'vendor/autoload.php';
spl_autoload_register(function ($class_name) {
    // Define an array of directories in the order of their priority to iterate through.
    $dirs = array('app/', 'controller/', 'model/', 'entity/', 'app/util/');
    // Looping through each directory to load all the class files. It will only require a file once.
    // If it finds the same class in a directory later on, IT WILL IGNORE IT! Because of that require once!
    foreach ($dirs as $dir) {
        if (file_exists($dir . $class_name . '.php')) {
            require_once $dir . $class_name . '.php';
            return;
        }
    }
});
try {
    Kernel::getInstance()->response();
} catch (Exception $e) {
    $e = new TraceableException($e);
    echo $e->show();
}
开发者ID:alexandre-le-borgne,项目名称:-PHP-DUT-S3-Projet,代码行数:26,代码来源:index.php

示例11:

<?php

require_once __DIR__ . "/../vendor/autoload.php";
$app = Kernel::getInstance()->run();
开发者ID:alexdevid,项目名称:slim-rest,代码行数:4,代码来源:index.php

示例12: getPrincipalsManagerInstance

 private static function getPrincipalsManagerInstance()
 {
     if (self::$PrincipalsManager === null) {
         self::$PrincipalsManager = parent::getInstance(SERVICE_UM_PRINCIPALSMANAGER);
     }
     return self::$PrincipalsManager;
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:7,代码来源:UMManager.php

示例13:

<?php

require_once __DIR__ . "/../vendor/autoload.php";
$app = Kernel::getInstance();
$app->run();
开发者ID:alexdevid,项目名称:google-parsing,代码行数:5,代码来源:index.php

示例14: renderControllerAction

 public function renderControllerAction($route, $data = array())
 {
     Kernel::getInstance()->generateResponse($route, $data, true);
 }
开发者ID:alexandre-le-borgne,项目名称:-PHP-DUT-S3-Projet,代码行数:4,代码来源:View.php


注:本文中的Kernel::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。