示例#1
0
 function __construct()
 {
     parent::__construct();
     $this->contentLanguage = $this->app->getGlobal('wgContLang')->getCode();
     $this->script = $this->wg->Script;
     $this->user = $this->wg->User;
 }
示例#2
0
 public function __construct($id = null)
 {
     parent::__construct();
     if (is_null($id)) {
         $id = $this->wg->CityId;
     }
     $this->id = $id;
     if ($this->wg->CityId == $id) {
         $this->db = wfGetDB(DB_SLAVE);
         $this->dbname = $this->wg->DBname;
     } else {
         // find db name
         $dbname = WikiFactory::IDtoDB($this->id);
         if (empty($dbname)) {
             throw new Exception("Could not find wiki with ID {$this->id}");
         }
         // open db connection (and check if db really exists)
         $db = wfGetDB(DB_SLAVE, array(), $dbname);
         if (!is_object($db)) {
             throw new Exception("Could not connect to wiki database {$dbname}");
         }
         $this->db = $db;
         $this->dbname = $dbname;
     }
 }
示例#3
0
 function __construct()
 {
     parent::__construct();
     if (!self::$initialized) {
         // Nirvana singleton, please use F::build
         F::setInstance(__CLASS__, $this);
         self::$initialized = true;
     }
 }
示例#4
0
 public function __construct($type, $dbName = null)
 {
     parent::__construct();
     $this->dbName = $dbName;
     $this->cityId = null;
     $this->type = $type;
     $this->fileChanged = false;
     $this->removed = false;
 }
 function __construct()
 {
     parent::__construct();
     if (self::$isWikiaMobile === null) {
         self::$isWikiaMobile = $this->app->checkSkin('wikiamobile');
     }
     if (!self::$isWikiaMobile && empty($this->app->wg->RTEParserEnabled)) {
         self::$enabled = true;
     }
 }
 function __construct()
 {
     parent::__construct();
     if (self::$isOasis === null) {
         self::$isOasis = $this->app->checkSkin('oasis');
     }
     if (self::$isWikiaMobile === null) {
         self::$isWikiaMobile = !empty($isOasis) ? false : $this->app->checkSkin('wikiamobile');
     }
 }
示例#7
0
 public function __construct($model, $data = array())
 {
     parent::__construct();
     $this->model = $model;
     if (!empty($data)) {
         foreach ($data as $key => $value) {
             $method = "set{$key}";
             $this->{$method}($value);
         }
     }
     $this->service = new PhalanxService();
     $this->ip = $this->wg->request->getIp();
 }
 /**
  * ArticleService constructor
  *
  * @param Article|Title|int $articleOrId [OPTIONAL] An Article or Title instance or a valid article ID (lower performance)
  */
 public function __construct($articleOrId = null)
 {
     parent::__construct();
     if (!is_null($articleOrId)) {
         if (is_numeric($articleOrId)) {
             $this->setArticleById($articleOrId);
         } elseif ($articleOrId instanceof Article) {
             $this->setArticle($articleOrId);
         } elseif ($articleOrId instanceof Title) {
             $this->setArticleByTitle($articleOrId);
         }
     }
 }
示例#9
0
 /**
  * Creates a new SassService object based on the Sass source provided.
  * Please use static constructors instead of calling this constructor directly.
  *
  * @param Source $source
  */
 public function __construct(Source $source)
 {
     parent::__construct();
     $this->source = $source;
     // set up default cache variant
     if (!empty($this->wg->DevelEnvironment)) {
         $this->setCacheVariant("dev-{$this->wg->DevelEnvironmentName}");
     } else {
         $hostPrefix = getHostPrefix();
         if ($hostPrefix != null) {
             $this->setCacheVariant("staging-{$hostPrefix}");
         }
     }
 }
 function __construct($langCode = null)
 {
     wfProfileIn(__METHOD__);
     parent::__construct();
     // create a new broker object
     $this->broker = enchant_broker_init();
     // set path to directory with extra dictionaries
     // @see http://blog.iwanluijks.nl/2010/10/using-enchant-with-php-on-windows-part.html
     $ip = $this->app->getGlobal('IP');
     $this->path = "{$ip}/lib/dicts";
     enchant_broker_set_dict_path($this->broker, ENCHANT_MYSPELL, $this->path);
     enchant_broker_set_dict_path($this->broker, ENCHANT_ISPELL, $this->path);
     // try to load dictionary
     if (!empty($langCode)) {
         $this->load($langCode);
     }
     wfProfileOut(__METHOD__);
 }
 public function __construct()
 {
     parent::__construct();
     $this->homePageHelper = new WikiaHomePageHelper();
 }
