define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "338");
+define('CURR_SVN_REVISION', "339");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
}
// Version number
-$EXT_VERSION = "0.1.8";
+$EXT_VERSION = "0.1.9";
// Auto-set extension version
if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = 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");
+$EXT_VER_HISTORY = 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");
switch ($EXT_LOAD_MODE)
{
break;
case "0.1.8": // SQL queries for v0.1.8
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_theme ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_themes ENUM('Y','N') NOT NULL DEFAULT 'Y'";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Daten von installierten Themes werden nun gecacht.";
break;
+
+ case "0.1.9": // SQL queries for v0.1.9
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_admin_menu ENUM('Y','N') NOT NULL DEFAULT 'N'";
+
+ // Update notes (these will be set as task text!)
+ $UPDATE_NOTES = "Administratormenü experimentell gecacht.";
+ break;
}
break;
if ($cacheMode != "init") {
// Initialize cache system only when it's needed
$cacheInstance = new mxchange_cache($_CONFIG['cache_update'], PATH."inc/".$_CONFIG['cache_path'], $_CONFIG['cache_tested']);
- if ($cacheInstance->ret != "done") {
+ if ($cacheInstance->getStatus() != "done") {
// Failed to initialize cache sustem
ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_INITIALIZE);
}
************************************************************************/
// Some security stuff...
-if (basename($_SERVER['PHP_SELF']) == basename(__FILE__))
-{
+if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
define('ADMIN_CACHE_MODREG', "Soll der Zugriff auf die Tabelle <STRONG>"._MYSQL_PREFIX."_mod_reg</STRONG> beschleunigt werden?");
define('ADMIN_CACHE_REFDEPTH', "Soll der Zugriff auf die Tabelle <STRONG>"._MYSQL_PREFIX."_refdepths</STRONG> beschleunigt werden?");
define('ADMIN_CACHE_REFSYS', "Soll der Zugriff auf die Tabelle <STRONG>"._MYSQL_PREFIX."_refsystem</STRONG> beschleunigt werden?");
+define('ADMIN_CACHE_THEMES', "Soll der Zugriff auf die Tabelle <STRONG>"._MYSQL_PREFIX."_themes</STRONG> beschleunigt werden?");
+define('ADMIN_CACHE_ADMIN_MENU', "Soll der Aufbau des Administratormenüs beschleunigt werden (EXPERIMENTELL!)?");
define('ADMIN_CACHE_PATH', "Relativer Pfad für alle Cache-Dateien zum Pfad <STRONG>inc</STRONG>");
//
// Constructor
function mxchange_cache($interval, $path, $tested) {
+ // Failed is the default
+ $this->ret = "failed";
+
// Remember interval in class
- $this->update_interval=$interval;
+ $this->update_interval = $interval;
// Remeber path
- $this->cache_path=$path;
+ $this->cache_path = $path;
// Check if path exists
if ((is_dir($path)) && (!$tested)) {
UPDATE_CONFIG("cache_tested", 1);
// All done!
- return "done";
+ $this->ret = "done";
} else {
// Stop! Set a .htaccess file first
- $this->ret="htaccess";
- return "htaccess";
+ $this->ret = "htaccess";
}
}
} elseif ($tested) {
// System already tested
- $this->ret="done";
- return "done";
+ $this->ret = "done";
}
-
- // Something goes wrong here!
- $this->ret="failed";
- return "failed";
}
function cache_file($file, $ignore_ctime=false) {
// Return line
return $line;
}
+
+ function getStatus () {
+ return $this->ret;
+ }
}
//
?>
}
//
function ADD_ADMIN_MENU($act, $wht, $return=false) {
- global $menuDesription, $menuTitle, $cacheInstance;
+ global $menuDesription, $menuTitle, $cacheInstance, $_CONFIG;
// Init variables
$SUB = false;
$menuTitle = array();
// Is there a cache instance?
- if (is_object($cacheInstance)) {
+ if ((is_object($cacheInstance)) && (isset($_CONFIG['cache_admin_menu'])) && ($_CONFIG['cache_admin_menu'] == "Y")) {
// Create cache name
$cacheName = "admin_".$act."_".$wht."_".GET_LANGUAGE()."_".strtolower(get_session('admin_login'));
eval($eval);
// Is there a cache instance again?
- if (is_object($cacheInstance)) {
+ if ((is_object($cacheInstance)) && (isset($_CONFIG['cache_admin_menu'])) && ($_CONFIG['cache_admin_menu'] == "Y")) {
// Init cache
$cacheInstance->cache_init($cacheName);
else
{
// Prepare data
- switch ($_CONFIG['cache_admins'])
- {
+ switch ($_CONFIG['cache_admins']) {
case 'Y': define('__ADMINS_Y', " checked"); define('__ADMINS_N', ""); break;
case 'N': define('__ADMINS_Y', ""); define('__ADMINS_N', " checked"); break;
}
- switch ($_CONFIG['cache_acls'])
- {
+ switch ($_CONFIG['cache_acls']) {
case 'Y': define('__ACLS_Y', " checked"); define('__ACLS_N', ""); break;
case 'N': define('__ACLS_Y', ""); define('__ACLS_N', " checked"); break;
}
- switch ($_CONFIG['cache_exts'])
- {
+ switch ($_CONFIG['cache_exts']) {
case 'Y': define('__EXTS_Y', " checked"); define('__EXTS_N', ""); break;
case 'N': define('__EXTS_Y', ""); define('__EXTS_N', " checked"); break;
}
- switch ($_CONFIG['cache_config'])
- {
+ switch ($_CONFIG['cache_config']) {
case 'Y': define('__CONFIG_Y', " checked"); define('__CONFIG_N', ""); break;
case 'N': define('__CONFIG_Y', ""); define('__CONFIG_N', " checked"); break;
}
- switch ($_CONFIG['cache_modreg'])
- {
+ switch ($_CONFIG['cache_modreg']) {
case 'Y': define('__MODREG_Y', " checked"); define('__MODREG_N', ""); break;
case 'N': define('__MODREG_Y', ""); define('__MODREG_N', " checked"); break;
}
- switch ($_CONFIG['cache_refdepth'])
- {
+ switch ($_CONFIG['cache_refdepth']) {
case 'Y': define('__REFDEPTH_Y', " checked"); define('__REFDEPTH_N', ""); break;
case 'N': define('__REFDEPTH_Y', ""); define('__REFDEPTH_N', " checked"); break;
}
- switch ($_CONFIG['cache_refsys'])
- {
+ switch ($_CONFIG['cache_refsys']) {
case 'Y': define('__REFSYS_Y', " checked"); define('__REFSYS_N', ""); break;
case 'N': define('__REFSYS_Y', ""); define('__REFSYS_N', " checked"); break;
}
+ switch ($_CONFIG['cache_themes']) {
+ case 'Y': define('__THEMES_Y', " checked"); define('__THEMES_N', ""); break;
+ case 'N': define('__THEMES_Y', ""); define('__THEMES_N', " checked"); break;
+ }
+ switch ($_CONFIG['cache_admin_menu']) {
+ case 'Y': define('__ADMIN_MENU_Y', " checked"); define('__ADMIN_MENU_N', ""); break;
+ case 'N': define('__ADMIN_MENU_Y', ""); define('__ADMIN_MENU_N', " checked"); break;
+ }
define('__PATH', $_CONFIG['cache_path']);
// Load template
<TR>
<TD colspan="2" class="seperator" height="10"> </TD>
</TR>
+ <TR>
+ <TD align="right" width="350" height="20">
+ {--ADMIN_CACHE_THEMES--}</TD>
+ <TD width="150" style="padding-left: 10px"><INPUT type="radio"
+ name="cache_themes" value="Y" class="admin_normal"{!__THEMES_Y!}> {--YES--}
+ <INPUT type="radio" name="cache_themes" value="N" class="admin_normal"{!__THEMES_N!}> {--NO--}
+ </TD>
+ </TR>
+ <TR>
+ <TD colspan="2" class="seperator" height="10"> </TD>
+ </TR>
+ <TR>
+ <TD align="right" width="350" height="20">
+ {--ADMIN_CACHE_ADMIN_MENU--}</TD>
+ <TD width="150" style="padding-left: 10px"><INPUT type="radio"
+ name="cache_admin_menu" value="Y" class="admin_normal"{!__ADMIN_MENU_Y!}> {--YES--}
+ <INPUT type="radio" name="cache_admin_menu" value="N" class="admin_normal"{!__ADMIN_MENU_N!}> {--NO--}
+ </TD>
+ </TR>
+ <TR>
+ <TD colspan="2" class="seperator" height="10"> </TD>
+ </TR>
<TR>
<TD align="right" width="350" height="20">
{--ADMIN_CACHE_PATH--}:</TD>