Gdn::factoryOverwrite PHP Method

factoryOverwrite() public static method

public static factoryOverwrite ( null $Value = null ) : integer
$Value null
return integer
    public static function factoryOverwrite($Value = null)
    {
        $Result = self::$_FactoryOverwrite & 1 > 0;
        if (!is_null($Value)) {
            self::$_FactoryOverwrite = $Value;
        }
        return $Result;
    }

Usage Example

示例#1
0
 /**
  * Register the debug database that captures the queries.
  *
  * This event happens as early as possible so that all queries can be captured.
  *
  * @param Gdn_PluginManager $sender The {@link Gdn_PluginManager} firing the event.
  */
 public function gdn_pluginManager_afterStart_handler($sender)
 {
     $tmp = Gdn::factoryOverwrite(true);
     Gdn::factoryInstall(Gdn::AliasDatabase, 'Gdn_DatabaseDebug', dirname(__FILE__) . DS . 'class.databasedebug.php', Gdn::FactorySingleton, array('Database'));
     Gdn::factoryOverwrite($tmp);
     unset($tmp);
 }