示例#12
0
 function __construct()
 {
     parent::__construct();
     F::setInstance(__CLASS__, $this);
 }
示例#13
0
 public function __construct($config)
 {
     parent::__construct();
     $this->config = $config;
 }
示例#14
0
 public function __construct()
 {
     $this->captcha = Factory\Module::getInstance();
     parent::__construct();
 }
 function __construct(array $items, \Parser $parser)
 {
     parent::__construct();
     $this->parser = $parser;
     $this->setGalleryData($items);
 }
 function __construct()
 {
     parent::__construct();
     $this->avoidActions = array('edit', 'submit');
 }
 function __construct()
 {
     parent::__construct();
     $this->items = array();
     $this->count = 0;
 }
 /**
  * Accepts a Solarium select result and a search config.
  * If not the root search result set, you should provide the parent and metaposition.
  * @param Solarium_Result_Select $result
  * @param WikiaSearchConfig $searchConfig
  * @param WikiaSearchResultSet $parent
  * @param int $metaposition
  */
 public function __construct(Solarium_Result_Select $result, WikiaSearchConfig $searchConfig, $parent = null, $metaposition = null)
 {
     wfProfileIn(__METHOD__);
     parent::__construct();
     $this->searchResultObject = $result;
     $this->searchConfig = $searchConfig;
     $this->setQuery($searchConfig->getQuery(WikiaSearchConfig::QUERY_ENCODED));
     if ($result instanceof Solarium_Result_Select_Empty) {
         return;
     }
     if ($parent === null && $this->searchConfig->getGroupResults()) {
         $this->setResultGroupings($result, $searchConfig);
         $this->setResultsFound($this->getHostGrouping()->getMatches());
     } else {
         $this->parent = $parent;
         $this->metaposition = $metaposition;
         $this->highlightingObject = $result->getHighlighting();
         $this->setResultsStart($result->getStart())->setQueryTime($result->getQueryTime());
         if ($this->parent !== null && $this->metaposition !== null) {
             $this->prepareChildResultSet();
         } else {
             // default behavior for an ungrouped search result set
             $this->prependArticleMatchIfExists()->setResults($this->searchResultObject->getDocuments())->setResultsFound($this->resultsFound + $this->searchResultObject->getNumFound());
         }
     }
     wfProfileOut(__METHOD__);
 }
示例#19
0
 public function __construct(StructuredDataAPIClient $apiClient)
 {
     $this->APIClient = $apiClient;
     parent::__construct();
 }
示例#20
0
 public function __construct(GlobalTitle $title)
 {
     parent::__construct();
     $this->mTitle = $title;
 }
 /**
  * Handles dependency injection for solarium client
  * @param Solarium_Client $client
  */
 public function __construct(Solarium_Client $client)
 {
     $this->client = $client;
     parent::__construct();
 }
示例#22
0
 public function __construct(Title $currentTitle = null)
 {
     parent::__construct();
     $this->title = $currentTitle;
 }
 /**
  * Constructor method
  * @see   WikiaSearchConfigTest::testConstructor
  * @param array $params
  */
 public function __construct(array $params = array())
 {
     parent::__construct();
     $this->params = array_merge($this->params, array('requestedFields' => $this->requestedFields), $params);
 }
示例#24
0
 /**
  * Instantiates the class; sets and configures the Solarium client
  * @param Solarium_Client $client
  */
 public function __construct(Solarium_Client $client)
 {
     $this->client = $client;
     $this->client->setAdapter('Solarium_Client_Adapter_Curl');
     parent::__construct();
 }
 public function __construct()
 {
     parent::__construct();
 }
 public function __construct()
 {
     parent::__construct();
     $this->homePageHelper = F::build('WikiaHomePageHelper');
 }