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(); }
/** * @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()]); }
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'] : ''; }
public static function getInstance() { self::$Logger = Logger::getLogger('system.services.MMap.MMapMsg'); return parent::getInstance(__CLASS__); }
/** * @return \Kernel */ public function getKernel() { return \Kernel::getInstance(); }
public static function getInstance() { return parent::getInstance(__CLASS__); }
public static function getInstance() { return parent::getInstance(DEFAULT_MEMORYMANAGER); }
public function __construct() { $this->fixture = Kernel::getInstance('MemorySession'); }
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); }
<?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(); }
<?php require_once __DIR__ . "/../vendor/autoload.php"; $app = Kernel::getInstance()->run();
private static function getPrincipalsManagerInstance() { if (self::$PrincipalsManager === null) { self::$PrincipalsManager = parent::getInstance(SERVICE_UM_PRINCIPALSMANAGER); } return self::$PrincipalsManager; }
<?php require_once __DIR__ . "/../vendor/autoload.php"; $app = Kernel::getInstance(); $app->run();
public function renderControllerAction($route, $data = array()) { Kernel::getInstance()->generateResponse($route, $data, true); }