本文整理汇总了PHP中Gdn::_Config方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn::_Config方法的具体用法?PHP Gdn::_Config怎么用?PHP Gdn::_Config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdn
的用法示例。
在下文中一共展示了Gdn::_Config方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: factoryInstall
/**
* Install a class to the factory.
*
* @param string $Alias An alias for the class that will be used to retreive instances of it.
* @param string $ClassName The actual name of the class.
* @param string $Path The path to the class' file. You can prefix the path with ~ to start at the application root.
* @param string $FactoryType The way objects will be instantiated for the class. One of (Gdn::FactoryInstance, Gdn::FactoryPrototype, Gdn::FactorySingleton).
* @see Gdn_Factory::Install()
*/
public static function factoryInstall($Alias, $ClassName, $Path = '', $FactoryType = self::FactorySingleton, $Data = null)
{
// Don't overwrite an existing definition.
if (self::$_FactoryOverwrite === false && self::factoryExists($Alias)) {
return;
}
self::factory()->install($Alias, $ClassName, $Path, $FactoryType, $Data);
// Cache some of the more commonly used factory objects as properties.
switch ($Alias) {
case self::AliasConfig:
self::$_Config = self::factory($Alias);
break;
case self::AliasLocale:
self::$_Locale = self::factory($Alias);
break;
case self::AliasRequest:
self::$_Request = self::factory($Alias);
break;
case self::AliasPluginManager:
self::$_PluginManager = self::factory($Alias);
break;
case self::AliasSession:
self::$_Session = null;
break;
}
}
示例2: FactoryInstall
/**
* Install a class to the factory.
*
* @param string $Alias An alias for the class that will be used to retreive instances of it.
* @param string $ClassName The actual name of the class.
* @param string $Path The path to the class' file. You can prefix the path with ~ to start at the application root.
* @param string $FactoryType The way objects will be instantiated for the class. One of (Gdn::FactoryInstance, Gdn::FactoryPrototype, Gdn::FactorySingleton).
* @see Gdn_Factory::Install()
*/
public static function FactoryInstall($Alias, $ClassName, $Path, $FactoryType = self::FactoryInstance, $Data = NULL)
{
// Don't overwrite an existing definition.
if (self::$_FactoryOverwrite === FALSE && self::FactoryExists($Alias)) {
return;
}
self::$_Factory->Install($Alias, $ClassName, $Path, $FactoryType, $Data);
// Cache some of the more commonly used factory objects as properties.
switch ($Alias) {
case self::AliasConfig:
self::$_Config = self::Factory($Alias);
break;
case self::AliasSession:
self::$_Session = NULL;
break;
}
}