Example #1
0
 private static function createDirs(Module_Audit $module, $dropTable)
 {
     $dirname = GWF_WWW_PATH . 'dbimg';
     if (false === GWF_File::createDir($dirname)) {
         return GWF_HTML::err('ERR_WRITE_FILE', array($dirname));
     }
     $dirname = GWF_WWW_PATH . 'dbimg/sudosh';
     if (false === GWF_File::createDir($dirname)) {
         return GWF_HTML::err('ERR_WRITE_FILE', array($dirname));
     }
     if (false === GWF_HTAccess::protect($dirname)) {
         return GWF_HTML::err('ERR_WRITE_FILE', array($dirname . '.htaccess'));
     }
     return '';
 }
Example #2
0
 public function on_repo_checkout_Pb()
 {
     GDO::table('Dog_Repo')->createTable(true);
     GDO::table('Dog_RepoSubscribes')->createTable(true);
     GDO::table('Dog_RepoUsers')->createTable(true);
     GWF_File::removeDir(Dog_Repo::baseDir(), false, true, true);
     $argv = $this->argv();
     $argc = count($argv);
     if ($argc !== 3) {
         return $this->showHelp('checkout');
     }
     $type = $argv[1];
     if (!Dog_Repo::isValidType($type)) {
         return $this->rply('err_software');
     }
     $url = @parse_url($argv[2]);
     if (!isset($url['scheme'])) {
         return $this->rply('err_url', $url);
     }
     $url = $argv[2];
     if (!GWF_HTTP::pageExists($url)) {
         return $this->rply('err_connect');
     }
     $name = $argv[0];
     if (!Dog_Repo::isValidName($name)) {
         return $this->rply('err_repo_name');
     }
     if (Dog_Repo::exists($name)) {
         return $this->rply('err_repo_taken');
     }
     if (!GWF_File::createDir(Dog_Repo::repoDir($name))) {
         return $this->rply('err_create_dir');
     }
     if (!($repo = Dog_Repo::create($url, $name, $type))) {
         return Dog::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     call_user_func(array($this, 'checkout_' . $type), $repo);
 }