public function buildArgument(dom\element $arg, fs\file $file, dom\element $test) { require_once 'core/functions/Path.php'; $sName = core\functions\path\urlize($file->getName() . '-' . $test->readAttribute('name')); $tmp = $this->exportDirectory->createFile($sName . '.xml'); $doc = $this->getManager('dom')->createDocument($arg); $doc->saveFile($tmp, true); $result = $this->getManager()->load($tmp, array(), true); //$result->setBaseDirectory($file->getParent()); return $result; }
protected function parseResult(dom\element $test, fs\file $file, array $aArguments = array()) { $result = null; if ($document = $test->getx('self:document', array(), false)) { require_once 'core/functions/Path.php'; $sName = core\functions\path\urlize($file->getName() . '-' . $test->readx('@name')); $cache = $this->getExportDirectory()->createFile($sName); $cache->saveText((string) $this->createDocument($document->getFirst())); $manager = $this->getManager(self::PARSER_MANAGER); $result = $this->buildResult($test, $manager, $cache, $aArguments); $this->set('result', $result); } return $result; }
public function getCachedFile(fs\file $file, $sExtension = self::EXTENSION_DEFAULT, $iDebug = fs\resource::DEBUG_EXIST) { $sName = $file->getName() . $sExtension; return $this->getCachedDirectory($file)->getFile($sName, $iDebug); }
protected function loadTarget(dom\document $doc, fs\file $file) { if ($sTarget = $doc->getRoot()->readx('@build:target', array('build' => self::BUILD_NS), false)) { if ($sTarget[0] == '[') { switch (substr($sTarget, 1, -1)) { case 'current()': $sTarget = (string) $file->getParent(); break; default: $this->throwException(sprintf('Cannot handler build option %s', $sTarget)); } } $dir = $this->getControler('fs/editable')->getDirectory($sTarget); $result = $dir->getFile($file->getName() . '.php', fs\resource::DEBUG_EXIST); } else { $result = $this->loadSelfTarget($file); } return $result; }
protected function secureFile(fs\file $file) { //dspf($file); if ($this->getControler()->mustSecure()) { if (!$this->getSettings() or !($aRights = $this->getSettings()->getFile($file->getName()))) { $aRights = $this->getChildrenRights(); } $file->setRights($aRights); } else { $file->setRights($this->getChildrenRights()); } }