Mage_Install_Model_Installer Class Reference

Inheritance diagram for Mage_Install_Model_Installer:

Varien_Object

List of all members.

Public Member Functions

 isApplicationInstalled ()
 getDataModel ()
 setDataModel (Varien_Object $model)
 checkDownloads ()
 checkServer ()
 getServerCheckStatus ()
 installConfig ($data)
 installDb ()
 createAdministrator ($data)
 installEnryptionKey ($key)
 finish ()

Public Attributes

const INSTALLER_HOST_RESPONSE = 'MAGENTO'

Protected Attributes

 $_dataModel


Detailed Description

Definition at line 35 of file Installer.php.


Member Function Documentation

checkDownloads (  ) 

Check packages (pear) downloads

Returns:
boolean

Definition at line 91 of file Installer.php.

00092     {
00093         try {
00094             $result = Mage::getModel('install/installer_pear')->checkDownloads();
00095             $result = true;
00096         } catch (Exception $e) {
00097             $result = false;
00098         }
00099         $this->setDownloadCheckStatus($result);
00100         return $result;
00101     }

checkServer (  ) 

Check server settings

Returns:
bool

Definition at line 108 of file Installer.php.

00109     {
00110         try {
00111             Mage::getModel('install/installer_filesystem')->install();
00112 
00113             Mage::getModel('install/installer_env')->install();
00114             $result = true;
00115         } catch (Exception $e) {
00116             $result = false;
00117         }
00118         $this->setData('server_check_status', $result);
00119         return $result;
00120     }

createAdministrator ( data  ) 

Create admin user

Parameters:
array $data
Returns:
Mage_Install_Model_Installer

Definition at line 213 of file Installer.php.

00214     {
00215         $user = Mage::getModel('admin/user')
00216             ->load('admin', 'username');
00217         if ($user && $user->getPassword()=='4297f44b13955235245b2497399d7a93') {
00218             $user->delete();
00219         }
00220 
00221         $user = Mage::getModel('admin/user')
00222             ->load($data['username'], 'username');
00223         $user->addData($data)->save();
00224         $user->setRoleIds(array(1))->saveRelations();
00225 
00226         /*Mage::getModel("permissions/user")->setRoleId(1)
00227             ->setUserId($user->getId())
00228             ->setFirstname($user->getFirstname())
00229             ->add();*/
00230 
00231         return $this;
00232     }

finish (  ) 

Definition at line 249 of file Installer.php.

00250     {
00251         Mage::getSingleton('install/installer_config')->replaceTmpInstallDate();
00252         Mage::app()->cleanCache();
00253 
00254         $cacheData = array();
00255         foreach (Mage::helper('core')->getCacheTypes() as $type=>$label) {
00256             $cacheData[$type] = 1;
00257         }
00258         Mage::app()->saveUseCache($cacheData);
00259         return $this;
00260     }

getDataModel (  ) 

Get data model

Returns:
Varien_Object

Definition at line 66 of file Installer.php.

00067     {
00068         if (is_null($this->_dataModel)) {
00069             $this->setDataModel(Mage::getSingleton('install/session'));
00070         }
00071         return $this->_dataModel;
00072     }

getServerCheckStatus (  ) 

Retrieve server checking result status

Returns:
unknown

Definition at line 127 of file Installer.php.

00128     {
00129         $status = $this->getData('server_check_status');
00130         if (is_null($status)) {
00131             $status = $this->checkServer();
00132         }
00133         return $status;
00134     }

installConfig ( data  ) 

Installation config data

Parameters:
array $data
Returns:
Mage_Install_Model_Installer

Definition at line 142 of file Installer.php.

00143     {
00144         $data['db_active'] = true;
00145         Mage::getSingleton('install/installer_db')->checkDatabase($data);
00146         Mage::getSingleton('install/installer_config')
00147             ->setConfigData($data)
00148             ->install();
00149         return $this;
00150     }

installDb (  ) 

Database installation

Returns:
Mage_Install_Model_Installer

Saving host information into DB

Saving locale information into DB

Definition at line 157 of file Installer.php.

00158     {
00159         Mage_Core_Model_Resource_Setup::applyAllUpdates();
00160         $data = $this->getDataModel()->getConfigData();
00161 
00162         /**
00163          * Saving host information into DB
00164          */
00165         $setupModel = new Mage_Core_Model_Resource_Setup('core_setup');
00166 
00167         if (!empty($data['use_rewrites'])) {
00168             $setupModel->setConfigData(Mage_Core_Model_Store::XML_PATH_USE_REWRITES, 1);
00169         }
00170 
00171         $unsecureBaseUrl = Mage::getBaseUrl('web');
00172         if (!empty($data['unsecure_base_url'])) {
00173             $unsecureBaseUrl = $data['unsecure_base_url'];
00174             $setupModel->setConfigData(Mage_Core_Model_Store::XML_PATH_UNSECURE_BASE_URL, $unsecureBaseUrl);
00175         }
00176 
00177         if (!empty($data['use_secure'])) {
00178             $setupModel->setConfigData(Mage_Core_Model_Store::XML_PATH_SECURE_IN_FRONTEND, 1);
00179             $setupModel->setConfigData(Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL, $data['secure_base_url']);
00180             if (!empty($data['use_secure_admin'])) {
00181                 $setupModel->setConfigData(Mage_Core_Model_Store::XML_PATH_SECURE_IN_ADMINHTML, 1);
00182             }
00183         }
00184         elseif (!empty($data['unsecure_base_url'])) {
00185             $setupModel->setConfigData(Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL, $unsecureBaseUrl);
00186         }
00187 
00188         /**
00189          * Saving locale information into DB
00190          */
00191         $locale = $this->getDataModel()->getLocaleData();
00192         if (!empty($locale['locale'])) {
00193             $setupModel->setConfigData(Mage_Core_Model_Locale::XML_PATH_DEFAULT_LOCALE, $locale['locale']);
00194         }
00195         if (!empty($locale['timezone'])) {
00196             $setupModel->setConfigData(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE, $locale['timezone']);
00197         }
00198         if (!empty($locale['currency'])) {
00199             $setupModel->setConfigData(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE, $locale['currency']);
00200             $setupModel->setConfigData(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_DEFAULT, $locale['currency']);
00201             $setupModel->setConfigData(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_ALLOW, $locale['currency']);
00202         }
00203 
00204         return $this;
00205     }

installEnryptionKey ( key  ) 

Set encryption key

Parameters:
string $key
Returns:
Mage_Install_Model_Installer

Definition at line 240 of file Installer.php.

00241     {
00242         if ($key) {
00243             Mage::helper('core')->validateKey($key);
00244         }
00245         Mage::getSingleton('install/installer_config')->replaceTmpEncryptKey($key);
00246         return $this;
00247     }

isApplicationInstalled (  ) 

Checking install status of application

Returns:
bool

Definition at line 56 of file Installer.php.

00057     {
00058         return Mage::isInstalled();
00059     }

setDataModel ( Varien_Object model  ) 

Set data model to store data between installation steps

Parameters:
Varien_Object $model
Returns:
Mage_Install_Model_Installer

Definition at line 80 of file Installer.php.

00081     {
00082         $this->_dataModel = $model;
00083         return $this;
00084     }


Member Data Documentation

$_dataModel [protected]

Definition at line 49 of file Installer.php.

const INSTALLER_HOST_RESPONSE = 'MAGENTO'

Installer host response used to check urls

Definition at line 42 of file Installer.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:27 2009 for Magento by  doxygen 1.5.8