]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-sql_patches.php
More wrapper functions used, removed bigintval() which caused a lot trouble
[mailer.git] / inc / extensions / ext-sql_patches.php
index 138f723c1d053ad4807b114f3ffcbdcec4e94dff..fc66df9d3fc2fc17b07ed75e85f4b0a2ea8e89aa 100644 (file)
@@ -14,8 +14,6 @@
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
@@ -43,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.7.1');
+setThisExtensionVersion('0.7.2');
 
 // Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1'));
+setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2'));
 
 // Keep this extension always active!
 setExtensionAlwaysActive('Y');
@@ -54,7 +52,7 @@ setExtensionAlwaysActive('Y');
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
                // This depends on 'cache' now
-               addExtensionUpdateDependency('cache');
+               addExtensionDependency('cache');
                break;
 
        case 'remove': // Do stuff when removing extension
@@ -117,7 +115,7 @@ switch (getExtensionMode()) {
                                break;
 
                        case '0.0.2': // SQL queries for v0.0.2
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `auto_purge` `auto_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*14)."");
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `auto_purge` `auto_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay()*14)."");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("In der Tabelle <strong>{?_MYSQL_PREFIX?}_config</strong> musste die Spalte <strong>auto_purge</strong> (autom. L&ouml;schen von Best&auml;tigungsmails angepasst werden (war auf dem Testsystem auf TINYINT(4) gesetzt.)");
@@ -183,7 +181,7 @@ switch (getExtensionMode()) {
                        case '0.1.1': // SQL queries for v0.1.1
                                addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Men&uuml;punkt (what-welcome ist Standart) als Einstiegspunkt in das Men&uuml;system genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE `what`='config_home' LIMIT 1");
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `index_delay` TINYINT(3) NOT NULL DEFAULT 0");
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `index_cookie` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*365)."");
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `index_cookie` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay()*365)."");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Sie k&ouml;nnen nun <a href=\"{%url=modules.php?module=admin&amp;what=config_home%}\">hier</a> die Verz&ouml;gerungszeit in der <a href=\"{%url=index.php%}\">Eingangsseite</a> einstellen.");
@@ -509,7 +507,7 @@ PRIMARY KEY (`id`)
                                addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `what`=NULL WHERE `what`=''");
 
                                // Make this depending on ext-menu
-                               addExtensionUpdateDependency('menu');
+                               addExtensionDependency('menu');
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Schl&uuml;ssel in Admin-, Gast- und Mitgliedsmen&uuml; verbessert.");
@@ -580,7 +578,7 @@ PRIMARY KEY (`id`)
                                addMemberMenuSql('main','reflist','Ref-&Uuml;bersicht','N','Y',5);
 
                                // Depends on refback extension
-                               addExtensionUpdateDependency('refback');
+                               addExtensionDependency('refback');
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Ref-&Uuml;bersicht eingebaut. Diese h&auml;ngt von der Erweiterung <strong>refback</strong> ab.");
@@ -643,7 +641,7 @@ PRIMARY KEY (`filter_id`)
 
                        case '0.6.2': // SQL queries for v0.6.2
                                // Depends on refback extension
-                               addExtensionUpdateDependency('user');
+                               addExtensionDependency('user');
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Abh&auml;ngigkeit von <u>ext-user</u> gesetzt.");
@@ -736,11 +734,18 @@ INDEX (`ip`)
 
                        case '0.7.1': // SQL queries for v0.7.1
                                // This update just depends on ext-timezone to make integration of an essential extension much easier
-                               addExtensionUpdateDependency('timezone');
+                               addExtensionDependency('timezone');
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Zeitzone ist nun mit ext-timezone konfigurierbar.");
                                break;
+
+                       case '0.7.2': // SQL queries for v0.7.2
+                               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `task_type`='MEMBER_SUPPORT' WHERE `task_type`='SUPPORT_MEMBER'");
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Daten an Namenskonvention angepasst.");
+                               break;
                } // END - switch
                break;
 
@@ -756,23 +761,14 @@ INDEX (`ip`)
 
                // Read key from secret file
                if ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && ((getFileHash() == '') || (getMasterSalt() == '') || (getPassScramble() == ''))) {
-                       // Cache instance
                        // Maybe need setup of secret key!
                        loadIncludeOnce('inc/gen_sql_patches.php');
-
-                       // @TODO Rewrite this to a filter
-                       if ((isExtensionInstalledAndNewer('cache', '0.1.2')) && (isCacheInstanceValid())) {
-                               // Destroy some cache files
-                               if ($GLOBALS['cache_instance']->loadCacheFile('config'))    $GLOBALS['cache_instance']->removeCacheFile();
-                               if ($GLOBALS['cache_instance']->loadCacheFile('extension')) $GLOBALS['cache_instance']->removeCacheFile();
-                               if ($GLOBALS['cache_instance']->loadCacheFile('modules'))   $GLOBALS['cache_instance']->removeCacheFile();
-                       } // END - if
                } // END - if
 
                // Test again
                if ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && (getFileHash() != '') && (getMasterSalt() != '') && (getPassScramble() != '')) {
                        // File hash fas generated so we can also file the secret file... hopefully.
-                       $hashFile = sprintf("%sinc/cache/.%s", getPath(), getFileHash());
+                       $hashFile = sprintf("%sinc/cache/.%s.cache", getPath(), getFileHash());
                        if (isFileReadable($hashFile)) {
                                // Read file
                                setConfigEntry('secret_key', readFromFile($hashFile));