本文整理汇总了PHP中Craft::setIsInstalled方法的典型用法代码示例。如果您正苦于以下问题:PHP Craft::setIsInstalled方法的具体用法?PHP Craft::setIsInstalled怎么用?PHP Craft::setIsInstalled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Craft
的用法示例。
在下文中一共展示了Craft::setIsInstalled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Installs Craft!
*
* @param array $inputs
* @throws Exception
* @throws \Exception
* @return void
*/
public function run($inputs)
{
craft()->config->maxPowerCaptain();
if (Craft::isInstalled()) {
throw new Exception(Craft::t('Craft is already installed.'));
}
// Set the language to the desired locale
craft()->setLanguage($inputs['locale']);
$records = $this->findInstallableRecords();
// Start the transaction
$transaction = craft()->db->beginTransaction();
try {
Craft::log('Installing Craft.');
// Create the tables
$this->_createTablesFromRecords($records);
$this->_createForeignKeysFromRecords($records);
$this->_createContentTable();
$this->_createRelationsTable();
$this->_createShunnedMessagesTable();
$this->_createSearchIndexTable();
$this->_createAndPopulateInfoTable($inputs);
$this->_createAssetTransformIndexTable();
$this->_createRackspaceAccessTable();
Craft::log('Committing the transaction.');
$transaction->commit();
} catch (\Exception $e) {
$transaction->rollBack();
throw $e;
}
// Craft, you are installed now.
Craft::setIsInstalled();
$this->_populateMigrationTable();
$this->_addLocale($inputs['locale']);
$this->_addUser($inputs);
if (!craft()->isConsole()) {
$this->_logUserIn($inputs);
}
$this->_saveDefaultMailSettings($inputs['email'], $inputs['siteName']);
$this->_createDefaultContent($inputs);
Craft::log('Finished installing Craft.');
}