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 @@
+ +
+
+
+

+
+ +
+ "/> +
+ +
+

+
+ +
+ "/> +
+
+
+ +
+
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, 'In-portal 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.

We are proud to present our newly developed "default" theme that introduces a fresh look as well totally new approach in the template system.
', 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 @@ +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