public static function newFromRow($row)
 {
     $wiki = new self($row->fw_name);
     $wiki->_title = $row->fw_title;
     $wiki->_description = $row->fw_description;
     $wiki->_creator = $row->fw_creator;
     $wiki->_variables = unserialize($row->fw_parameters);
     $wiki->_permissions = unserialize($row->fw_permissions);
     $dbr = MediaWikiFarmer::getInstance()->getDB(DB_SLAVE);
     $res = $dbr->select(array('farmer_extension', 'farmer_wiki_extension'), '*', array('fwe_wiki' => $row->fw_id), __METHOD__, array(), array('farmer_wiki_extension' => array('LEFT JOIN', 'fwe_extension = fe_id')));
     $wiki->_extensions = array();
     foreach ($res as $row) {
         $wiki->_extensions[$row->fe_name] = MediaWikiFarmer_Extension::newFromRow($row);
     }
     return $wiki;
 }
 /**
  * Gets extensions objects
  *
  * @return Array
  */
 public function getExtensions($forceReload = false)
 {
     if ($this->_extensionsLoaded && !$forceReload) {
         return $this->_extensions;
     }
     if ($this->useDatabase()) {
         $dbr = $this->getDB(DB_SLAVE);
         $res = $dbr->select('farmer_extension', '*', array(), __METHOD__);
         $this->_extensions = array();
         foreach ($res as $row) {
             $this->_extensions[$row->fe_name] = MediaWikiFarmer_Extension::newFromRow($row);
         }
     } else {
         if (is_readable($this->_getExtensionFile())) {
             $contents = file_get_contents($this->_getExtensionFile());
             $extensions = unserialize($contents);
             if (is_array($extensions)) {
                 $this->_extensions = $extensions;
             }
         } else {
             // perhaps we should throw an error or something?
         }
     }
     $extensionsLoaded = true;
     return $this->_extensions;
 }