From: <tr...@us...> - 2011-10-27 23:15:34
|
Revision: 7988 http://xoops.svn.sourceforge.net/xoops/?rev=7988&view=rev Author: trabis Date: 2011-10-27 23:15:24 +0000 (Thu, 27 Oct 2011) Log Message: ----------- Refactoring... Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.cache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.ini.php XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.locale.php XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/apc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image/scripts/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha/recaptchalib.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/text.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.tar.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/database.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/databasefactory.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/mysqldatabase.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/sqlutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/downloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/file/file.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/file/folder.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/file/xoopsfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/logger/render.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/logger/xoopslogger.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/joint.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/read.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/stats.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/sync.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/write.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/model/xoopsmodel.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/module.textsanitizer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/pagenav.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/preload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tardownloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/template.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/censor/censor.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/censor/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/config.custom.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/flash/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/flash/flash.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/iframe/iframe.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/image/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/image/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/li/li.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/mms/mms.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/mp3/mp3.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/rtsp/rtsp.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/syntaxhighlight/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/syntaxhighlight/syntaxhighlight.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/textfilter/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/textfilter/textfilter.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/ul/ul.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/wiki/config.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/wiki/wiki.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/wmp/wmp.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/textsanitizer/youtube/youtube.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/theme_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/tree.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/uploader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/userutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/utility/xoopsutility.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xml/themesetparser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoops.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/dhtmltextarea/dhtmltextarea.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/dhtmltextarea/editor_registry.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/sampleform.inc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/textarea/editor_registry.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/textarea/textarea.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/xoopseditor.inc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopseditor/xoopseditor.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/form.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formbutton.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formbuttontray.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcheckbox.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcolorpicker.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formcontainer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdatetime.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formdhtmltextarea.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formeditor.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formelement.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formelementtray.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formfile.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhidden.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formhiddentoken.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formlabel.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formpassword.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formradio.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formradioyn.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formraw.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselect.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectcheckgroup.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectcountry.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselecteditor.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectgroup.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectlang.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectmatchoption.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselecttheme.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselecttimezone.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formselectuser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtext.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtextarea.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/formtextdateselect.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/grouppermform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/simpleform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/tableform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/themeform.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslists.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopslocal.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsmailer.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopssecurity.php XoopsCore/branches/2.6.x/2.6.0/htdocs/class/zipdownloader.php XoopsCore/branches/2.6.x/2.6.0/htdocs/edituser.php XoopsCore/branches/2.6.x/2.6.0/htdocs/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/imagemanager.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/calendarjs.php XoopsCore/branches/2.6.x/2.6.0/htdocs/include/common.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.cache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.cache.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.cache.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -12,124 +12,185 @@ */ if (!defined("FRAMEWORKS_ART_FUNCTIONS_CACHE")): -define("FRAMEWORKS_ART_FUNCTIONS_CACHE", true); + define("FRAMEWORKS_ART_FUNCTIONS_CACHE", true); -function mod_generateCacheId_byGroup($groups = null) -{ - global $xoopsUser; + /** + * @param null|array $groups + * @return string + */ + function mod_generateCacheId_byGroup($groups = null) + { + $xoops = Xoops::getInstance(); - if (!empty($groups) && is_array($groups)) { - } elseif (is_object( $xoopsUser )) { - $groups = $xoopsUser->getGroups(); + if (!empty($groups) && is_array($groups)) { + } elseif ($xoops->isUser()) { + $groups = $xoops->user->getGroups(); + } + if (!empty($groups) && is_array($groups)) { + sort($groups); + $contentCacheId = substr(md5(implode(",", $groups) . XOOPS_DB_PASS . XOOPS_DB_NAME), 0, strlen(XOOPS_DB_USER) * 2); + } else { + $contentCacheId = XOOPS_GROUP_ANONYMOUS; + } + + return $contentCacheId; } - if (!empty($groups) && is_array($groups)) { - sort($groups); - $contentCacheId = substr( md5(implode(",", $groups).XOOPS_DB_PASS.XOOPS_DB_NAME), 0, strlen(XOOPS_DB_USER) * 2 ); - } else { - $contentCacheId = XOOPS_GROUP_ANONYMOUS; + + /** + * @param null|array $groups + * @return string + */ + function mod_generateCacheId($groups = null) + { + return mod_generateCacheId_byGroup($groups); } - return $contentCacheId; -} + /** + * @param $data + * @param null|string $name + * @param null|string $dirname + * @param string $root_path + * @return bool + */ + function mod_createFile($data, $name = null, $dirname = null, $root_path = XOOPS_CACHE_PATH) + { + $xoops = Xoops::getInstance(); -function mod_generateCacheId($groups = null) -{ - return mod_generateCacheId_byGroup($groups); -} + $name = ($name) ? $name : strval(time()); + $dirname = ($dirname) ? $dirname : $xoops->moduleDirname; -function mod_createFile($data, $name = null, $dirname = null, $root_path = XOOPS_CACHE_PATH) -{ - global $xoopsModule; + $key = "{$dirname}_{$name}"; + return XoopsCache::write($key, $data); + } - $name = ($name) ? $name : strval(time()); - $dirname = ($dirname) ? $dirname : (is_object($xoopsModule) ? $xoopsModule->getVar("dirname", "n") : "system"); + /** + * @param $data + * @param null|string $name + * @param null|string $dirname + * @return bool + */ + function mod_createCacheFile($data, $name = null, $dirname = null) + { + return mod_createFile($data, $name, $dirname); + } - $key = "{$dirname}_{$name}"; - return XoopsCache::write($key, $data); -} + /** + * @param $data + * @param null|string $name + * @param null|string $dirname + * @param null|array $groups + * @return bool + */ + function mod_createCacheFile_byGroup($data, $name = null, $dirname = null, $groups = null) + { + $name .= mod_generateCacheId_byGroup(); + return mod_createCacheFile($data, $name, $dirname); + } -function mod_createCacheFile($data, $name = null, $dirname = null) -{ - return mod_createFile($data, $name, $dirname); -} + /** + * @param $name + * @param null|string $dirname + * @param string $root_path + * @return mixed|null + */ + function mod_loadFile($name, $dirname = null, $root_path = XOOPS_CACHE_PATH) + { + $xoops = Xoops::getInstance(); -function mod_createCacheFile_byGroup($data, $name = null, $dirname = null, $groups = null) -{ - $name .= mod_generateCacheId_byGroup(); - return mod_createCacheFile($data, $name, $dirname); -} + $data = null; -function mod_loadFile($name, $dirname = null, $root_path = XOOPS_CACHE_PATH) -{ - global $xoopsModule; + if (empty($name)) { + return $data; + } + $dirname = ($dirname) ? $dirname : $xoops->moduleDirname; - $data = null; + $key = "{$dirname}_{$name}"; + return XoopsCache::read($key); + } - if (empty($name)) return $data; - $dirname = ($dirname) ? $dirname : (is_object($xoopsModule) ? $xoopsModule->getVar("dirname", "n") : "system"); + /** + * @param $name + * @param null|string $dirname + * @return mixed|null + */ + function mod_loadCacheFile($name, $dirname = null) + { + $data = mod_loadFile($name, $dirname); + return $data; + } - $key = "{$dirname}_{$name}"; - return XoopsCache::read($key); -} + /** + * @param $name + * @param null|string $dirname + * @param null|array $groups + * @return mixed|null + */ + function mod_loadCacheFile_byGroup($name, $dirname = null, $groups = null) + { + $name .= mod_generateCacheId_byGroup(); + $data = mod_loadFile($name, $dirname); + return $data; + } -function mod_loadCacheFile($name, $dirname = null) -{ - $data = mod_loadFile($name, $dirname); - return $data; -} - -function mod_loadCacheFile_byGroup($name, $dirname = null, $groups = null) -{ - $name .= mod_generateCacheId_byGroup(); - $data = mod_loadFile($name, $dirname); - return $data; -} - -/* Shall we use the function of glob for better performance ? */ - -function mod_clearFile($name = "", $dirname = null, $root_path = XOOPS_CACHE_PATH) -{ - if (empty($dirname)) { - $pattern = ($dirname) ? "{$dirname}_{$name}.*\.php" : "[^_]+_{$name}.*\.php"; - if ($handle = opendir($root_path)) { - while (false !== ($file = readdir($handle))) { - if (is_file($root_path . '/' . $file) && preg_match("/^{$pattern}$/", $file)) { - @unlink($root_path . '/' . $file); + /* Shall we use the function of glob for better performance ? */ + /** + * @param string $name + * @param null|string $dirname + * @param string $root_path + * @return bool + */ + function mod_clearFile($name = "", $dirname = null, $root_path = XOOPS_CACHE_PATH) + { + if (empty($dirname)) { + $pattern = ($dirname) ? "{$dirname}_{$name}.*\.php" : "[^_]+_{$name}.*\.php"; + if ($handle = opendir($root_path)) { + while (false !== ($file = readdir($handle))) { + if (is_file($root_path . '/' . $file) && preg_match("/^{$pattern}$/", $file)) { + @unlink($root_path . '/' . $file); + } } + closedir($handle); } - closedir($handle); + } else { + foreach (glob($root_path . "/{$dirname}_{$name}*.php") as $file) { + @unlink($file); + } } - } else { - foreach (glob($root_path . "/{$dirname}_{$name}*.php") as $file) { - @unlink($file); - } + return true; } - return true; -} -function mod_clearCacheFile($name = "", $dirname = null) -{ - return mod_clearFile($name, $dirname); -} + /** + * @param string $name + * @param null|string $dirname + * @return bool + */ + function mod_clearCacheFile($name = "", $dirname = null) + { + return mod_clearFile($name, $dirname); + } -function mod_clearSmartyCache($pattern = "") -{ - global $xoopsModule; + /** + * @param string $pattern + * @return bool + */ + function mod_clearSmartyCache($pattern = "") + { + $xoops = Xoops::getInstance(); - if (empty($pattern)) { - $dirname = (is_object($xoopsModule) ? $xoopsModule->getVar("dirname", "n") : "system"); - $pattern = "/(^{$dirname}\^.*\.html$|blk_{$dirname}_.*[^\.]*\.html$)/"; - } - if ($handle = opendir(XOOPS_CACHE_PATH)) { - while (false !== ($file = readdir($handle))) { - if (is_file(XOOPS_CACHE_PATH . '/' . $file) && preg_match($pattern, $file)) { - @unlink(XOOPS_CACHE_PATH . '/' . $file); + if (empty($pattern)) { + $dirname = $xoops->moduleDirname; + $pattern = "/(^{$dirname}\^.*\.html$|blk_{$dirname}_.*[^\.]*\.html$)/"; + } + if ($handle = opendir(XOOPS_CACHE_PATH)) { + while (false !== ($file = readdir($handle))) { + if (is_file(XOOPS_CACHE_PATH . '/' . $file) && preg_match($pattern, $file)) { + @unlink(XOOPS_CACHE_PATH . '/' . $file); + } } + closedir($handle); } - closedir($handle); + return true; } - return true; -} endif; ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.config.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -11,104 +11,108 @@ * @subpackage art */ -if(!defined("FRAMEWORKS_ART_FUNCTIONS_CONFIG")): -define("FRAMEWORKS_ART_FUNCTIONS_CONFIG", true); +if (!defined("FRAMEWORKS_ART_FUNCTIONS_CONFIG")): + define("FRAMEWORKS_ART_FUNCTIONS_CONFIG", true); -/** - * Load configs of a module - * - * - * @param string $dirname module dirname - * @return array - */ -function mod_loadConfig($dirname = "") -{ - $xoops = Xoops::getInstance(); - if (empty($dirname) && !$xoops->isModule()) { - return null; - } - $dirname = !empty($dirname) ? $dirname : $xoops->module->getVar("dirname"); - - if ($xoops->isModule() && $xoops->module->getVar("dirname", "n") == $dirname){ - if (!empty($xoops->moduleConfig)) { - $moduleConfig = $xoops->moduleConfig; - } else { + /** + * Load configs of a module + * + * @param string $dirname module dirname + * @return array + */ + function mod_loadConfig($dirname = "") + { + $xoops = Xoops::getInstance(); + if (empty($dirname) && !$xoops->isModule()) { return null; } - } else { + $dirname = !empty($dirname) ? $dirname : $xoops->module->getVar("dirname"); - if (!$moduleConfig = XoopsCache::read("{$dirname}_config")) { - $moduleConfig = mod_fetchConfig($dirname); - XoopsCache::write("{$dirname}_config", $moduleConfig); + if ($xoops->isModule() && $xoops->module->getVar("dirname", "n") == $dirname) { + if (!empty($xoops->moduleConfig)) { + $moduleConfig = $xoops->moduleConfig; + } else { + return null; + } + } else { + + if (!$moduleConfig = XoopsCache::read("{$dirname}_config")) { + $moduleConfig = mod_fetchConfig($dirname); + XoopsCache::write("{$dirname}_config", $moduleConfig); + } } + if ($customConfig = @include XOOPS_ROOT_PATH . "/modules/{$dirname}/include/plugin.php") { + $moduleConfig = array_merge($moduleConfig, $customConfig); + } + return $moduleConfig; } - if ($customConfig = @include XOOPS_ROOT_PATH . "/modules/{$dirname}/include/plugin.php") { - $moduleConfig = array_merge($moduleConfig, $customConfig); + + /** + * @param string $dirname + * @return array + */ + function mod_loadConfg($dirname = "") + { + return mod_loadConfig($dirname); } - return $moduleConfig; -} -function mod_loadConfg($dirname = "") -{ - return mod_loadConfig($dirname); -} + /** + * Fetch configs of a module from database + * + * @param string $dirname module dirname + * @return array + */ + function mod_fetchConfig($dirname = "") + { + if (empty($dirname)) { + return null; + } -/** - * Fetch configs of a module from database - * - * - * @param string $dirname module dirname - * @return array - */ -function mod_fetchConfig($dirname = "") -{ - if (empty($dirname)) { - return null; - } + $xoops = Xoops::getInstance(); + /* @var $module_handler XoopsModuleHandler */ + $module_handler = $xoops->getHandler('module'); + if (!$module = $module_handler->getByDirname($dirname)) { + trigger_error("Module '{$dirname}' does not exist", E_USER_WARNING); + return null; + } + /* @var $config_handler XoopsConfigHandler */ + $config_handler = $xoops->getHandler('config'); + $criteria = new CriteriaCompo(new Criteria('conf_modid', $module->getVar('mid'))); + $configs = $config_handler->getConfigs($criteria); + $moduleConfig = array(); + foreach (array_keys($configs) as $i) { + $moduleConfig[$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput(); + } + unset($module, $configs); - $module_handler = xoops_gethandler('module'); - if (!$module = $module_handler->getByDirname($dirname)) { - trigger_error("Module '{$dirname}' does not exist", E_USER_WARNING); - return null; + return $moduleConfig; } - $config_handler = xoops_gethandler('config'); - $criteria = new CriteriaCompo(new Criteria('conf_modid', $module->getVar('mid'))); - $configs = $config_handler->getConfigs($criteria); - foreach (array_keys($configs) as $i) { - $moduleConfig[$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput(); + function mod_fetchConfg($dirname = "") + { + return mod_fetchConfig($dirname); } - unset($module, $configs); - return $moduleConfig; -} + /** + * clear config cache of a module + * + * + * @param string $dirname module dirname + * @return bool + */ + function mod_clearConfig($dirname = "") + { + if (empty($dirname)) { + return false; + } -function mod_fetchConfg($dirname = "") -{ - return mod_fetchConfig($dirname); -} -/** - * clear config cache of a module - * - * - * @param string $dirname module dirname - * @return bool - */ -function mod_clearConfig($dirname = "") -{ - if (empty($dirname)) { - return false; + return XoopsCache::delete("{$dirname}_config"); } + function mod_clearConfg($dirname = "") + { + return mod_clearConfig($dirname); + } - return XoopsCache::delete("{$dirname}_config"); -} - -function mod_clearConfg($dirname = "") -{ - return mod_clearConfig($dirname); -} - -endif; -?> \ No newline at end of file +endif; \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.ini.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.ini.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.ini.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -63,8 +63,7 @@ if (defined($constant)) { return true; } - return include_once FRAMEWORKS_ROOT_PATH . "/{$dirname}/functions.{$group}" . (empty($group) ? "" - : ".") . "php"; + return include_once FRAMEWORKS_ROOT_PATH . "/{$dirname}/functions.{$group}" . (empty($group) ? "" : ".") . "php"; } @@ -84,13 +83,12 @@ { $xoops = Xoops::getInstance(); - $dirname = !empty($dirname) ? $dirname : $xoops->module->getVar("dirname", "n"); + $dirname = !empty($dirname) ? $dirname : $xoops->moduleDirname; $constant = strtoupper("{$dirname}_functions" . (($group) ? "_{$group}" : "") . "_loaded"); if (defined($constant)) { return true; } - $filename = XOOPS_ROOT_PATH . "/modules/{$dirname}/include/functions.{$group}" . (empty($group) ? "" - : ".") . "php"; + $filename = XOOPS_ROOT_PATH . "/modules/{$dirname}/include/functions.{$group}" . (empty($group) ? "" : ".") . "php"; return include_once $filename; } @@ -107,7 +105,7 @@ function mod_loadRenderer($class, $dirname = "") { $xoops = Xoops::getInstance(); - $dirname = !empty($dirname) ? $dirname : $xoops->module->getVar("dirname", "n"); + $dirname = !empty($dirname) ? $dirname : $xoops->moduleDirname; $renderer = ucfirst($dirname) . ucfirst($class) . "Renderer"; if (!class_exists($renderer)) { require_once XOOPS_ROOT_PATH . "/modules/{$dirname}/class/{$class}.renderer.php"; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.locale.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.locale.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.locale.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -21,7 +21,7 @@ * @subpackage art */ if (!defined("FRAMEWORKS_ART_FUNCTIONS_LOCALE")): -define("FRAMEWORKS_ART_FUNCTIONS_LOCALE", true); + define("FRAMEWORKS_ART_FUNCTIONS_LOCALE", true); endif; ?> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/Frameworks/art/functions.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -11,9 +11,11 @@ * @subpackage art */ -if (defined('XOOPS_ART_FUNCTIONS')) return false; +if (defined('XOOPS_ART_FUNCTIONS')) { + return false; +} define('XOOPS_ART_FUNCTIONS', true); - + include_once dirname(__FILE__) . "/functions.ini.php"; load_functions("cache"); @@ -21,24 +23,28 @@ load_functions("locale"); load_functions("admin"); -if (!class_exists('ArtObject')) - include_once dirname(__FILE__) . "/object.php"; +if (!class_exists('ArtObject')) { + include_once dirname(__FILE__) . "/object.php"; +} /** * get MySQL server version - * + * * In some cases mysql_get_client_info is required instead * - * @return string + * @param null $conn + * @return string */ function mod_getMysqlVersion($conn = null) { static $mysql_version; - if (isset($mysql_version)) return $mysql_version; + if (isset($mysql_version)) { + return $mysql_version; + } if (!is_null($conn)) { - $version = mysql_get_server_info($conn); + $mysql_version = mysql_get_server_info($conn); } else { - $version = mysql_get_server_info(); + $mysql_version = mysql_get_server_info(); } return $mysql_version; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -97,7 +97,7 @@ { $xoops = Xoops::getInstance(); $ret = '<br />'; - if ($xoops->config['debug_mode'] == 1 || $xoops->config['debug_mode'] == 2) { + if ($xoops->getConfig('debug_mode') == 1 || $xoops->getConfig('debug_mode') == 2) { if (!empty($this->_errors)) { foreach ($this->_errors as $errstr) { $ret .= $errstr . '<br/>'; @@ -111,6 +111,4 @@ } return $ret; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ads.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -108,6 +108,4 @@ $userDN = $uname . '@' . $this->ldap_domain_name; return $userDN; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_ldap.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -17,6 +17,7 @@ * @author Pierre-Eric MENUET <pe...@fr...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -202,12 +203,11 @@ */ public function __construct(XoopsDatabase $dao = null) { + $xoops = Xoops::getInstance(); $this->_dao = $dao; - // The config handler object allows us to look at the configuration options that are stored in the database - /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); - $config = $config_handler->getConfigsByCat(XOOPS_CONF_AUTH); - foreach ($config as $key => $val) { + //Configuration options that are stored in the database + $configs = $xoops->getConfigs(XOOPS_CONF_AUTH); + foreach ($configs as $key => $val) { $this->$key = $val; } } @@ -335,6 +335,4 @@ } return $xoopsUser; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_provisionning.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -79,14 +79,13 @@ */ public function __construct(XoopsAuth &$auth_instance) { + $xoops = Xoops::getInstance(); $this->_auth_instance = $auth_instance; - /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); - $config = $config_handler->getConfigsByCat(XOOPS_CONF_AUTH); - foreach ($config as $key => $val) { + $configs = $xoops->getConfigs(XOOPS_CONF_AUTH); + foreach ($configs as $key => $val) { $this->$key = $val; } - $config_gen = $config_handler->getConfigsByCat(XOOPS_CONF); + $config_gen = $xoops->getConfigs(XOOPS_CONF); $this->default_TZ = $config_gen['default_TZ']; $this->theme_set = $config_gen['theme_set']; $this->com_mode = $config_gen['com_mode']; @@ -101,8 +100,9 @@ */ public function getXoopsUser($uname) { + $xoops = Xoops::getInstance(); /* @var $member_handler XoopsMemberHandler */ - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getHandler('member'); $criteria = new Criteria('uname', $uname); $getuser = $member_handler->getUsers($criteria); if (count($getuser) == 1) { @@ -150,9 +150,10 @@ */ public function add($datas, $uname, $pwd = null) { + $xoops = Xoops::getInstance(); $ret = false; /* @var $member_handler XoopsMemberHandler */ - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getHandler('member'); // Create XOOPS Database User $newuser = $member_handler->createUser(); $newuser->setVar('uname', $uname); @@ -177,7 +178,7 @@ $newuser->unsetNew(); return $newuser; } else { - redirect_header(XOOPS_URL . '/user.php', 5, $newuser->getHtmlErrors()); + $xoops->redirect(XOOPS_URL . '/user.php', 5, $newuser->getHtmlErrors()); } return $ret; } @@ -191,11 +192,12 @@ * @param string $pwd * @return bool|XoopsUser */ - public function change(&$xoopsUser, $datas, $uname, $pwd = null) + public function change(XoopsUser &$xoopsUser, $datas, $uname, $pwd = null) { + $xoops = Xoops::getInstance(); $ret = false; /* @var $member_handler XoopsMemberHandler */ - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getHandler('member'); $xoopsUser->setVar('pass', md5(stripslashes($pwd))); $tab_mapping = explode('|', $this->ldap_field_mapping); foreach ($tab_mapping as $mapping) { @@ -207,7 +209,7 @@ if ($member_handler->insertUser($xoopsUser)) { return $xoopsUser; } else { - redirect_header(XOOPS_URL . '/user.php', 5, $xoopsUser->getHtmlErrors()); + $xoops->redirect(XOOPS_URL . '/user.php', 5, $xoopsUser->getHtmlErrors()); } return $ret; } @@ -247,6 +249,4 @@ public function resetpwd() { } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/auth_xoops.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -35,7 +35,7 @@ * * @param XoopsDatabase|null $dao */ - public function __construct($dao = null) + public function __construct(XoopsDatabase $dao = null) { $this->_dao = $dao; $this->auth_method = 'xoops'; @@ -50,14 +50,13 @@ */ public function authenticate($uname, $pwd = null) { + $xoops = Xoops::getInstance(); /* @var $member_handler XoopsMemberHandler */ - $member_handler = xoops_gethandler('member'); + $member_handler = $xoops->getHandler('member'); $user = $member_handler->loginUser($uname, $pwd); if ($user == false) { $this->setErrors(1, _US_INCORRECTLOGIN); } return $user; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/auth/authfactory.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -45,8 +45,7 @@ static $auth_instance; if (!isset($auth_instance)) { /* @var $config_handler XoopsConfigHandler */ - $config_handler = xoops_gethandler('config'); - $authConfig = $config_handler->getConfigsByCat(XOOPS_CONF_AUTH); + $authConfig = $xoops->getConfigs(XOOPS_CONF_AUTH); if (empty($authConfig['auth_method'])) { // If there is a config error, we use xoops $xoops_auth_method = 'xoops'; } else { @@ -82,6 +81,4 @@ } return $auth_instance; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/apc.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/apc.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/apc.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -17,6 +17,7 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); /** @@ -59,12 +60,12 @@ * Called automatically by the cache frontend * To reinitialize the settings call Cache::engine('EngineName', [optional] settings = array()); * - * @param array $setting array of setting for the engine + * @param array $settings array of setting for the engine * @return boolean True if the engine has been successfully initialized, false if not * @see CacheEngine::__defaults * @access public */ - function init($settings = array()) + public function init($settings = array()) { parent::init($settings); return function_exists('apc_cache_info'); @@ -79,7 +80,7 @@ * @return boolean True if the data was succesfully cached, false on failure * @access public */ - function write($key, &$value, $duration) + public function write($key, &$value, $duration) { return apc_store($key, $value, $duration); } @@ -91,7 +92,7 @@ * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it * @access public */ - function read($key) + public function read($key) { return apc_fetch($key); } @@ -103,7 +104,7 @@ * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed * @access public */ - function delete($key) + public function delete($key) { return apc_delete($key); } @@ -114,10 +115,8 @@ * @return boolean True if the cache was succesfully cleared, false otherwise * @access public */ - function clear() + public function clear() { return apc_clear_cache('user'); } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/file.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -311,6 +311,4 @@ } return true; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/memcache.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -179,6 +179,4 @@ } return true; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/model.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -89,7 +89,7 @@ $defaults = array('fields' => array('data', 'expires')); $this->settings = array_merge($defaults, $this->settings); $this->fields = $this->settings['fields']; - $this->model = xoops_getHandler('cachemodel'); + $this->model = Xoops::getInstance()->getHandler('cachemodel'); return true; } @@ -102,7 +102,7 @@ */ public function gc() { - return $this->model->deleteAll(new Criteria($this->fields[1], time, '<= ')); + return $this->model->deleteAll(new Criteria($this->fields[1], 'time', '<= ')); } /** @@ -165,10 +165,8 @@ * @return boolean True if the cache was succesfully cleared, false otherwise * @access public */ - function clear() + public function clear() { return $this->model->deleteAll(); } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xcache.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -168,6 +168,4 @@ } } } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/cache/xoopscache.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -183,7 +183,7 @@ * * @access public */ - function gc() + static function gc() { $_this = XoopsCache::getInstance(); $config = $_this->config(); @@ -419,9 +419,7 @@ */ public function init($settings = array()) { - $this->settings = array_merge(array( - 'duration' => 31556926, 'probability' => 100 - ), $settings); + $this->settings = array_merge(array('duration' => 31556926, 'probability' => 100), $settings); return true; } @@ -494,6 +492,4 @@ { return $this->settings; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.image.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.image.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -34,6 +34,4 @@ 'skip_characters' => array( 'o', '0', 'i', 'l', '1' ) -); // characters that should not be used - -?> \ No newline at end of file +); // characters that should not be used \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -30,6 +30,4 @@ 'name' => 'xoopscaptcha', // captcha name 'skipmember' => true, // Skip CAPTCHA check for members 'maxattempts' => 10, // Maximum attempts for each session -); - -?> \ No newline at end of file +); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.recaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.recaptcha.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/config.recaptcha.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -25,5 +25,4 @@ 'public_key' => 'YourPublicApiKey', 'theme' => 'white', // 'red' | 'white' | 'blackglass' | 'clean' | 'custom' 'lang' => _LANGCODE -); -?> \ No newline at end of file +); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image/scripts/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image/scripts/image.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image/scripts/image.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -79,12 +79,18 @@ */ public $oImage; + /** + * Constructor + */ public function __construct() { $this->captcha_handler = XoopsCaptcha::getInstance(); $this->config = $this->captcha_handler->loadConfig("image"); } + /** + * @return void + */ public function loadImage() { $this->generateCode(); @@ -165,13 +171,14 @@ * Create CAPTCHA iamge with GD * Originated by DuGris' SecurityImage */ - // --------------------------------------------------------------------------- // - // Class : SecurityImage 1.5 // - // Author: DuGris aka L. Jen <http://www.dugris.info> // - // Email : Du...@wa... // - // Licence: GNU // - // Project: The XOOPS Project // - // --------------------------------------------------------------------------- // + + /** + * @copyright The XOOPS project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @author DuGris aka L. Jen <http://www.dugris.info> <Du...@wa...> + * @version $Id$ + * @return void + */ public function createImageGd() { $this->loadFont(); @@ -219,12 +226,18 @@ imagedestroy($this->oImage); } + /** + * @return void + */ public function loadFont() { $fonts = $this->getList("fonts", "ttf"); $this->font = XOOPS_ROOT_PATH . "/class/captcha/image/fonts/" . $fonts[array_rand($fonts)]; } + /** + * @return void + */ public function setImageSize() { $MaxCharWidth = 0; @@ -414,7 +427,7 @@ /**#@-*/ /** - * Create CAPTCHA image with BMP + * Create CAPTCHA image with BMP * * @param string $file * @return string @@ -434,6 +447,4 @@ } $image_handler = new XoopsCaptchaImageHandler(); -$image_handler->loadImage(); - -?> \ No newline at end of file +$image_handler->loadImage(); \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/image.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -19,6 +19,7 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); class XoopsCaptchaImage extends XoopsCaptchaMethod @@ -85,6 +86,4 @@ { return '<img id="' . ($this->config["name"]) . '" src="' . XOOPS_URL . '/class/captcha/image/scripts/image.php" onclick=\'this.src="' . XOOPS_URL . '/class/captcha/image/scripts/image.php?refresh="+Math.random()' . '\' style="cursor: pointer; vertical-align: middle;" alt="" />'; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha/recaptchalib.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha/recaptchalib.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha/recaptchalib.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -201,6 +201,10 @@ array('domains' => $domain, 'app' => $appname)); } +/** + * @param $val + * @return string + */ function _recaptcha_aes_pad($val) { $block_size = 16; @@ -296,6 +300,4 @@ $url = recaptcha_mailhide_url($pubkey, $privkey, $email); return htmlentities($emailparts[0]) . "<a href='" . htmlentities($url) . "' onclick=\"window.open('" . htmlentities($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities($emailparts [1]); -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/recaptcha.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -70,6 +70,4 @@ } return $is_valid; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/text.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/text.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/text.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -17,6 +17,7 @@ * @author Taiwen Jiang <ph...@us...> * @version $Id$ */ + defined('XOOPS_ROOT_PATH') or die('Restricted access'); class XoopsCaptchaText extends XoopsCaptchaMethod @@ -54,6 +55,4 @@ } return '<span style="font-style: normal; font-weight: bold; font-size: 100%; font-color: #333; border: 1px solid #333; padding: 1px 5px;">' . $expression . '</span>'; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/captcha/xoopscaptcha.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -27,44 +27,45 @@ /** * @var bool */ - var $active; + public $active; /** * @var XoopsCaptchaMethod */ - var $handler; + public $handler; /** * @var string */ - var $path_basic; + public $path_basic; /** * @var string */ - var $path_plugin; + public $path_plugin; /** * @var string */ - var $name; + public $name; /** * @var array */ - var $config = array(); + public $config = array(); /** * @var array */ - var $message = array(); + public $message = array(); /** * construct */ public function __construct() { - xoops_loadLanguage('captcha'); + $xoops = Xoops::getInstance(); + $xoops->loadLanguage('captcha'); // Load static configurations $this->path_basic = XOOPS_ROOT_PATH . '/class/captcha'; $this->path_plugin = XOOPS_ROOT_PATH . '/Frameworks/captcha'; @@ -279,7 +280,7 @@ * @param bool $clearSession * @return bool */ - function destroyGarbage($clearSession = false) + public function destroyGarbage($clearSession = false) { $this->loadHandler(); $this->handler->destroyGarbage(); @@ -384,12 +385,12 @@ /** * @var array */ - var $config; + public $config; /** * @var string */ - var $code; + public $code; /** * XoopsCaptchaMethod::__construct() @@ -428,7 +429,7 @@ * * @return string */ - function getCode() + public function getCode() { return strval($this->code); } @@ -438,7 +439,7 @@ * * @return string */ - function render() + public function render() { return ''; } @@ -446,7 +447,7 @@ /** * @return string */ - function renderValidationJS() + public function renderValidationJS() { return ''; } @@ -475,6 +476,4 @@ return true; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.tar.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.tar.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.tar.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -653,6 +653,4 @@ } return $file; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/class.zipfile.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -163,6 +163,4 @@ pack('V', strlen($data)) . // offset to start of central dir "\x00\x00"; // .zip file comment length } // end of the 'file()' method -} // end of the 'zipfile' class - -?> \ No newline at end of file +} // end of the 'zipfile' class \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/commentrenderer.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -27,21 +27,33 @@ */ class XoopsCommentRenderer { + /** - * *#@+ - * - * @access private + * @var XoopsTpl */ private $_tpl; + + /** + * @var array + */ private $_comments = array(); + + /** + * @var bool + */ private $_useIcons = true; + + /** + * @var bool + */ private $_doIconCheck = false; - private $_statusText; /** - * *#@- + * @var array */ + private $_statusText; + /** * Constructor * @@ -315,7 +327,7 @@ $poster['id'] = intval($poster_id); if ($poster['id'] > 0) { /* @var $memberHandler XoopsMemberHandler */ - $memberHandler = xoops_gethandler('member'); + $memberHandler = Xoops::getInstance()->getHandler('member'); $com_poster = $memberHandler->getUser($poster['id']); if (!is_object($com_poster)) { $poster['id'] = 0; @@ -336,16 +348,17 @@ { $poster['id'] = intval($poster_id); if ($poster['id'] > 0) { - /* @var $memberHandler XoopsMemberHandler */ - $memberHandler = xoops_gethandler('member'); - $com_poster = $memberHandler->getUser($poster['id']); + $xoops = Xoops::getInstance(); + /* @var $member_handler XoopsMemberHandler */ + $member_handler = $xoops->getHandler('member'); + $com_poster = $member_handler->getUser($poster['id']); if (is_object($com_poster)) { $poster['uname'] = XoopsUserUtility::getUnameFromId($poster['id'], false, true); $poster_rank = $com_poster->rank(); $poster['rank_image'] = ($poster_rank['image'] != '') ? $poster_rank['image'] : 'blank.gif'; $poster['rank_title'] = $poster_rank['title']; $poster['avatar'] = $com_poster->getVar('user_avatar'); - $poster['regdate'] = formatTimestamp($com_poster->getVar('user_regdate'), 's'); + $poster['regdate'] = $xoops->formatTimestamp($com_poster->getVar('user_regdate'), 's'); $poster['from'] = $com_poster->getVar('user_from'); $poster['postnum'] = $com_poster->getVar('posts'); $poster['status'] = $com_poster->isOnline() ? _CM_ONLINE : ''; @@ -388,6 +401,4 @@ } return '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />'; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php 2011-10-27 19:33:34 UTC (rev 7987) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/criteria.php 2011-10-27 23:15:24 UTC (rev 7988) @@ -39,7 +39,6 @@ protected $order = 'ASC'; /** - * * @var string */ protected $sort = ''; @@ -59,7 +58,6 @@ protected $start = 0; /** - * * @var string */ protected $groupby = ''; @@ -90,7 +88,6 @@ } /** - * * @return string */ public function getSort() @@ -99,7 +96,6 @@ } /** - * * @param string $order */ public function setOrder($order) @@ -110,7 +106,6 @@ } /** - * * @return string */ public function getOrder() @@ -119,7 +114,6 @@ } /** - * * @param int $limit */ public function setLimit($limit = 0) @@ -128,7 +122,6 @@ } /** - * * @return int */ public function getLimit() @@ -137,7 +130,6 @@ } /** - * * @param int $start */ public function setStart($start = 0) @@ -146,7 +138,6 @@ } /** - * * @return int */ public function getStart() @@ -155,7 +146,6 @@ } /** - * * @param string $group */ public function setGroupby($group) @@ -164,16 +154,12 @@ } /** - * * @return string */ public function getGroupby() { return $this->groupby ? " GROUP BY {$this->groupby}" : ""; } - /** - * *#@- - */ } /** @@ -288,13 +274,28 @@ class Criteria extends CriteriaElement { /** - * * @var string */ protected $prefix; + + /** + * @var string + */ protected $function; + + /** + * @var string + */ protected $column; + + /** + * @var string + */ protected $operator; + + /** + * @var mixed + */ protected $value; /** @@ -390,6 +391,4 @@ $cond = $this->render(); return empty($cond) ? '' : "WHERE {$cond}"; } -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/database/database.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/c... [truncated message content] |