本文整理汇总了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();
}
示例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()]);
}
示例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'] : '';
}
示例4: getInstance
public static function getInstance()
{
self::$Logger = Logger::getLogger('system.services.MMap.MMapMsg');
return parent::getInstance(__CLASS__);
}
示例5: getKernel
/**
* @return \Kernel
*/
public function getKernel()
{
return \Kernel::getInstance();
}
示例6: getInstance
public static function getInstance()
{
return parent::getInstance(__CLASS__);
}
示例7: getInstance
public static function getInstance()
{
return parent::getInstance(DEFAULT_MEMORYMANAGER);
}
示例8: __construct
public function __construct()
{
$this->fixture = Kernel::getInstance('MemorySession');
}
示例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);
}
示例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();
}
示例11:
<?php
require_once __DIR__ . "/../vendor/autoload.php";
$app = Kernel::getInstance()->run();
示例12: getPrincipalsManagerInstance
private static function getPrincipalsManagerInstance()
{
if (self::$PrincipalsManager === null) {
self::$PrincipalsManager = parent::getInstance(SERVICE_UM_PRINCIPALSMANAGER);
}
return self::$PrincipalsManager;
}
示例13:
<?php
require_once __DIR__ . "/../vendor/autoload.php";
$app = Kernel::getInstance();
$app->run();
示例14: renderControllerAction
public function renderControllerAction($route, $data = array())
{
Kernel::getInstance()->generateResponse($route, $data, true);
}