Ejemplo n.º 1
0
 /**
 Rebuilds database items collection. Optional <var>$pwd</var> parameter is
 the path where to start rebuild.
 
 @param	pwd		<b>string</b>		Directory to rebuild
 */
 public function rebuild($pwd = '')
 {
     if (!$this->core->auth->isSuperAdmin()) {
         throw new Exception(__('You are not a super administrator.'));
     }
     $this->chdir($pwd);
     parent::getDir();
     $dir = $this->dir;
     foreach ($dir['dirs'] as $d) {
         if (!$d->parent) {
             $this->rebuild($d->relname, false);
         }
     }
     foreach ($dir['files'] as $f) {
         $this->chdir(dirname($f->relname));
         $this->createFile($f->basename);
     }
     $this->rebuildDB($pwd);
 }