本文整理匯總了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.');
}