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


PHP StatusNet::initDefaults方法代码示例

本文整理汇总了PHP中StatusNet::initDefaults方法的典型用法代码示例。如果您正苦于以下问题:PHP StatusNet::initDefaults方法的具体用法?PHP StatusNet::initDefaults怎么用?PHP StatusNet::initDefaults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StatusNet的用法示例。


在下文中一共展示了StatusNet::initDefaults方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doInstall

 /**
  * The beef of the installer!
  * Create database, config file, and admin user.
  *
  * Prerequisites: validation of input data.
  *
  * @return boolean success
  */
 function doInstall()
 {
     $this->updateStatus("Initializing...");
     ini_set('display_errors', 1);
     error_reporting(E_ALL);
     if (!defined('STATUSNET')) {
         define('STATUSNET', 1);
     }
     require_once INSTALLDIR . '/lib/framework.php';
     StatusNet::initDefaults($this->server, $this->path);
     try {
         $this->db = $this->setupDatabase();
         if (!$this->db) {
             // database connection failed, do not move on to create config file.
             return false;
         }
     } catch (Exception $e) {
         // Lower-level DB error!
         $this->updateStatus("Database error: " . $e->getMessage(), true);
         return false;
     }
     // Make sure we can write to the file twice
     $oldUmask = umask(00);
     if (!$this->skipConfig) {
         $this->updateStatus("Writing config file...");
         $res = $this->writeConf();
         if (!$res) {
             $this->updateStatus("Can't write config file.", true);
             return false;
         }
     }
     if (!empty($this->adminNick)) {
         // Okay, cross fingers and try to register an initial user
         if ($this->registerInitialUser()) {
             $this->updateStatus("An initial user with the administrator role has been created.");
         } else {
             $this->updateStatus("Could not create initial StatusNet user (administrator).", true);
             return false;
         }
     }
     if (!$this->skipConfig) {
         $this->updateStatus("Setting site profile...");
         $res = $this->writeSiteProfile();
         if (!$res) {
             $this->updateStatus("Can't write to config file.", true);
             return false;
         }
     }
     // Restore original umask
     umask($oldUmask);
     // Set permissions back to something decent
     chmod(INSTALLDIR . '/config.php', 0644);
     /*
         TODO https needs to be considered
     */
     $link = "http://" . $this->server . '/' . $this->path;
     $this->updateStatus("StatusNet has been installed at {$link}");
     $this->updateStatus("<strong>DONE!</strong> You can visit your <a href='{$link}'>new StatusNet site</a> (login as '{$this->adminNick}'). If this is your first StatusNet install, you may want to poke around our <a href='http://status.net/wiki/Getting_started'>Getting Started guide</a>.");
     return true;
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:68,代码来源:installer.php

示例2: init

 /**
  * Initialize, or re-initialize, StatusNet global configuration
  * and plugins.
  *
  * If switching site configurations during script execution, be
  * careful when working with leftover objects -- global settings
  * affect many things and they may not behave as you expected.
  *
  * @param $server optional web server hostname for picking config
  * @param $path optional URL path for picking config
  * @param $conffile optional configuration file path
  *
  * @throws NoConfigException if config file can't be found
  */
 public static function init($server = null, $path = null, $conffile = null)
 {
     StatusNet::initDefaults($server, $path);
     StatusNet::loadConfigFile($conffile);
     // Load settings from database; note we need autoload for this
     Config::loadSettings();
     self::initPlugins();
 }
开发者ID:stevertiqo,项目名称:StatusNet,代码行数:22,代码来源:statusnet.php

示例3: init

 /**
  * Initialize, or re-initialize, StatusNet global configuration
  * and plugins.
  *
  * If switching site configurations during script execution, be
  * careful when working with leftover objects -- global settings
  * affect many things and they may not behave as you expected.
  *
  * @param $server optional web server hostname for picking config
  * @param $path optional URL path for picking config
  * @param $conffile optional configuration file path
  *
  * @throws NoConfigException if config file can't be found
  */
 public static function init($server = null, $path = null, $conffile = null)
 {
     Router::clear();
     StatusNet::initDefaults($server, $path);
     StatusNet::loadConfigFile($conffile);
     $sprofile = common_config('site', 'profile');
     if (!empty($sprofile)) {
         StatusNet::loadSiteProfile($sprofile);
     }
     // Load settings from database; note we need autoload for this
     Config::loadSettings();
     self::initPlugins();
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:27,代码来源:statusnet.php


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