Пример #1
0
 public function core_module_installation()
 {
     if (!isset($_SESSION['Boost'])) {
         $modules = PHPWS_Core::coreModList();
         $_SESSION['Boost'] = new PHPWS_Boost();
         $_SESSION['Boost']->loadModules($modules);
     }
     // Load branch database
     PHPWS_DB::loadDB($this->getDSN(), $this->dbprefix, false, false);
     $this->title = dgettext('branch', 'Installing core modules');
     $result = $_SESSION['Boost']->install(false, true, $this->branch->directory);
     if (PHPWS_Error::isError($result)) {
         PHPWS_Error::log($result);
         $this->content[] = dgettext('branch', 'An error occurred while trying to install your modules.') . ' ' . dgettext('branch', 'Please check your error logs and try again.');
         Branch::loadHubDB();
         return true;
     } else {
         $this->content[] = $result;
     }
     Branch::loadHubDB();
     return $_SESSION['Boost']->isFinished();
 }
Пример #2
0
 /**
  * Restores the branch connection after calling the loadHubDB
  */
 public static function restoreBranchDB()
 {
     if (isset($GLOBALS['Branch_Temp'])) {
         $prefix = $dsn = null;
         extract($GLOBALS['Branch_Temp']);
         PHPWS_DB::loadDB($dsn, $prefix);
         \Database::phpwsDSNLoader($dsn, $prefix);
     } else {
         if (defined('PHPWS_TABLE_PREFIX')) {
             $prefix = PHPWS_TABLE_PREFIX;
         } else {
             $prefix = null;
         }
         PHPWS_DB::loadDB(PHPWS_DSN, $prefix);
         \Database::phpwsDSNLoader(PHPWS_DSN, $prefix);
     }
 }
Пример #3
0
 public static function touchDB()
 {
     if (!PHPWS_DB::isConnected()) {
         return PHPWS_DB::loadDB();
     }
 }