Exemple #1
0
 protected function loadRegistry($force = false)
 {
     if (!$force && $this->registryArray) {
         return;
     }
     PWELogger::debug("Loading registry file: %s", $this->registryFile);
     // read site structure
     $XML = new PWEXML($this->PWE->getTempDirectory());
     $this->registryArray = array();
     $XML->FileToArray($this->registryFile, $this->registryArray);
     $logger = $this->getModuleSettings('PWE\\Core\\PWELogger');
     if ($logger['!a']) {
         PWELogger::setLevel(PWELogger::getLevelByName($logger['!a']['level']));
     }
 }
Exemple #2
0
 public function getSiteStructure()
 {
     $XML = new PWEXML($this->getTempDirectory());
     $struct = array();
     $XML->FileToArray($this->siteStructureFile, $struct);
     return $struct;
 }
Exemple #3
0
 protected function setUp()
 {
     $xml = new PWEXML();
     $xml->FileToArray(__DIR__ . '/coreXML/out.xml', $this->struct);
 }
Exemple #4
0
 public function testBrokenWrite()
 {
     $tmp = PWEUnitTests::utGetCleanTMP();
     $registerData = array();
     $registerData['!a']['dir'] = '/tmp';
     $registerData['!c']['ArchiveToken'] = array('!v' => 'changeme');
     $xml = new PWEXML();
     $data = array('test' => array($registerData));
     try {
         $xml->ArrayToFile($data, $tmp . '/test.xml');
         $this->fail();
     } catch (RuntimeException $e) {
         $this->assertFileNotExists($tmp . '/test.xml');
     }
 }