]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-sql_patches.php
One more wrapper function introduced, fixed for installation phase
[mailer.git] / inc / extensions / ext-sql_patches.php
index 4e644041ab1967bc476502f7f9556c1f53a77e32..64883e68b3df23c8d11cd3314ce926e95194d640 100644 (file)
@@ -93,7 +93,7 @@ switch (getExtensionMode()) {
 `action`='account'");
 
                // Unregister filter
-               unregisterFilter('member_login_check', 'RESET_USER_LOGIN_FAILURE', true, getExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'member_login_check', 'RESET_USER_LOGIN_FAILURE', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
@@ -707,7 +707,7 @@ CHANGE `what` `what` VARCHAR(50) NULL DEFAULT NULL');
 
                        case '0.6.9': // SQL queries for 0.6.9
                                // Register filter
-                               registerFilter('member_login_check', 'RESET_USER_LOGIN_FAILURE', false, true, getExtensionDryRun());
+                               registerFilter('member_login_check', 'RESET_USER_LOGIN_FAILURE', false, true, isExtensionDryRun());
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Filter zum Zurücksetzens des fehlgeschlagenen Mitgliederlogins hinzugefügt (internes TODO).");
@@ -728,7 +728,7 @@ INDEX (`ip`)
                                addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `dns_cache_timeout` BIGINT(20) NOT NULL DEFAULT ' . (60*60*24));
 
                                // Register filter
-                               registerFilter('reset', 'CLEANUP_DNS_CACHE', false, true, getExtensionDryRun());
+                               registerFilter('reset', 'CLEANUP_DNS_CACHE', false, true, isExtensionDryRun());
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("IP-Resolver-Klasse hinzugefügt, um bei der Erweiterung ext-network DNS-Anfragen einzusparen.");
@@ -755,24 +755,15 @@ INDEX (`ip`)
                setConfigEntry('secret_key', '');
 
                // Read key from secret file
-               if ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && ((getConfig('file_hash') == '') || (getConfig('master_salt') == '') || (getConfig('pass_scramble') == ''))) {
-                       // Cache instance
+               if ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && ((getFileHash() == '') || (getMasterSalt() == '') || (getPassScramble() == ''))) {
                        // 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')) && (getConfig('file_hash') != '') && (getConfig('master_salt') != '') && (getConfig('pass_scramble') != '')) {
+               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/.secret/.%s", getConfig('PATH'), getConfig('file_hash'));
+                       $hashFile = sprintf("%sinc/cache/.%s.cache", getPath(), getFileHash());
                        if (isFileReadable($hashFile)) {
                                // Read file
                                setConfigEntry('secret_key', readFromFile($hashFile));