X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fextensions.php;h=7f43bbac09bc8c96c556acbe5aa17a40cdd3728e;hb=c99c15da4f0f45ea20be40a1320112e7af83af90;hp=dc22eaeb7a42c826ef6d44ca477ab41dc80deefb;hpb=e1653405d28923c78b2e292125306ccf61138f24;p=mailer.git diff --git a/inc/extensions.php b/inc/extensions.php index dc22eaeb7a..7f43bbac09 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -70,17 +70,17 @@ function EXTENSION_REGISTER($ext_name, $id, $dry_run=false) if (!empty($UPDATE_NOTES)) { // Update notes found - $NOTES .= "v".$EXT_VER.":
".$UPDATE_NOTES."

\n"; + $NOTES .= "v".$EXT_VER.":
".$UPDATE_NOTES."

\n"; $UPDATE_NOTES = ""; } elseif (($EXT_VER == "0.0") || ($EXT_VER == "0.0.0")) { // Initial release - $NOTES .= "v".$EXT_VER.":
".INITIAL_RELEASE."

\n"; + $NOTES .= "v".$EXT_VER.":
".INITIAL_RELEASE."

\n"; } else { - $NOTES .= "v".$EXT_VER.":
".NO_UPDATE_NOTES."

\n"; + $NOTES .= "v".$EXT_VER.":
".NO_UPDATE_NOTES."

\n"; } } } @@ -271,9 +271,9 @@ function EXT_IS_ACTIVE ($ext_name, $ignore_admin=false, $ignore_cache=false) if ((!mxchange_installed) || (mxchange_installing) || (empty($ext_name))) return false; // Extension's file name will also be checked - $FILE = PATH."inc/extensions/ext-".$ext_name.".php"; - if ((!file_exists($FILE)) && (!is_readable($FILE))) return false; - //* DEBUG: */ echo "*".$ext_name."*
"; + $file = PATH."inc/extensions/ext-".$ext_name.".php"; + if ((!file_exists($file)) && (!is_readable($file))) return false; + //* DEBUG: */ echo "*".$ext_name."*
"; // Failed is the default $ret = false; @@ -319,24 +319,22 @@ function EXT_IS_ACTIVE ($ext_name, $ignore_admin=false, $ignore_cache=false) ) ); } -// -function GET_EXT_VERSION ($ext_name) -{ - global $EXTENSIONS, $CONFIG; +// Get version from extensions +function GET_EXT_VERSION ($ext_name) { + global $EXTENSIONS, $CONFIG, $CACHE; + $ret = false; + // Extensions are all inactive during installation if ((!mxchange_installed) || (mxchange_installing)) return ""; // Is the cache written? - if (!empty($EXTENSIONS['ext_version'][$ext_name])) - { + if (!empty($EXTENSIONS['ext_version'][$ext_name])) { // Load data from cache $ret = $EXTENSIONS['ext_version'][$ext_name]; // Count cache hits - if (isset($CONFIG['cache_hits'])) $CONFIG['cache_hits']++; - } - else - { + if (isset($CONFIG['cache_hits'])) $CONFIG['cache_hits']++; else $CONFIG['cache_hits'] = 1; + } elseif (!is_object($CACHE)) { // Load from database $result = SQL_QUERY_ESC("SELECT ext_version FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1", array($ext_name), __FILE__, __LINE__); @@ -390,17 +388,17 @@ function EXTENSION_UPDATE($file, $ext, $EXT_VER, $dry_run=false) if (!empty($UPDATE_NOTES)) { // Update notes found - $NOTES .= "v".$EXT_VER.":
".$UPDATE_NOTES."

\n"; + $NOTES .= "v".$EXT_VER.":
".$UPDATE_NOTES."

\n"; $UPDATE_NOTES = ""; } elseif ($EXT_VER == "0.0") { // Initial release - $NOTES .= "v".$EXT_VER.":
".INITIAL_RELEASE."

\n"; + $NOTES .= "v".$EXT_VER.":
".INITIAL_RELEASE."

\n"; } else { - $NOTES .= "v".$EXT_VER.":
".NO_UPDATE_NOTES."

\n"; + $NOTES .= "v".$EXT_VER.":
".NO_UPDATE_NOTES."

\n"; } }