示例#1
0
文件: index.php 项目: hcopr/Hubbub
<?

  h2_errorhandler(-1, 'Server-specific config file missing (domain '.$_SERVER['HTTP_HOST'].')', __FILE__, 0);

?>
<br/>
<br/>
Click here to start installing Hubbub on this server: <br/>
<input type="button" value="Install Hubbub" onclick="document.location.href='?p=step1';"/>
示例#2
0
文件: database.php 项目: hcopr/Hubbub
function DB_Connect()
{
    if ($GLOBALS['db_link']) {
        return;
    }
    $DBERR = null;
    $GLOBALS['db_link'] = mysql_pconnect(cfg('db/host'), cfg('db/user'), cfg('db/password')) or $DBERR = 'The database connection to server ' . cfg('db/user') . '@' . cfg('db/host') . ' could not be established (code: ' . @mysql_error($GLOBALS['db_link']) . ')';
    if ($DBERR == null) {
        mysql_select_db(cfg('db/database'), $GLOBALS['db_link']) or $DBERR = 'The database connection to database ' . cfg('db/database') . ' on ' . cfg('db/user') . '@' . cfg('db/host') . ' could not be established. (code: ' . @mysql_error($GLOBALS['db_link']) . ')';
    }
    if ($DBERR != null) {
        $startupErrors = 'Seems like something went wrong with the Hubbub database :-(<br/>' . $DBERR;
        h2_errorhandler(0, $startupErrors, __FILE__);
        die;
    } else {
        mysql_query("SET NAMES 'utf8'", $GLOBALS['db_link']);
    }
}
示例#3
0
文件: hubbub2.php 项目: hcopr/Hubbub
 function invokeAction($action, $params = null)
 {
     $action = getDefault($action, cfg('service/defaultaction'));
     $this->lastAction = $action;
     if ($params == null) {
         $params =& $_REQUEST;
     }
     // let's see if we have a sub controller for this, if so: call it!
     $subAction = $action;
     $subController = CutSegment(URL_CA_SEPARATOR, $subAction);
     if (isset($this->subControllers[$subController])) {
         $this->subControllers[$subController]->invokeAction($subAction, $params);
         $this->deferredViewController =& $this->subControllers[$subController];
         return;
     }
     // by convention, actions starting with "ajax_" don't return the whole page template
     // since they're intended to be partial content
     if (substr($action, 0, 5) == 'ajax_') {
         $this->skipView = true;
         $GLOBALS['config']['page']['template'] = 'blank';
     }
     if (is_callable(array($this, $action))) {
         $output = $this->{$action}($params);
     } else {
         h2_errorhandler(0, 'Action not defined: ' . $this->name . '.' . $action);
     }
     if ($output != null) {
         print $output;
     }
     $GLOBALS['config']['page']['title'] = $action;
 }