示例#1
0
 public function updateBranches(&$content)
 {
     if (!PHPWS_Core::moduleExists('branch')) {
         return true;
     }
     PHPWS_Core::initModClass('branch', 'Branch_Admin.php');
     $branches = Branch_Admin::getBranches(true);
     if (empty($branches)) {
         return true;
     }
     $keys = array_keys($this->status);
     foreach ($branches as $branch) {
         $GLOBALS['Boost_In_Branch'] = $branch;
         // used as the "local" directory in updateFiles
         $GLOBALS['boost_branch_dir'] = $branch->directory;
         if (PHPWS_Error::isError($branch->loadBranchDB())) {
             $content[] = dgettext('boost', 'Problem connecting to the branch. May be too many connections.');
             continue;
         }
         // create a new boost based on the branch database
         $branch_boost = new PHPWS_Boost();
         $branch_boost->loadModules($keys, false);
         $content[] = '<hr />';
         $content[] = sprintf(dgettext('boost', 'Updating branch %s'), $branch->branch_name);
         $result = $branch_boost->update($content);
         if (PHPWS_Error::isError($result)) {
             PHPWS_Error::log($result);
             $content[] = dgettext('boost', 'Unable to update branch.');
         }
     }
     Branch::loadHubDB();
     $GLOBALS['Boost_In_Branch'] = false;
 }
示例#2
0
<?php

/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
if (!Current_User::authorized('branch')) {
    Current_User::disallow();
}
PHPWS_Core::initModClass('branch', 'Branch_Admin.php');
$branch_admin = new Branch_Admin();
$branch_admin->main();