Esempio n. 1
0
 /**
  *
  * @param type $sPath
  * @return string
  */
 public function load($sPath, $bRun = true)
 {
     $this->aContexts['arguments']->set('path');
     $file = $this->getFile($sPath);
     //$parent = $this->getControler('parser')->getContext('action/current');
     dsp("Rebuild : {$sPath}");
     if (!in_array((string) $file, $this->get('exclude/run')->query())) {
         $manager = $this->getManager(self::PARSER_MANAGER);
         $manager->load($file, $this->aContexts, true, is_null($bRun) ? true : $bRun);
     }
     //$parent->getContexts()->get('message');
     return '1';
 }
Esempio n. 2
0
 protected function loadDocument(dom\handler $doc, fs\file $file)
 {
     $aResult = array();
     $iDisabled = 0;
     require_once 'core/functions/Global.php';
     $tests = $doc->queryx('self:test[@standalone]', array(), false);
     if (!$tests->length) {
         $tests = $doc->queryx('self:test');
     } else {
         dsp('WARNING : @standalone activated on ' . $file->asToken());
     }
     foreach ($tests as $test) {
         if (!$test->testAttribute('disabled', false)) {
             $aResult[] = $this->loadElement($test, $doc, $file);
         } else {
             $iDisabled++;
         }
     }
     $aResult['disabled'] = $iDisabled;
     return $aResult;
 }
Esempio n. 3
0
 protected function logQuery($sQuery)
 {
     if ($this->readArgument('debug/show')) {
         dsp($sQuery);
     }
 }
Esempio n. 4
0
 protected function showResult($content)
 {
     if ($this->readArgument('debug/show')) {
         dsp($this->getFile()->asToken());
         dsp($content);
     }
 }
Esempio n. 5
0
 protected function buildWindowScript(array $aPaths)
 {
     $this->setDirectory(__FILE__);
     $args = $this->getArguments();
     $post = $this->getPost();
     if (!($file = $this->getFile(current($aPaths), false))) {
         if (\Sylma::isAdmin()) {
             dsp('Action not found');
         }
         $this->send404();
         $content = $this->getError();
     } else {
         try {
             $content = $this->prepareMain($file, $args, $post);
         } catch (core\exception $e) {
             $e->save(false);
             $content = $this->getError();
         }
     }
     while (next($aPaths)) {
         $sPath = current($aPaths);
         $args->set(self::CONTENT_SUB, $content);
         $content = $this->getScriptFile($this->getFile($sPath), array('arguments' => $args, 'post' => $post, 'contexts' => $this->getContexts()));
     }
     return $content;
 }