Attached Files |
deployment_script_core.patch [^] (1,654 bytes) 2011-04-10 21:21
[Show Content]
Index: run_event.php
===================================================================
--- run_event.php (revision 0)
+++ run_event.php (revision 0)
@@ -0,0 +1,50 @@
+<?php
+/**
+* @version $Id$
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2011 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+//die('Restrictred use!');
+
+$start = getmicrotime();
+
+define('CRON', 1);
+define('ADMIN', 1);
+define('REL_PATH', 'tools');
+define('FULL_PATH', realpath(dirname(__FILE__) . '/..'));
+define('DBG_SKIP_REPORTING', 1);
+
+$_SERVER['HTTP_USER_AGENT'] = 'gecko';
+
+// in command line, then 2nd argument is password
+$password = isset($argv) && isset($argv[2]) ? $argv[2] : '';
+
+if ($password != 'b674006f3edb1d9cd4d838c150b0567d') {
+ die('Bad key' . PHP_EOL);
+}
+
+include_once(FULL_PATH . '/core/kernel/startup.php');
+
+$application =& kApplication::Instance();
+$application->Init();
+
+$application->StoreVar('user_id', USER_ROOT, true);
+$application->HandleEvent($ev, $argv[1]); // event name in form "prefix[.special]:event_name"
+
+$application->Done();
+
+$end = getmicrotime();
+
+function getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+}
\ No newline at end of file
deployment_script_modules.patch [^] (13,361 bytes) 2011-04-10 21:22
[Show Content]
Index: install/install_data.sql
===================================================================
--- install/install_data.sql (revision 14318)
+++ install/install_data.sql (working copy)
@@ -1,5 +1,3 @@
-# place here only sql queries, that were executed on live AND dev sites !!!
-
INSERT INTO Permissions VALUES(DEFAULT, 'custom.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.edit', 11, 1, 1, 0);
@@ -7,13 +5,3 @@
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.view', 11, 1, 1, 0);
INSERT INTO Modules VALUES ('Custom', 'modules/custom/', 'custom-sections', DEFAULT, 1, 10, 'custom/', 0, NULL);
-
-
-# ===== SQLs above this line already on LIVE ================================================================================================
-
-# place here only sql queries, that were executed on dev site !!!
-
-
-# ===== SQLs above this line already on DEV ========================================================================================================
-
-# place here only sql queries, that were executed on prod server !!!
Index: install/install_schema.sql
===================================================================
--- install/install_schema.sql (revision 14318)
+++ install/install_schema.sql (working copy)
@@ -1,5 +1,3 @@
-# place here only sql queries, that were executed on live AND dev sites !!!
-
CREATE TABLE Widgets (
WidgetId int(11) NOT NULL AUTO_INCREMENT,
Title varchar(255) NOT NULL DEFAULT '',
@@ -17,11 +15,4 @@
PRIMARY KEY (WidgetId)
);
-# ===== SQLs above this line already on LIVE ================================================================================================
-
-# place here only sql queries, that were executed on dev site !!!
-
-
-# ===== SQLs above this line already on DEV ========================================================================================================
-
-# place here only sql queries, that were executed on prod server !!!
+ALTER TABLE Modules ADD AppliedDBRevisions TEXT NULL;
Index: install/project_upgrades.sql
===================================================================
--- install/project_upgrades.sql (revision 0)
+++ install/project_upgrades.sql (revision 0)
@@ -0,0 +1,14 @@
+# r1: task for revision 1 (#435345)
+# строка один
+# строка два
+# r3: task for revision 2 (#435345)
+# ла-ла
+# r2: task for revision 2 (#435345)
+ALTER TABLE MISSING;
+SELECT *
+FROM bf_Modules;
+# r5(4): task for revision 2 (#435345)
+SELECT *
+FROM bf_Modules;
+# r4(3,1): task for revision 2 (#435345)
+# строка три
\ No newline at end of file
Index: install/upgrades.sql
===================================================================
--- install/upgrades.sql (revision 14318)
+++ install/upgrades.sql (working copy)
@@ -42,4 +42,7 @@
# ===== v 1.1.2-RC1 =====
-# ===== v 1.1.2 =====
\ No newline at end of file
+# ===== v 1.1.2 =====
+
+# ===== v 1.1.3-B1 =====
+ALTER TABLE Modules ADD AppliedDBRevisions TEXT NULL;
Index: units/sections/custom_eh.php
===================================================================
--- units/sections/custom_eh.php (revision 14318)
+++ units/sections/custom_eh.php (working copy)
@@ -9,6 +9,21 @@
class CustomEventHandler extends kEventHandler {
/**
+ * Allows to override standart permission mapping
+ *
+ */
+ function mapPermissions()
+ {
+ parent::mapPermissions();
+
+ $permissions = Array (
+ 'OnDeploy' => Array ('self' => 'debug'),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
* Connection to database
*
* @var kDBConnection
@@ -47,4 +62,377 @@
$this->Application->setUnitOption($event->MasterEvent->Prefix, 'Fields', $fields);
}
+ /**
+ * Deploy changes
+ *
+ * Usage: "php tools/run_event.php custom-sections:OnDeploy b674006f3edb1d9cd4d838c150b0567d"
+ *
+ * @param kEvent $event
+ */
+ function OnDeploy(&$event)
+ {
+ $event->status = erSTOP;
+
+ $deployment_helper = new DeploymentHelper($event->Prefix);
+ $deployment_helper->deploy();
+ }
+ }
+
+
+ class DeploymentHelper extends kHelper {
+
+ private $unitPrefix = '';
+
+ private $revisionSqls = Array ();
+
+ private $revisionDependencies = Array ();
+
+ private $appliedRevisions = Array ();
+
+ public function DeploymentHelper($prefix)
+ {
+ parent::kHelper();
+
+ $this->unitPrefix = $prefix;
+
+ set_time_limit(0);
+ ini_set('memory_limit', -1);
+
+ $this->loadAppliedRevisions();
+ }
+
+ private function loadAppliedRevisions()
+ {
+ $sql = 'SELECT AppliedDBRevisions
+ FROM ' . TABLE_PREFIX . 'Modules
+ WHERE Name = ' . $this->Conn->qstr( $this->getModuleName() );
+ $revisions = $this->Conn->GetOne($sql);
+
+ $this->appliedRevisions = $revisions ? explode(',', $revisions) : Array ();
+ }
+
+ private function saveAppliedRevisions()
+ {
+ // maybe optimize
+ sort($this->appliedRevisions);
+
+ $fields_hash = Array (
+ 'AppliedDBRevisions' => implode(',', $this->appliedRevisions),
+ );
+
+ $this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'Modules', '`Name` = ' . $this->Conn->qstr($this->getModuleName()));
+ }
+
+ /**
+ * Deploys pending changes to a site
+ *
+ */
+ public function deploy()
+ {
+ echo 'Upgrading Database ... ';
+ if ( !$this->upgradeDatabase() ) {
+ return ;
+ }
+
+ echo 'OK' . PHP_EOL;
+
+ $this->importLanguagePack();
+ $this->resetCaches();
+ $this->refreshThemes();
+
+ echo 'Deployed' . PHP_EOL;
+ }
+
+ /**
+ * Import latest languagepack (without overwrite)
+ *
+ */
+ private function importLanguagePack()
+ {
+ $language_import_helper =& $this->Application->recallObject('LanguageImportHelper');
+ /* @var $language_import_helper LanguageImportHelper */
+
+ echo 'Importing LanguagePack ... ';
+ $filename = $this->getModuleFile('english.lang');
+ $language_import_helper->performImport($filename, '|0|1|2|', 'Custom', LANG_SKIP_EXISTING);
+ echo 'OK' . PHP_EOL;
+ }
+
+ /**
+ * Resets unit and section cache
+ *
+ */
+ private function resetCaches()
+ {
+ // 2. reset unit config cache (so new classes get auto-registered)
+ echo 'Resetting Unit Config Cache ... ';
+ $admin_event = new kEvent('adm:OnResetConfigsCache');
+ $this->Application->HandleEvent($admin_event);
+ echo 'OK' . PHP_EOL;
+
+ // 3. reset sections cache
+ echo 'Resetting Sections Cache ... ';
+ $admin_event = new kEvent('adm:OnResetSections');
+ $this->Application->HandleEvent($admin_event);
+ echo 'OK' . PHP_EOL;
+ }
+
+ /**
+ * rebuild theme files
+ *
+ */
+ private function refreshThemes()
+ {
+ echo 'Rebuilding Theme Files ... ';
+ $admin_event = new kEvent('adm:OnRebuildThemes');
+ $this->Application->HandleEvent($admin_event);
+ echo 'OK' . PHP_EOL;
+ }
+
+ /**
+ * Runs database upgrade script
+ *
+ * @return bool
+ */
+ private function upgradeDatabase()
+ {
+ $this->Conn->errorHandler = Array(&$this, 'handleSqlError');
+
+ if ( !$this->collectDatabaseRevisions() || !$this->checkRevisionDependencies() ) {
+ return false;
+ }
+
+ $applied = $this->applyRevisions();
+ $this->saveAppliedRevisions();
+
+ return $applied;
+ }
+
+ /**
+ * Collects database revisions from "project_upgrades.sql" file.
+ *
+ * @return bool
+ */
+ private function collectDatabaseRevisions()
+ {
+ $filename = $this->getModuleFile('project_upgrades.sql');
+
+ if ( !file_exists($filename) ) {
+ return true;
+ }
+
+ $sqls = file_get_contents($filename);
+ preg_match_all("/# r([\d]+)([^\:]*):.*?(\n|$)/s", $sqls, $matches, PREG_SET_ORDER + PREG_OFFSET_CAPTURE);
+
+ if (!$matches) {
+ echo 'No Database Revisions Found' . PHP_EOL;
+
+ return false;
+ }
+
+ foreach ($matches as $index => $match) {
+ $revision = $match[1][0];
+
+ if ( $this->revisionApplied($revision) ) {
+ // skip applied revisions
+ continue;
+ }
+
+ if ( isset($this->revisionSqls[$revision]) ) {
+ // duplicate revision among non-applied ones
+ echo 'Duplicate revision ' . $revision . ' found' . PHP_EOL;
+
+ return false;
+ }
+
+ // get revision sqls
+ $start_pos = $match[0][1] + strlen($match[0][0]);
+ $end_pos = isset($matches[$index + 1]) ? $matches[$index + 1][0][1] : strlen($sqls);
+ $revision_sqls = substr($sqls, $start_pos, $end_pos - $start_pos);
+
+ if (!$revision_sqls) {
+ // resision without sqls
+ continue;
+ }
+
+ $this->revisionSqls[$revision] = $revision_sqls;
+ $revision_lependencies = $this->parseRevisionDependencies($match[2][0]);
+
+ if ($revision_lependencies) {
+ $this->revisionDependencies[$revision] = $revision_lependencies;
+ }
+ }
+
+ ksort($this->revisionSqls);
+ ksort($this->revisionDependencies);
+
+ return true;
+ }
+
+ /**
+ * Checks that all dependent revisions are either present now OR were applied before
+ *
+ * @return bool
+ */
+ private function checkRevisionDependencies()
+ {
+ foreach ($this->revisionDependencies as $revision => $revision_dependencies) {
+ foreach ($revision_dependencies as $revision_dependency) {
+ if ( $this->revisionApplied($revision_dependency) ) {
+ // revision dependend upon already applied -> depencency fulfilled
+ continue;
+ }
+
+ if ($revision_dependency >= $revision) {
+ echo 'Revision ' . $revision . ' has incorrect dependency to revision ' . $revision_dependency . '. Only dependencies to older revisions are allowed!' . PHP_EOL;
+
+ return false;
+ }
+
+ if ( !isset($this->revisionSqls[$revision_dependency]) ) {
+ echo 'Revision ' . $revision . ' depends on missing revision ' . $revision_dependency . '!' . PHP_EOL;
+
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Runs all pending sqls
+ *
+ * @return bool
+ */
+ private function applyRevisions()
+ {
+ if (!$this->revisionSqls) {
+ return true;
+ }
+
+ echo PHP_EOL;
+
+ foreach ($this->revisionSqls as $revision => $sqls) {
+ echo 'Processing DB Revision: #' . $revision . ' ... ';
+
+ $sqls = str_replace("\r\n", "\n", $sqls); // convert to linux line endings
+ $no_comment_sqls = preg_replace("/#\s([^;]*?)\n/is", '', $sqls); // remove all comments "#" on new lines
+
+ $sqls = explode(";\n", $no_comment_sqls . "\n"); // ensures that last sql won't have ";" in it
+ $sqls = array_map('trim', $sqls);
+
+ foreach ($sqls as $index => $sql) {
+ if (!$sql || (substr($sql, 0, 1) == '#')) {
+ continue; // usually last line
+ }
+
+ $this->Conn->Query($sql);
+
+ if ( $this->Conn->hasError() ) {
+ // consider revisions with errors applied
+ $this->appliedRevisions[] = $revision;
+
+ return false;
+ }
+ }
+
+ $this->appliedRevisions[] = $revision;
+ echo 'OK' . PHP_EOL;
+ }
+
+ return true;
+ }
+
+ /**
+ * Error handler for sql errors
+ *
+ * @param int $code
+ * @param string $msg
+ * @param string $sql
+ * @return bool
+ */
+ public function handleSqlError($code, $msg, $sql)
+ {
+ echo 'Error (#' . $code . ': ' . $msg . ') during SQL processing:' . PHP_EOL . $sql . PHP_EOL;
+ echo 'Please execute rest of sqls in this revision by hand and run deployment script again.' . PHP_EOL;
+
+ return true;
+ }
+
+ /**
+ * Checks if given revision was already applied
+ *
+ * @param int $revision
+ * @return bool
+ */
+ private function revisionApplied($revision)
+ {
+ foreach ($this->appliedRevisions as $applied_revision) {
+ // revision range
+ $applied_revision = explode('-', $applied_revision, 2);
+
+ if ( !isset($applied_revision[1]) ) {
+ // convert single revision to revision range
+ $applied_revision[1] = $applied_revision[0];
+ }
+
+ if ( $revision >= $applied_revision[0] && $revision <= $applied_revision[1] ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns path to given file in current module install folder
+ *
+ * @param string $filename
+ * @return string
+ */
+ private function getModuleFile($filename)
+ {
+ static $module_folder = null;
+
+ if ( !isset($module_folder) ) {
+ $module_folder = $this->Application->findModule('Name', $this->getModuleName(), 'Path');
+ }
+
+ return FULL_PATH . DIRECTORY_SEPARATOR . $module_folder . 'install/' . $filename;
+ }
+
+ /**
+ * Returns module name, where this class is used
+ *
+ * @return string
+ */
+ private function getModuleName()
+ {
+ static $module_name = null;
+
+ if ( !isset($module_name) ) {
+ $module_folder = $this->Application->getUnitOption($this->unitPrefix, 'ModuleFolder');
+ $module_name = $this->Application->findModule('Path', $module_folder . '/', 'Name');
+ }
+
+ return $module_name;
+ }
+
+ /**
+ * Extracts revisions from string in format "(1,3,5464,23342,3243)"
+ *
+ * @param string $string
+ * @return Array
+ */
+ private function parseRevisionDependencies($string)
+ {
+ if (!$string) {
+ return Array ();
+ }
+
+ $string = explode(',', substr($string, 1, -1));
+
+ return array_map('trim', $string);
+ }
}
\ No newline at end of file
deployment_script_core_v2.patch [^] (9,223 bytes) 2011-04-14 09:46
[Show Content]
Index: core/admin_templates/tools/system_tools.tpl
===================================================================
--- core/admin_templates/tools/system_tools.tpl (revision 14318)
+++ core/admin_templates/tools/system_tools.tpl (working copy)
@@ -115,6 +115,29 @@
<div style="float: right; width: 49%;">
<div class="summary-box">
<div class="title">
+ <inp2:m_Phrase name="la_section_ProjectDeployment"/>
+ </div>
+ <div class="content">
+ <div class="group">
+ <h4><inp2:m_Phrase name="la_title_SystemToolsSynchronizeDBRevisions"/></h4>
+ <div class="hint">
+ <inp2:m_Phrase name="la_hint_SystemToolsSynchronizeDBRevisions"/>
+ </div>
+ <input type="button" class="button" onclick="submit_event('adm', 'OnSynchronizeDBRevisions');" value="<inp2:m_Phrase name="la_btn_Synchronize" no_editing="1"/>"/>
+ </div>
+
+ <div class="group last">
+ <h4><inp2:m_Phrase name="la_title_SystemToolsDeploy"/></h4>
+ <div class="hint">
+ <inp2:m_Phrase name="la_hint_SystemToolsDeploy"/>
+ </div>
+ <input type="button" class="button" onclick="submit_event('adm', 'OnDeploy');" value="<inp2:m_Phrase name="la_btn_Deploy" no_editing="1"/>"/>
+ </div>
+ </div>
+ </div>
+
+ <div class="summary-box">
+ <div class="title">
<inp2:m_Phrase name="la_section_Templates"/>
</div>
<div class="content">
Index: core/install/install_data.sql
===================================================================
--- core/install/install_data.sql (revision 14318)
+++ core/install/install_data.sql (working copy)
@@ -961,5 +961,5 @@
#INSERT INTO PageContent VALUES (DEFAULT, 1, 1, '<span style="font-weight: bold;">In-portal</span> is a revolutionary Web Site management system that allows you to automate and facilitate management of large portal and community web sites. Regardless of whether you are running a directory site or a content news portal, a community site or an online mall, In-portal will enhance your web site management experience with innovative.</span><br><br>We are proud to present our newly developed <b>"default"</b> theme that introduces a fresh look as well totally new approach in the template system.</span><br>', NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0);
-INSERT INTO Modules VALUES ('Core', 'core/', 'adm', DEFAULT, 1, 1, '', 0, NULL);
-INSERT INTO Modules VALUES ('In-Portal', 'core/', 'm', DEFAULT, 1, 0, '', 0, NULL);
\ No newline at end of file
+INSERT INTO Modules VALUES ('Core', 'core/', 'adm', DEFAULT, 1, 1, '', 0, NULL, NULL);
+INSERT INTO Modules VALUES ('In-Portal', 'core/', 'm', DEFAULT, 1, 0, '', 0, NULL, NULL);
\ No newline at end of file
Index: core/install/install_schema.sql
===================================================================
--- core/install/install_schema.sql (revision 14318)
+++ core/install/install_schema.sql (working copy)
@@ -1,7 +1,7 @@
CREATE TABLE PermissionConfig (
PermissionConfigId int(11) NOT NULL auto_increment,
PermissionName varchar(30) NOT NULL default '',
- Description varchar(255) NOT NULL default '',
+ Description varchar(255) NOT NULL default '',
ModuleId varchar(20) NOT NULL default '0',
PRIMARY KEY (PermissionConfigId),
KEY PermissionName (PermissionName)
@@ -155,16 +155,17 @@
);
CREATE TABLE Modules (
- `Name` varchar(255) NOT NULL default '',
- Path varchar(255) NOT NULL default '',
- `Var` VARCHAR(100) NOT NULL DEFAULT '',
- Version varchar(10) NOT NULL default '0.0.0',
- Loaded tinyint(4) NOT NULL default '1',
- LoadOrder tinyint(4) NOT NULL default '0',
- TemplatePath varchar(255) NOT NULL default '',
- RootCat int(11) NOT NULL default '0',
- BuildDate int(10) unsigned default NULL,
- PRIMARY KEY (`Name`),
+ `Name` varchar(255) NOT NULL DEFAULT '',
+ Path varchar(255) NOT NULL DEFAULT '',
+ Var varchar(100) NOT NULL DEFAULT '',
+ Version varchar(10) NOT NULL DEFAULT '0.0.0',
+ Loaded tinyint(4) NOT NULL DEFAULT '1',
+ LoadOrder tinyint(4) NOT NULL DEFAULT '0',
+ TemplatePath varchar(255) NOT NULL DEFAULT '',
+ RootCat int(11) NOT NULL DEFAULT '0',
+ BuildDate int(10) unsigned DEFAULT NULL,
+ AppliedDBRevisions text,
+ PRIMARY KEY (`Name`),
KEY Loaded (Loaded),
KEY LoadOrder (LoadOrder)
);
Index: core/install/upgrades.sql
===================================================================
--- core/install/upgrades.sql (revision 14318)
+++ core/install/upgrades.sql (working copy)
@@ -2016,4 +2016,7 @@
'LA_FLD_SELECTORNAME'
);
-# ===== v 5.1.2 =====
\ No newline at end of file
+# ===== v 5.1.2 =====
+
+# ===== v 5.1.3-B1 =====
+ALTER TABLE Modules ADD AppliedDBRevisions TEXT NULL;
\ No newline at end of file
Index: core/units/admin/admin_events_handler.php
===================================================================
--- core/units/admin/admin_events_handler.php (revision 14318)
+++ core/units/admin/admin_events_handler.php (working copy)
@@ -19,6 +19,7 @@
function mapPermissions()
{
parent::mapPermissions();
+
$permissions = Array(
'OnSaveColumns' => array('self' => true),
'OnClosePopup' => array('self' => true),
@@ -44,8 +45,8 @@
$system_events = Array (
'OnResetModRwCache', 'OnResetSections', 'OnResetConfigsCache', 'OnResetParsedData', 'OnResetMemcache',
- 'OnDeleteCompiledTemplates', 'OnCompileTemplates', 'OnGenerateTableStructure',
- 'OnRebuildThemes', 'OnCheckPrefixConfig', 'OnMemoryCacheGet', 'OnMemoryCacheSet'
+ 'OnDeleteCompiledTemplates', 'OnCompileTemplates', 'OnGenerateTableStructure', 'OnSynchronizeDBRevisions',
+ 'OnDeploy', 'OnRebuildThemes', 'OnCheckPrefixConfig', 'OnMemoryCacheGet', 'OnMemoryCacheSet'
);
if (in_array($event->Name, $system_events)) {
@@ -1320,6 +1321,41 @@
echo $json_helper->encode($ret);
}
+
+ /**
+ * Deploy changes
+ *
+ * Usage: "php tools/run_event.php adm:OnDeploy b674006f3edb1d9cd4d838c150b0567d"
+ *
+ * @param kEvent $event
+ */
+ function OnDeploy(&$event)
+ {
+ if ( isset($GLOBALS['argv']) ) {
+ // command line invocation -> don't perform redirect
+ $event->status = erSTOP;
+ }
+
+ $deployment_helper =& $this->Application->recallObject('DeploymentHelper');
+ /* @var $deployment_helper DeploymentHelper */
+
+ $deployment_helper->deployAll();
+ }
+
+ /**
+ * Synchronizes database revisions from "project_upgrades.sql" file
+ *
+ * @param kEvent $event
+ */
+ function OnSynchronizeDBRevisions(&$event)
+ {
+ $deployment_helper =& $this->Application->recallObject('DeploymentHelper');
+ /* @var $deployment_helper DeploymentHelper */
+
+ if ( !$deployment_helper->deployAll(true) ) {
+ $event->status = erFAIL;
+ }
+ }
}
Index: core/units/helpers/helpers_config.php
===================================================================
--- core/units/helpers/helpers_config.php (revision 14318)
+++ core/units/helpers/helpers_config.php (working copy)
@@ -66,5 +66,7 @@
Array ('pseudo' => 'MimeDecodeHelper', 'class' => 'MimeDecodeHelper', 'file' => 'mime_decode_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'),
Array ('pseudo' => 'UserHelper', 'class' => 'UserHelper', 'file' => 'user_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'),
Array ('pseudo' => 'SiteHelper', 'class' => 'SiteHelper', 'file' => 'site_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'),
+
+ Array ('pseudo' => 'DeploymentHelper', 'class' => 'DeploymentHelper', 'file' => 'deployment_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'),
),
);
\ No newline at end of file
Index: tools/run_event.php
===================================================================
--- tools/run_event.php (revision 0)
+++ tools/run_event.php (revision 0)
@@ -0,0 +1,50 @@
+<?php
+/**
+* @version $Id$
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2011 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+die('Restrictred use!');
+
+$start = getmicrotime();
+
+define('CRON', 1);
+define('ADMIN', 1);
+define('REL_PATH', 'tools');
+define('FULL_PATH', realpath(dirname(__FILE__) . '/..'));
+define('DBG_SKIP_REPORTING', 1);
+
+$_SERVER['HTTP_USER_AGENT'] = 'gecko';
+
+// in command line, then 2nd argument is password
+$password = isset($argv) && isset($argv[2]) ? $argv[2] : '';
+
+if ($password != 'b674006f3edb1d9cd4d838c150b0567d') {
+ die('Bad key' . PHP_EOL);
+}
+
+include_once(FULL_PATH . '/core/kernel/startup.php');
+
+$application =& kApplication::Instance();
+$application->Init();
+
+$application->StoreVar('user_id', USER_ROOT, true);
+$application->HandleEvent($ev, $argv[1]); // event name in form "prefix[.special]:event_name"
+
+$application->Done();
+
+$end = getmicrotime();
+
+function getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+}
\ No newline at end of file
deployment_script_modules_v2.patch [^] (6,154 bytes) 2011-04-14 09:46
[Show Content]
Index: custom/install/install_data.sql
===================================================================
--- custom/install/install_data.sql (revision 14318)
+++ custom/install/install_data.sql (working copy)
@@ -1,19 +1,7 @@
-# place here only sql queries, that were executed on live AND dev sites !!!
-
INSERT INTO Permissions VALUES(DEFAULT, 'custom.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.view', 11, 1, 1, 0);
-INSERT INTO Modules VALUES ('Custom', 'modules/custom/', 'custom-sections', DEFAULT, 1, 10, 'custom/', 0, NULL);
-
-
-# ===== SQLs above this line already on LIVE ================================================================================================
-
-# place here only sql queries, that were executed on dev site !!!
-
-
-# ===== SQLs above this line already on DEV ========================================================================================================
-
-# place here only sql queries, that were executed on prod server !!!
+INSERT INTO Modules VALUES ('Custom', 'modules/custom/', 'custom-sections', DEFAULT, 1, 10, 'custom/', 0, NULL, NULL);
Index: custom/install/install_schema.sql
===================================================================
--- custom/install/install_schema.sql (revision 14318)
+++ custom/install/install_schema.sql (working copy)
@@ -1,5 +1,3 @@
-# place here only sql queries, that were executed on live AND dev sites !!!
-
CREATE TABLE Widgets (
WidgetId int(11) NOT NULL AUTO_INCREMENT,
Title varchar(255) NOT NULL DEFAULT '',
@@ -17,11 +15,3 @@
PRIMARY KEY (WidgetId)
);
-# ===== SQLs above this line already on LIVE ================================================================================================
-
-# place here only sql queries, that were executed on dev site !!!
-
-
-# ===== SQLs above this line already on DEV ========================================================================================================
-
-# place here only sql queries, that were executed on prod server !!!
Index: custom/install/project_upgrades.sql
===================================================================
--- custom/install/project_upgrades.sql (revision 0)
+++ custom/install/project_upgrades.sql (revision 0)
@@ -0,0 +1,14 @@
+# r1: task for revision 1 (#435345)
+# строка один
+# строка два
+# r3: task for revision 2 (#435345)
+# ла-ла
+# r2: task for revision 2 (#435345)
+ALTER TABLE MISSING;
+SELECT *
+FROM bf_Modules;
+# r5(4): task for revision 2 (#435345)
+SELECT *
+FROM bf_Modules;
+# r4(3,1): task for revision 2 (#435345)
+# строка три
\ No newline at end of file
Index: in-auction/install/install_data.sql
===================================================================
--- in-auction/install/install_data.sql (revision 14318)
+++ in-auction/install/install_data.sql (working copy)
@@ -1792,4 +1792,4 @@
INSERT INTO Permissions VALUES (DEFAULT, 'ebay:configuration_feedbacks.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'ebay:configuration_general.edit', 11, 1, 1, 0);
-INSERT INTO Modules VALUES ('In-Auction', 'modules/in-auction/', 'ebay-sections', DEFAULT, 1, 6, 'in-auction/', 2, NULL);
+INSERT INTO Modules VALUES ('In-Auction', 'modules/in-auction/', 'ebay-sections', DEFAULT, 1, 6, 'in-auction/', 2, NULL, NULL);
Index: in-bulletin/install/install_data.sql
===================================================================
--- in-bulletin/install/install_data.sql (revision 14318)
+++ in-bulletin/install/install_data.sql (working copy)
@@ -226,4 +226,4 @@
INSERT INTO CustomField VALUES (DEFAULT, 1, 'bb_ItemTemplate', 'la_fld_cust_bb_ItemTemplate', 0, 'la_title_SystemCF', 'la_fld_cust_bb_ItemTemplate', 'text', NULL, '', 0, 0, 1, 0);
-INSERT INTO Modules VALUES ('In-Bulletin', 'modules/in-bulletin/', 'bb', DEFAULT, 1, 3, 'in-bulletin/', {TopicCatId}, NULL);
+INSERT INTO Modules VALUES ('In-Bulletin', 'modules/in-bulletin/', 'bb', DEFAULT, 1, 3, 'in-bulletin/', {TopicCatId}, NULL, NULL);
Index: in-commerce/install/install_data.sql
===================================================================
--- in-commerce/install/install_data.sql (revision 14318)
+++ in-commerce/install/install_data.sql (working copy)
@@ -470,4 +470,4 @@
INSERT INTO ImportScripts VALUES (DEFAULT, 'Products from CSV file [In-Commerce]', '', 'p', 'In-Commerce', '', 'CSV', '1');
-INSERT INTO Modules VALUES ('In-Commerce', 'modules/in-commerce/', 'p', DEFAULT, 1, 4, 'in-commerce/', 2, NULL);
+INSERT INTO Modules VALUES ('In-Commerce', 'modules/in-commerce/', 'p', DEFAULT, 1, 4, 'in-commerce/', 2, NULL, NULL);
Index: in-link/install/install_data.sql
===================================================================
--- in-link/install/install_data.sql (revision 14318)
+++ in-link/install/install_data.sql (working copy)
@@ -244,4 +244,4 @@
INSERT INTO Counters VALUES (DEFAULT, 'linkhits_count', 'SELECT ROUND(SUM(Hits)) FROM <%PREFIX%>Link', NULL, NULL, '300', '0', '|Link|');
-INSERT INTO Modules VALUES ('In-Link', 'modules/in-link/', 'l', DEFAULT, 1, 1, 'in-link/', 2, NULL);
+INSERT INTO Modules VALUES ('In-Link', 'modules/in-link/', 'l', DEFAULT, 1, 1, 'in-link/', 2, NULL, NULL);
Index: in-news/install/install_data.sql
===================================================================
--- in-news/install/install_data.sql (revision 14318)
+++ in-news/install/install_data.sql (working copy)
@@ -183,4 +183,4 @@
INSERT INTO ImportScripts VALUES (DEFAULT, 'Articles from CSV file [In-News]', '', 'n', 'In-News', '', 'CSV', '1');
-INSERT INTO Modules VALUES ('In-News', 'modules/in-news/', 'n', DEFAULT, 1, 2, 'in-news/', {NewsCatId}, NULL);
\ No newline at end of file
+INSERT INTO Modules VALUES ('In-News', 'modules/in-news/', 'n', DEFAULT, 1, 2, 'in-news/', {NewsCatId}, NULL, NULL);
\ No newline at end of file
ImprovingProjectDeploymentTrans.txt [^] (1,075 bytes) 2011-06-26 21:13
[Show Content]
la_section_ProjectDeployment = Project Deployment
la_title_SystemToolsSynchronizeDBRevisions = Synchronize Database Revisions
la_hint_SystemToolsSynchronizeDBRevisions =
<ul>
<li>As a result, script will Validate current <b><u>project_upgrades.sql</u></b> file and outline any errors or inconsistencies, and auto-populate all missing DB Revisions from the file into AppliedDBRevisions.</li>
<li><b style="color:red">NOTE:</b> Developers should ONLY run this before they perform Repository Updates on thei working copy!</li>
</ul>
la_btn_Syncronize = Syncronize
la_hint_SystemToolsDeploy = Deploy Changes
la_hint_SystemToolsDeploy =
<ul>
<li>This deploy script will apply all Database Changes stored in <b><u>[module]/project_upgrades.sql</u></b> to the current website and save applied Revisions in AppliedDBRevisions.</li>
<li>This deploy script will create all new language phrases by re-importing <b><u>custom/install/english.lang</u></b> file.</li>
<li>This deploy script will reset all caches at once</li>
</ul>
la_btn_Deploy = Deploy
deployment_script_core_v3.patch [^] (28,457 bytes) 2011-06-28 10:14
[Show Content]
Index: core/admin_templates/tools/system_tools.tpl
===================================================================
--- core/admin_templates/tools/system_tools.tpl (revision 14318)
+++ core/admin_templates/tools/system_tools.tpl (working copy)
@@ -115,6 +115,29 @@
<div style="float: right; width: 49%;">
<div class="summary-box">
<div class="title">
+ <inp2:m_Phrase name="la_section_ProjectDeployment"/>
+ </div>
+ <div class="content">
+ <div class="group">
+ <h4><inp2:m_Phrase name="la_title_SystemToolsSynchronizeDBRevisions"/></h4>
+ <div class="hint">
+ <inp2:m_Phrase name="la_hint_SystemToolsSynchronizeDBRevisions"/>
+ </div>
+ <input type="button" class="button" onclick="submit_event('adm', 'OnSynchronizeDBRevisions');" value="<inp2:m_Phrase name="la_btn_Synchronize" no_editing="1"/>"/>
+ </div>
+
+ <div class="group last">
+ <h4><inp2:m_Phrase name="la_title_SystemToolsDeploy"/></h4>
+ <div class="hint">
+ <inp2:m_Phrase name="la_hint_SystemToolsDeploy"/>
+ </div>
+ <input type="button" class="button" onclick="submit_event('adm', 'OnDeploy');" value="<inp2:m_Phrase name="la_btn_Deploy" no_editing="1"/>"/>
+ </div>
+ </div>
+ </div>
+
+ <div class="summary-box">
+ <div class="title">
<inp2:m_Phrase name="la_section_Templates"/>
</div>
<div class="content">
Index: core/install/english.lang
===================================================================
--- core/install/english.lang (revision 14364)
+++ core/install/english.lang (working copy)
@@ -24,6 +24,7 @@
<PHRASE Label="la_btn_ContentMode" Module="Core" Type="1">Q29udGVudCBNb2Rl</PHRASE>
<PHRASE Label="la_btn_Delete" Module="Core" Type="1">RGVsZXRl</PHRASE>
<PHRASE Label="la_btn_DeleteDraft" Module="Core" Type="1">RGVsZXRl</PHRASE>
+ <PHRASE Label="la_btn_Deploy" Module="Core" Type="1">RGVwbG95</PHRASE>
<PHRASE Label="la_btn_DesignMode" Module="Core" Type="1">RGVzaWduIE1vZGU=</PHRASE>
<PHRASE Label="la_btn_Down" Module="Core" Type="1">RG93bg==</PHRASE>
<PHRASE Label="la_btn_Edit" Module="Core" Type="1">RWRpdA==</PHRASE>
@@ -46,6 +47,7 @@
<PHRASE Label="la_btn_SelectAll" Module="Core" Type="1">U2VsZWN0IEFsbA==</PHRASE>
<PHRASE Label="la_btn_SetValue" Module="Core" Type="1">U2V0IFZhbHVl</PHRASE>
<PHRASE Label="la_btn_ShowStructure" Module="Core" Type="1">U2hvdyBTdHJ1Y3R1cmU=</PHRASE>
+ <PHRASE Label="la_btn_Synchronize" Module="Core" Type="1">U3luY2hyb25pemU=</PHRASE>
<PHRASE Label="la_btn_Unselect" Module="Core" Type="1">VW5zZWxlY3Q=</PHRASE>
<PHRASE Label="la_btn_Up" Module="Core" Type="1">VXA=</PHRASE>
<PHRASE Label="la_btn_UseDraft" Module="Core" Type="1">VXNl</PHRASE>
@@ -708,6 +710,7 @@
<PHRASE Label="la_hint_SystemToolsCacheKeys" Module="Core" Type="1">Q2FjaGUgS2V5KHMp</PHRASE>
<PHRASE Label="la_hint_SystemToolsClearTemplatesCache" Module="Core" Type="1">PHVsPg0KICA8bGk+RGVsZXRlcyBhbGwgY29tcGlsZWQgdGVtcGxhdGVzIGZyb20gQWRtaW4gQ29uc29sZSBhbmQgRnJvbnQtZW5kIHRoZW1lcy48L2xpPg0KICA8bGk+UmVjb21tZW5kZWQgZm9yIHRoZSBtYWludGVuYW5jZSBwdXJwb3Nlcywgc2luY2UgZG9lcyBub3QgcHJvdmlkZSBhbnkgYWR2YW50YWdlcyBleGNlcHQgZm9yIHRlbXBvcmFyeSBsb3dlcmluZyB1c2FnZSBvZiB0aGUgZGlzayBzcGFjZS4gQWxsIHRlbXBsYXRlcyB3aWxsIGJlIGF1dG9tYXRpY2FsbHkgcmVjb21waWxlZCBhdCB0aGUgdGltZSBvZiB2aXNpdC48L2xpPg0KPC91bD4=</PHRASE>
<PHRASE Label="la_hint_SystemToolsDatabaseCache" Module="Core" Type="1">ZGF0YWJhc2UgY2FjaGU=</PHRASE>
+ <PHRASE Label="la_hint_SystemToolsDeploy" Module="Core" Type="1">PHVsPg0KPGxpPlRoaXMgZGVwbG95IHNjcmlwdCB3aWxsIGFwcGx5IGFsbCBEYXRhYmFzZSBDaGFuZ2VzIHN0b3JlZCBpbiA8Yj48dT5bbW9kdWxlXS9wcm9qZWN0X3VwZ3JhZGVzLnNxbDwvdT48L2I+IHRvIHRoZSBjdXJyZW50IHdlYnNpdGUgYW5kIHNhdmUgYXBwbGllZCBSZXZpc2lvbnMgaW4gQXBwbGllZERCUmV2aXNpb25zLjwvbGk+DQo8bGk+VGhpcyBkZXBsb3kgc2NyaXB0IHdpbGwgY3JlYXRlIGFsbCBuZXcgbGFuZ3VhZ2UgcGhyYXNlcyBieSByZS1pbXBvcnRpbmcgPGI+PHU+Y3VzdG9tL2luc3RhbGwvZW5nbGlzaC5sYW5nPC91PjwvYj4gZmlsZS48L2xpPg0KPGxpPlRoaXMgZGVwbG95IHNjcmlwdCB3aWxsIHJlc2V0IGFsbCBjYWNoZXMgYXQgb25jZTwvbGk+DQo8L3VsPg==</PHRASE>
<PHRASE Label="la_hint_SystemToolsKeyName" Module="Core" Type="1">PHVsPg0KICA8bGk+TmFtZSBvZiB0aGUgS2V5IHVzZWQgdG8gZ2V0IG9yIHNldCB0aGUgZGF0YSAodmFsdWUpIGluIHRoZSBtZW1vcnkgY2FjaGUgKDxzdHJvbmc+PGk+a0FwcGxpY2F0aW9uOjpzZXRDYWNoZTwvaT48L3N0cm9uZz4gYW5kIDxzdHJvbmc+PGk+a0FwcGxpY2F0aW9uOjpnZXRDYWNoZTwvaT48L3N0cm9uZz4gbWV0aG9kcykuPC9saT4NCjwvdWw+</PHRASE>
<PHRASE Label="la_hint_SystemToolsKeyValue" Module="Core" Type="1">Q3VycmVudCB2YWx1ZSBvciBhIG5ldyB2YWx1ZSAoZm9yIHNldHRpbmcpIG9mIHRoZSBrZXkgbmFtZSBzcGVjaWZpZWQgYWJvdmUu</PHRASE>
<PHRASE Label="la_hint_SystemToolsLocateUnitConfigFile" Module="Core" Type="1">PHVsPg0KICA8bGk+U2hvd3MgdGhlIGxvY2F0aW9uIG9mIDxzdHJvbmc+PGk+VW5pdCBDb25maWc8L2k+PC9zdHJvbmc+IGZpbGUsIGFzc29jaWF0ZWQgd2l0aCB0aGUgZ2l2ZW4gPHN0cm9uZz48aT5Vbml0IENvbmZpZyBQcmVmaXg8L2k+PC9zdHJvbmc+IChpZS4gImFkbSIsICJ1IiwgImxhbmciIGFuZCBvdGhlcnMpLjwvbGk+DQo8L3VsPg==</PHRASE>
@@ -722,6 +725,7 @@
<PHRASE Label="la_hint_SystemToolsResetParsedCachedData" Module="Core" Type="1">PHVsPg0KICA8bGk+UmVzZXRzIHZhcmlvdXMgY2FjaGVkIHN5c3RlbSBkYXRhIHN1Y2ggYXMgZGVmaW5lZCBQSFAgQ2xhc3NlcyAobWFwcGluZyBiZXR3ZWVuIHRoZSBjbGFzcyBuYW1lIGFuZCBwaHlzaWNhbCBmaWxlbmFtZSBhbmQgbG9jYXRpb24gb2YgdGhlIGNsYXNzKSwgSG9va3MsIEFnZW50cywgQ2FjaGVkIENvbmZpZ3VyYXRpb24gVmFyaWFibGVzLCBSZXBsYWNlbWVudCBUZW1wbGF0ZXMsIFJld3JpdGUgTGlzdGVuZXJzIGFuZCBMb2FkZWQgTW9kdWxlcy4gRGF0YSBpcyByZWFkIGFuZCBjb2xsZWN0ZWQgZnJvbSA8c3Ryb25nPjxpPlVuaXQgQ29uZmlnPC9pPjwvc3Ryb25nPiBmaWxlcyB0aGF0IGFscmVhZHkgYmVlbiBzY2FubmVkIGFuZCBjYWNoZWQgYnkgdGhlIHN5c3RlbS48L2xpPg0KPC91bD4=</PHRASE>
<PHRASE Label="la_hint_SystemToolsResetSMSMenuCache" Module="Core" Type="1">PHVsPg0KICA8bGk+RGVsZXRlcyB0aGUgY2FjaGVkIHZlcnNpb24gb2YgRnJvbnQtZW5kIG1lbnUgKGRpc3BsYXllZCB2aWEgPHN0cm9uZz48aT4mbHQ7aW5wMjpzdF9DYWNoZWRNZW51IC4uLi8mZ3Q7PC9pPjwvc3Ryb25nPiB0YWcpLiBUaGlzIGNhY2hlIGlzIHVwZGF0ZWQgYXV0b21hdGljYWxseSwgd2hlbiB0aGUgd2Vic2l0ZSBzdHJ1Y3R1cmUgb3Igc2VjdGlvbnMgYXJlIGNoYW5nZWQuPC9saT4NCiAgPGxpPlVzZSB0aGlzIG9wdGlvbiBvbmx5IGluIGNhc2UgaWYgZGlzcGxheWVkIG1lbnUgb24gdGhlIEZyb250LWVuZCBkb2Vzbid0IG1hdGNoIHRoZSBtZW51IGRlZmluZWQgaW4gQWRtaW4gQ29uc29sZS48L2xpPg0KPC91bD4=</PHRASE>
<PHRASE Label="la_hint_SystemToolsShowDatabaseTableStructure" Module="Core" Type="1">PHVsPg0KICA8bGk+U2hvd3MgdGhlIHN0cnVjdHVyZSBvZiB0aGUgZGF0YWJhc2UgdGFibGUgbG9hZGluZyBpdCBieSB0aGUgVGFibGUgTmFtZSAodGFibGUgcHJlZml4IGlzIG9wdGlvbmFsKSBvciA8c3Ryb25nPjxpPlVuaXQgQ29uZmlnIFByZWZpeDwvaT48L3N0cm9uZz4gYXNzb2NpYXRlZCB3aXRoIHRoaXMgdGFibGUuPC9saT4NCjwvdWw+</PHRASE>
+ <PHRASE Label="la_hint_SystemToolsSynchronizeDBRevisions" Module="Core" Type="1">PHVsPg0KPGxpPkFzIGEgcmVzdWx0LCBzY3JpcHQgd2lsbCBWYWxpZGF0ZSBjdXJyZW50IDxiPjx1PnByb2plY3RfdXBncmFkZXMuc3FsPC91PjwvYj4gZmlsZSBhbmQgb3V0bGluZSBhbnkgZXJyb3JzIG9yIGluY29uc2lzdGVuY2llcywgYW5kIGF1dG8tcG9wdWxhdGUgYWxsIG1pc3NpbmcgREIgUmV2aXNpb25zIGZyb20gdGhlIGZpbGUgaW50byBBcHBsaWVkREJSZXZpc2lvbnMuPC9saT4NCjxsaT48YiBzdHlsZT0iY29sb3I6cmVkIj5OT1RFOjwvYj4gRGV2ZWxvcGVycyBzaG91bGQgT05MWSBydW4gdGhpcyBiZWZvcmUgdGhleSBwZXJmb3JtIFJlcG9zaXRvcnkgVXBkYXRlcyBvbiB0aGVpIHdvcmtpbmcgY29weSE8L2xpPg0KPC91bD4=</PHRASE>
<PHRASE Label="la_hint_UsingRegularExpression" Module="Core" Type="1">VXNpbmcgUmVndWxhciBFeHByZXNzaW9u</PHRASE>
<PHRASE Label="la_Hot" Module="Core" Type="1">SG90</PHRASE>
<PHRASE Label="la_Html" Module="Core" Type="1">SFRNTA==</PHRASE>
@@ -1064,6 +1068,7 @@
<PHRASE Label="la_section_overview" Module="Core" Type="1">U2VjdGlvbiBPdmVydmlldw==</PHRASE>
<PHRASE Label="la_section_Page" Module="Core" Type="1">U2VjdGlvbiBQcm9wZXJ0aWVz</PHRASE>
<PHRASE Label="la_section_PageCaching" Module="Core" Type="1">U2VjdGlvbiBDYWNoaW5n</PHRASE>
+ <PHRASE Label="la_section_ProjectDeployment" Module="Core" Type="1">UHJvamVjdCBEZXBsb3ltZW50</PHRASE>
<PHRASE Label="la_section_Properties" Module="Core" Type="1">UHJvcGVydGllcw==</PHRASE>
<PHRASE Label="la_section_QuickLinks" Module="Core" Type="1">UXVpY2sgTGlua3M=</PHRASE>
<PHRASE Label="la_section_RecipientsInfo" Module="Core" Type="1">UmVjaXBpZW50cyBJbmZvcm1hdGlvbg==</PHRASE>
@@ -1385,6 +1390,7 @@
<PHRASE Label="la_title_SystemTools" Module="Core" Type="1">U3lzdGVtIFRvb2xz</PHRASE>
<PHRASE Label="la_title_SystemToolsClearTemplatesCache" Module="Core" Type="1">Q2xlYXIgVGVtcGxhdGVzIENhY2hl</PHRASE>
<PHRASE Label="la_title_SystemToolsCommonlyUsedKeys" Module="Core" Type="1">Q29tbW9ubHkgVXNlZCBLZXlz</PHRASE>
+ <PHRASE Label="la_title_SystemToolsDeploy" Module="Core" Type="1">RGVwbG95IENoYW5nZXM=</PHRASE>
<PHRASE Label="la_title_SystemToolsKeyName" Module="Core" Type="1">S2V5IE5hbWU=</PHRASE>
<PHRASE Label="la_title_SystemToolsKeyValue" Module="Core" Type="1">S2V5IFZhbHVl</PHRASE>
<PHRASE Label="la_title_SystemToolsLocateUnitConfigFile" Module="Core" Type="1">TG9jYXRlIFVuaXQgQ29uZmlnIEZpbGU=</PHRASE>
@@ -1398,6 +1404,7 @@
<PHRASE Label="la_title_SystemToolsResetParsedCachedData" Module="Core" Type="1">UmVzZXQgUGFyc2VkIGFuZCBDYWNoZWQgU3lzdGVtIERhdGE=</PHRASE>
<PHRASE Label="la_title_SystemToolsResetSMSMenuCache" Module="Core" Type="1">UmVzZXQgU01TIE1lbnUgQ2FjaGU=</PHRASE>
<PHRASE Label="la_title_SystemToolsShowDatabaseTableStructure" Module="Core" Type="1">U2hvdyBEYXRhYmFzZSBUYWJsZSBTdHJ1Y3R1cmU=</PHRASE>
+ <PHRASE Label="la_title_SystemToolsSynchronizeDBRevisions" Module="Core" Type="1">U3luY2hyb25pemUgRGF0YWJhc2UgUmV2aXNpb25z</PHRASE>
<PHRASE Label="la_title_ThemeFiles" Module="Core" Type="1">VGhlbWUgRmlsZXM=</PHRASE>
<PHRASE Label="la_title_Thesaurus" Module="Core" Type="1">VGhlc2F1cnVz</PHRASE>
<PHRASE Label="la_title_UpdatingCategories" Module="Core" Type="1">VXBkYXRpbmcgU2VjdGlvbnM=</PHRASE>
Index: core/install/install_data.sql
===================================================================
--- core/install/install_data.sql (revision 14364)
+++ core/install/install_data.sql (working copy)
@@ -962,5 +962,5 @@
#INSERT INTO PageContent VALUES (DEFAULT, 1, 1, '<span style="font-weight: bold;">In-portal</span> is a revolutionary Web Site management system that allows you to automate and facilitate management of large portal and community web sites. Regardless of whether you are running a directory site or a content news portal, a community site or an online mall, In-portal will enhance your web site management experience with innovative.</span><br><br>We are proud to present our newly developed <b>"default"</b> theme that introduces a fresh look as well totally new approach in the template system.</span><br>', NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0);
-INSERT INTO Modules VALUES ('Core', 'core/', 'adm', DEFAULT, 1, 1, '', 0, NULL);
-INSERT INTO Modules VALUES ('In-Portal', 'core/', 'm', DEFAULT, 1, 0, '', 0, NULL);
\ No newline at end of file
+INSERT INTO Modules VALUES ('Core', 'core/', 'adm', DEFAULT, 1, 1, '', 0, NULL, NULL);
+INSERT INTO Modules VALUES ('In-Portal', 'core/', 'm', DEFAULT, 1, 0, '', 0, NULL, NULL);
\ No newline at end of file
Index: core/install/install_schema.sql
===================================================================
--- core/install/install_schema.sql (revision 14332)
+++ core/install/install_schema.sql (working copy)
@@ -1,7 +1,7 @@
CREATE TABLE PermissionConfig (
PermissionConfigId int(11) NOT NULL auto_increment,
PermissionName varchar(30) NOT NULL default '',
- Description varchar(255) NOT NULL default '',
+ Description varchar(255) NOT NULL default '',
ModuleId varchar(20) NOT NULL default '0',
PRIMARY KEY (PermissionConfigId),
KEY PermissionName (PermissionName)
@@ -155,16 +155,17 @@
);
CREATE TABLE Modules (
- `Name` varchar(255) NOT NULL default '',
- Path varchar(255) NOT NULL default '',
- `Var` VARCHAR(100) NOT NULL DEFAULT '',
- Version varchar(10) NOT NULL default '0.0.0',
- Loaded tinyint(4) NOT NULL default '1',
- LoadOrder tinyint(4) NOT NULL default '0',
- TemplatePath varchar(255) NOT NULL default '',
- RootCat int(11) NOT NULL default '0',
- BuildDate int(10) unsigned default NULL,
- PRIMARY KEY (`Name`),
+ `Name` varchar(255) NOT NULL DEFAULT '',
+ Path varchar(255) NOT NULL DEFAULT '',
+ Var varchar(100) NOT NULL DEFAULT '',
+ Version varchar(10) NOT NULL DEFAULT '0.0.0',
+ Loaded tinyint(4) NOT NULL DEFAULT '1',
+ LoadOrder tinyint(4) NOT NULL DEFAULT '0',
+ TemplatePath varchar(255) NOT NULL DEFAULT '',
+ RootCat int(11) NOT NULL DEFAULT '0',
+ BuildDate int(10) unsigned DEFAULT NULL,
+ AppliedDBRevisions text,
+ PRIMARY KEY (`Name`),
KEY Loaded (Loaded),
KEY LoadOrder (LoadOrder)
);
Index: core/install/upgrades.sql
===================================================================
--- core/install/upgrades.sql (revision 14364)
+++ core/install/upgrades.sql (working copy)
@@ -2020,4 +2020,7 @@
# ===== v 5.1.3-B1 =====
ALTER TABLE FormSubmissions CHANGE ReferrerURL ReferrerURL TEXT NULL;
-INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UserEmailActivationTimeout', '', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_config_UserEmailActivationTimeout', 'text', NULL, NULL, 10.051, 0, 0, NULL);
\ No newline at end of file
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UserEmailActivationTimeout', '', 'In-Portal:Users', 'in-portal:configure_users', 'la_title_General', 'la_config_UserEmailActivationTimeout', 'text', NULL, NULL, 10.051, 0, 0, NULL);
+
+# ===== v 5.1.3-B2 =====
+ALTER TABLE Modules ADD AppliedDBRevisions TEXT NULL;
\ No newline at end of file
Index: core/units/admin/admin_events_handler.php
===================================================================
--- core/units/admin/admin_events_handler.php (revision 14326)
+++ core/units/admin/admin_events_handler.php (working copy)
@@ -19,6 +19,7 @@
function mapPermissions()
{
parent::mapPermissions();
+
$permissions = Array(
'OnSaveColumns' => array('self' => true),
'OnClosePopup' => array('self' => true),
@@ -44,8 +45,8 @@
$system_events = Array (
'OnResetModRwCache', 'OnResetSections', 'OnResetConfigsCache', 'OnResetParsedData', 'OnResetMemcache',
- 'OnDeleteCompiledTemplates', 'OnCompileTemplates', 'OnGenerateTableStructure',
- 'OnRebuildThemes', 'OnCheckPrefixConfig', 'OnMemoryCacheGet', 'OnMemoryCacheSet'
+ 'OnDeleteCompiledTemplates', 'OnCompileTemplates', 'OnGenerateTableStructure', 'OnSynchronizeDBRevisions',
+ 'OnDeploy', 'OnRebuildThemes', 'OnCheckPrefixConfig', 'OnMemoryCacheGet', 'OnMemoryCacheSet'
);
if (in_array($event->Name, $system_events)) {
@@ -1320,6 +1321,41 @@
echo $json_helper->encode($ret);
}
+
+ /**
+ * Deploy changes
+ *
+ * Usage: "php tools/run_event.php adm:OnDeploy b674006f3edb1d9cd4d838c150b0567d"
+ *
+ * @param kEvent $event
+ */
+ function OnDeploy(&$event)
+ {
+ if ( isset($GLOBALS['argv']) ) {
+ // command line invocation -> don't perform redirect
+ $event->status = erSTOP;
+ }
+
+ $deployment_helper =& $this->Application->recallObject('DeploymentHelper');
+ /* @var $deployment_helper DeploymentHelper */
+
+ $deployment_helper->deployAll();
+ }
+
+ /**
+ * Synchronizes database revisions from "project_upgrades.sql" file
+ *
+ * @param kEvent $event
+ */
+ function OnSynchronizeDBRevisions(&$event)
+ {
+ $deployment_helper =& $this->Application->recallObject('DeploymentHelper');
+ /* @var $deployment_helper DeploymentHelper */
+
+ if ( !$deployment_helper->deployAll(true) ) {
+ $event->status = erFAIL;
+ }
+ }
}
Index: core/units/helpers/deployment_helper.php
===================================================================
--- core/units/helpers/deployment_helper.php (revision 0)
+++ core/units/helpers/deployment_helper.php (revision 0)
@@ -0,0 +1,386 @@
+<?php
+/**
+* @version $Id$
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2011 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+defined('FULL_PATH') or die('restricted access!');
+
+class DeploymentHelper extends kHelper {
+
+ private $moduleName = '';
+
+ private $revisionSqls = Array ();
+
+ private $revisionDependencies = Array ();
+
+ private $appliedRevisions = Array ();
+
+ private $dryRun = false;
+
+ private $lineEnding = PHP_EOL;
+
+ public function DeploymentHelper()
+ {
+ parent::kHelper();
+
+ set_time_limit(0);
+ ini_set('memory_limit', -1);
+ }
+
+ private function loadAppliedRevisions()
+ {
+ $sql = 'SELECT AppliedDBRevisions
+ FROM ' . TABLE_PREFIX . 'Modules
+ WHERE Name = ' . $this->Conn->qstr( $this->moduleName );
+ $revisions = $this->Conn->GetOne($sql);
+
+ $this->appliedRevisions = $revisions ? explode(',', $revisions) : Array ();
+ }
+
+ private function saveAppliedRevisions()
+ {
+ // maybe optimize
+ sort($this->appliedRevisions);
+
+ $fields_hash = Array (
+ 'AppliedDBRevisions' => implode(',', $this->appliedRevisions),
+ );
+
+ $this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'Modules', '`Name` = ' . $this->Conn->qstr($this->moduleName));
+ }
+
+ public function deployAll($dry_run = false)
+ {
+ $this->dryRun = $dry_run;
+ $this->lineEnding = $dry_run ? '<br/>' . PHP_EOL : PHP_EOL;
+
+ $ret = true;
+
+ foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
+ $this->moduleName = $module_name;
+
+ if ( !file_exists($this->getModuleFile('project_upgrades.sql')) ) {
+ continue;
+ }
+
+ $ret = $ret && $this->deploy($module_name);
+ }
+
+ if (!$this->dryRun) {
+ $this->resetCaches();
+ $this->refreshThemes();
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Deploys pending changes to a site
+ *
+ */
+ private function deploy($module_name)
+ {
+ echo 'Deploying Module "' . $module_name . '":' . $this->lineEnding;
+
+ echo 'Upgrading Database ... ';
+ if ( !$this->upgradeDatabase() ) {
+ return false;
+ }
+
+ echo 'OK' . $this->lineEnding;
+
+ $this->importLanguagePack();
+
+ echo 'Done.' . $this->lineEnding;
+
+ return true;
+ }
+
+ /**
+ * Import latest languagepack (without overwrite)
+ *
+ */
+ private function importLanguagePack()
+ {
+ $language_import_helper =& $this->Application->recallObject('LanguageImportHelper');
+ /* @var $language_import_helper LanguageImportHelper */
+
+ echo 'Importing LanguagePack ... ';
+ $filename = $this->getModuleFile('english.lang');
+ $language_import_helper->performImport($filename, '|0|1|2|', $this->moduleName, LANG_SKIP_EXISTING);
+ echo 'OK' . $this->lineEnding;
+ }
+
+ /**
+ * Resets unit and section cache
+ *
+ */
+ private function resetCaches()
+ {
+ // 2. reset unit config cache (so new classes get auto-registered)
+ echo 'Resetting Unit Config Cache ... ';
+ $admin_event = new kEvent('adm:OnResetConfigsCache');
+ $this->Application->HandleEvent($admin_event);
+ echo 'OK' . $this->lineEnding;
+
+ // 3. reset sections cache
+ echo 'Resetting Sections Cache ... ';
+ $admin_event = new kEvent('adm:OnResetSections');
+ $this->Application->HandleEvent($admin_event);
+ echo 'OK' . $this->lineEnding;
+ }
+
+ /**
+ * Rebuild theme files
+ *
+ */
+ private function refreshThemes()
+ {
+ echo 'Rebuilding Theme Files ... ';
+ $admin_event = new kEvent('adm:OnRebuildThemes');
+ $this->Application->HandleEvent($admin_event);
+ echo 'OK' . $this->lineEnding;
+ }
+
+ /**
+ * Runs database upgrade script
+ *
+ * @return bool
+ */
+ private function upgradeDatabase()
+ {
+ $this->loadAppliedRevisions();
+ $this->Conn->errorHandler = Array(&$this, 'handleSqlError');
+
+ if ( !$this->collectDatabaseRevisions() || !$this->checkRevisionDependencies() ) {
+ return false;
+ }
+
+ $applied = $this->applyRevisions();
+ $this->saveAppliedRevisions();
+
+ return $applied;
+ }
+
+ /**
+ * Collects database revisions from "project_upgrades.sql" file.
+ *
+ * @return bool
+ */
+ private function collectDatabaseRevisions()
+ {
+ $filename = $this->getModuleFile('project_upgrades.sql');
+
+ if ( !file_exists($filename) ) {
+ return true;
+ }
+
+ $sqls = file_get_contents($filename);
+ preg_match_all("/# r([\d]+)([^\:]*):.*?(\n|$)/s", $sqls, $matches, PREG_SET_ORDER + PREG_OFFSET_CAPTURE);
+
+ if (!$matches) {
+ echo 'No Database Revisions Found' . $this->lineEnding;
+
+ return false;
+ }
+
+ foreach ($matches as $index => $match) {
+ $revision = $match[1][0];
+
+ if ( $this->revisionApplied($revision) ) {
+ // skip applied revisions
+ continue;
+ }
+
+ if ( isset($this->revisionSqls[$revision]) ) {
+ // duplicate revision among non-applied ones
+ echo 'Duplicate revision ' . $revision . ' found' . $this->lineEnding;
+
+ return false;
+ }
+
+ // get revision sqls
+ $start_pos = $match[0][1] + strlen($match[0][0]);
+ $end_pos = isset($matches[$index + 1]) ? $matches[$index + 1][0][1] : strlen($sqls);
+ $revision_sqls = substr($sqls, $start_pos, $end_pos - $start_pos);
+
+ if (!$revision_sqls) {
+ // resision without sqls
+ continue;
+ }
+
+ $this->revisionSqls[$revision] = $revision_sqls;
+ $revision_lependencies = $this->parseRevisionDependencies($match[2][0]);
+
+ if ($revision_lependencies) {
+ $this->revisionDependencies[$revision] = $revision_lependencies;
+ }
+ }
+
+ ksort($this->revisionSqls);
+ ksort($this->revisionDependencies);
+
+ return true;
+ }
+
+ /**
+ * Checks that all dependent revisions are either present now OR were applied before
+ *
+ * @return bool
+ */
+ private function checkRevisionDependencies()
+ {
+ foreach ($this->revisionDependencies as $revision => $revision_dependencies) {
+ foreach ($revision_dependencies as $revision_dependency) {
+ if ( $this->revisionApplied($revision_dependency) ) {
+ // revision dependend upon already applied -> depencency fulfilled
+ continue;
+ }
+
+ if ($revision_dependency >= $revision) {
+ echo 'Revision ' . $revision . ' has incorrect dependency to revision ' . $revision_dependency . '. Only dependencies to older revisions are allowed!' . $this->lineEnding;
+
+ return false;
+ }
+
+ if ( !isset($this->revisionSqls[$revision_dependency]) ) {
+ echo 'Revision ' . $revision . ' depends on missing revision ' . $revision_dependency . '!' . $this->lineEnding;
+
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Runs all pending sqls
+ *
+ * @return bool
+ */
+ private function applyRevisions()
+ {
+ if (!$this->revisionSqls) {
+ return true;
+ }
+
+ if ($this->dryRun) {
+ $this->appliedRevisions = array_merge($this->appliedRevisions, array_keys($this->revisionSqls));
+
+ return true;
+ }
+
+ echo $this->lineEnding;
+
+ foreach ($this->revisionSqls as $revision => $sqls) {
+ echo 'Processing DB Revision: #' . $revision . ' ... ';
+
+ $sqls = str_replace("\r\n", "\n", $sqls); // convert to linux line endings
+ $no_comment_sqls = preg_replace("/#\s([^;]*?)\n/is", '', $sqls); // remove all comments "#" on new lines
+
+ $sqls = explode(";\n", $no_comment_sqls . "\n"); // ensures that last sql won't have ";" in it
+ $sqls = array_map('trim', $sqls);
+
+ foreach ($sqls as $index => $sql) {
+ if (!$sql || (substr($sql, 0, 1) == '#')) {
+ continue; // usually last line
+ }
+
+ $this->Conn->Query($sql);
+
+ if ( $this->Conn->hasError() ) {
+ // consider revisions with errors applied
+ $this->appliedRevisions[] = $revision;
+
+ return false;
+ }
+ }
+
+ $this->appliedRevisions[] = $revision;
+ echo 'OK' . $this->lineEnding;
+ }
+
+ return true;
+ }
+
+ /**
+ * Error handler for sql errors
+ *
+ * @param int $code
+ * @param string $msg
+ * @param string $sql
+ * @return bool
+ */
+ public function handleSqlError($code, $msg, $sql)
+ {
+ echo 'Error (#' . $code . ': ' . $msg . ') during SQL processing:' . $this->lineEnding . $sql . $this->lineEnding;
+ echo 'Please execute rest of sqls in this revision by hand and run deployment script again.' . $this->lineEnding;
+
+ return true;
+ }
+
+ /**
+ * Checks if given revision was already applied
+ *
+ * @param int $revision
+ * @return bool
+ */
+ private function revisionApplied($revision)
+ {
+ foreach ($this->appliedRevisions as $applied_revision) {
+ // revision range
+ $applied_revision = explode('-', $applied_revision, 2);
+
+ if ( !isset($applied_revision[1]) ) {
+ // convert single revision to revision range
+ $applied_revision[1] = $applied_revision[0];
+ }
+
+ if ( $revision >= $applied_revision[0] && $revision <= $applied_revision[1] ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns path to given file in current module install folder
+ *
+ * @param string $filename
+ * @return string
+ */
+ private function getModuleFile($filename)
+ {
+ $module_folder = $this->Application->findModule('Name', $this->moduleName, 'Path');
+
+ return FULL_PATH . DIRECTORY_SEPARATOR . $module_folder . 'install/' . $filename;
+ }
+
+ /**
+ * Extracts revisions from string in format "(1,3,5464,23342,3243)"
+ *
+ * @param string $string
+ * @return Array
+ */
+ private function parseRevisionDependencies($string)
+ {
+ if (!$string) {
+ return Array ();
+ }
+
+ $string = explode(',', substr($string, 1, -1));
+
+ return array_map('trim', $string);
+ }
+}
\ No newline at end of file
Property changes on: core\units\helpers\deployment_helper.php
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ LF
Index: core/units/helpers/helpers_config.php
===================================================================
--- core/units/helpers/helpers_config.php (revision 14318)
+++ core/units/helpers/helpers_config.php (working copy)
@@ -66,5 +66,7 @@
Array ('pseudo' => 'MimeDecodeHelper', 'class' => 'MimeDecodeHelper', 'file' => 'mime_decode_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'),
Array ('pseudo' => 'UserHelper', 'class' => 'UserHelper', 'file' => 'user_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'),
Array ('pseudo' => 'SiteHelper', 'class' => 'SiteHelper', 'file' => 'site_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'),
+
+ Array ('pseudo' => 'DeploymentHelper', 'class' => 'DeploymentHelper', 'file' => 'deployment_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'),
),
);
\ No newline at end of file
Index: tools/run_event.php
===================================================================
--- tools/run_event.php (revision 0)
+++ tools/run_event.php (revision 0)
@@ -0,0 +1,50 @@
+<?php
+/**
+* @version $Id$
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2011 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+die('Restrictred use!');
+
+$start = getmicrotime();
+
+define('CRON', 1);
+define('ADMIN', 1);
+define('REL_PATH', 'tools');
+define('FULL_PATH', realpath(dirname(__FILE__) . '/..'));
+define('DBG_SKIP_REPORTING', 1);
+
+$_SERVER['HTTP_USER_AGENT'] = 'gecko';
+
+// in command line, then 2nd argument is password
+$password = isset($argv) && isset($argv[2]) ? $argv[2] : '';
+
+if ($password != 'b674006f3edb1d9cd4d838c150b0567d') {
+ die('Bad key' . PHP_EOL);
+}
+
+include_once(FULL_PATH . '/core/kernel/startup.php');
+
+$application =& kApplication::Instance();
+$application->Init();
+
+$application->StoreVar('user_id', USER_ROOT, true);
+$application->HandleEvent($ev, $argv[1]); // event name in form "prefix[.special]:event_name"
+
+$application->Done();
+
+$end = getmicrotime();
+
+function getmicrotime()
+{
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+}
Property changes on: tools\run_event.php
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ LF
deployment_script_modules_v3.patch [^] (5,971 bytes) 2011-06-28 10:18
[Show Content]
Index: custom/install/install_data.sql
===================================================================
--- custom/install/install_data.sql (revision 14318)
+++ custom/install/install_data.sql (working copy)
@@ -1,19 +1,7 @@
-# place here only sql queries, that were executed on live AND dev sites !!!
-
INSERT INTO Permissions VALUES(DEFAULT, 'custom.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:widgets.view', 11, 1, 1, 0);
-INSERT INTO Modules VALUES ('Custom', 'modules/custom/', 'custom-sections', DEFAULT, 1, 10, 'custom/', 0, NULL);
-
-
-# ===== SQLs above this line already on LIVE ================================================================================================
-
-# place here only sql queries, that were executed on dev site !!!
-
-
-# ===== SQLs above this line already on DEV ========================================================================================================
-
-# place here only sql queries, that were executed on prod server !!!
+INSERT INTO Modules VALUES ('Custom', 'modules/custom/', 'custom-sections', DEFAULT, 1, 10, 'custom/', 0, NULL, NULL);
Index: custom/install/install_schema.sql
===================================================================
--- custom/install/install_schema.sql (revision 14318)
+++ custom/install/install_schema.sql (working copy)
@@ -1,5 +1,3 @@
-# place here only sql queries, that were executed on live AND dev sites !!!
-
CREATE TABLE Widgets (
WidgetId int(11) NOT NULL AUTO_INCREMENT,
Title varchar(255) NOT NULL DEFAULT '',
@@ -17,11 +15,3 @@
PRIMARY KEY (WidgetId)
);
-# ===== SQLs above this line already on LIVE ================================================================================================
-
-# place here only sql queries, that were executed on dev site !!!
-
-
-# ===== SQLs above this line already on DEV ========================================================================================================
-
-# place here only sql queries, that were executed on prod server !!!
Index: custom/install/project_upgrades.sql
===================================================================
--- custom/install/project_upgrades.sql (revision 0)
+++ custom/install/project_upgrades.sql (revision 0)
@@ -0,0 +1,2 @@
+# r1: Initial Project Task (#TASK_ID)
+
Property changes on: custom\install\project_upgrades.sql
___________________________________________________________________
Added: svn:eol-style
+ LF
Index: in-auction/install/install_data.sql
===================================================================
--- in-auction/install/install_data.sql (revision 14318)
+++ in-auction/install/install_data.sql (working copy)
@@ -1792,4 +1792,4 @@
INSERT INTO Permissions VALUES (DEFAULT, 'ebay:configuration_feedbacks.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'ebay:configuration_general.edit', 11, 1, 1, 0);
-INSERT INTO Modules VALUES ('In-Auction', 'modules/in-auction/', 'ebay-sections', DEFAULT, 1, 6, 'in-auction/', 2, NULL);
+INSERT INTO Modules VALUES ('In-Auction', 'modules/in-auction/', 'ebay-sections', DEFAULT, 1, 6, 'in-auction/', 2, NULL, NULL);
Index: in-bulletin/install/install_data.sql
===================================================================
--- in-bulletin/install/install_data.sql (revision 14318)
+++ in-bulletin/install/install_data.sql (working copy)
@@ -226,4 +226,4 @@
INSERT INTO CustomField VALUES (DEFAULT, 1, 'bb_ItemTemplate', 'la_fld_cust_bb_ItemTemplate', 0, 'la_title_SystemCF', 'la_fld_cust_bb_ItemTemplate', 'text', NULL, '', 0, 0, 1, 0);
-INSERT INTO Modules VALUES ('In-Bulletin', 'modules/in-bulletin/', 'bb', DEFAULT, 1, 3, 'in-bulletin/', {TopicCatId}, NULL);
+INSERT INTO Modules VALUES ('In-Bulletin', 'modules/in-bulletin/', 'bb', DEFAULT, 1, 3, 'in-bulletin/', {TopicCatId}, NULL, NULL);
Index: in-commerce/install/install_data.sql
===================================================================
--- in-commerce/install/install_data.sql (revision 14318)
+++ in-commerce/install/install_data.sql (working copy)
@@ -470,4 +470,4 @@
INSERT INTO ImportScripts VALUES (DEFAULT, 'Products from CSV file [In-Commerce]', '', 'p', 'In-Commerce', '', 'CSV', '1');
-INSERT INTO Modules VALUES ('In-Commerce', 'modules/in-commerce/', 'p', DEFAULT, 1, 4, 'in-commerce/', 2, NULL);
+INSERT INTO Modules VALUES ('In-Commerce', 'modules/in-commerce/', 'p', DEFAULT, 1, 4, 'in-commerce/', 2, NULL, NULL);
Index: in-link/install/install_data.sql
===================================================================
--- in-link/install/install_data.sql (revision 14318)
+++ in-link/install/install_data.sql (working copy)
@@ -244,4 +244,4 @@
INSERT INTO Counters VALUES (DEFAULT, 'linkhits_count', 'SELECT ROUND(SUM(Hits)) FROM <%PREFIX%>Link', NULL, NULL, '300', '0', '|Link|');
-INSERT INTO Modules VALUES ('In-Link', 'modules/in-link/', 'l', DEFAULT, 1, 1, 'in-link/', 2, NULL);
+INSERT INTO Modules VALUES ('In-Link', 'modules/in-link/', 'l', DEFAULT, 1, 1, 'in-link/', 2, NULL, NULL);
Index: in-news/install/install_data.sql
===================================================================
--- in-news/install/install_data.sql (revision 14318)
+++ in-news/install/install_data.sql (working copy)
@@ -183,4 +183,4 @@
INSERT INTO ImportScripts VALUES (DEFAULT, 'Articles from CSV file [In-News]', '', 'n', 'In-News', '', 'CSV', '1');
-INSERT INTO Modules VALUES ('In-News', 'modules/in-news/', 'n', DEFAULT, 1, 2, 'in-news/', {NewsCatId}, NULL);
\ No newline at end of file
+INSERT INTO Modules VALUES ('In-News', 'modules/in-news/', 'n', DEFAULT, 1, 2, 'in-news/', {NewsCatId}, NULL, NULL);
\ No newline at end of file
|