Skip to content

Instantly share code, notes, and snippets.

@Fi1osof
Created March 18, 2013 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fi1osof/e11e6c75bf4f44f27c45 to your computer and use it in GitHub Desktop.
Save Fi1osof/e11e6c75bf4f44f27c45 to your computer and use it in GitHub Desktop.
<?php
require_once dirname(__FILE__).'/core/config/config.inc.php';
include_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx= new modX();
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
// Settings
$settings = array(
'cultureKey' => 'ru'
,'fe_editor_lang' => 'ru'
,'publish_default' => 1
,'tvs_below_content' => 1
,'upload_maxsize' => '10485760'
,'cache_resource' => 0
, 'topmenu_show_descriptions' => 0
, 'locale' => 'ru_RU.utf-8'
, 'manager_lang_attribute' => 'ru'
, 'manager_language' => 'ru'
//smtp
, 'mail_smtp_auth' => 1
, 'mail_smtp_hosts' => 'smtp.yandex.ru'
, 'mail_smtp_pass' => 'pass'
, 'mail_smtp_port' => '465'
, 'mail_smtp_prefix' => 'ssl'
, 'mail_smtp_user' => 'mymail@yandex.ru'
, 'mail_use_smtp' => 1
//url
, 'automatic_alias' => 1
, 'friendly_urls' => 1
, 'global_duplicate_uri_check' => 1
, 'friendly_alias_translit' => 'russian'
,'link_tag_scheme' => 'full'
);
foreach ($settings as $k => $v) {
$res = $modx->getObject('modSystemSetting', array('key' => $k));
$res->set('value', $v);
$res->save();
}
// Resources
$resources = array(
'1' => array('pagetitle' => 'Главная','template' => 2)
,'2' => array('hidemenu' => 1, 'pagetitle' => 'style','template' => 0,'published' => 1,'alias' => 'style' ,'content_type' => 4, 'richtext' => 0, 'content' => '[[lessCSS? &file=`mybootstrap.less` &path=`assets/theme/`]]')
,'3' => array('hidemenu' => 1, 'pagetitle' => 'sitemap','template' => 0,'published' => 1,'alias' => 'sitemap' ,'content_type' => 2, 'richtext' => 0, 'content' =>'[[!GoogleSiteMap?]]')
,'4' => array('hidemenu' => 1, 'pagetitle' => 'robots','template' => 0,'published' => 1,'alias' => 'robots' ,'content_type' => 3, 'richtext' => 0)
);
foreach ($resources as $k => $v) {
if (!$res = $modx->getObject('modResource', $k)) {
$res = $modx->newObject('modResource');
}
$res->fromArray($v);
$res->save();
}
// Cache
$modx->cacheManager->refresh();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment