public function initTest(fs\file $file, $iTest) { $this->setDirectory($file->getParent()); $this->setNamespace(self::NS, 'self'); $this->setManager($this); //$this->resetDB(); $this->setFile($file); $this->setTestKey($iTest); $this->setSettings(array()); $this->exportDirectory = $this->loadCacheDirectory($this->getDirectory()); }
public function loadBuilder(fs\file $file, fs\directory $dir = null, core\argument $args = null, dom\document $doc = null) { if (!$dir) { $dir = $file->getParent(); } if (!$doc) { $doc = $file->asDocument(); } $result = $this->loadBuilderFromNS($doc->getRoot()->getNamespace(), $file, $dir, $args, $doc); return $result; }
protected function getCachedDirectory(fs\file $file) { $fs = $this->getControler('fs/cache'); return $fs->getDirectory()->addDirectory((string) $file->getParent()); }
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; }