本文整理汇总了PHP中Mage_Core_Model_App::isInstalled方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_App::isInstalled方法的具体用法?PHP Mage_Core_Model_App::isInstalled怎么用?PHP Mage_Core_Model_App::isInstalled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_App
的用法示例。
在下文中一共展示了Mage_Core_Model_App::isInstalled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isInstalled
/**
* Shortcut for the application "is installed" getter
*
* @return bool
* @throws Magento_Exception
*
* @todo Remove in favour of Mage_Core_Model_App::isInstalled() as soon as dependencies on application are injected
*/
public static function isInstalled()
{
if (!self::$_app) {
throw new Magento_Exception('Application instance has not been initialized yet.');
}
return self::$_app->isInstalled();
}
示例2: testIsInstalled
public function testIsInstalled()
{
$this->assertTrue($this->_mageModel->isInstalled());
}
示例3: install
/**
* Install Magento
*
* @return boolean
*/
public function install()
{
try {
/**
* Check if already installed
*/
if ($this->_app->isInstalled()) {
$this->addError('ERROR: Magento is already installed');
return false;
}
/**
* Prepare data
*/
$this->_prepareData();
if ($this->hasErrors()) {
return false;
}
$installer = $this->_getInstaller();
/**
* Install configuration
*/
$installer->installConfig($this->_getDataModel()->getConfigData());
// TODO fix wizard and simplify this everythere
if ($this->hasErrors()) {
return false;
}
/**
* Reinitialize configuration (to use new config data)
*/
$this->_app->cleanCache();
Mage::getConfig()->reinit();
/**
* Install database
*/
$installer->installDb();
if ($this->hasErrors()) {
return false;
}
/**
* Create primary administrator user
*/
$installer->createAdministrator($this->_getDataModel()->getAdminData());
if ($this->hasErrors()) {
return false;
}
/**
* Save encryption key or create if empty
*/
$encryptionKey = empty($this->_args['encryption_key']) ? md5(time()) : $this->_args['encryption_key'];
$this->_getDataModel()->setEncryptionKey($encryptionKey);
$installer->installEnryptionKey($encryptionKey);
if ($this->hasErrors()) {
return false;
}
/**
* Installation finish
*/
$installer->finish();
if ($this->hasErrors()) {
return false;
}
/**
* Change directories mode to be writable by apache user
*/
@chmod('var/cache', 0777);
@chmod('var/session', 0777);
} catch (Exception $e) {
$this->addError('ERROR: ' . $e->getMessage());
return false;
}
return true;
}