From: <var...@us...> - 2016-05-25 10:30:30
|
Revision: 9852 http://sourceforge.net/p/phpwiki/code/9852 Author: vargenau Date: 2016-05-25 10:30:28 +0000 (Wed, 25 May 2016) Log Message: ----------- Be case consistent Modified Paths: -------------- trunk/doc/HISTORY trunk/lib/FileFinder.php trunk/lib/Google.php trunk/lib/IniConfig.php trunk/lib/PageType.php trunk/lib/WikiDB/ADODB.php trunk/lib/WikiDB/PDO.php trunk/lib/WikiDB/backend/ADODB_sqlite.php trunk/lib/WikiTheme.php trunk/lib/WikiUser.php trunk/lib/loadsave.php trunk/lib/main.php trunk/lib/plugin/SqlResult.php trunk/lib/plugin/SystemInfo.php trunk/lib/plugin/WikiTranslation.php trunk/lib/stdlib.php trunk/lib/upgrade.php trunk/pgsrc/ReleaseNotes Modified: trunk/doc/HISTORY =================================================================== --- trunk/doc/HISTORY 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/doc/HISTORY 2016-05-25 10:30:28 UTC (rev 9852) @@ -59,7 +59,7 @@ * new Error-style with collapsed output of repeated messages * trim pagenames to avoid abuse * no double login page header, better login msg. -* improved FileFinder include_path logic (NormalizeLocalFileName, ...) +* improved FileFinder include_path logic (normalizeLocalFileName, ...) ** init global FileFinder to add proper include paths at startup adds PHPWIKI_DIR if started from another dir, lib/pear also ** fix slashify for Windows Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/FileFinder.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -456,7 +456,7 @@ } // Search PHP's include_path to find file or directory. -function FindFile($file, $missing_okay = false, $slashify = false) +function findFile($file, $missing_okay = false, $slashify = false) { static $finder; if (!isset($finder)) { @@ -478,7 +478,7 @@ // Search PHP's include_path to find file or directory. // Searches for "locale/$LANG/$file", then for "$file". -function FindLocalizedFile($file, $missing_okay = false, $re_init = false) +function findLocalizedFile($file, $missing_okay = false, $re_init = false) { static $finder; if ($re_init or !isset($finder)) @@ -486,7 +486,7 @@ return $finder->findFile($file, $missing_okay); } -function FindLocalizedButtonFile($file, $missing_okay = false, $re_init = false) +function findLocalizedButtonFile($file, $missing_okay = false, $re_init = false) { static $buttonfinder; if ($re_init or !isset($buttonfinder)) @@ -501,9 +501,9 @@ * require_once 'lib/file.php' loading style. * Doesn't expand "~" or symlinks yet. truename would be perfect. * - * NormalizeLocalFileName("lib/config.php") => /home/user/phpwiki/lib/config.php + * normalizeLocalFileName("lib/config.php") => /home/user/phpwiki/lib/config.php */ -function NormalizeLocalFileName($file) +function normalizeLocalFileName($file) { static $finder; if (!isset($finder)) { @@ -525,7 +525,7 @@ /** * Prefixes with DATA_PATH and slashify */ -function NormalizeWebFileName($file) +function normalizeWebFileName($file) { static $finder; if (!isset($finder)) { Modified: trunk/lib/Google.php =================================================================== --- trunk/lib/Google.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/Google.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -170,7 +170,7 @@ } else $this->license_key = GOOGLE_LICENSE_KEY; - $this->soapclient = new soapclient(SERVER_URL . NormalizeWebFileName("GoogleSearch.wsdl"), "wsdl"); + $this->soapclient = new soapclient(SERVER_URL . normalizeWebFileName("GoogleSearch.wsdl"), "wsdl"); $this->proxy = $this->soapclient->getProxy(); if ($maxResults > 10) $maxResults = 10; if ($maxResults < 1) $maxResults = 1; Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/IniConfig.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -512,16 +512,16 @@ $GLOBALS['INCLUDE_PATH'] = $rs['INCLUDE_PATH']; } $rs['PLUGIN_CACHED_CACHE_DIR'] = TEMP_DIR . '/cache'; - if (!FindFile($rs['PLUGIN_CACHED_CACHE_DIR'], 1)) { // [29ms] - FindFile(TEMP_DIR, false, 1); // TEMP must exist! + if (!findFile($rs['PLUGIN_CACHED_CACHE_DIR'], 1)) { // [29ms] + findFile(TEMP_DIR, false, 1); // TEMP must exist! mkdir($rs['PLUGIN_CACHED_CACHE_DIR'], 0777); } // will throw an error if not exists. - define('PLUGIN_CACHED_CACHE_DIR', FindFile($rs['PLUGIN_CACHED_CACHE_DIR'], false, 1)); + define('PLUGIN_CACHED_CACHE_DIR', findFile($rs['PLUGIN_CACHED_CACHE_DIR'], false, 1)); } else { define('PLUGIN_CACHED_CACHE_DIR', $rs['PLUGIN_CACHED_CACHE_DIR']); // will throw an error if not exists. - FindFile(PLUGIN_CACHED_CACHE_DIR); + findFile(PLUGIN_CACHED_CACHE_DIR); } } @@ -556,7 +556,7 @@ global $FieldSeparator, $AllActionPages; global $DBParams; // init FileFinder to add proper include paths - FindFile("lib/interwiki.map", true); + findFile("lib/interwiki.map", true); // $FieldSeparator = "\xFF"; // this byte should never appear in utf-8 $FieldSeparator = "\xFF"; @@ -735,7 +735,7 @@ // If user has not defined PHPWIKI_DIR, and we need it if (!defined('PHPWIKI_DIR') and !file_exists("themes/default")) { - $themes_dir = FindFile("themes"); + $themes_dir = findFile("themes"); define('PHPWIKI_DIR', dirname($themes_dir)); } @@ -884,7 +884,7 @@ // 1. If the script is not index.php but something like "de", on a different path // then bindtextdomain() fails, but after chdir to the correct path it will work okay. // 2. But the weird error "Undefined variable: bindtextdomain" is generated then. - $bindtextdomain_path = FindFile("locale", false, true); + $bindtextdomain_path = findFile("locale", false, true); if (isWindows()) $bindtextdomain_path = str_replace("/", "\\", $bindtextdomain_path); $bindtextdomain_real = @bindtextdomain("phpwiki", $bindtextdomain_path); Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/PageType.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -212,8 +212,8 @@ $url = getUploadFilePath(); // calculate to a relative local path to /uploads for PDF images. $doc_root = $request->get("DOCUMENT_ROOT"); - $ldir = NormalizeLocalFileName($url); - $wikiroot = NormalizeLocalFileName(''); + $ldir = normalizeLocalFileName($url); + $wikiroot = normalizeLocalFileName(''); if (isWindows()) { $ldir = strtolower($ldir); $doc_root = strtolower($doc_root); @@ -222,7 +222,7 @@ if (string_starts_with($ldir, $doc_root)) { $link_prefix = substr($url, strlen($doc_root)); } elseif (string_starts_with($ldir, $wikiroot)) { - $link_prefix = NormalizeWebFileName(substr($url, strlen($wikiroot))); + $link_prefix = normalizeWebFileName(substr($url, strlen($wikiroot))); } } Modified: trunk/lib/WikiDB/ADODB.php =================================================================== --- trunk/lib/WikiDB/ADODB.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/WikiDB/ADODB.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -26,7 +26,7 @@ if (is_string($dbparams['dsn'])) $dbparams['dsn'] = $backend . ':' . substr($dbparams['dsn'], 6); } - if (FindFile("lib/WikiDB/backend/ADODB_" . $backend . ".php", true)) { + if (findFile("lib/WikiDB/backend/ADODB_" . $backend . ".php", true)) { $backend = 'ADODB_' . $backend; } else { $backend = 'ADODB'; Modified: trunk/lib/WikiDB/PDO.php =================================================================== --- trunk/lib/WikiDB/PDO.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/WikiDB/PDO.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -25,7 +25,7 @@ elseif (preg_match('/^(\w+):/', $dbparams['dsn'], $m)) $backend = $m[1]; // Do we have a override? Currently none: mysql, sqlite, oci, mssql - if (FindFile("lib/WikiDB/backend/PDO_$backend.php", true)) { + if (findFile("lib/WikiDB/backend/PDO_$backend.php", true)) { $backend = 'PDO_' . $backend; } else { $backend = 'PDO'; Modified: trunk/lib/WikiDB/backend/ADODB_sqlite.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_sqlite.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/WikiDB/backend/ADODB_sqlite.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -17,7 +17,7 @@ if (!file_exists($parsed['database'])) { // creating the empty database $db = $parsed['database']; - $schema = FindFile("schemas/sqlite-initialize.sql"); + $schema = findFile("schemas/sqlite-initialize.sql"); `sqlite $db < $schema`; `echo "CREATE USER wikiuser" | sqlite $db`; } Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/WikiTheme.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -227,8 +227,8 @@ global $request; $this->_name = $theme_name; - $this->_themes_dir = NormalizeLocalFileName("themes"); - $this->_path = defined('PHPWIKI_DIR') ? NormalizeLocalFileName("") : ""; + $this->_themes_dir = normalizeLocalFileName("themes"); + $this->_path = defined('PHPWIKI_DIR') ? normalizeLocalFileName("") : ""; $this->_theme = "themes/$theme_name"; $this->_parents = array(); Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/WikiUser.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -1638,7 +1638,7 @@ function sanify($value) { - if (!empty($value) and FindFile($this->_themefile($value))) + if (!empty($value) and findFile($this->_themefile($value))) return $value; return $this->default_value; } Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/loadsave.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -558,12 +558,12 @@ // check if the dumped file will be accessible from outside $doc_root = $request->get("DOCUMENT_ROOT"); if ($WikiTheme->DUMP_MODE == 'HTML') { - $ldir = NormalizeLocalFileName($directory); - $wikiroot = NormalizeLocalFileName(''); + $ldir = normalizeLocalFileName($directory); + $wikiroot = normalizeLocalFileName(''); if (string_starts_with($ldir, $doc_root)) { $link_prefix = substr($directory, strlen($doc_root)) . "/"; } elseif (string_starts_with($ldir, $wikiroot)) { - $link_prefix = NormalizeWebFileName(substr($directory, strlen($wikiroot))) . "/"; + $link_prefix = normalizeWebFileName(substr($directory, strlen($wikiroot))) . "/"; } else { $prefix = ''; if (isWindows()) { @@ -1126,7 +1126,7 @@ $error_html = sprintf(" " . _("%s: not defined"), "INTERWIKI_MAP_FILE"); $goback = true; } - $mapfile = FindFile(INTERWIKI_MAP_FILE, 1); + $mapfile = findFile(INTERWIKI_MAP_FILE, 1); if (!$goback && !file_exists($mapfile)) { $error_html = sprintf(" " . _("File “%s” not found."), INTERWIKI_MAP_FILE); $goback = true; @@ -1401,7 +1401,7 @@ // with broken dirname or basename functions. // FIXME: windows uses \ and : if (is_integer(strpos($file_or_dir, "/"))) { - $newfile = FindFile($file_or_dir, true); + $newfile = findFile($file_or_dir, true); // Panic. urlencoded by the browser (e.g. San%20Diego => San Diego) if (!$newfile) $file_or_dir = dirname($file_or_dir) . "/" @@ -1498,9 +1498,9 @@ StartLoadDump($request, _("Loading up virgin wiki")); - $pgsrc = FindLocalizedFile(WIKI_PGSRC); - $default_pgsrc = FindFile(DEFAULT_WIKI_PGSRC); - $theme_pgsrc = FindFile("themes/".THEME."/".WIKI_PGSRC, true); + $pgsrc = findLocalizedFile(WIKI_PGSRC); + $default_pgsrc = findFile(DEFAULT_WIKI_PGSRC); + $theme_pgsrc = findFile("themes/".THEME."/".WIKI_PGSRC, true); $request->setArg('overwrite', true); // Load theme pgsrc, if it exists @@ -1540,10 +1540,10 @@ $epage = urlencode($page); if (!$dbi->isWikiPage($page)) { // translated version provided? - if ($lf = FindLocalizedFile($pgsrc . $finder->_pathsep . $epage, 1)) { + if ($lf = findLocalizedFile($pgsrc . $finder->_pathsep . $epage, 1)) { LoadAny($request, $lf); } else { // load english version of required action page - LoadAny($request, FindFile(DEFAULT_WIKI_PGSRC . $finder->_pathsep . urlencode($f))); + LoadAny($request, findFile(DEFAULT_WIKI_PGSRC . $finder->_pathsep . urlencode($f))); $page = $f; } } Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/main.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -171,7 +171,7 @@ if (isset($this->_user->_authhow) and $this->_user->_authhow == 'session') $user_lang = $GLOBALS['LANG']; update_locale($user_lang); - FindLocalizedButtonFile(".", 'missing_ok', 'reinit'); + findLocalizedButtonFile(".", 'missing_ok', 'reinit'); } //if (empty($_lang->lang) and $GLOBALS['LANG'] != $_lang->default_value) ; } Modified: trunk/lib/plugin/SqlResult.php =================================================================== --- trunk/lib/plugin/SqlResult.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/plugin/SqlResult.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -83,7 +83,7 @@ function getDsn($alias) { - $ini = parse_ini_file(FindFile("config/SqlResult.ini")); + $ini = parse_ini_file(findFile("config/SqlResult.ini")); return $ini[$alias]; } Modified: trunk/lib/plugin/SystemInfo.php =================================================================== --- trunk/lib/plugin/SystemInfo.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/plugin/SystemInfo.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -453,7 +453,7 @@ function available_plugins() { - $fileset = new FileSet(FindFile('lib/plugin'), '*.php'); + $fileset = new FileSet(findFile('lib/plugin'), '*.php'); $list = $fileset->getFiles(); natcasesort($list); reset($list); Modified: trunk/lib/plugin/WikiTranslation.php =================================================================== --- trunk/lib/plugin/WikiTranslation.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/plugin/WikiTranslation.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -437,7 +437,7 @@ if (!is_array($exclude)) $exclude = $pagelist->explodePageList($exclude, false, $sortby, $limit, $exclude); - $path = FindLocalizedFile(WIKI_PGSRC); + $path = findLocalizedFile(WIKI_PGSRC); $pgsrc = new FileSet($path); foreach ($pgsrc->getFiles($exclude, $sortby, $limit) as $pagename) { $pagename = urldecode($pagename); @@ -474,7 +474,7 @@ // navbar links, actionpages, and admin requests case 'buttons': $buttons = $GLOBALS['AllActionPages']; - $fileset = new FileSet(FindFile("themes/MacOSX/buttons/en"), + $fileset = new FileSet(findFile("themes/MacOSX/buttons/en"), "*.png"); foreach ($fileset->getFiles() as $file) { $b = urldecode(substr($file, 0, -4)); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/stdlib.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -465,7 +465,7 @@ // Correct silently the most common error if ($url != $ori_url and empty($arr) and !preg_match("/^http/", $url)) { // space belongs to the path - $file = NormalizeLocalFileName($ori_url); + $file = normalizeLocalFileName($ori_url); if (file_exists($file)) { $link = HTML::img(array('src' => $ori_url)); trigger_error( @@ -508,9 +508,9 @@ elseif (preg_match("/^http/", $url)) { // external url $size = @getimagesize($url); } else { // local file - if (file_exists($file = NormalizeLocalFileName($url))) { // here + if (file_exists($file = normalizeLocalFileName($url))) { // here $size = @getimagesize($file); - } elseif (file_exists(NormalizeLocalFileName(urldecode($url)))) { + } elseif (file_exists(normalizeLocalFileName(urldecode($url)))) { $size = @getimagesize($file); $link->setAttr('src', rawurldecode($url)); } elseif (string_starts_with($url, getUploadDataPath())) { // there Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/lib/upgrade.php 2016-05-25 10:30:28 UTC (rev 9852) @@ -134,10 +134,10 @@ $this->_rename_page_helper("_GroupInfo", "GroupAuthInfo"); //never officially existed $this->_rename_page_helper("InterWikiKarte", "InterWikiListe"); // german only - $path = FindFile('pgsrc'); + $path = findFile('pgsrc'); $pgsrc = new FileSet($path); // most actionpages have the same name as the plugin - $loc_path = FindLocalizedFile('pgsrc'); + $loc_path = findLocalizedFile('pgsrc'); foreach ($pgsrc->getFiles() as $filename) { if (substr($filename, -1, 1) == '~') continue; if (substr($filename, -5, 5) == '.orig') continue; @@ -146,7 +146,7 @@ $translation = __($pagename); if ($translation == $pagename) $this->doPgsrcUpdate($pagename, $path, $filename); - elseif (FindLocalizedFile('pgsrc/' . urlencode($translation), 1)) + elseif (findLocalizedFile('pgsrc/' . urlencode($translation), 1)) $this->doPgsrcUpdate($translation, $loc_path, urlencode($translation)); else $this->doPgsrcUpdate($pagename, $path, $filename); } @@ -184,9 +184,9 @@ } $translation = __("HomePage"); if ($translation == "HomePage") { - $path = FindFile(WIKI_PGSRC); + $path = findFile(WIKI_PGSRC); } else { - $path = FindLocalizedFile(WIKI_PGSRC); + $path = findLocalizedFile(WIKI_PGSRC); } $pgsrc = new FileSet($path); // fixme: verification, ... @@ -943,7 +943,7 @@ { $o_filename = $filename; if (!file_exists($filename)) - $filename = FindFile($filename); + $filename = findFile($filename); if (!file_exists($filename)) return array(false, sprintf(_("File “%s” not found."), $o_filename)); $found = false; Modified: trunk/pgsrc/ReleaseNotes =================================================================== --- trunk/pgsrc/ReleaseNotes 2016-05-25 10:17:43 UTC (rev 9851) +++ trunk/pgsrc/ReleaseNotes 2016-05-25 10:30:28 UTC (rev 9852) @@ -614,7 +614,7 @@ * new Error-style with collapsed output of repeated messages * whitespace trim pagenames to avoid abuse * no double login page header, better login msg. -* improved ~FileFinder include_path logic (~NormalizeLocalFileName, ...) +* improved ~FileFinder include_path logic (~normalizeLocalFileName, ...) ** init global ~FileFinder to add proper include paths at startup adds PHPWIKI_DIR to the front if started from another dir, lib/pear to the end. ** fix slashify for Windows This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |