Exemplo n.º 1
0
 /**
  * Определяет папку, в которую установлена система
  * @return string
  */
 private function init_paths()
 {
     $filter = new filter();
     if (empty($filter->server('DOCUMENT_ROOT'))) {
         $this->root = '.';
     } else {
         $step = 0 - strlen(basename($filter->server('SCRIPT_FILENAME')));
         $this->root = substr($filter->server('SCRIPT_FILENAME'), 0, $step - 1);
     }
     $this->twinklefox = $this->root . DIRECTORY_SEPARATOR . 'twinklefox';
     $this->files = $this->root . DIRECTORY_SEPARATOR . 'files';
     $this->modules = $this->root . DIRECTORY_SEPARATOR . 'modules';
 }
Exemplo n.º 2
0
 /**
  * Парсит параметры
  */
 private function init_options()
 {
     $filter = new filter();
     if ($this->link !== false) {
         foreach (explode($this->separator, $this->link) as $link) {
             if ($filter->option($link) !== false) {
                 if (isset($this->reserved_flags[$link]) && count($this->options) == 0) {
                     if ($this->flag === 'default' && $this->reserved_flags[$link] === true) {
                         $this->flag = $link;
                     } else {
                         $this->flag = 'error';
                     }
                 } else {
                     $this->options[] = $link;
                     $this->links[] = implode($this->separator, $this->options);
                 }
             } else {
                 $this->flag = 'error';
             }
         }
         $this->link = implode($this->separator, $this->options);
     }
 }