本文整理汇总了PHP中StatusNet::init方法的典型用法代码示例。如果您正苦于以下问题:PHP StatusNet::init方法的具体用法?PHP StatusNet::init怎么用?PHP StatusNet::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StatusNet
的用法示例。
在下文中一共展示了StatusNet::init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
Event::handle('Autoload', array(&$cls));
}
}
}
}
}
// XXX: how many of these could be auto-loaded on use?
// XXX: note that these files should not use config options
// at compile time since DB config options are not yet loaded.
require_once 'Validate.php';
require_once 'markdown.php';
// XXX: other formats here
define('NICKNAME_FMT', VALIDATE_NUM . VALIDATE_ALPHA_LOWER);
require_once INSTALLDIR . '/lib/util.php';
require_once INSTALLDIR . '/lib/action.php';
require_once INSTALLDIR . '/lib/mail.php';
require_once INSTALLDIR . '/lib/subs.php';
require_once INSTALLDIR . '/lib/clientexception.php';
require_once INSTALLDIR . '/lib/serverexception.php';
try {
StatusNet::init(@$server, @$path, @$conffile);
} catch (NoConfigException $e) {
// XXX: Throw a conniption if database not installed
// XXX: Find a way to use htmlwriter for this instead of handcoded markup
echo '<p>' . _('No configuration file found. ') . '</p>';
echo '<p>' . _('I looked for configuration files in the following places: ') . '<br/> ';
echo implode($e->configFiles, '<br/>');
echo '<p>' . _('You may wish to run the installer to fix this.') . '</p>';
echo '<a href="install.php">' . _('Go to the installer.') . '</a>';
exit;
}
示例2: Status_network
break;
case 'invite':
$reminders[] = $types['invite'];
break;
case 'all':
$reminders = $types;
break;
}
if (have_option('u', 'universe')) {
$sn = new Status_network();
try {
if ($sn->find()) {
while ($sn->fetch()) {
try {
$server = $sn->getServerName();
StatusNet::init($server);
// Different queue manager, maybe!
$qm = QueueManager::get();
foreach ($reminders as $reminder) {
extract($reminder);
$qm->enqueue(array($type, $opts), 'siterem');
if (!$quiet) {
print "Sent pending {$type} reminders for {$server}.\n";
}
}
} catch (Exception $e) {
// keep going
common_log(LOG_ERR, "Couldn't init {$server}.\n", __FILE__);
if (!$quiet) {
print "Couldn't init {$server}.\n";
}
示例3: switchSite
/**
* Change site configuration to site specified by nickname,
* if set up via Status_network. If not, sites other than
* the current will fail horribly.
*
* May throw exception or trigger a fatal error if the given
* site is missing or configured incorrectly.
*
* @param string $nickname
*/
public static function switchSite($nickname)
{
if ($nickname == StatusNet::currentSite()) {
return true;
}
$sn = Status_network::staticGet('nickname', $nickname);
if (empty($sn)) {
return false;
throw new Exception("No such site nickname '{$nickname}'");
}
$server = $sn->getServerName();
StatusNet::init($server);
}