本文整理汇总了PHP中midcom::init方法的典型用法代码示例。如果您正苦于以下问题:PHP midcom::init方法的具体用法?PHP midcom::init怎么用?PHP midcom::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类midcom
的用法示例。
在下文中一共展示了midcom::init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
$autoloaded++;
}
/**
* Get service or midcom_application singletons. Services are automatically instantiated if they
* were not used before
*
* @param string $name The service name as listed in the _service_classes array or null to get midcom_application
* @return mixed The requested instance
*/
public static function get($name = null)
{
if (is_null($name)) {
return self::$_application;
}
if (isset(self::$_services[$name])) {
return self::$_services[$name];
}
if (isset(self::$_service_classes[$name])) {
$service_class = self::$_service_classes[$name];
self::$_services[$name] = new $service_class();
return self::$_services[$name];
}
throw new midcom_error("Requested service '{$name}' is not available.");
}
public static function get_version()
{
return self::$_version;
}
}
midcom::init();