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'])); } }
public function getSiteStructure() { $XML = new PWEXML($this->getTempDirectory()); $struct = array(); $XML->FileToArray($this->siteStructureFile, $struct); return $struct; }
protected function setUp() { $xml = new PWEXML(); $xml->FileToArray(__DIR__ . '/coreXML/out.xml', $this->struct); }
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'); } }