Ejemplo n.º 1
0
 /**
  * Uninstall webtools
  *
  * @param  string $path
  * @return void
  */
 public static function uninstall($path)
 {
     $path = rtrim(realpath($path), '/') . '/';
     if (PHP_OS == 'WINNT') {
         $path = str_replace("\\", '/', $path);
     }
     if (!is_dir($path . 'public/')) {
         throw new \Exception('Document root cannot be located');
     }
     TBootstrap::uninstall($path);
     CodeMirror::uninstall($path);
     if (is_file($path . 'public/webtools.config.php')) {
         unlink($path . 'public/webtools.config.php');
     }
     if (is_file($path . 'public/webtools.php')) {
         unlink($path . 'public/webtools.php');
     }
 }
Ejemplo n.º 2
0
 /**
  * Uninstall webtools
  *
  * @param  string $path
  * @return bool
  *
  * @throws \Exception
  */
 public static function uninstall($path)
 {
     $path = realpath($path) . DIRECTORY_SEPARATOR;
     if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
         $path = str_replace("\\", '/', $path);
     }
     if (!is_dir($path . 'public/')) {
         throw new \Exception('Document root cannot be located');
     }
     $bootstrap = new Bootstrap();
     $bootstrap->uninstall($path);
     $codeMirror = new CodeMirror();
     $codeMirror->uninstall($path);
     $jQuery = new JQuery();
     $jQuery->uninstall($path);
     if (is_file($path . 'public/webtools.config.php')) {
         unlink($path . 'public/webtools.config.php');
     }
     if (is_file($path . 'public/webtools.php')) {
         unlink($path . 'public/webtools.php');
     }
     return true;
 }