コード例 #1
0
ファイル: CConfigure.php プロジェクト: Broncko/Savant
 /**
  * returns configuration from given class
  * @param string $pClass
  * @param string $pSection
  * @return SimpleXMLElement
  */
 public static function getClassConfig($pClass, $pSection = 'default')
 {
     $configFile = CBootstrap::getConfigFile($pClass);
     if (!\file_exists($configFile)) {
         throw new EConfigure("no config file for class %s found", $pClass);
     }
     $config = self::load($configFile, false);
     //deactivate dtd validation while fixing bug
     $section = $config->configurations->xpath("//section[@name='" . $pSection . "']");
     return self::getConfigFromSection($section[0]);
 }
コード例 #2
0
ファイル: AStandardObject.php プロジェクト: Broncko/Savant
 /**
  * create a standardobject instance
  * @param string $pConfig section of the configuration file
  */
 public function __construct($pConfig = 'default')
 {
     $this->confSection = $pConfig;
     $this->confFile = CBootstrap::getConfigFile(\get_class($this));
     AOP\AFramework::weave($this, new AOP\JoinPoints\CConstructor(\get_class($this)));
 }