当前位置: 首页>>代码示例>>PHP>>正文


PHP StatusNet::init方法代码示例

本文整理汇总了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;
}
开发者ID:himmelex,项目名称:NTW,代码行数:31,代码来源:common.php

示例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";
                    }
开发者ID:Grasia,项目名称:bolotweet,代码行数:31,代码来源:sendemailreminder.php

示例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);
 }
开发者ID:stevertiqo,项目名称:StatusNet,代码行数:23,代码来源:statusnet.php


注:本文中的StatusNet::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。