Esempio n. 1
0
 public function main()
 {
     $this->log('<%=$version%>', Project::MSG_INFO);
     // define a force tag
     $time = false;
     if ($this->force) {
         $xtime = strtotime($this->force);
         if (!$xtime) {
             $time = time();
             if ($this->force != 'force') {
                 $this->log('wrong date "' . $this->force . '"', Project::MSG_WARN);
             }
         } else {
             $time = $xtime;
         }
     }
     $this->preprocessor->cfg_time($time);
     $this->preprocessor->logLevel = $this->logLevel;
     // difine variable definitions
     foreach ($this->parameters as $v) {
         $file = $v->getFile();
         if (@is_readable($file)) {
             foreach (file($file) as $vv) {
                 if (preg_match('/^(?:\\;.*|\\#.*|([^=]+)=(.*))$/', $vv, $mm)) {
                     if (!empty($mm[1])) {
                         $this->preprocessor->export(trim($mm[1]), trim($mm[2]));
                     }
                 }
             }
         } else {
             $this->preprocessor->export($v->getName(), $v->getValue());
         }
     }
     //run it!
     if (!!$this->config) {
         $this->log('making "' . $this->config . '"', Project::MSG_WARN);
         POINT::clear();
         $this->preprocessor->xml_read($this->config);
         $this->preprocessor->process();
     } else {
         if (!empty($this->xconfigs)) {
             $config = '';
             foreach ($this->xconfigs as $v) {
                 $config .= $v->getText();
             }
             $this->log('making "' . $config . '"', Project::MSG_WARN);
             POINT::clear();
             $this->preprocessor->xml_read($config);
             $this->preprocessor->process();
         }
     }
 }