Exemplo n.º 1
0
 /**
  * Setup the config.php file
  *
  *
  */
 public function setupConfigNameMode()
 {
     //
     $configFile = 'config/' . $this->name . '.' . $this->mode . '.php';
     //
     $configPath = __BASE__ . '/' . $configFile;
     // load default config
     if (file_exists($configPath) && filesize($configPath)) {
         return;
     }
     //
     $configCode = str_replace(['{home}', '{name}', '{mode}', '{configFile}'], [Urlman::currentBase(), $this->name, $this->mode, $configFile], file_get_contents(__DIR__ . '/files/name.mode.php'));
     //
     echo '<h1>Setup ' . $configFile . ' file</h1>' . '<blockquote><p>' . 'Copy this code into your <strong>' . $configFile . '</strong> ' . 'and insert your modules.' . '</p></blockquote>' . '<div class="textarea-wrapper">' . '<textarea rows="14" cols="80">' . $configCode . '</textarea></div>';
     //
     $this->drawRefresh();
 }