Beispiel #1
0
 /**
  * Load local package data array
  *
  * @param string $packageName without extension
  * @return array|boolean
  */
 public function loadLocalPackage($packageName)
 {
     $xmlFile = sprintf('connect/%.xml', $packageName);
     $serFile = sprintf('connect/%.ser', $packageName);
     if ($this->readDirectory->isFile($xmlFile) && $this->readDirectory->isReadable($xmlFile)) {
         $xml = simplexml_load_string($this->readDirectory->readFile($xmlFile));
         $data = $this->_xmlConverter->xmlToAssoc($xml);
         if (!empty($data)) {
             return $data;
         }
     }
     if ($this->readDirectory->isFile($serFile) && $this->readDirectory->isReadable($xmlFile)) {
         $data = unserialize($this->readDirectory->readFile($serFile));
         if (!empty($data)) {
             return $data;
         }
     }
     return false;
 }
Beispiel #2
0
 /**
  * Load aliases to classes map from file
  *
  * @param string $pathToMapFile
  * @return string
  */
 protected function _loadMap($pathToMapFile)
 {
     if ($this->_directory->isFile($pathToMapFile)) {
         return $this->_directory->readFile($pathToMapFile);
     }
     return '';
 }