本文整理汇总了PHP中AppContext::createAutowiredService方法的典型用法代码示例。如果您正苦于以下问题:PHP AppContext::createAutowiredService方法的具体用法?PHP AppContext::createAutowiredService怎么用?PHP AppContext::createAutowiredService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppContext
的用法示例。
在下文中一共展示了AppContext::createAutowiredService方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function &buildView($viewName)
{
$view =& AppContext::createAutowiredService($this->viewClass, $viewName);
$view->serviceName = $viewName;
$view->url = $this->prefix . $viewName . $this->suffix;
if ($this->contentType != null) {
$view->contentType = $this->contentType;
}
$view->requestContextAttribute =& $this->requestContextAttribute;
$view->staticAttributes =& $this->staticAttributes;
return $view;
}
示例2: isset
function &_getDefaultStrategy($className)
{
$strategyClass = isset($this->defaultStrategies[$className]) ? $this->defaultStrategies[$className] : null;
$obj = _null();
if (!is_null($strategyClass) && !empty($strategyClass)) {
$obj =& AppContext::createAutowiredService($strategyClass);
}
return $obj;
}
示例3: define
define('EXT', '.' . pathinfo(__FILE__, PATHINFO_EXTENSION));
define('FCPATH', __FILE__);
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('ROOTPATH', $realpath);
define('BASEPATH', $system_folder . '/');
define('APPPATH', $application_folder . '/');
//load the system
require BASEPATH . 'bootstrap' . EXT;
// The 3 GLOBALs
$request =& new Request();
$response =& new Response();
$appContext =& new AppContext();
//starts output buffering
$response->start();
//bootstrap the app if needed
if (file_exists(APPPATH . 'bootstrap' . EXT)) {
include APPPATH . 'bootstrap' . EXT;
}
//load the application
AppContext::load(APPPATH . '/config/app-context.yml');
//load any plugins? - NOTE: plugins can override core behavior and add new controllers
autodiscover_plugins();
//display cache after loading plugins but before calling Dispatcher
if ($response->displayCache() !== TRUE) {
//handle the request
$dispatcher =& AppContext::createAutowiredService('Dispatcher');
$dispatcher->process(&$request, &$response);
}
//send the response to the browser
$response->flush();
// flushs output buffering
示例4: switch
function &_get_typed_value($value)
{
# value is a string
if (is_string($value)) {
# tagged value
if (preg_match('/^!!(autowire|service|property|constant)\\s+(.+)$/', $value, $matches)) {
switch ($matches[1]) {
case 'autowire':
$string = $matches[2];
if (strstr($string, '::')) {
list($filename, $clazz) = explode('::', $string);
if (!class_exists($clazz)) {
if (!is_file($this->base . $filename) || !file_exists($this->base . $filename)) {
show_error('Instantiator Error', "File not found for '{$clazz}': " . $this->base . $filename);
}
include $this->base . $filename;
}
} else {
$clazz = $string;
}
$value =& AppContext::createAutowiredService($clazz);
break;
case 'service':
$service = $matches[2];
$point =& AppContext::servicePoint($service);
if ($point == NULL) {
show_error('Instantiator Error', 'Undefined service-point: ' . $service);
}
$value =& $point->instance();
break;
case 'property':
$value = AppContext::property($matches[2]);
break;
case 'constant':
$value = constant($matches[2]);
break;
}
}
} else {
if (is_array($value)) {
# recurse
$newvalue = array_map(array(&$this, '_get_typed_value'), &$value);
$value =& $newvalue;
}
}
return $value;
}
示例5:
function &getUserAgent()
{
return AppContext::createAutowiredService('UserAgent');
}