From: <var...@us...> - 2015-01-27 10:27:10
|
Revision: 9493 http://sourceforge.net/p/phpwiki/code/9493 Author: vargenau Date: 2015-01-27 10:27:03 +0000 (Tue, 27 Jan 2015) Log Message: ----------- Use upper case for ZIP and HTML Modified Paths: -------------- trunk/lib/WikiPluginCached.php trunk/lib/main.php trunk/lib/ziplib.php Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2015-01-27 10:26:36 UTC (rev 9492) +++ trunk/lib/WikiPluginCached.php 2015-01-27 10:27:03 UTC (rev 9493) @@ -840,7 +840,7 @@ // cache empty, but image maps have to be created _inline_ // so ask user to reload wiki page instead if (($plugin->getPluginType() & PLUGIN_CACHED_MAP) && PLUGIN_CACHED_FORCE_SYNCMAP) { - $errortext = _("Image map expired. Reload wiki page to recreate its html part."); + $errortext = _("Image map expired. Reload wiki page to recreate its HTML part."); $this->printError($errorformat, $errortext); } Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2015-01-27 10:26:36 UTC (rev 9492) +++ trunk/lib/main.php 2015-01-27 10:27:03 UTC (rev 9493) @@ -564,7 +564,7 @@ $actionDescriptions = array('browse' => _("view this page"), 'diff' => _("diff this page"), - 'dumphtml' => _("dump html pages"), + 'dumphtml' => _("dump HTML pages"), 'dumpserial' => _("dump serial pages"), 'edit' => _("edit this page"), 'rename' => _("rename this page"), @@ -575,13 +575,13 @@ 'purge' => _("purge this page"), 'remove' => _("remove this page"), 'unlock' => _("unlock this page"), - 'upload' => _("upload a zip dump"), + 'upload' => _("upload a ZIP dump"), 'verify' => _("verify the current action"), 'viewsource' => _("view the source of this page"), 'xmlrpc' => _("access this wiki via XML-RPC"), 'soap' => _("access this wiki via SOAP"), - 'zip' => _("download a zip dump from this wiki"), - 'ziphtml' => _("download a html zip dump from this wiki") + 'zip' => _("download a ZIP dump from this wiki"), + 'ziphtml' => _("download a HTML ZIP dump from this wiki") ); } if (in_array($action, array_keys($actionDescriptions))) @@ -608,7 +608,7 @@ $disallowedActionDescriptions = array('browse' => _("Browsing pages"), 'diff' => _("Diffing pages"), - 'dumphtml' => _("Dumping html pages"), + 'dumphtml' => _("Dumping HTML pages"), 'dumpserial' => _("Dumping serial pages"), 'edit' => _("Editing pages"), 'revert' => _("Reverting to a previous version of pages"), @@ -618,13 +618,13 @@ 'purge' => _("Purging pages"), 'remove' => _("Removing pages"), 'unlock' => _("Unlocking pages"), - 'upload' => _("Uploading zip dumps"), + 'upload' => _("Uploading ZIP dumps"), 'verify' => _("Verify the current action"), 'viewsource' => _("Viewing the source of pages"), 'xmlrpc' => _("XML-RPC access"), 'soap' => _("SOAP access"), - 'zip' => _("Downloading zip dumps"), - 'ziphtml' => _("Downloading html zip dumps") + 'zip' => _("Downloading ZIP dumps"), + 'ziphtml' => _("Downloading HTML ZIP dumps") ); } if (in_array($action, array_keys($disallowedActionDescriptions))) Modified: trunk/lib/ziplib.php =================================================================== --- trunk/lib/ziplib.php 2015-01-27 10:26:36 UTC (rev 9492) +++ trunk/lib/ziplib.php 2015-01-27 10:27:03 UTC (rev 9493) @@ -322,7 +322,7 @@ if ($zipfile) { $this->zipfile = $zipfile; if (!($this->fp = fopen($zipfile, "rb"))) { - trigger_error(sprintf(_("Can't open zip file “%s” for reading"), + trigger_error(sprintf(_("Can't open ZIP file “%s” for reading"), $zipfile), E_USER_ERROR); } } @@ -333,11 +333,11 @@ if ($this->fp) { $chunk = fread($this->fp, $nbytes); if (strlen($chunk) != $nbytes) - trigger_error(_("Unexpected EOF in zip file"), E_USER_ERROR); + trigger_error(_("Unexpected EOF in ZIP file"), E_USER_ERROR); return $chunk; } elseif ($this->buf) { if (strlen($this->buf) < $nbytes) - trigger_error(_("Unexpected EOF in zip file"), E_USER_ERROR); + trigger_error(_("Unexpected EOF in ZIP file"), E_USER_ERROR); $chunk = substr($this->buf, 0, $nbytes); $this->buf = substr($this->buf, $nbytes); return $chunk; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-09 14:12:10
|
Revision: 9516 http://sourceforge.net/p/phpwiki/code/9516 Author: vargenau Date: 2015-02-09 14:12:08 +0000 (Mon, 09 Feb 2015) Log Message: ----------- Do not use void function result Modified Paths: -------------- trunk/lib/PageList.php trunk/lib/WikiDB/backend/ADODB_mssql.php trunk/lib/WikiDB/backend/ADODB_mssqlnative.php trunk/lib/WikiDB/backend/ADODB_mysql.php trunk/lib/WikiDB/backend/ADODB_oci8po.php trunk/lib/WikiDB/backend/ADODB_postgres7.php trunk/lib/WikiDB/backend/PDO_mysql.php trunk/lib/WikiDB/backend/PDO_oci8.php trunk/lib/WikiDB/backend/PearDB.php trunk/lib/WikiDB/backend/PearDB_ffpgsql.php trunk/lib/WikiDB/backend/PearDB_mysql.php trunk/lib/WikiDB/backend/PearDB_oci8.php trunk/lib/WikiDB/backend/PearDB_pgsql.php trunk/lib/WikiDB/backend/PearDB_sqlite.php trunk/lib/WikiDB/backend/cvs.php trunk/lib/WikiDB/backend/dbaBase.php trunk/lib/WikiDB/backend/file.php trunk/lib/WikiDB/backend.php trunk/lib/plugin/RecentChanges.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/PageList.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -187,7 +187,8 @@ if ($this->_iscustom) { $this->_field = substr($field, 7); } elseif ($this->_need_rev) - $this->_field = substr($field, 4); else + $this->_field = substr($field, 4); + else $this->_field = $field; } Modified: trunk/lib/WikiDB/backend/ADODB_mssql.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_mssql.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/ADODB_mssql.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -32,7 +32,7 @@ { // Do nothing here -- Leave that for the DB // Cost Based Optimizer tuning vary from version to version - return 1; + return true; } /** Modified: trunk/lib/WikiDB/backend/ADODB_mssqlnative.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_mssqlnative.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/ADODB_mssqlnative.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -32,7 +32,7 @@ { // Do nothing here -- Leave that for the DB // Cost Based Optimizer tuning vary from version to version - return 1; + return true; } // Search callabcks Modified: trunk/lib/WikiDB/backend/ADODB_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_mysql.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/ADODB_mysql.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -80,7 +80,7 @@ foreach ($this->_table_names as $table) { $dbh->Execute("OPTIMIZE TABLE $table"); } - return 1; + return true; } /** Modified: trunk/lib/WikiDB/backend/ADODB_oci8po.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_oci8po.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/ADODB_oci8po.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -35,7 +35,7 @@ { // Do nothing here -- Leave that for the DBA // Cost Based Optimizer tuning vary from version to version - return 1; + return true; } /** Modified: trunk/lib/WikiDB/backend/ADODB_postgres7.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_postgres7.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/ADODB_postgres7.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -37,7 +37,7 @@ */ function optimize() { - return 0; // if the wikiuser is not the table owner + return false; // if the wikiuser is not the table owner /* foreach ($this->_table_names as $table) { Modified: trunk/lib/WikiDB/backend/PDO_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_mysql.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PDO_mysql.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -81,7 +81,7 @@ foreach ($this->_table_names as $table) { $this->query("OPTIMIZE TABLE $table"); } - return 1; + return true; } function listOfTables() Modified: trunk/lib/WikiDB/backend/PDO_oci8.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_oci8.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PDO_oci8.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -33,7 +33,7 @@ { // Do nothing here -- Leave that for the DBA // Cost Based Optimizer tuning vary from version to version - return 1; + return true; } /** Modified: trunk/lib/WikiDB/backend/PearDB.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PearDB.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -171,7 +171,6 @@ $dbh->query(sprintf("UPDATE %s SET hits=hits+1 WHERE pagename='%s'", $this->_table_names['page_tbl'], $dbh->escapeSimple($pagename))); - return; } /** Modified: trunk/lib/WikiDB/backend/PearDB_ffpgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_ffpgsql.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PearDB_ffpgsql.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -197,7 +197,7 @@ function set_cached_html($pagename, $data) { - return parent::set_cached_html(PAGE_PREFIX . $pagename, $data); + parent::set_cached_html(PAGE_PREFIX . $pagename, $data); } function _get_pageid($pagename, $create_if_missing = false) @@ -567,7 +567,7 @@ function increaseHitCount($pagename) { - return parent::increaseHitCount(PAGE_PREFIX . $pagename); + parent::increaseHitCount(PAGE_PREFIX . $pagename); } function _serialize($data) @@ -581,7 +581,7 @@ */ function optimize() { - return 0; + return true; } /** Modified: trunk/lib/WikiDB/backend/PearDB_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_mysql.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PearDB_mysql.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -166,7 +166,7 @@ foreach ($this->_table_names as $table) { $dbh->query("OPTIMIZE TABLE $table"); } - return 1; + return true; } /** @@ -201,7 +201,6 @@ $this->_table_names['page_tbl'], $dbh->escapeSimple($pagename), ($this->_serverinfo['version'] >= 323.0) ? "LIMIT 1" : "")); - return; } } Modified: trunk/lib/WikiDB/backend/PearDB_oci8.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_oci8.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PearDB_oci8.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -38,7 +38,7 @@ { // Do nothing here -- Leave that for the DBA // Cost Based Optimizer tuning vary from version to version - return 1; + return true; } /** Modified: trunk/lib/WikiDB/backend/PearDB_pgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_pgsql.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PearDB_pgsql.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -51,7 +51,7 @@ */ function optimize() { - return 0; // if the wikiuser is not the table owner + return true; // if the wikiuser is not the table owner /* foreach ($this->_table_names as $table) { @@ -97,13 +97,13 @@ $dbh = &$this->_dbh; $page_tbl = $this->_table_names['page_tbl']; if (USE_BYTEA) - $sth = $dbh->query(sprintf("UPDATE $page_tbl" + $dbh->query(sprintf("UPDATE $page_tbl" . " SET cached_html='%s'" . " WHERE pagename='%s'", $this->_quote($data), $dbh->escapeSimple($pagename))); else - $sth = $dbh->query("UPDATE $page_tbl" + $dbh->query("UPDATE $page_tbl" . " SET cached_html=?" . " WHERE pagename=?", // PearDB does NOT use pg_escape_string()! Oh dear. Modified: trunk/lib/WikiDB/backend/PearDB_sqlite.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_sqlite.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/PearDB_sqlite.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -27,6 +27,7 @@ */ function optimize() { + return true; // NOP } Modified: trunk/lib/WikiDB/backend/cvs.php =================================================================== --- trunk/lib/WikiDB/backend/cvs.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/cvs.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -510,6 +510,7 @@ function optimize() { + return true; } /** Modified: trunk/lib/WikiDB/backend/dbaBase.php =================================================================== --- trunk/lib/WikiDB/backend/dbaBase.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/dbaBase.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -78,6 +78,7 @@ function optimize() { $this->_db->optimize(); + return true; } function sync() Modified: trunk/lib/WikiDB/backend/file.php =================================================================== --- trunk/lib/WikiDB/backend/file.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend/file.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -657,7 +657,7 @@ */ function optimize() { - return 0; //trigger_error("optimize: Not Implemented", E_USER_WARNING); + return true; //trigger_error("optimize: Not Implemented", E_USER_WARNING); } /** Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/WikiDB/backend.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -469,9 +469,12 @@ /** * Optimize the database. + * + * @return bool */ function optimize() { + return true; } /** Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2015-02-09 10:23:25 UTC (rev 9515) +++ trunk/lib/plugin/RecentChanges.php 2015-02-09 14:12:08 UTC (rev 9516) @@ -770,6 +770,7 @@ function headline() { + return array(); } function authorLink($rev) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-18 15:47:07
|
Revision: 9547 http://sourceforge.net/p/phpwiki/code/9547 Author: vargenau Date: 2015-02-18 15:46:57 +0000 (Wed, 18 Feb 2015) Log Message: ----------- RSS_ENCODING is UTF-8 Modified Paths: -------------- trunk/lib/RSSWriter091.php trunk/lib/RssWriter.php trunk/lib/RssWriter2.php Modified: trunk/lib/RSSWriter091.php =================================================================== --- trunk/lib/RSSWriter091.php 2015-02-18 15:34:57 UTC (rev 9546) +++ trunk/lib/RSSWriter091.php 2015-02-18 15:46:57 UTC (rev 9547) @@ -64,8 +64,8 @@ */ function __spew() { - header("Content-Type: application/xml; charset=" . RSS_ENCODING); - printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", RSS_ENCODING); + header("Content-Type: application/xml; charset=UTF-8"); + print("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); print("<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n"); print("\"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n"); $this->printXML(); Modified: trunk/lib/RssWriter.php =================================================================== --- trunk/lib/RssWriter.php 2015-02-18 15:34:57 UTC (rev 9546) +++ trunk/lib/RssWriter.php 2015-02-18 15:46:57 UTC (rev 9547) @@ -124,8 +124,8 @@ */ function __spew() { - header("Content-Type: application/xml; charset=" . RSS_ENCODING); - echo('<' . '?xml version="1.0" encoding="' . RSS_ENCODING . '"?' . ">\n"); + header("Content-Type: application/xml; charset=UTF-8"); + echo('<' . '?xml version="1.0" encoding="UTF-8" ?' . ">\n"); $this->printXML(); } Modified: trunk/lib/RssWriter2.php =================================================================== --- trunk/lib/RssWriter2.php 2015-02-18 15:34:57 UTC (rev 9546) +++ trunk/lib/RssWriter2.php 2015-02-18 15:46:57 UTC (rev 9547) @@ -66,8 +66,8 @@ */ function __spew() { - header("Content-Type: application/rss+xml; charset=" . RSS_ENCODING); - echo('<' . '?xml version="1.0" encoding="' . RSS_ENCODING . '"?' . ">\n"); + header("Content-Type: application/rss+xml; charset=UTF-8"); + echo('<' . '?xml version="1.0" encoding="UTF-8" ?' . ">\n"); //RSS2 really is 0.92 echo '<!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.92.dtd">', "\n"; echo "<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-27 16:12:28
|
Revision: 9570 http://sourceforge.net/p/phpwiki/code/9570 Author: vargenau Date: 2015-02-27 16:12:26 +0000 (Fri, 27 Feb 2015) Log Message: ----------- PHP Doc Modified Paths: -------------- trunk/lib/WikiDB/backend/PDO.php trunk/lib/WikiDB/backend/PearDB.php trunk/lib/WikiDB/backend/file.php trunk/lib/WikiUser/PdoDb.php Modified: trunk/lib/WikiDB/backend/PDO.php =================================================================== --- trunk/lib/WikiDB/backend/PDO.php 2015-02-27 15:50:45 UTC (rev 9569) +++ trunk/lib/WikiDB/backend/PDO.php 2015-02-27 16:12:26 UTC (rev 9570) @@ -455,7 +455,7 @@ * * @param $version int Which version to get. * - * @return hash The version data, or false if specified version does not + * @return array hash The version data, or false if specified version does not * exist. */ function get_versiondata($pagename, $version, $want_content = false) Modified: trunk/lib/WikiDB/backend/PearDB.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB.php 2015-02-27 15:50:45 UTC (rev 9569) +++ trunk/lib/WikiDB/backend/PearDB.php 2015-02-27 16:12:26 UTC (rev 9570) @@ -341,7 +341,7 @@ * * @param $version int Which version to get. * - * @return hash The version data, or false if specified version does not + * @return array hash The version data, or false if specified version does not * exist. */ function get_versiondata($pagename, $version, $want_content = false) Modified: trunk/lib/WikiDB/backend/file.php =================================================================== --- trunk/lib/WikiDB/backend/file.php 2015-02-27 15:50:45 UTC (rev 9569) +++ trunk/lib/WikiDB/backend/file.php 2015-02-27 16:12:26 UTC (rev 9570) @@ -272,8 +272,8 @@ /** * Get page meta-data from database. * - * @param $pagename string Page name. - * @return hash + * @param string $pagename Page name. + * @return array hash * Returns a hash containing the page meta-data. * Returns an empty array if there is no meta-data for the requested page. * Keys which might be present in the hash are: @@ -309,8 +309,8 @@ * $backend->update_pagedata($pagename, array('locked' => false)); * </pre> * - * @param $pagename string Page name. - * @param $newdata hash New meta-data. + * @param string $pagename Page name. + * @param array $newdata hash New meta-data. */ /** * This will create a new page if page being requested does not @@ -376,7 +376,7 @@ * the content, the backend might still want to set the value of * '%content' to the empty string if it knows there's no content. * - * @return hash The version data, or false if specified version does not + * @return array hash The version data, or false if specified version does not * exist. * * Some keys which might be present in the $versiondata hash are: @@ -478,9 +478,9 @@ * If the given ($pagename,$version) is already in the database, * this method completely overwrites any stored data for that version. * - * @param $pagename string Page name. - * @param $version int New revisions content. - * @param $data hash New revision metadata. + * @param string $pagename Page name. + * @param int $version New revisions content. + * @param array $data hash New revision metadata. * * @see get_versiondata */ @@ -494,11 +494,11 @@ * * If the given ($pagename,$version) is already in the database, * this method only changes those meta-data values whose keys are - * explicity listed in $newdata. + * explicitly listed in $newdata. * - * @param $pagename string Page name. - * @param $version int New revisions content. - * @param $newdata hash New revision metadata. + * @param string $pagename Page name. + * @param int $version New revisions content. + * @param array $newdata hash New revision metadata. * @see set_versiondata, get_versiondata */ function update_versiondata($pagename, $version, $newdata) Modified: trunk/lib/WikiUser/PdoDb.php =================================================================== --- trunk/lib/WikiUser/PdoDb.php 2015-02-27 15:50:45 UTC (rev 9569) +++ trunk/lib/WikiUser/PdoDb.php 2015-02-27 16:12:26 UTC (rev 9570) @@ -27,7 +27,7 @@ /** * PDO DB methods (PHP5) * prepare, bind, execute. - * We use numrical FETCH_MODE_ROW, so we don't need aliases in the auth_* SQL statements. + * We use numerical FETCH_MODE_ROW, so we don't need aliases in the auth_* SQL statements. * * @tables: user * @tables: pref This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-03-02 16:02:57
|
Revision: 9581 http://sourceforge.net/p/phpwiki/code/9581 Author: vargenau Date: 2015-03-02 16:02:55 +0000 (Mon, 02 Mar 2015) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/Captcha.php trunk/lib/TextSearchQuery.php trunk/lib/WikiTheme.php Modified: trunk/lib/Captcha.php =================================================================== --- trunk/lib/Captcha.php 2015-03-02 15:45:06 UTC (rev 9580) +++ trunk/lib/Captcha.php 2015-03-02 16:02:55 UTC (rev 9581) @@ -34,7 +34,7 @@ */ public $request; - function Captcha($meta = array(), $width = 250, $height = 80) + function __construct($meta = array(), $width = 250, $height = 80) { /** * @var WikiRequest $request Modified: trunk/lib/TextSearchQuery.php =================================================================== --- trunk/lib/TextSearchQuery.php 2015-03-02 15:45:06 UTC (rev 9580) +++ trunk/lib/TextSearchQuery.php 2015-03-02 16:02:55 UTC (rev 9581) @@ -94,7 +94,7 @@ * @param $regex string one of 'auto', 'none', 'glob', 'posix', 'pcre', 'sql' * @see TextSearchQuery */ - function TextSearchQuery($search_query, $case_exact = false, $regex = 'auto') + function __construct($search_query, $case_exact = false, $regex = 'auto') { if ($regex == 'none' or !$regex) { $this->_regex = 0; Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2015-03-02 15:45:06 UTC (rev 9580) +++ trunk/lib/WikiTheme.php 2015-03-02 16:02:55 UTC (rev 9581) @@ -1797,7 +1797,7 @@ * @param $img_url string URL for button's image. * @param $img_attr array Additional attributes for the <img> tag. */ - function ImageButton($text, $url, $class, $img_url, $img_attr = array()) + function __construct($text, $url, $class, $img_url, $img_attr = array()) { /** * @var WikiRequest $request This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-03-03 15:25:33
|
Revision: 9587 http://sourceforge.net/p/phpwiki/code/9587 Author: vargenau Date: 2015-03-03 15:25:24 +0000 (Tue, 03 Mar 2015) Log Message: ----------- Align prototype for functions _getValue, _getSortableValue, format Modified Paths: -------------- trunk/lib/PageList.php trunk/lib/plugin/BackLinks.php trunk/lib/plugin/FullTextSearch.php trunk/lib/plugin/LinkDatabase.php trunk/lib/plugin/LinkSearch.php trunk/lib/plugin/ListPages.php trunk/lib/plugin/ListSubpages.php trunk/lib/plugin/SemanticSearch.php trunk/lib/plugin/WantedPages.php trunk/lib/plugin/WikiAdminRemove.php trunk/lib/plugin/WikiAdminRename.php trunk/lib/plugin/WikiAdminUtils.php trunk/lib/plugin/WikiTranslation.php trunk/lib/wikilens/PageListColumns.php Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/PageList.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -62,7 +62,7 @@ } } - function format($pagelist, $page_handle, &$revision_handle) + function format($pagelist, $page_handle, $revision_handle) { return HTML::td($this->_tdattr, $this->_getValue($page_handle, $revision_handle)); @@ -197,7 +197,7 @@ * @param WikiDB_PageRevision $revision_handle * @return mixed */ - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { if ($this->_need_rev) { if (!$revision_handle) @@ -214,7 +214,7 @@ * @param WikiDB_PageRevision $revision_handle * @return int|string */ - function _getSortableValue($page_handle, &$revision_handle) + function _getSortableValue($page_handle, $revision_handle) { $val = $this->_getValue($page_handle, $revision_handle); if ($this->_field == 'hits') @@ -241,13 +241,13 @@ class _PageList_Column_size extends _PageList_Column { - function format($pagelist, $page_handle, &$revision_handle) + function format($pagelist, $page_handle, $revision_handle) { return HTML::td($this->_tdattr, $this->_getValuePageList($pagelist, $page_handle, $revision_handle)); } - function _getValuePageList($pagelist, $page_handle, &$revision_handle) + function _getValuePageList($pagelist, $page_handle, $revision_handle) { if (!$revision_handle or (!$revision_handle->_data['%content'] or $revision_handle->_data['%content'] === true) @@ -262,7 +262,7 @@ return $size; } - function _getSortableValue($page_handle, &$revision_handle) + function _getSortableValue($page_handle, $revision_handle) { if (!$revision_handle) $revision_handle = $page_handle->getCurrentRevision(true); @@ -286,7 +286,7 @@ $this->_textIfFalse = new RawXml('—'); //mdash } - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { //FIXME: check if $this is available in the parent (->need_rev) $val = parent::_getValue($page_handle, $revision_handle); @@ -308,7 +308,7 @@ parent::__construct($field, $heading, 'center'); } - function _getValuePageList($pagelist, $page_handle, &$revision_handle) + function _getValuePageList($pagelist, $page_handle, $revision_handle) { $pagename = $page_handle->getName(); $selected = !empty($pagelist->_selected[$pagename]); @@ -327,7 +327,7 @@ } } - function format($pagelist, $page_handle, &$revision_handle) + function format($pagelist, $page_handle, $revision_handle) { return HTML::td($this->_tdattr, $this->_getValuePageList($pagelist, $page_handle, $revision_handle)); @@ -350,13 +350,13 @@ $this->WikiTheme = &$WikiTheme; } - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { $time = parent::_getValue($page_handle, $revision_handle); return $this->WikiTheme->formatDateTime($time); } - function _getSortableValue($page_handle, &$revision_handle) + function _getSortableValue($page_handle, $revision_handle) { return parent::_getValue($page_handle, $revision_handle); } @@ -364,7 +364,7 @@ class _PageList_Column_version extends _PageList_Column { - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { if (!$revision_handle) $revision_handle = $page_handle->getCurrentRevision(); @@ -396,7 +396,7 @@ } } - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { if (!$revision_handle or (!$revision_handle->_data['%content'] or $revision_handle->_data['%content'] === true) @@ -465,7 +465,7 @@ true)); } - function _getSortableValue($page_handle, &$revision_handle) + function _getSortableValue($page_handle, $revision_handle) { if (is_object($page_handle) and !empty($page_handle->score)) return $page_handle->score; @@ -488,7 +488,7 @@ $this->dbi =& $request->getDbh(); } - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { $author = parent::_getValue($page_handle, $revision_handle); if ($this->dbi->isWikiPage($author)) @@ -497,7 +497,7 @@ return $author; } - function _getSortableValue($page_handle, &$revision_handle) + function _getSortableValue($page_handle, $revision_handle) { return parent::_getValue($page_handle, $revision_handle); } @@ -505,7 +505,7 @@ class _PageList_Column_owner extends _PageList_Column_author { - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { $author = $page_handle->getOwner(); if ($this->dbi->isWikiPage($author)) @@ -514,7 +514,7 @@ return $author; } - function _getSortableValue($page_handle, &$revision_handle) + function _getSortableValue($page_handle, $revision_handle) { return parent::_getValue($page_handle, $revision_handle); } @@ -522,7 +522,7 @@ class _PageList_Column_creator extends _PageList_Column_author { - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { $author = $page_handle->getCreator(); if ($this->dbi->isWikiPage($author)) @@ -531,7 +531,7 @@ return $author; } - function _getSortableValue($page_handle, &$revision_handle) + function _getSortableValue($page_handle, $revision_handle) { return parent::_getValue($page_handle, $revision_handle); } @@ -548,7 +548,7 @@ $this->dbi = &$request->getDbh(); } - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { if ($this->dbi->isWikiPage($page_handle->getName())) return WikiLink($page_handle, 'known'); @@ -556,7 +556,7 @@ return WikiLink($page_handle, 'unknown'); } - function _getSortableValue($page_handle, &$revision_handle) + function _getSortableValue($page_handle, $revision_handle) { return $page_handle->getName(); } @@ -572,7 +572,7 @@ class _PageList_Column_perm extends _PageList_Column { - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { $perm_array = pagePermissions($page_handle->_pagename); return pagePermissionsSimpleFormat($perm_array, @@ -583,7 +583,7 @@ class _PageList_Column_acl extends _PageList_Column { - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { $perm_tree = pagePermissions($page_handle->_pagename); @@ -875,7 +875,7 @@ * Take a PageList_Page object, and return an HTML object to display * it in a table or list row. */ - private function renderPageRow(&$page_handle, $i = 0) + private function renderPageRow($page_handle, $i = 0) { $page_handle = $this->getPageFromHandle($page_handle); //FIXME. only on sf.net Modified: trunk/lib/plugin/BackLinks.php =================================================================== --- trunk/lib/plugin/BackLinks.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/plugin/BackLinks.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -192,7 +192,7 @@ // how many links from this backLink to other pages class _PageList_Column_BackLinks_count extends _PageList_Column { - function _getValue($page, &$revision_handle) + function _getValue($page, $revision_handle) { $iter = $page->getPageLinks(); $count = $iter->count(); Modified: trunk/lib/plugin/FullTextSearch.php =================================================================== --- trunk/lib/plugin/FullTextSearch.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/plugin/FullTextSearch.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -171,7 +171,7 @@ $this->_PageList_Column($params[0], $params[1], $params[2]); } - function _getValue(&$page, $revision_handle) + function _getValue($page, $revision_handle) { $pagename = $page->getName(); $count = count($this->parentobj->_wpagelist[$pagename]); Modified: trunk/lib/plugin/LinkDatabase.php =================================================================== --- trunk/lib/plugin/LinkDatabase.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/plugin/LinkDatabase.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -213,7 +213,7 @@ class _PageList_Column_LinkDatabase_links extends _PageList_Column { - function _getValue($page, &$revision_handle) + function _getValue($page, $revision_handle) { $out = HTML(); $links = $page->getPageLinks(); Modified: trunk/lib/plugin/LinkSearch.php =================================================================== --- trunk/lib/plugin/LinkSearch.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/plugin/LinkSearch.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -179,7 +179,7 @@ $this->_pagelist =& $pagelist; } - function _getValue(&$page, $revision_handle) + function _getValue($page, $revision_handle) { if (is_object($page)) $text = $page->getName(); else $text = $page; Modified: trunk/lib/plugin/ListPages.php =================================================================== --- trunk/lib/plugin/ListPages.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/plugin/ListPages.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -143,7 +143,7 @@ return $this->_PageList_Column($field, $display, 'center'); } - function _getValue($page, &$revision_handle) + function _getValue($page, $revision_handle) { $iter = $page->getLinks($this->_direction); $count = $iter->count(); Modified: trunk/lib/plugin/ListSubpages.php =================================================================== --- trunk/lib/plugin/ListSubpages.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/plugin/ListSubpages.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -125,7 +125,7 @@ // how many backlinks for this subpage class _PageList_Column_ListSubpages_count extends _PageList_Column { - function _getValue($page, &$revision_handle) + function _getValue($page, $revision_handle) { $iter = $page->getBackLinks(); $count = $iter->count(); Modified: trunk/lib/plugin/SemanticSearch.php =================================================================== --- trunk/lib/plugin/SemanticSearch.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/plugin/SemanticSearch.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -445,7 +445,7 @@ $this->_pagelist =& $pagelist; } - function _getValue(&$page, $revision_handle) + function _getValue($page, $revision_handle) { $link = $this->_pagelist->_links[$this->current_row]; return WikiLink($link['linkname'], 'if_known'); @@ -455,7 +455,7 @@ class _PageList_Column_SemanticSearch_link extends _PageList_Column_SemanticSearch_relation { - function _getValue(&$page, $revision_handle) + function _getValue($page, $revision_handle) { $link = $this->_pagelist->_links[$this->current_row]; if ($this->_field != 'value') Modified: trunk/lib/plugin/WantedPages.php =================================================================== --- trunk/lib/plugin/WantedPages.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/plugin/WantedPages.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -164,7 +164,7 @@ $this->_PageList_Column($params[0], $params[1], $params[2]); } - function _getValue(&$page, $revision_handle) + function _getValue($page, $revision_handle) { $html = false; $pagename = $page->getName(); @@ -189,7 +189,7 @@ $this->_PageList_Column($params[0], $params[1], $params[2]); } - function _getValue(&$page, $revision_handle) + function _getValue($page, $revision_handle) { $pagename = $page->getName(); $count = count($this->parentobj->_wpagelist[$pagename]); Modified: trunk/lib/plugin/WikiAdminRemove.php =================================================================== --- trunk/lib/plugin/WikiAdminRemove.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/plugin/WikiAdminRemove.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -247,7 +247,7 @@ class _PageList_Column_remove extends _PageList_Column { - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { return Button(array('action' => 'remove'), _("Remove"), $page_handle->getName()); Modified: trunk/lib/plugin/WikiAdminRename.php =================================================================== --- trunk/lib/plugin/WikiAdminRename.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/plugin/WikiAdminRename.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -312,7 +312,7 @@ // moved from lib/PageList.php class _PageList_Column_renamed_pagename extends _PageList_Column { - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { global $request; $post_args = $request->getArg('admin_rename'); Modified: trunk/lib/plugin/WikiAdminUtils.php =================================================================== --- trunk/lib/plugin/WikiAdminUtils.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/plugin/WikiAdminUtils.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -312,7 +312,7 @@ class _PageList_Column_email extends _PageList_Column { - function _getValue(&$prefs, $dummy) + function _getValue($prefs, $dummy) { return $prefs->get('email'); } @@ -321,7 +321,7 @@ class _PageList_Column_emailVerified extends _PageList_Column { - function _getValue(&$prefs, $status) + function _getValue($prefs, $status) { $name = $prefs->get('userid'); $input = HTML::input(array('type' => 'checkbox', Modified: trunk/lib/plugin/WikiTranslation.php =================================================================== --- trunk/lib/plugin/WikiTranslation.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/plugin/WikiTranslation.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -516,7 +516,7 @@ $this->_PageList_Column_base($this->_field); } - function _getValue($page, &$revision_handle) + function _getValue($page, $revision_handle) { if (is_object($page)) $text = $page->getName(); else $text = $page; Modified: trunk/lib/wikilens/PageListColumns.php =================================================================== --- trunk/lib/wikilens/PageListColumns.php 2015-03-02 17:27:12 UTC (rev 9586) +++ trunk/lib/wikilens/PageListColumns.php 2015-03-03 15:25:24 UTC (rev 9587) @@ -43,13 +43,13 @@ */ class _PageList_Column_numbacklinks extends _PageList_Column_custom { - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { $theIter = $page_handle->getBackLinks(); return $theIter->count(); } - function _getSortableValue($page_handle, &$revision_handle) + function _getSortableValue($page_handle, $revision_handle) { return $this->_getValue($page_handle, $revision_handle); } @@ -64,7 +64,7 @@ $this->_selectedBuddies = $this->_pagelist->getOption('selectedBuddies'); } - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { global $request; @@ -97,7 +97,7 @@ $this->_selectedBuddies = $this->_pagelist->getOption('selectedBuddies'); } - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { global $request, $WikiTheme; @@ -121,7 +121,7 @@ $this->_selectedBuddies = $this->_pagelist->getOption('selectedBuddies'); } - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { global $request, $WikiTheme; @@ -164,7 +164,7 @@ if (!$this->_dimension) $this->_dimension = 0; } - function format($pagelist, $page_handle, &$revision_handle) + function format($pagelist, $page_handle, $revision_handle) { /** * @var WikiRequest $request @@ -188,7 +188,7 @@ return $td; } - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { $pagename = $page_handle->getName(); @@ -215,7 +215,7 @@ } - function _getSortableValue($page_handle, &$revision_handle) + function _getSortableValue($page_handle, $revision_handle) { return $this->_getValue($page_handle, $revision_handle); } @@ -235,7 +235,7 @@ if (!$this->_dimension) $this->_dimension = 0; } - function format($pagelist, $page_handle, &$revision_handle) + function format($pagelist, $page_handle, $revision_handle) { $plugin = new WikiPlugin_RateIt(); if (defined('FUSIONFORGE') && FUSIONFORGE) { @@ -250,7 +250,7 @@ return $td; } - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { global $request; @@ -268,7 +268,7 @@ } } - function _getSortableValue($page_handle, &$revision_handle) + function _getSortableValue($page_handle, $revision_handle) { return $this->_getValue($page_handle, $revision_handle); } @@ -294,7 +294,7 @@ $this->_users = $this->_pagelist->getOption('users'); } - function format($pagelist, $page_handle, &$revision_handle) + function format($pagelist, $page_handle, $revision_handle) { $pred = $this->_getValue($page_handle, $revision_handle); $mean = $this->_active_ratings_user->mean_rating($this->_dimension); @@ -310,7 +310,7 @@ return $td; } - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { $pagename = $page_handle->getName(); @@ -318,7 +318,7 @@ return sprintf("%.1f", min(5, max(0, $pred))); } - function _getSortableValue($page_handle, &$revision_handle) + function _getSortableValue($page_handle, $revision_handle) { return $this->_getValue($page_handle, $revision_handle); } @@ -352,7 +352,7 @@ } } - function _getValue($page_handle, &$revision_handle) + function _getValue($page_handle, $revision_handle) { $ratings = $this->_active_ratings_user->get_ratings(); $iter = $page_handle->getLinks(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-04-01 08:04:50
|
Revision: 9634 http://sourceforge.net/p/phpwiki/code/9634 Author: vargenau Date: 2015-04-01 08:04:48 +0000 (Wed, 01 Apr 2015) Log Message: ----------- Remove MockRequest Modified Paths: -------------- trunk/lib/MailNotify.php trunk/lib/WikiDB.php trunk/lib/loadsave.php trunk/lib/plugin/PasswordReset.php trunk/lib/plugin/UserPreferences.php trunk/lib/plugin/WatchPage.php Modified: trunk/lib/MailNotify.php =================================================================== --- trunk/lib/MailNotify.php 2015-03-31 13:37:40 UTC (rev 9633) +++ trunk/lib/MailNotify.php 2015-04-01 08:04:48 UTC (rev 9634) @@ -330,22 +330,15 @@ */ public function onChangePage(&$wikidb, &$wikitext, $version, &$meta) { - /** - * @var WikiRequest $request - */ - global $request; - - if (!is_a($request, 'MockRequest')) { - $notify = $wikidb->get('notify'); - /* Generate notification emails? */ - if (!empty($notify) and is_array($notify)) { - if (empty($this->pagename)) - $this->pagename = $meta['pagename']; - // TODO: Should be used for ModeratePage and RSS2 Cloud xml-rpc also. - $this->getPageChangeEmails($notify); - if (!empty($this->emails)) { - $this->sendPageChangeNotification($wikitext, $version, $meta); - } + $notify = $wikidb->get('notify'); + /* Generate notification emails? */ + if (!empty($notify) and is_array($notify)) { + if (empty($this->pagename)) + $this->pagename = $meta['pagename']; + // TODO: Should be used for ModeratePage and RSS2 Cloud xml-rpc also. + $this->getPageChangeEmails($notify); + if (!empty($this->emails)) { + $this->sendPageChangeNotification($wikitext, $version, $meta); } } } @@ -357,14 +350,9 @@ */ public function onDeletePage(&$wikidb, $pagename) { - /** - * @var WikiRequest $request - */ - global $request; - $result = true; /* Generate notification emails? */ - if (!$wikidb->isWikiPage($pagename) and !is_a($request, 'MockRequest')) { + if (!$wikidb->isWikiPage($pagename)) { $notify = $wikidb->get('notify'); if (!empty($notify) and is_array($notify)) { //TODO: deferr it (quite a massive load if you remove some pages). @@ -385,19 +373,12 @@ */ public function onRenamePage(&$wikidb, $oldpage, $new_pagename) { - /** - * @var WikiRequest $request - */ - global $request; - - if (!is_a($request, 'MockRequest')) { - $notify = $wikidb->get('notify'); - if (!empty($notify) and is_array($notify)) { - $this->getPageChangeEmails($notify); - if (!empty($this->emails)) { - $this->pagename = $oldpage; - $this->sendPageRenameNotification($new_pagename); - } + $notify = $wikidb->get('notify'); + if (!empty($notify) and is_array($notify)) { + $this->getPageChangeEmails($notify); + if (!empty($this->emails)) { + $this->pagename = $oldpage; + $this->sendPageRenameNotification($new_pagename); } } } Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2015-03-31 13:37:40 UTC (rev 9633) +++ trunk/lib/WikiDB.php 2015-04-01 08:04:48 UTC (rev 9634) @@ -577,7 +577,7 @@ E_USER_WARNING); } /* Generate notification emails? */ - if ($result and ENABLE_MAILNOTIFY and !is_a($request, 'MockRequest')) { + if ($result and ENABLE_MAILNOTIFY) { $notify = $this->get('notify'); if (!empty($notify) and is_array($notify)) { include_once 'lib/MailNotify.php'; @@ -1083,7 +1083,6 @@ $notify = $this->_wikidb->get('notify'); if (!empty($notify) and is_array($notify) - and !is_a($request, 'MockRequest') ) { include_once 'lib/MailNotify.php'; $MailNotify = new MailNotify($newrevision->getName()); @@ -1697,7 +1696,7 @@ $this->getMetaData()); if ($possibly_cache_results and !WIKIDB_NOCACHE_MARKUP) { - // If we're still the current version, cache the transfomed page. + // If we're still the current version, cache the transformed page. //$backend->lock(); if ($this->isCurrent()) { $page->set('_cached_html', $this->_transformedContent->pack()); Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2015-03-31 13:37:40 UTC (rev 9633) +++ trunk/lib/loadsave.php 2015-04-01 08:04:48 UTC (rev 9634) @@ -37,12 +37,14 @@ return true; // Ignore error } -function StartLoadDump(&$request, $title, $html = '') +/** + * @param WikiRequest $request + * @param string $title + * @param HTML $html + */ + +function StartLoadDump(&$request, $title, $html = null) { - // MockRequest is from the unit testsuite, a faked request. (may be cmd-line) - // We are silent on unittests. - if (is_a($request, 'MockRequest')) - return; // FIXME: This is a hack. This really is the worst overall hack in phpwiki. if ($html) $html->pushContent('%BODY%'); @@ -56,12 +58,13 @@ $request->_deferredPageChangeNotification = array(); } +/** + * @param WikiRequest $request + */ function EndLoadDump(&$request) { global $WikiTheme; - if (is_a($request, 'MockRequest')) - return; $action = $request->getArg('action'); if ($action == 'browse') // loading virgin $pagelink = WikiLink(HOME_PAGE); @@ -140,6 +143,10 @@ * (RFC 1521 has been superceeded by RFC 2045 & others). * * Also see http://www.faqs.org/rfcs/rfc2822.html +/* + * @param WikiDB_Page $page + * @param int $nversions + * @return string */ function MailifyPage($page, $nversions = 1) { @@ -215,6 +222,8 @@ * If $include_archive is false, only the current version of each page * is included in the zip file; otherwise all archived versions are * included as well. + * + * @param WikiRequest $request */ function MakeWikiZip(&$request) { @@ -304,6 +313,9 @@ exit; } +/** + * @param WikiRequest $request + */ function DumpToDir(&$request) { $directory = $request->getArg('directory'); @@ -352,16 +364,12 @@ longer_timeout($timeout); // Reset watchdog $pagename = $page->getName(); - if (!is_a($request, 'MockRequest')) { - PrintXML(HTML::br(), $pagename, ' ... '); - flush(); - } + PrintXML(HTML::br(), $pagename, ' ... '); + flush(); if (in_array($pagename, $excludeList)) { - if (!is_a($request, 'MockRequest')) { - PrintXML(_("Skipped.")); - flush(); - } + PrintXML(_("Skipped.")); + flush(); continue; } $filename = FilenameForPage($pagename); @@ -384,10 +392,8 @@ $num = fwrite($fd, $data, strlen($data)); $msg->pushContent(HTML::small(fmt("%s bytes written", $num))); - if (!is_a($request, 'MockRequest')) { - PrintXML($msg); - flush(); - } + PrintXML($msg); + flush(); assert($num == strlen($data)); fclose($fd); } @@ -397,12 +403,10 @@ function _copyMsg($page, $smallmsg) { - if (!is_a($GLOBALS['request'], 'MockRequest')) { - if ($page) $msg = HTML(HTML::br(), HTML($page), HTML::small($smallmsg)); - else $msg = HTML::small($smallmsg); - PrintXML($msg); - flush(); - } + if ($page) $msg = HTML(HTML::br(), HTML($page), HTML::small($smallmsg)); + else $msg = HTML::small($smallmsg); + PrintXML($msg); + flush(); } function mkdir_p($pathname, $permission = 0777) @@ -485,7 +489,8 @@ EndLoadDump($request); } -/* Known problem: any plugins or other code which echo()s text will +/** + * Known problem: any plugins or other code which echo()s text will * lead to a corrupted html zip file which may produce the following * errors upon unzipping: * @@ -494,7 +499,10 @@ * (attempting to re-compensate) * * However, the actual wiki page data should be unaffected. + * + * @param WikiRequest $request */ + function MakeWikiZipHtml(&$request) { global $WikiTheme; @@ -634,13 +642,11 @@ if ($page->get('locked')) $attrib['write_protected'] = 1; } elseif (!$silent) { - if (!is_a($request, 'MockRequest')) { - PrintXML(HTML::br(), $pagename, ' ... '); - flush(); - } + PrintXML(HTML::br(), $pagename, ' ... '); + flush(); } if (in_array($pagename, $excludeList)) { - if (!$silent and !is_a($request, 'MockRequest')) { + if (!$silent) { PrintXML(_("Skipped.")); flush(); } @@ -723,9 +729,7 @@ } $msg->pushContent(HTML::small(fmt("%s bytes written", $num), "\n")); if (!$silent) { - if (!is_a($request, 'MockRequest')) { - PrintXML($msg); - } + PrintXML($msg); flush(); $request->chunkOutput(); } @@ -1019,10 +1023,8 @@ if (!$skip) { // in case of failures print the culprit: - if (!is_a($request, 'MockRequest')) { - PrintXML(HTML::span(WikiLink($pagename))); - flush(); - } + PrintXML(HTML::span(WikiLink($pagename))); + flush(); $new = $page->save($content, WIKIDB_FORCE_CREATE, $versiondata); $dbi->touch(); $mesg->pushContent(' ', fmt("- saved to database as version %d", @@ -1065,13 +1067,11 @@ } } - if (!is_a($request, 'MockRequest')) { - if ($skip) - PrintXML(HTML::em(WikiLink($pagename)), $mesg); - else - PrintXML($mesg); - flush(); - } + if ($skip) + PrintXML(HTML::em(WikiLink($pagename)), $mesg); + else + PrintXML($mesg); + flush(); } // action=revert (by diff) @@ -1169,9 +1169,7 @@ if ($goback) return $content; - // if loading from virgin setup do echo, otherwise trigger_error E_USER_NOTICE - if (!is_a($GLOBALS['request'], 'MockRequest')) - echo sprintf(_("Loading InterWikiMap from external file %s."), $mapfile), "<br />"; + echo sprintf(_("Loading InterWikiMap from external file %s."), $mapfile), "<br />"; $fd = fopen($mapfile, "rb"); $data = fread($fd, filesize($mapfile)); @@ -1420,6 +1418,12 @@ return $magic == ZIP_LOCHEAD_MAGIC || $magic == ZIP_CENTHEAD_MAGIC; } +/** + * @param WikiRequest $request + * @param string $file_or_dir + * @param array $files + * @param array $exclude + */ function LoadAny(&$request, $file_or_dir, $files = array(), $exclude = array()) { // Try urlencoded filename for accented characters. @@ -1464,13 +1468,15 @@ } } +/** + * @param WikiRequest $request + */ function LoadFileOrDir(&$request) { $source = $request->getArg('source'); $finder = new FileFinder; $source = $finder->slashifyPath($source); - StartLoadDump($request, - sprintf(_("Loading “%s”"), $source)); + StartLoadDump($request, sprintf(_("Loading “%s”"), $source)); LoadAny($request, $source); EndLoadDump($request); } @@ -1479,6 +1485,8 @@ * HomePage was not found so first-time install is supposed to run. * - import all pgsrc pages. * - Todo: installer interface to edit config/config.ini settings + * + * @param WikiRequest $request */ function SetupWiki(&$request) { Modified: trunk/lib/plugin/PasswordReset.php =================================================================== --- trunk/lib/plugin/PasswordReset.php 2015-03-31 13:37:40 UTC (rev 9633) +++ trunk/lib/plugin/PasswordReset.php 2015-04-01 08:04:48 UTC (rev 9634) @@ -65,6 +65,10 @@ $alert->show(); } + /** + * @param WikiRequest $request + * @param string $userid + */ private function doEmail(&$request, $userid) { @@ -87,6 +91,13 @@ $alert->show(); } + /** + * @param WikiRequest $request + * @param string $userid + * @param string $header + * @param string $footer + * @return HtmlElement + */ private function doForm(&$request, $userid = '', $header = '', $footer = '') { if (!$header) { @@ -123,9 +134,6 @@ function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); - if (is_a($request, 'MockRequest')) - return ''; - $user =& $request->_user; $post_args = $request->getArg('admin_reset'); $userid = $args['user']; Modified: trunk/lib/plugin/UserPreferences.php =================================================================== --- trunk/lib/plugin/UserPreferences.php 2015-03-31 13:37:40 UTC (rev 9633) +++ trunk/lib/plugin/UserPreferences.php 2015-04-01 08:04:48 UTC (rev 9634) @@ -73,8 +73,6 @@ $args = $this->getArgs($argstr, $request); $user =& $request->_user; $user->_request = $request; - if (is_a($request, 'MockRequest')) - return ''; if (defined('FUSIONFORGE') && FUSIONFORGE) { if (!($user->isAuthenticated())) { return HTML::p(array('class' => 'error'), Modified: trunk/lib/plugin/WatchPage.php =================================================================== --- trunk/lib/plugin/WatchPage.php 2015-03-31 13:37:40 UTC (rev 9633) +++ trunk/lib/plugin/WatchPage.php 2015-04-01 08:04:48 UTC (rev 9634) @@ -104,10 +104,7 @@ */ function run($dbi, $argstr, &$request, $basepage) { - $args = $this->getArgs($argstr, $request); - if (is_a($request, 'MockRequest')) - return ''; $user =& $request->_user; $userid = $user->UserName(); $page = $args['page']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-05-12 14:32:48
|
Revision: 9697 http://sourceforge.net/p/phpwiki/code/9697 Author: vargenau Date: 2015-05-12 14:32:46 +0000 (Tue, 12 May 2015) Log Message: ----------- Avoid warning Modified Paths: -------------- trunk/lib/imagecache.php trunk/lib/main.php Modified: trunk/lib/imagecache.php =================================================================== --- trunk/lib/imagecache.php 2015-05-07 08:48:22 UTC (rev 9696) +++ trunk/lib/imagecache.php 2015-05-12 14:32:46 UTC (rev 9697) @@ -77,7 +77,7 @@ } if ($userid = $request->getCookieVar(getCookieName())) { if (!empty($userid) and substr($userid, 0, 2) != 's:') { - $request->_user->authhow = 'cookie'; + $request->_user->_authhow = 'cookie'; return $userid; } } Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2015-05-07 08:48:22 UTC (rev 9696) +++ trunk/lib/main.php 2015-05-12 14:32:46 UTC (rev 9697) @@ -998,7 +998,7 @@ if ($userid = $this->getCookieVar(getCookieName())) { if (!empty($userid) and substr($userid, 0, 2) != 's:') { - $this->_user->authhow = 'cookie'; + $this->_user->_authhow = 'cookie'; return $userid; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-09-16 16:32:29
|
Revision: 9726 http://sourceforge.net/p/phpwiki/code/9726 Author: vargenau Date: 2015-09-16 16:32:27 +0000 (Wed, 16 Sep 2015) Log Message: ----------- New function: close_tags Modified Paths: -------------- trunk/lib/loadsave.php trunk/lib/main.php trunk/lib/stdlib.php Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2015-09-16 10:17:38 UTC (rev 9725) +++ trunk/lib/loadsave.php 2015-09-16 16:32:27 UTC (rev 9726) @@ -63,8 +63,6 @@ */ function EndLoadDump(&$request) { - global $WikiTheme; - $action = $request->getArg('action'); if ($action == 'browse') // loading virgin $pagelink = WikiLink(HOME_PAGE); @@ -98,36 +96,7 @@ PrintXML(HTML::p(HTML::strong(_("Complete."))), HTML::p(fmt("Return to %s", $pagelink))); - // Ugly hack to get valid XHTML code - if (is_a($WikiTheme, 'WikiTheme_fusionforge')) { - echo "</div>\n"; - echo "</div>\n"; - echo "</main>\n"; - echo "</div>\n"; - } elseif (is_a($WikiTheme, 'WikiTheme_Sidebar') - or is_a($WikiTheme, 'WikiTheme_MonoBook') - ) { - echo "</div>\n"; - echo "</div>\n"; - echo "</div>\n"; - echo "</div>\n"; - } elseif (is_a($WikiTheme, 'WikiTheme_wikilens')) { - echo "</div>\n"; - echo "</td>\n"; - echo "</tr>\n"; - echo "</table>\n"; - } elseif (is_a($WikiTheme, 'WikiTheme_blog')) { - echo "</div>\n"; - echo "</div>\n"; - } elseif (is_a($WikiTheme, 'WikiTheme_Crao') - or is_a($WikiTheme, 'WikiTheme_Hawaiian') - or is_a($WikiTheme, 'WikiTheme_MacOSX') - or is_a($WikiTheme, 'WikiTheme_shamino_com') - or is_a($WikiTheme, 'WikiTheme_smaller') - ) { - echo "</div>\n"; - } - echo "</body></html>\n"; + close_tags(); // HACK } //////////////////////////////////////////////////////////////// Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2015-09-16 10:17:38 UTC (rev 9725) +++ trunk/lib/main.php 2015-09-16 16:32:27 UTC (rev 9726) @@ -849,8 +849,7 @@ if (!empty($errormsg)) { PrintXML(HTML::p(array('class' => 'error'), _("Fatal PhpWiki Error")._(': ').$errormsg)); - // HACK: - echo "\n</div>\n</div>\n</div>\n</div>\n</body>\n</html>"; + close_tags(); // HACK } if (is_object($this->_user)) { $this->_user->page = $this->getArg('pagename'); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2015-09-16 10:17:38 UTC (rev 9725) +++ trunk/lib/stdlib.php 2015-09-16 16:32:27 UTC (rev 9726) @@ -2119,3 +2119,42 @@ { return mb_ereg_replace('[^\w\. \-]', '-', $filename); } + +/** + * Close all open tags depending on WikiTheme + */ +function close_tags() +{ + global $WikiTheme; + + // Ugly hack to get valid XHTML code + if (is_a($WikiTheme, 'WikiTheme_fusionforge')) { + echo "</div>\n"; + echo "</div>\n"; + echo "</main>\n"; + echo "</div>\n"; + } elseif (is_a($WikiTheme, 'WikiTheme_Sidebar') + or is_a($WikiTheme, 'WikiTheme_MonoBook') + ) { + echo "</div>\n"; + echo "</div>\n"; + echo "</div>\n"; + echo "</div>\n"; + } elseif (is_a($WikiTheme, 'WikiTheme_wikilens')) { + echo "</div>\n"; + echo "</td>\n"; + echo "</tr>\n"; + echo "</table>\n"; + } elseif (is_a($WikiTheme, 'WikiTheme_blog')) { + echo "</div>\n"; + echo "</div>\n"; + } elseif (is_a($WikiTheme, 'WikiTheme_Crao') + or is_a($WikiTheme, 'WikiTheme_Hawaiian') + or is_a($WikiTheme, 'WikiTheme_MacOSX') + or is_a($WikiTheme, 'WikiTheme_shamino_com') + or is_a($WikiTheme, 'WikiTheme_smaller') + ) { + echo "</div>\n"; + } + echo "</body></html>\n"; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-09-22 15:51:50
|
Revision: 9730 http://sourceforge.net/p/phpwiki/code/9730 Author: vargenau Date: 2015-09-22 15:51:48 +0000 (Tue, 22 Sep 2015) Log Message: ----------- Upload: replace multiple spaces by single space Modified Paths: -------------- trunk/lib/plugin/UpLoad.php trunk/lib/stdlib.php Modified: trunk/lib/plugin/UpLoad.php =================================================================== --- trunk/lib/plugin/UpLoad.php 2015-09-22 15:27:07 UTC (rev 9729) +++ trunk/lib/plugin/UpLoad.php 2015-09-22 15:51:48 UTC (rev 9730) @@ -129,7 +129,7 @@ $userfile = $request->getUploadedFile('userfile'); if ($userfile) { $userfile_name = $userfile->getName(); - $userfile_name = trim(basename($userfile_name)); + $userfile_name = basename($userfile_name); if (UPLOAD_USERDIR) { $username = $request->_user->_userid; $file_dir .= $username; @@ -197,7 +197,7 @@ $message->pushContent(HTML::div(array('class' => 'feedback'), HTML::p(_("File successfully uploaded.")), HTML::p($link), - HTML::p(_("Note: some forbidden characters in filename have been replaced by dash.")))); + HTML::p(_("Note: filename was sanified: spaces from beginning and end removed, multiple spaces replaced by one, forbidden characters replaced by dash.")))); } else { $message->pushContent(HTML::div(array('class' => 'feedback'), HTML::p(_("File successfully uploaded.")), Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2015-09-22 15:27:07 UTC (rev 9729) +++ trunk/lib/stdlib.php 2015-09-22 15:51:48 UTC (rev 9730) @@ -2113,10 +2113,15 @@ } /** - * Sanify filename: replace all disallowed characters with dashes + * Sanify filename: + * - remove spaces from the beginning and end + * - replace multiple spaces by single space + * - replace all disallowed characters with dashes */ function sanify_filename($filename) { + $filename = trim($filename); + $filename = preg_replace('!\s+!', ' ', $filename); return mb_ereg_replace('[^\w\. \-]', '-', $filename); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-01-06 17:45:17
|
Revision: 9751 http://sourceforge.net/p/phpwiki/code/9751 Author: vargenau Date: 2016-01-06 17:45:14 +0000 (Wed, 06 Jan 2016) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/WikiUser/AdoDb.php trunk/lib/WikiUser/Db.php trunk/lib/WikiUser/File.php trunk/lib/WikiUser/FusionForge.php trunk/lib/WikiUser/HttpAuth.php trunk/lib/WikiUser/HttpAuthUpper.php trunk/lib/WikiUser/PdoDb.php trunk/lib/WikiUser/PearDb.php trunk/lib/WikiUser/Session.php trunk/lib/WikiUser.php Modified: trunk/lib/WikiUser/AdoDb.php =================================================================== --- trunk/lib/WikiUser/AdoDb.php 2016-01-06 09:28:54 UTC (rev 9750) +++ trunk/lib/WikiUser/AdoDb.php 2016-01-06 17:45:14 UTC (rev 9751) @@ -38,7 +38,7 @@ { public $_authmethod = 'AdoDb'; - function _AdoDbPassUser($UserName = '', $prefs = false) + function __construct($UserName = '', $prefs = false) { /** * @var WikiRequest $request @@ -48,7 +48,7 @@ if (!$this->_prefs and is_a($this, "_AdoDbPassUser")) { if ($prefs) $this->_prefs = $prefs; if (!isset($this->_prefs->_method)) - _PassUser::_PassUser($UserName); + _PassUser::__construct($UserName); } if (!$this->isValidName($UserName)) { trigger_error(_("Invalid username."), E_USER_WARNING); Modified: trunk/lib/WikiUser/Db.php =================================================================== --- trunk/lib/WikiUser/Db.php 2016-01-06 09:28:54 UTC (rev 9750) +++ trunk/lib/WikiUser/Db.php 2016-01-06 17:45:14 UTC (rev 9751) @@ -49,7 +49,7 @@ // This can only be called from _PassUser, because the parent class // sets the auth_dbi and pref methods, before this class is initialized. - function _DbPassUser($UserName = '', $prefs = false) + function __construct($UserName = '', $prefs = false) { /** * @var WikiRequest $request @@ -60,7 +60,7 @@ if ($prefs) $this->_prefs = $prefs; } if (!isset($this->_prefs->_method)) - _PassUser::_PassUser($UserName); + parent::__construct($UserName); elseif (!$this->isValidName($UserName)) { trigger_error(_("Invalid username."), E_USER_WARNING); return false; Modified: trunk/lib/WikiUser/File.php =================================================================== --- trunk/lib/WikiUser/File.php 2016-01-06 09:28:54 UTC (rev 9750) +++ trunk/lib/WikiUser/File.php 2016-01-06 17:45:14 UTC (rev 9751) @@ -33,12 +33,12 @@ // This can only be called from _PassUser, because the parent class // sets the pref methods, before this class is initialized. - function _FilePassUser($UserName = '', $prefs = false, $file = '') + function __construct($UserName = '', $prefs = false, $file = '') { if (!$this->_prefs and is_a($this, "_FilePassUser")) { if ($prefs) $this->_prefs = $prefs; if (!isset($this->_prefs->_method)) - _PassUser::_PassUser($UserName); + parent::__construct($UserName); } $this->_userid = $UserName; // read the .htaccess style file. We use our own copy of the standard pear class. Modified: trunk/lib/WikiUser/FusionForge.php =================================================================== --- trunk/lib/WikiUser/FusionForge.php 2016-01-06 09:28:54 UTC (rev 9750) +++ trunk/lib/WikiUser/FusionForge.php 2016-01-06 17:45:14 UTC (rev 9751) @@ -28,11 +28,11 @@ public $_is_external = 0; - function _FusionForgePassUser($UserName = '', $prefs = false) + function __construct($UserName = '', $prefs = false) { if ($prefs) $this->_prefs = $prefs; if (!isset($this->_prefs->_method)) - _PassUser::_PassUser($UserName); + parent::__construct($UserName); if ($UserName) $this->_userid = $UserName; $this->_authmethod = 'FusionForge'; Modified: trunk/lib/WikiUser/HttpAuth.php =================================================================== --- trunk/lib/WikiUser/HttpAuth.php 2016-01-06 09:28:54 UTC (rev 9750) +++ trunk/lib/WikiUser/HttpAuth.php 2016-01-06 17:45:14 UTC (rev 9751) @@ -35,11 +35,11 @@ class _HttpAuthPassUser extends _PassUser { - function _HttpAuthPassUser($UserName = '', $prefs = false) + function __construct($UserName = '', $prefs = false) { if ($prefs) $this->_prefs = $prefs; if (!isset($this->_prefs->_method)) - _PassUser::_PassUser($UserName); + parent::__construct($UserName); if ($UserName) $this->_userid = $UserName; $this->_authmethod = 'HttpAuth'; Modified: trunk/lib/WikiUser/HttpAuthUpper.php =================================================================== --- trunk/lib/WikiUser/HttpAuthUpper.php 2016-01-06 09:28:54 UTC (rev 9750) +++ trunk/lib/WikiUser/HttpAuthUpper.php 2016-01-06 17:45:14 UTC (rev 9751) @@ -36,11 +36,11 @@ class _HttpAuthUpperPassUser extends _PassUser { - function _HttpAuthUpperPassUser($UserName = '', $prefs = false) + function __construct($UserName = '', $prefs = false) { if ($prefs) $this->_prefs = $prefs; if (!isset($this->_prefs->_method)) - _PassUser::_PassUser($UserName); + parent::__construct($UserName); if ($UserName) $this->_userid = $UserName; $this->_authmethod = 'HttpAuthUpper'; Modified: trunk/lib/WikiUser/PdoDb.php =================================================================== --- trunk/lib/WikiUser/PdoDb.php 2016-01-06 09:28:54 UTC (rev 9750) +++ trunk/lib/WikiUser/PdoDb.php 2016-01-06 17:45:14 UTC (rev 9751) @@ -35,7 +35,7 @@ { public $_authmethod = 'PDODb'; - function _PdoDbPassUser($UserName = '', $prefs = false) + function __construct($UserName = '', $prefs = false) { /** * @var WikiRequest $request @@ -46,7 +46,7 @@ if ($prefs) $this->_prefs = $prefs; } if (!isset($this->_prefs->_method)) - _PassUser::_PassUser($UserName); + _PassUser::__construct($UserName); elseif (!$this->isValidName($UserName)) { trigger_error(_("Invalid username."), E_USER_WARNING); return false; Modified: trunk/lib/WikiUser/PearDb.php =================================================================== --- trunk/lib/WikiUser/PearDb.php 2016-01-06 09:28:54 UTC (rev 9750) +++ trunk/lib/WikiUser/PearDb.php 2016-01-06 17:45:14 UTC (rev 9751) @@ -33,7 +33,7 @@ { public $_authmethod = 'PearDb'; - function _PearDbPassUser($UserName = '', $prefs = false) + function __construct($UserName = '', $prefs = false) { /** * @var WikiRequest $request @@ -46,7 +46,7 @@ } } if (!isset($this->_prefs->_method)) { - _PassUser::_PassUser($UserName); + _PassUser::__construct($UserName); } elseif (!$this->isValidName($UserName)) { trigger_error(_("Invalid username."), E_USER_WARNING); return false; Modified: trunk/lib/WikiUser/Session.php =================================================================== --- trunk/lib/WikiUser/Session.php 2016-01-06 09:28:54 UTC (rev 9750) +++ trunk/lib/WikiUser/Session.php 2016-01-06 17:45:14 UTC (rev 9751) @@ -30,7 +30,7 @@ class _SessionPassUser extends _PassUser { - function _SessionPassUser($UserName = '', $prefs = false) + function __construct($UserName = '', $prefs = false) { if ($prefs) $this->_prefs = $prefs; if (!defined("AUTH_SESS_USER") or !defined("AUTH_SESS_LEVEL")) { @@ -57,7 +57,7 @@ $this->_userid = $sess[AUTH_SESS_USER]; } if (!isset($this->_prefs->_method)) - _PassUser::_PassUser($this->_userid); + parent::__construct($this->_userid); $this->_level = AUTH_SESS_LEVEL; $this->_authmethod = 'Session'; } Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2016-01-06 09:28:54 UTC (rev 9750) +++ trunk/lib/WikiUser.php 2016-01-06 17:45:14 UTC (rev 9751) @@ -925,7 +925,7 @@ public $_current_index; // check and prepare the auth and pref methods only once - function _PassUser($UserName = '', $prefs = false) + function __construct($UserName = '', $prefs = false) { /** * @var WikiRequest $request @@ -1480,7 +1480,7 @@ { public $default_value; - function _UserPreference($default_value) + function __construct($default_value) { $this->default_value = $default_value; } @@ -1534,10 +1534,9 @@ class _UserPreference_numeric extends _UserPreference { - function _UserPreference_numeric($default, $minval = false, - $maxval = false) + function __construct($default, $minval = false, $maxval = false) { - $this->_UserPreference((double)$default); + parent::__construct((double)$default); $this->_minval = (double)$minval; $this->_maxval = (double)$maxval; } @@ -1556,9 +1555,9 @@ class _UserPreference_int extends _UserPreference_numeric { - function _UserPreference_int($default, $minval = false, $maxval = false) + function __construct($default, $minval = false, $maxval = false) { - $this->_UserPreference_numeric((int)$default, (int)$minval, (int)$maxval); + parent::__construct((int)$default, (int)$minval, (int)$maxval); } function sanify($value) @@ -1570,9 +1569,9 @@ class _UserPreference_bool extends _UserPreference { - function _UserPreference_bool($default = false) + function __construct($default = false) { - $this->_UserPreference((bool)$default); + parent::__construct((bool)$default); } function sanify($value) @@ -1600,9 +1599,9 @@ class _UserPreference_language extends _UserPreference { - function _UserPreference_language($default = DEFAULT_LANGUAGE) + function __construct($default = DEFAULT_LANGUAGE) { - $this->_UserPreference($default); + parent::__construct($default); } // FIXME: check for valid locale @@ -1634,9 +1633,9 @@ class _UserPreference_theme extends _UserPreference { - function _UserPreference_theme($default = THEME) + function __construct($default = THEME) { - $this->_UserPreference($default); + parent::__construct($default); } function sanify($value) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-01-11 20:10:14
|
Revision: 9762 http://sourceforge.net/p/phpwiki/code/9762 Author: vargenau Date: 2016-01-11 20:10:12 +0000 (Mon, 11 Jan 2016) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/SemanticWeb.php trunk/lib/TextSearchQuery.php Modified: trunk/lib/SemanticWeb.php =================================================================== --- trunk/lib/SemanticWeb.php 2016-01-07 17:53:40 UTC (rev 9761) +++ trunk/lib/SemanticWeb.php 2016-01-11 20:10:12 UTC (rev 9762) @@ -285,20 +285,13 @@ class SemanticAttributeSearchQuery extends NumericSearchQuery { - /* - public $base_units = array('m' => explode(',','km,miles,cm,dm,mm,ft,inch,inches,meter'), - 'm^2' => explode(',','km^2,ha,cm^2,mi^2'), - 'm^3' => explode(',','km^3,lit,cm^3,dm^3,gallons'), - ); - */ - /** * We need to detect units from the freetext query: * population > 1 million */ function __construct($search_query, $placeholders, $unit = '') { - $this->NumericSearchQuery($search_query, $placeholders); + parent::__construct($search_query, $placeholders); $this->_units = new Units(); $this->unit = $unit; } Modified: trunk/lib/TextSearchQuery.php =================================================================== --- trunk/lib/TextSearchQuery.php 2016-01-07 17:53:40 UTC (rev 9761) +++ trunk/lib/TextSearchQuery.php 2016-01-11 20:10:12 UTC (rev 9762) @@ -367,7 +367,7 @@ * @param $placeholders array or string All placeholders in the query must be defined * here, and will be replaced by the matcher. */ - public function NumericSearchQuery($search_query, $placeholders) + function __construct($search_query, $placeholders) { // added some basic security checks against user input $this->_query = $search_query; @@ -802,7 +802,7 @@ public $op = "NOT"; public $_op = TSQ_TOK_NOT; - function TextSearchQuery_node_not($leaf) + function __construct($leaf) { $this->leaves = array($leaf); } @@ -1141,8 +1141,7 @@ class TextSearchQuery_Lexer { - function TextSearchQuery_Lexer($query_str, $case_exact = false, - $regex = TSQ_REGEX_AUTO) + function __construct($query_str, $case_exact = false, $regex = TSQ_REGEX_AUTO) { $this->tokens = $this->tokenize($query_str, $case_exact, $regex); $this->query_str = $query_str; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-01-22 17:06:41
|
Revision: 9768 http://sourceforge.net/p/phpwiki/code/9768 Author: vargenau Date: 2016-01-22 17:06:38 +0000 (Fri, 22 Jan 2016) Log Message: ----------- Remove unused arguments Modified Paths: -------------- trunk/lib/plugin/IncludePage.php trunk/lib/stdlib.php Modified: trunk/lib/plugin/IncludePage.php =================================================================== --- trunk/lib/plugin/IncludePage.php 2016-01-22 17:04:02 UTC (rev 9767) +++ trunk/lib/plugin/IncludePage.php 2016-01-22 17:06:38 UTC (rev 9768) @@ -201,7 +201,7 @@ } } if ($sections) { - $c = extractSections($sections, $c, $pagename, $quiet, 1); + $c = extractSections($sections, $c); } if ($lines) { $c = array_slice($c, 0, $lines); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2016-01-22 17:04:02 UTC (rev 9767) +++ trunk/lib/stdlib.php 2016-01-22 17:06:38 UTC (rev 9768) @@ -1821,7 +1821,7 @@ } // Extract the first $sections sections of the page -function extractSections($sections, $content, $page, $quiet = false, $sectionhead = false) +function extractSections($sections, $content) { $mycontent = $content; @@ -1839,8 +1839,7 @@ $section = $match[2]; // Strip trailing blanks lines and ---- <hr>s $text = preg_replace("/\\s*^-{4,}\\s*$/m", "", $match[3]); - if ($sectionhead) - $text = $match[1] . $section . "\n" . $text; + $text = $match[1] . $section . "\n" . $text; $result .= $text; $mycontent = explode("\n", $match[4]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-02-08 09:12:57
|
Revision: 9777 http://sourceforge.net/p/phpwiki/code/9777 Author: vargenau Date: 2016-02-08 09:12:52 +0000 (Mon, 08 Feb 2016) Log Message: ----------- Add phpweather-2.2.2 Added Paths: ----------- trunk/lib/phpweather-2.2.2/ trunk/lib/phpweather-2.2.2/AUTHORS trunk/lib/phpweather-2.2.2/COPYING trunk/lib/phpweather-2.2.2/ChangeLog trunk/lib/phpweather-2.2.2/INSTALL trunk/lib/phpweather-2.2.2/README trunk/lib/phpweather-2.2.2/base_object.php trunk/lib/phpweather-2.2.2/config/ trunk/lib/phpweather-2.2.2/config/connectivity_test.php trunk/lib/phpweather-2.2.2/config/index.php trunk/lib/phpweather-2.2.2/config/make_config.php trunk/lib/phpweather-2.2.2/config/make_db.php trunk/lib/phpweather-2.2.2/config/make_stations.php trunk/lib/phpweather-2.2.2/config/pw_dependency.php trunk/lib/phpweather-2.2.2/config/pw_dependency_and.php trunk/lib/phpweather-2.2.2/config/pw_dependency_equal.php trunk/lib/phpweather-2.2.2/config/pw_dependency_not.php trunk/lib/phpweather-2.2.2/config/pw_dependency_or.php trunk/lib/phpweather-2.2.2/config/pw_option.php trunk/lib/phpweather-2.2.2/config/pw_option_boolean.php trunk/lib/phpweather-2.2.2/config/pw_option_integer.php trunk/lib/phpweather-2.2.2/config/pw_option_multi_select.php trunk/lib/phpweather-2.2.2/config/pw_option_select.php trunk/lib/phpweather-2.2.2/config/pw_option_text.php trunk/lib/phpweather-2.2.2/config/pw_optiongroup.php trunk/lib/phpweather-2.2.2/config/pw_validator.php trunk/lib/phpweather-2.2.2/config/pw_validator_ereg.php trunk/lib/phpweather-2.2.2/config/pw_validator_range.php trunk/lib/phpweather-2.2.2/config/reset_session.php trunk/lib/phpweather-2.2.2/config/speed_test.php trunk/lib/phpweather-2.2.2/currentimage.php trunk/lib/phpweather-2.2.2/data_retrieval.php trunk/lib/phpweather-2.2.2/db/ trunk/lib/phpweather-2.2.2/db/files/ trunk/lib/phpweather-2.2.2/db/files/AE.php trunk/lib/phpweather-2.2.2/db/files/AF.php trunk/lib/phpweather-2.2.2/db/files/AG.php trunk/lib/phpweather-2.2.2/db/files/AL.php trunk/lib/phpweather-2.2.2/db/files/AM.php trunk/lib/phpweather-2.2.2/db/files/AN.php trunk/lib/phpweather-2.2.2/db/files/AO.php trunk/lib/phpweather-2.2.2/db/files/AQ.php trunk/lib/phpweather-2.2.2/db/files/AR.php trunk/lib/phpweather-2.2.2/db/files/AT.php trunk/lib/phpweather-2.2.2/db/files/AU.php trunk/lib/phpweather-2.2.2/db/files/AW.php trunk/lib/phpweather-2.2.2/db/files/AZ.php trunk/lib/phpweather-2.2.2/db/files/BA.php trunk/lib/phpweather-2.2.2/db/files/BB.php trunk/lib/phpweather-2.2.2/db/files/BD.php trunk/lib/phpweather-2.2.2/db/files/BE.php trunk/lib/phpweather-2.2.2/db/files/BF.php trunk/lib/phpweather-2.2.2/db/files/BG.php trunk/lib/phpweather-2.2.2/db/files/BH.php trunk/lib/phpweather-2.2.2/db/files/BI.php trunk/lib/phpweather-2.2.2/db/files/BJ.php trunk/lib/phpweather-2.2.2/db/files/BM.php trunk/lib/phpweather-2.2.2/db/files/BN.php trunk/lib/phpweather-2.2.2/db/files/BO.php trunk/lib/phpweather-2.2.2/db/files/BR.php trunk/lib/phpweather-2.2.2/db/files/BS.php trunk/lib/phpweather-2.2.2/db/files/BW.php trunk/lib/phpweather-2.2.2/db/files/BY.php trunk/lib/phpweather-2.2.2/db/files/BZ.php trunk/lib/phpweather-2.2.2/db/files/CA.php trunk/lib/phpweather-2.2.2/db/files/CD.php trunk/lib/phpweather-2.2.2/db/files/CF.php trunk/lib/phpweather-2.2.2/db/files/CG.php trunk/lib/phpweather-2.2.2/db/files/CH.php trunk/lib/phpweather-2.2.2/db/files/CI.php trunk/lib/phpweather-2.2.2/db/files/CK.php trunk/lib/phpweather-2.2.2/db/files/CL.php trunk/lib/phpweather-2.2.2/db/files/CM.php trunk/lib/phpweather-2.2.2/db/files/CN.php trunk/lib/phpweather-2.2.2/db/files/CO.php trunk/lib/phpweather-2.2.2/db/files/CR.php trunk/lib/phpweather-2.2.2/db/files/CU.php trunk/lib/phpweather-2.2.2/db/files/CV.php trunk/lib/phpweather-2.2.2/db/files/CX.php trunk/lib/phpweather-2.2.2/db/files/CY.php trunk/lib/phpweather-2.2.2/db/files/CZ.php trunk/lib/phpweather-2.2.2/db/files/DE.php trunk/lib/phpweather-2.2.2/db/files/DJ.php trunk/lib/phpweather-2.2.2/db/files/DK.php trunk/lib/phpweather-2.2.2/db/files/DM.php trunk/lib/phpweather-2.2.2/db/files/DO.php trunk/lib/phpweather-2.2.2/db/files/DZ.php trunk/lib/phpweather-2.2.2/db/files/EC.php trunk/lib/phpweather-2.2.2/db/files/EE.php trunk/lib/phpweather-2.2.2/db/files/EG.php trunk/lib/phpweather-2.2.2/db/files/EH.php trunk/lib/phpweather-2.2.2/db/files/ES.php trunk/lib/phpweather-2.2.2/db/files/ET.php trunk/lib/phpweather-2.2.2/db/files/FI.php trunk/lib/phpweather-2.2.2/db/files/FJ.php trunk/lib/phpweather-2.2.2/db/files/FK.php trunk/lib/phpweather-2.2.2/db/files/FM.php trunk/lib/phpweather-2.2.2/db/files/FR.php trunk/lib/phpweather-2.2.2/db/files/GA.php trunk/lib/phpweather-2.2.2/db/files/GB.php trunk/lib/phpweather-2.2.2/db/files/GD.php trunk/lib/phpweather-2.2.2/db/files/GE.php trunk/lib/phpweather-2.2.2/db/files/GF.php trunk/lib/phpweather-2.2.2/db/files/GH.php trunk/lib/phpweather-2.2.2/db/files/GI.php trunk/lib/phpweather-2.2.2/db/files/GL.php trunk/lib/phpweather-2.2.2/db/files/GM.php trunk/lib/phpweather-2.2.2/db/files/GN.php trunk/lib/phpweather-2.2.2/db/files/GP.php trunk/lib/phpweather-2.2.2/db/files/GQ.php trunk/lib/phpweather-2.2.2/db/files/GR.php trunk/lib/phpweather-2.2.2/db/files/GS.php trunk/lib/phpweather-2.2.2/db/files/GT.php trunk/lib/phpweather-2.2.2/db/files/GW.php trunk/lib/phpweather-2.2.2/db/files/GY.php trunk/lib/phpweather-2.2.2/db/files/HK.php trunk/lib/phpweather-2.2.2/db/files/HN.php trunk/lib/phpweather-2.2.2/db/files/HR.php trunk/lib/phpweather-2.2.2/db/files/HT.php trunk/lib/phpweather-2.2.2/db/files/HU.php trunk/lib/phpweather-2.2.2/db/files/ID.php trunk/lib/phpweather-2.2.2/db/files/IE.php trunk/lib/phpweather-2.2.2/db/files/IL.php trunk/lib/phpweather-2.2.2/db/files/IN.php trunk/lib/phpweather-2.2.2/db/files/IO.php trunk/lib/phpweather-2.2.2/db/files/IQ.php trunk/lib/phpweather-2.2.2/db/files/IR.php trunk/lib/phpweather-2.2.2/db/files/IS.php trunk/lib/phpweather-2.2.2/db/files/IT.php trunk/lib/phpweather-2.2.2/db/files/JM.php trunk/lib/phpweather-2.2.2/db/files/JO.php trunk/lib/phpweather-2.2.2/db/files/JP.php trunk/lib/phpweather-2.2.2/db/files/KE.php trunk/lib/phpweather-2.2.2/db/files/KH.php trunk/lib/phpweather-2.2.2/db/files/KI.php trunk/lib/phpweather-2.2.2/db/files/KM.php trunk/lib/phpweather-2.2.2/db/files/KN.php trunk/lib/phpweather-2.2.2/db/files/KP.php trunk/lib/phpweather-2.2.2/db/files/KR.php trunk/lib/phpweather-2.2.2/db/files/KW.php trunk/lib/phpweather-2.2.2/db/files/KY.php trunk/lib/phpweather-2.2.2/db/files/KZ.php trunk/lib/phpweather-2.2.2/db/files/LA.php trunk/lib/phpweather-2.2.2/db/files/LB.php trunk/lib/phpweather-2.2.2/db/files/LC.php trunk/lib/phpweather-2.2.2/db/files/LK.php trunk/lib/phpweather-2.2.2/db/files/LR.php trunk/lib/phpweather-2.2.2/db/files/LS.php trunk/lib/phpweather-2.2.2/db/files/LT.php trunk/lib/phpweather-2.2.2/db/files/LU.php trunk/lib/phpweather-2.2.2/db/files/LV.php trunk/lib/phpweather-2.2.2/db/files/LY.php trunk/lib/phpweather-2.2.2/db/files/MA.php trunk/lib/phpweather-2.2.2/db/files/MD.php trunk/lib/phpweather-2.2.2/db/files/MG.php trunk/lib/phpweather-2.2.2/db/files/MH.php trunk/lib/phpweather-2.2.2/db/files/MK.php trunk/lib/phpweather-2.2.2/db/files/ML.php trunk/lib/phpweather-2.2.2/db/files/MM.php trunk/lib/phpweather-2.2.2/db/files/MO.php trunk/lib/phpweather-2.2.2/db/files/MQ.php trunk/lib/phpweather-2.2.2/db/files/MR.php trunk/lib/phpweather-2.2.2/db/files/MT.php trunk/lib/phpweather-2.2.2/db/files/MU.php trunk/lib/phpweather-2.2.2/db/files/MV.php trunk/lib/phpweather-2.2.2/db/files/MW.php trunk/lib/phpweather-2.2.2/db/files/MX.php trunk/lib/phpweather-2.2.2/db/files/MY.php trunk/lib/phpweather-2.2.2/db/files/MZ.php trunk/lib/phpweather-2.2.2/db/files/NA.php trunk/lib/phpweather-2.2.2/db/files/NC.php trunk/lib/phpweather-2.2.2/db/files/NE.php trunk/lib/phpweather-2.2.2/db/files/NG.php trunk/lib/phpweather-2.2.2/db/files/NI.php trunk/lib/phpweather-2.2.2/db/files/NL.php trunk/lib/phpweather-2.2.2/db/files/NO.php trunk/lib/phpweather-2.2.2/db/files/NP.php trunk/lib/phpweather-2.2.2/db/files/NR.php trunk/lib/phpweather-2.2.2/db/files/NZ.php trunk/lib/phpweather-2.2.2/db/files/OM.php trunk/lib/phpweather-2.2.2/db/files/PA.php trunk/lib/phpweather-2.2.2/db/files/PE.php trunk/lib/phpweather-2.2.2/db/files/PF.php trunk/lib/phpweather-2.2.2/db/files/PG.php trunk/lib/phpweather-2.2.2/db/files/PH.php trunk/lib/phpweather-2.2.2/db/files/PK.php trunk/lib/phpweather-2.2.2/db/files/PL.php trunk/lib/phpweather-2.2.2/db/files/PM.php trunk/lib/phpweather-2.2.2/db/files/PR.php trunk/lib/phpweather-2.2.2/db/files/PT.php trunk/lib/phpweather-2.2.2/db/files/PW.php trunk/lib/phpweather-2.2.2/db/files/PY.php trunk/lib/phpweather-2.2.2/db/files/QA.php trunk/lib/phpweather-2.2.2/db/files/RE.php trunk/lib/phpweather-2.2.2/db/files/RO.php trunk/lib/phpweather-2.2.2/db/files/RU.php trunk/lib/phpweather-2.2.2/db/files/RW.php trunk/lib/phpweather-2.2.2/db/files/SA.php trunk/lib/phpweather-2.2.2/db/files/SB.php trunk/lib/phpweather-2.2.2/db/files/SC.php trunk/lib/phpweather-2.2.2/db/files/SD.php trunk/lib/phpweather-2.2.2/db/files/SE.php trunk/lib/phpweather-2.2.2/db/files/SG.php trunk/lib/phpweather-2.2.2/db/files/SH.php trunk/lib/phpweather-2.2.2/db/files/SI.php trunk/lib/phpweather-2.2.2/db/files/SK.php trunk/lib/phpweather-2.2.2/db/files/SL.php trunk/lib/phpweather-2.2.2/db/files/SN.php trunk/lib/phpweather-2.2.2/db/files/SO.php trunk/lib/phpweather-2.2.2/db/files/SR.php trunk/lib/phpweather-2.2.2/db/files/ST.php trunk/lib/phpweather-2.2.2/db/files/SV.php trunk/lib/phpweather-2.2.2/db/files/SY.php trunk/lib/phpweather-2.2.2/db/files/SZ.php trunk/lib/phpweather-2.2.2/db/files/TD.php trunk/lib/phpweather-2.2.2/db/files/TG.php trunk/lib/phpweather-2.2.2/db/files/TH.php trunk/lib/phpweather-2.2.2/db/files/TJ.php trunk/lib/phpweather-2.2.2/db/files/TL.php trunk/lib/phpweather-2.2.2/db/files/TN.php trunk/lib/phpweather-2.2.2/db/files/TO.php trunk/lib/phpweather-2.2.2/db/files/TR.php trunk/lib/phpweather-2.2.2/db/files/TT.php trunk/lib/phpweather-2.2.2/db/files/TV.php trunk/lib/phpweather-2.2.2/db/files/TW.php trunk/lib/phpweather-2.2.2/db/files/TZ.php trunk/lib/phpweather-2.2.2/db/files/UA.php trunk/lib/phpweather-2.2.2/db/files/UG.php trunk/lib/phpweather-2.2.2/db/files/UM.php trunk/lib/phpweather-2.2.2/db/files/US.php trunk/lib/phpweather-2.2.2/db/files/UY.php trunk/lib/phpweather-2.2.2/db/files/UZ.php trunk/lib/phpweather-2.2.2/db/files/VC.php trunk/lib/phpweather-2.2.2/db/files/VE.php trunk/lib/phpweather-2.2.2/db/files/VG.php trunk/lib/phpweather-2.2.2/db/files/VI.php trunk/lib/phpweather-2.2.2/db/files/VN.php trunk/lib/phpweather-2.2.2/db/files/VU.php trunk/lib/phpweather-2.2.2/db/files/WS.php trunk/lib/phpweather-2.2.2/db/files/YE.php trunk/lib/phpweather-2.2.2/db/files/YU.php trunk/lib/phpweather-2.2.2/db/files/ZA.php trunk/lib/phpweather-2.2.2/db/files/ZM.php trunk/lib/phpweather-2.2.2/db/files/ZW.php trunk/lib/phpweather-2.2.2/db/files/countries.php trunk/lib/phpweather-2.2.2/db/files/stations.db trunk/lib/phpweather-2.2.2/db/pw_db_adodb.php trunk/lib/phpweather-2.2.2/db/pw_db_common.php trunk/lib/phpweather-2.2.2/db/pw_db_dba.php trunk/lib/phpweather-2.2.2/db/pw_db_mysql.php trunk/lib/phpweather-2.2.2/db/pw_db_null.php trunk/lib/phpweather-2.2.2/db/pw_db_pgsql.php trunk/lib/phpweather-2.2.2/db_layer.php trunk/lib/phpweather-2.2.2/db_updater.php trunk/lib/phpweather-2.2.2/defaults-dist.php trunk/lib/phpweather-2.2.2/doc/ trunk/lib/phpweather-2.2.2/doc/generate-doc.sh trunk/lib/phpweather-2.2.2/doc/phpweather.dvi trunk/lib/phpweather-2.2.2/doc/phpweather.html trunk/lib/phpweather-2.2.2/doc/phpweather.info trunk/lib/phpweather-2.2.2/doc/phpweather.pdf trunk/lib/phpweather-2.2.2/doc/phpweather.ps trunk/lib/phpweather-2.2.2/doc/phpweather.txt trunk/lib/phpweather-2.2.2/doc/src/ trunk/lib/phpweather-2.2.2/doc/src/contributors-body.texi trunk/lib/phpweather-2.2.2/doc/src/contributors.texi trunk/lib/phpweather-2.2.2/doc/src/phpweather.texi trunk/lib/phpweather-2.2.2/doc/src/texinfo.tex trunk/lib/phpweather-2.2.2/icons/ trunk/lib/phpweather-2.2.2/icons/0cloud.png trunk/lib/phpweather-2.2.2/icons/0cloud_fog.png trunk/lib/phpweather-2.2.2/icons/1cloud_fog.png trunk/lib/phpweather-2.2.2/icons/1cloud_heavyrain.png trunk/lib/phpweather-2.2.2/icons/1cloud_lightrain.png trunk/lib/phpweather-2.2.2/icons/1cloud_modrain.png trunk/lib/phpweather-2.2.2/icons/1cloud_norain.png trunk/lib/phpweather-2.2.2/icons/2cloud_fog.png trunk/lib/phpweather-2.2.2/icons/2cloud_hail.png trunk/lib/phpweather-2.2.2/icons/2cloud_heavyrain.png trunk/lib/phpweather-2.2.2/icons/2cloud_lightrain.png trunk/lib/phpweather-2.2.2/icons/2cloud_modrain.png trunk/lib/phpweather-2.2.2/icons/2cloud_norain.png trunk/lib/phpweather-2.2.2/icons/2cloud_snow.png trunk/lib/phpweather-2.2.2/icons/2cloud_thunders.png trunk/lib/phpweather-2.2.2/icons/3cloud_fog.png trunk/lib/phpweather-2.2.2/icons/3cloud_hail.png trunk/lib/phpweather-2.2.2/icons/3cloud_heavyrain.png trunk/lib/phpweather-2.2.2/icons/3cloud_lightrain.png trunk/lib/phpweather-2.2.2/icons/3cloud_modrain.png trunk/lib/phpweather-2.2.2/icons/3cloud_norain.png trunk/lib/phpweather-2.2.2/icons/3cloud_snow.png trunk/lib/phpweather-2.2.2/icons/3cloud_thunders.png trunk/lib/phpweather-2.2.2/icons/4_cloud_modrain.png trunk/lib/phpweather-2.2.2/icons/4cloud_fog.png trunk/lib/phpweather-2.2.2/icons/4cloud_hail.png trunk/lib/phpweather-2.2.2/icons/4cloud_heavyhail.png trunk/lib/phpweather-2.2.2/icons/4cloud_heavyrain.png trunk/lib/phpweather-2.2.2/icons/4cloud_heavysnow.png trunk/lib/phpweather-2.2.2/icons/4cloud_lighthail.png trunk/lib/phpweather-2.2.2/icons/4cloud_lightrain.png trunk/lib/phpweather-2.2.2/icons/4cloud_lightsnow.png trunk/lib/phpweather-2.2.2/icons/4cloud_modrain.png trunk/lib/phpweather-2.2.2/icons/4cloud_norain.png trunk/lib/phpweather-2.2.2/icons/4cloud_thunders.png trunk/lib/phpweather-2.2.2/icons/eee.png trunk/lib/phpweather-2.2.2/icons/n_0cloud.png trunk/lib/phpweather-2.2.2/icons/n_0cloud_fog.png trunk/lib/phpweather-2.2.2/icons/n_1cloud_fog.png trunk/lib/phpweather-2.2.2/icons/n_1cloud_heavyrain.png trunk/lib/phpweather-2.2.2/icons/n_1cloud_lightrain.png trunk/lib/phpweather-2.2.2/icons/n_1cloud_modrain.png trunk/lib/phpweather-2.2.2/icons/n_1cloud_norain.png trunk/lib/phpweather-2.2.2/icons/n_2cloud_fog.png trunk/lib/phpweather-2.2.2/icons/n_2cloud_hail.png trunk/lib/phpweather-2.2.2/icons/n_2cloud_heavyrain.png trunk/lib/phpweather-2.2.2/icons/n_2cloud_lightrain.png trunk/lib/phpweather-2.2.2/icons/n_2cloud_modrain.png trunk/lib/phpweather-2.2.2/icons/n_2cloud_norain.png trunk/lib/phpweather-2.2.2/icons/n_2cloud_snow.png trunk/lib/phpweather-2.2.2/icons/n_2cloud_thunders.png trunk/lib/phpweather-2.2.2/icons/n_3cloud_fog.png trunk/lib/phpweather-2.2.2/icons/n_3cloud_hail.png trunk/lib/phpweather-2.2.2/icons/n_3cloud_heavyrain.png trunk/lib/phpweather-2.2.2/icons/n_3cloud_lightrain.png trunk/lib/phpweather-2.2.2/icons/n_3cloud_modrain.png trunk/lib/phpweather-2.2.2/icons/n_3cloud_norain.png trunk/lib/phpweather-2.2.2/icons/n_3cloud_snow.png trunk/lib/phpweather-2.2.2/icons/n_3cloud_thunders.png trunk/lib/phpweather-2.2.2/icons/ne.png trunk/lib/phpweather-2.2.2/icons/nee.png trunk/lib/phpweather-2.2.2/icons/nne.png trunk/lib/phpweather-2.2.2/icons/nnn.png trunk/lib/phpweather-2.2.2/icons/nnw.png trunk/lib/phpweather-2.2.2/icons/nodir.png trunk/lib/phpweather-2.2.2/icons/nw.png trunk/lib/phpweather-2.2.2/icons/nww.png trunk/lib/phpweather-2.2.2/icons/phpweather-black.png trunk/lib/phpweather-2.2.2/icons/phpweather-long-black.png trunk/lib/phpweather-2.2.2/icons/phpweather-long-white.png trunk/lib/phpweather-2.2.2/icons/phpweather-white.png trunk/lib/phpweather-2.2.2/icons/se.png trunk/lib/phpweather-2.2.2/icons/see.png trunk/lib/phpweather-2.2.2/icons/sse.png trunk/lib/phpweather-2.2.2/icons/sss.png trunk/lib/phpweather-2.2.2/icons/ssw.png trunk/lib/phpweather-2.2.2/icons/sw.png trunk/lib/phpweather-2.2.2/icons/sww.png trunk/lib/phpweather-2.2.2/icons/temp_nodata.png trunk/lib/phpweather-2.2.2/icons/tempchilled.png trunk/lib/phpweather-2.2.2/icons/temphigh.png trunk/lib/phpweather-2.2.2/icons/templow.png trunk/lib/phpweather-2.2.2/icons/vrb.gif trunk/lib/phpweather-2.2.2/icons/wind_nodata.png trunk/lib/phpweather-2.2.2/icons/www.png trunk/lib/phpweather-2.2.2/images-test.php trunk/lib/phpweather-2.2.2/index.php trunk/lib/phpweather-2.2.2/languages.php trunk/lib/phpweather-2.2.2/output/ trunk/lib/phpweather-2.2.2/output/pw_images.php trunk/lib/phpweather-2.2.2/output/pw_output.php trunk/lib/phpweather-2.2.2/output/pw_text.php trunk/lib/phpweather-2.2.2/output/pw_text_cs.php trunk/lib/phpweather-2.2.2/output/pw_text_da.php trunk/lib/phpweather-2.2.2/output/pw_text_de.php trunk/lib/phpweather-2.2.2/output/pw_text_en.php trunk/lib/phpweather-2.2.2/output/pw_text_en_GB.php trunk/lib/phpweather-2.2.2/output/pw_text_en_US.php trunk/lib/phpweather-2.2.2/output/pw_text_es.php trunk/lib/phpweather-2.2.2/output/pw_text_fi.php trunk/lib/phpweather-2.2.2/output/pw_text_fr.php trunk/lib/phpweather-2.2.2/output/pw_text_hu.php trunk/lib/phpweather-2.2.2/output/pw_text_it.php trunk/lib/phpweather-2.2.2/output/pw_text_nl.php trunk/lib/phpweather-2.2.2/output/pw_text_no.php trunk/lib/phpweather-2.2.2/output/pw_text_pl.php trunk/lib/phpweather-2.2.2/output/pw_text_pt.php trunk/lib/phpweather-2.2.2/output/pw_text_sk.php trunk/lib/phpweather-2.2.2/output/pw_text_sv.php trunk/lib/phpweather-2.2.2/output/pw_text_tr.php trunk/lib/phpweather-2.2.2/phpweather.php trunk/lib/phpweather-2.2.2/pw_style.css trunk/lib/phpweather-2.2.2/pw_utilities.php trunk/lib/phpweather-2.2.2/stations.csv trunk/lib/phpweather-2.2.2/test.php trunk/lib/phpweather-2.2.2/test2.php Added: trunk/lib/phpweather-2.2.2/AUTHORS =================================================================== --- trunk/lib/phpweather-2.2.2/AUTHORS (rev 0) +++ trunk/lib/phpweather-2.2.2/AUTHORS 2016-02-08 09:12:52 UTC (rev 9777) @@ -0,0 +1,157 @@ +AUTHORS file for PHP Weather 2.2.2 2004-06-17 +Copyright (C) 2000-2004 Martin Geisler <gim...@gi...> +Licensed under the GNU GPL. See the file `COPYING' for details. + +Contributors to PHP Weather +*************************** + +Everybody listed below has helped in some way with the creation of PHP +Weather. If, by some mistake, your name isn't listed below, then send +a mail to Martin Geisler <gim...@gi...> so that proper credit +can given. Please include your SourceForge login, if any, and an URL +if you like. + +Kristian Kristensen (kkrz) + He made the interface to PostgreSQL. + +Jeremy D. Zawodny + He wrote `Geo::METAR', which is a Perl module which can do some of + the things PHP Weather now does. `Geo::METAR' can be found here: + `http://www.wcnet.org/jzawodn/perl/Geo-METAR/index.html'. + +Enrico Lodolo + For suggesting that I use http to get the METARs instead of the + much slower ftp. + +Stefan Wiesendanger + For rewritting some large `case'- and `switch'-statements as a + couple of arrays. This speeds-up the parsing of the METARs. + +Mike + He noticed that the pressures was all wrong. I though the unit + used in the METAR was hPa, when it really was inHg. + +Jeffrey Y. Sue + Suggested that I told people how to turn off the warnings, if you + don't establish a connection to MySQL. + + Later he made it possible to use PHP Weather with DBM databases. He + also added support for precipitation. Lots of other stuff, see the + `ChangeLog' for more details. + +Rutger Lubbers + Noticed that South/southeast was duplicated in the + directions-array. + +Eduardo Guilenea + Translated PHP Weather into Spanish, and thereby forced me to add + support for multiply languages. (Which was a Good Thing :-) + +Sven-Erik (seasoft) + Translated PHP Weather into Norwegian. + + He also sat down and did the boring work, when he manually compiled + the complete list of all airports available from NWS. + +Maciek Uhlig + Noticed that I sometimes tried to access `$cloud_coverage_array' + with just `$cloud_coverage' -- which, of cause, didn't work. + +Ing. Vladimir Kotala + Suggested that I changed the long text `... degrees Celsius' into + the more compact `... \xB0C', which is much better. + +Gyulai Mih\xE1ly (misibacsi) `http://gyulai.freeyellow.com/' + Made the Hungarian translation for PHP Weather. He has also + corrected tons of spelling errors. + +Johnny Funder <jh...@na...> + Lots of explanations and suggestions. He also gave a much simpler + formula for calculating the relative humidity. + +Ray van Beek + Helped me spot a little error with the current weather. He has also + written code that displays the current weather as an image. + +David Kjellquist + Added support for windchill. + +Max Hammond (iridium) + Lots of different things: bugfixes, clever suggestions, and general + maintenance. + +Jes\xFAs Pe\xF1as + Made the Spanish translation. + +Ondrej Jombik (nepto) + Translated PHP Weather into Slovak and rewrote the navigation + system used in index.php. He also looked at the MySQL and + PostgreSQL database and found some security flaws. + +Reini Urban + Fixed some problems with using PHP Weather on a default + installation of PHP 4.2. + +Kari Salovaara and Tage Malmen + Translated PHP Weater into Swedish and Finnish. + +Paul Kairis + Wrote the code that handles connections through a proxy server. + +Bas Elshof + Translated PHP Weather into Dutch. + +V\xE1clav R\xEDkal + Made a Czech translation. + +Radoslava Fed\xE1kov\xE1 + Czech translation. + +Guillaume Petit + Translated PHP Weather into French. + +Rudy Boedts + Updated the Dutch translation. + +Konrad Tadesse + Finally, a working German translation. + +Andrew Simpson (andrewsimpson) + Reported problems with the use of short open tags in a couple of + files. + +Jim Whitehead + Fixed the rounding of hours and minutes in the pretty-printed + report. + +Ferhat Bingol + Made a Turkish translation. + +Renato Gallmetzer + Provided us with an Italian translation. + +Pablo Alcaraz (pabloa) + Updated the Spanish translation and other bugfixes. + +Etienne Tourigny (etienne_t) + Added a method that decodes TAF reports and made some of the + database backends archive the data instead of always replacing the + old data with new reports. + +Justin Heideman + Drew a full set of beautiful icons for PHP Weather to display the + current weather conditions. + +Warren Rohner + Updated the South African stations in the `stations.csv' file. + +Nick Crossland (ncrossland) + Made a British English translation. + +Jos\xE9 de \xC1vila Junior + Updated the Brazillian stations in the `stations.csv' file. + +Cl\xE1udio Gamboa + Contributed a Portugues translation. + + Added: trunk/lib/phpweather-2.2.2/COPYING =================================================================== --- trunk/lib/phpweather-2.2.2/COPYING (rev 0) +++ trunk/lib/phpweather-2.2.2/COPYING 2016-02-08 09:12:52 UTC (rev 9777) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Added: trunk/lib/phpweather-2.2.2/ChangeLog =================================================================== --- trunk/lib/phpweather-2.2.2/ChangeLog (rev 0) +++ trunk/lib/phpweather-2.2.2/ChangeLog 2016-02-08 09:12:52 UTC (rev 9777) @@ -0,0 +1,3322 @@ +2004-06-17 12:54 Martin Geisler <gim...@gi...> + + * doc/src/contributors-body.texi: + + Fixed plain @. + +2004-06-17 12:31 Martin Geisler <gim...@gi...> + + * index.php: + + Remove any extra spaces in those two variables. + +2004-06-01 20:39 Martin Geisler <gim...@gi...> + + * doc/src/contributors-body.texi, output/pw_text_pt.php: + + Added a Portuguese translation made by Cl\xE1udio Gamboa. + +2004-06-01 20:30 Martin Geisler <gim...@gi...> + + * db/pw_db_null.php: + + The third field should be trimmed to remove the added padding. + +2004-05-29 16:08 Martin Geisler <gim...@gi...> + + * stations.csv, doc/src/contributors-body.texi: + + Update of the Brazillian stations. + +2004-05-10 09:00 Martin Geisler <gim...@gi...> + + * data_retrieval.php: + + Fix for bug report #951022 --- no initialization of $metar_time + when no METAR is received. + +2004-02-22 12:18 Max Hammond <ma...@fl...> + + * output/pw_text_en_US.php: + + Past tense + +2004-02-11 15:04 Martin Geisler <gim...@gi...> + + * doc/src/contributors-body.texi: + + Let's not forget Nick Crossland (ncrossland) for making the British + English translation. + +2004-02-11 14:40 Martin Geisler <gim...@gi...> + + * config/make_config.php: + + This will detect when session.auto_start is turned on, and abort so + that the user doesn't see a bunch of errors. Closes #816921. + +2004-02-11 14:08 Martin Geisler <gim...@gi...> + + * languages.php, pw_utilities.php, output/pw_text_en.php, + output/pw_text_en_GB.php, output/pw_text_en_US.php: + + Added a British English translation from Nick Crossland + (ncrossland), and reworked the object hiarachy to support dialects + within a language. + + The idea is that pw_text_en_US contains the code and pw_text_en_GB + extends this class to overrides a few strings. I've left a + pw_text_en class that can be used as an alias for pw_text_en_US. + + The function get_languages in pw_utilities has been adjusted + accordingly. + +2004-02-11 14:02 Martin Geisler <gim...@gi...> + + * output/pw_text.php: + + Use plural form of 'meter' here, this closes #891081 at + SourceForge, thanks goes to Nick Crossland (ncrossland) for + spotting this. + +2004-02-03 16:37 etienne_t + + * ChangeLog: + + Entries from the 2.1.2 release + +2004-02-03 16:33 etienne_t + + * VERSION: + + This is PHP Weather version 2.2.1 + +2004-02-03 16:22 etienne_t + + * .cvsignore: + + added test2.php to .cvsignore + +2004-02-01 17:29 Martin Geisler <gim...@gi...> + + * AUTHORS: + + More auto-generated documentation which shouldn't be in CVS either. + +2004-02-01 17:28 Martin Geisler <gim...@gi...> + + * doc/: phpweather.dvi, phpweather.html, phpweather.info, + phpweather.info-1, phpweather.info-2, phpweather.pdf, + phpweather.ps, phpweather.txt: + + I don't think the auto-generated documentation should be in CVS. + +2004-01-30 20:46 etienne_t + + * data_retrieval.php, phpweather.php, test2.php, + db/pw_db_mysql.php, db/pw_db_null.php, output/pw_text.php: + + Fixed the timestamp for METAR retreival and archiving in mysql and + null backends. The timestamp is kept as a unix timestamp (UTC) in + the objects. The mysql backend has been modified to keep a UTC + format in the table. + +2004-01-03 19:05 Martin Geisler <gim...@gi...> + + * data_retrieval.php, phpweather.php: + + This restores the null and mysql database backends to working + order... let's hope they stay that way. + +2004-01-03 18:38 Martin Geisler <gim...@gi...> + + * db/pw_db_mysql.php: + + Hmm... that was broke! + +2004-01-03 18:38 Martin Geisler <gim...@gi...> + + * index.php: + + I really think we should give this all it can take, so that we + catch undefined variables... remember, the index.php page is only + for demonstration purposes. + +2004-01-03 10:51 Martin Geisler <gim...@gi...> + + * data_retrieval.php: + + Reindention --- I read through the code and expanded a comment to + better document the behavious or gmmktime. + +2004-01-02 02:50 Martin Geisler <gim...@gi...> + + * output/pw_text_fi.php: + + Updates from Kari Salovaara. + +2004-01-01 23:46 Martin Geisler <gim...@gi...> + + * ChangeLog: + + Entries from the 2.1.2 release. + +2004-01-01 23:45 Martin Geisler <gim...@gi...> + + * VERSION: + + This is PHP Weather version 2.2.0. + +2004-01-01 23:40 Martin Geisler <gim...@gi...> + + * doc/src/: contributors.texi, phpweather.texi: + + More timestamps... + +2004-01-01 23:36 Martin Geisler <gim...@gi...> + + * INSTALL, README, README-CVS, make-release.sh: + + Updated year to 2004 --- Happy New Year! + +2004-01-01 23:31 Martin Geisler <gim...@gi...> + + * make-release.sh: + + Use the new script to generate the documentation for the release. + +2004-01-01 23:30 Martin Geisler <gim...@gi...> + + * .cvsignore: + + Also, please ignore the AUTHORS file for it's now autogenerated. + +2004-01-01 23:29 Martin Geisler <gim...@gi...> + + * doc/.cvsignore: + + Now please ignore all the phpweather.txt, phpweather.ps, ... files. + +2004-01-01 23:28 Martin Geisler <gim...@gi...> + + * doc/generate-doc.sh: + + I've replaced the autogenerated files with a scipt that can + generate them --- this script is also used for new releases. + +2004-01-01 23:20 Martin Geisler <gim...@gi...> + + * make-release.sh: + + The AUTHORS file is now generated from the Texinfo documentation. + + The release will now be pulled from the CVS server for developer + logins, bypassing the delay for the anonymous CVS service at + SourceForge. + +2004-01-01 22:50 Martin Geisler <gim...@gi...> + + * doc/src/phpweather.texi: + + Moved the Contributors chapter to contributors-body.texi, and + expanded things like "it's" to "it is". + +2004-01-01 22:49 Martin Geisler <gim...@gi...> + + * doc/src/contributors-body.texi: + + Hmm, there shouldn't be any indention after chapters etc. + +2004-01-01 21:59 Martin Geisler <gim...@gi...> + + * doc/src/: contributors.texi, contributors-body.texi: + + I've made a stand-alone Texinfo file that can be used to generate + the AUTHORS file. This will make sure that the AUTHORS file is in + sync with the Contributors chapter in the manual. + +2003-12-30 16:24 Martin Geisler <gim...@gi...> + + * db/files/: DJ.php, US.php, ZA.php, stations.db: + + Regenerated from the updated stations.csv file. + +2003-12-30 16:06 Martin Geisler <gim...@gi...> + + * stations.csv: + + Updated list of South African airports from Warren Rohner. + +2003-12-30 16:01 Martin Geisler <gim...@gi...> + + * data_retrieval.php: + + Removed a couple of old debug statements. + +2003-10-23 12:25 Martin Geisler <gim...@gi...> + + * output/pw_text_nl.php: + + Fixes sent to me by Nico Out <nm...@hc...>. + +2003-10-10 23:33 Martin Geisler <gim...@gi...> + + * AUTHORS, doc/src/phpweather.texi: + + Added latest contributors. I think the AUTHORS file ought to be + linked to the Contributors section in the Texinfo source so that + the two doesn't have to be keept synchronized. + +2003-10-07 22:41 Martin Geisler <gim...@gi...> + + * icons/vrb.png: + + That one shouldn't have been commited, for I'm keeping the animated + GIF image for the variable wind conditions. I would have preffered + to convert it into a MNG movie, but the MNG format still isn't + supported by any major browsers --- they've even recently removed + support for MNG animations from Mozilla... :-( + +2003-10-07 22:31 Martin Geisler <gim...@gi...> + + * currentimage.php, index.php, test.php, + config/connectivity_test.php, config/index.php, + config/make_config.php, config/make_db.php, + config/make_stations.php, config/speed_test.php, + output/pw_images.php: + + From GIF to PNG images all around. + +2003-10-07 22:30 Martin Geisler <gim...@gi...> + + * icons/: 0cloud.gif, 0cloud.png, 0cloud_fog.gif, 0cloud_fog.png, + 1cloud_fog.gif, 1cloud_fog.png, 1cloud_heavyrain.gif, + 1cloud_heavyrain.png, 1cloud_lightrain.gif, 1cloud_lightrain.png, + 1cloud_modrain.gif, 1cloud_modrain.png, 1cloud_norain.gif, + 1cloud_norain.png, 2cloud_fog.gif, 2cloud_fog.png, 2cloud_hail.gif, + 2cloud_hail.png, 2cloud_heavyrain.gif, 2cloud_heavyrain.png, + 2cloud_lightrain.gif, 2cloud_lightrain.png, 2cloud_modrain.gif, + 2cloud_modrain.png, 2cloud_norain.gif, 2cloud_norain.png, + 2cloud_snow.gif, 2cloud_snow.png, 2cloud_thunders.gif, + 2cloud_thunders.png, 3cloud_fog.gif, 3cloud_fog.png, + 3cloud_hail.gif, 3cloud_hail.png, 3cloud_heavyrain.gif, + 3cloud_heavyrain.png, 3cloud_lightrain.gif, 3cloud_lightrain.png, + 3cloud_modrain.gif, 3cloud_modrain.png, 3cloud_norain.gif, + 3cloud_norain.png, 3cloud_snow.gif, 3cloud_snow.png, + 3cloud_thunders.gif, 3cloud_thunders.png, 4_cloud_modrain.png, + 4cloud_fog.gif, 4cloud_fog.png, 4cloud_hail.png, + 4cloud_heavyhail.gif, 4cloud_heavyhail.png, 4cloud_heavyrain.gif, + 4cloud_heavyrain.png, 4cloud_heavysnow.gif, 4cloud_heavysnow.png, + 4cloud_lighthail.gif, 4cloud_lighthail.png, 4cloud_lightrain.gif, + 4cloud_lightrain.png, 4cloud_lightsnow.gif, 4cloud_lightsnow.png, + 4cloud_modrain.gif, 4cloud_modrain.png, 4cloud_norain.gif, + 4cloud_norain.png, 4cloud_thunders.gif, 4cloud_thunders.png, + eee.gif, eee.png, n_0cloud.gif, n_0cloud.png, n_0cloud_fog.gif, + n_0cloud_fog.png, n_1cloud_fog.gif, n_1cloud_fog.png, + n_1cloud_heavyrain.gif, n_1cloud_heavyrain.png, + n_1cloud_lightrain.gif, n_1cloud_lightrain.png, + n_1cloud_modrain.gif, n_1cloud_modrain.png, n_1cloud_norain.gif, + n_1cloud_norain.png, n_2cloud_fog.gif, n_2cloud_fog.png, + n_2cloud_hail.gif, n_2cloud_hail.png, n_2cloud_heavyrain.gif, + n_2cloud_heavyrain.png, n_2cloud_lightrain.gif, + n_2cloud_lightrain.png, n_2cloud_modrain.gif, n_2cloud_modrain.png, + n_2cloud_norain.gif, n_2cloud_norain.png, n_2cloud_snow.gif, + n_2cloud_snow.png, n_2cloud_thunders.gif, n_2cloud_thunders.png, + n_3cloud_fog.gif, n_3cloud_fog.png, n_3cloud_hail.gif, + n_3cloud_hail.png, n_3cloud_heavyrain.gif, n_3cloud_heavyrain.png, + n_3cloud_lightrain.gif, n_3cloud_lightrain.png, + n_3cloud_modrain.gif, n_3cloud_modrain.png, n_3cloud_norain.gif, + n_3cloud_norain.png, n_3cloud_snow.gif, n_3cloud_snow.png, + n_3cloud_thunders.gif, n_3cloud_thunders.png, ne.gif, ne.png, + nee.gif, nee.png, nne.gif, nne.png, nnn.gif, nnn.png, nnw.gif, + nnw.png, nodir.gif, nodir.png, nw.gif, nw.png, nww.gif, nww.png, + phpweather-black.gif, phpweather-black.png, + phpweather-long-black.gif, phpweather-long-black.png, + phpweather-long-white.gif, phpweather-long-white.png, + phpweather-white.gif, phpweather-white.png, se.gif, se.png, + see.gif, see.png, sse.gif, sse.png, sss.gif, sss.png, ssw.gif, + ssw.png, sw.gif, sw.png, sww.gif, sww.png, temp_nodata.gif, + temp_nodata.png, tempchilled.gif, tempchilled.png, temphigh.gif, + temphigh.png, templow.gif, templow.png, vrb.png, wind_nodata.gif, + wind_nodata.png, www.gif, www.png: + + Out with GIF images, in with new, beautiful PNG images drawn by + Justin Heideman! + +2003-10-02 22:54 etienne_t + + * data_retrieval.php, phpweather.php, db/pw_db_adodb.php, + db/pw_db_mysql.php: + + Added retrieval of archived metars. The current METAR is still in + metar and decoded_metar, time is in YYYYDDMMhhmmss format. There + are additionnal arrays metar_arch decoded_metar_arch which contain + all the METARs in the period set by data_retrieval::set_times(). + Modified db/pw_adodb.php and db/pw_mysql.php. + +2003-09-30 20:01 etienne_t + + * db/pw_db_mysql.php: + + Modified create_tables() + +2003-09-30 19:47 etienne_t + + * data_retrieval.php, defaults-dist.php, db/pw_db_mysql.php: + + Added archiving of METAR and TAF reports. The functions + insert_metar, update_metar, insert_taf, update_taf have been + modified to include the time of the report in the archive DB. + Modified only pw_db_mysql to reflect these changes. The DBs + pw_metars_arch and pw_tafs_arch must be created. You must set + properties archive_metars and archive_tafs to true for the archive + to happen transparently at each insert or update. + +2003-09-20 22:18 etienne_t + + * phpweather.php, test2.php, output/pw_text.php: + + Mods for TAF. Use timestamps in the taf periods (YYYYMMDDhhmmss). + Include PROB text in the hourly report. Descriptive data for + periods is in a sub-array 'desc'. Added a function + phpweather::get_taf_by_hour for a subset of the hourly report. + +2003-09-16 22:57 Martin Geisler <gim...@gi...> + + * output/: pw_text_cs.php, pw_text_hu.php, pw_text_pl.php, + pw_text_sk.php, pw_text_tr.php: + + Latest translation: Polish by Michal Margula + <alc...@uz...>. I've also added some comments that will + tell Emacs the encoding of the files so that it can display the + characters correctly. + +2003-09-13 02:38 etienne_t + + * data_retrieval.php, phpweather.php, test2.php, + output/pw_text.php: + + Added hour-by-hour decoding of the taf. test2.php was modified to + show that. Interpolation is done in BECMG periods and PROB periods + are not added to the hour-by-hour report. + +2003-09-08 08:02 Martin Geisler <gim...@gi...> + + * defaults-dist.php: + + I've updated the defaults to reflect the values given in + config/make_config.php. This will break existing installations + where the tables miss the 'pw_' prefix. + + How should we handle this, would it be enough to simply note it in + the download instructions on SourceForge? + +2003-09-08 07:51 Martin Geisler <gim...@gi...> + + * config/make_config.php: + + Let's include the new db_tafs option and also a couple of forgotten + options for the icons. + +2003-09-08 04:25 etienne_t + + * test2.php: + + Added test2.php to test the retrieval and decoding of METAR and TAF + reports + +2003-09-08 04:20 etienne_t + + * data_retrieval.php, defaults-dist.php, phpweather.php, + db/pw_db_mysql.php, db/pw_db_null.php: + + Added TAF support. Modified data_retrieval.php, defaults-dist.php, + phpweather.php, pw_db_mysql.php, pw_db_null.php. Needs to add + output functionality and support all backends. + +2003-09-02 18:06 Martin Geisler <gim...@gi...> + + * AUTHORS: + + Latest contributers. + +2003-09-02 18:06 Martin Geisler <gim...@gi...> + + * index.php: + + We actually require those files... Versions of PHP prior to 4.0.2 + distinguished between include() and require() in that require() + were handled unconditionally in a preprocessor-like fashion whereas + include() only read the file when needed. Now that both functions + (or rather language constructs) work the same we can switch to + require(). + +2003-09-02 17:59 Martin Geisler <gim...@gi...> + + * db/pw_db_dba.php: + + This should load the DBA extension on systems that doesn't do this + by default. + +2003-09-02 17:57 Martin Geisler <gim...@gi...> + + * output/: pw_text.php, pw_text_es.php: + + Patches from Pablo Alcaraz (pabloa) that update the Spanish + translation and fixes a bug with the visibility display. + +2003-08-03 22:23 Martin Geisler <gim...@gi...> + + * AUTHORS, output/pw_text_it.php, output/pw_text_tr.php: + + Lots of new translations! + +2003-08-03 15:10 Ondrej Jombik <ne...@po...> + + * output/: pw_text_cs.php, pw_text_sk.php: + + Updated links in source headers. + +2003-07-01 10:15 Martin Geisler <gim...@gi...> + + * config/: make_config.php, pw_option.php, pw_option_integer.php, + pw_option_multi_select.php, pw_option_select.php, + pw_option_text.php: + + Updated the Configuration Builder to match the new dependency + classes and added the fetch_method option. + + Also, the generated PHP code for the defaults.php file now deals + correctly with embedded single and double quotes in strings. Not + that there's much need for these (except possibly in mark_begin and + mark_end) but they're now properly escaped. + +2003-07-01 10:05 Martin Geisler <gim...@gi...> + + * config/: pw_dependency.php, pw_dependency_and.php, + pw_dependency_equal.php, pw_dependency_not.php, + pw_dependency_or.php: + + The dependency classes can now handle full Boolean expressions with + the pw_dependency_or, pw_dependency_and, and pw_dependency_not + classes. + + The old pw_dependency class is now called pw_dependency_equal + because it depends on a given option being equal to a given value. + The pw_dependency class is only there to act as some form of + interface although it isn't strictly necessary. + +2003-07-01 09:34 Martin Geisler <gim...@gi...> + + * data_retrieval.php: + + Added PhpDoc comments to get_metar_file() and get_metar_socket(). + +2003-06-14 23:37 Martin Geisler <gim...@gi...> + + * output/pw_text.php: + + The final full-stop would be omitted if the dew-point was missing + in the report. + +2003-06-14 23:35 Martin Geisler <gim...@gi...> + + * test.php: + + Now with the entire decoded METAR. + +2003-06-14 23:34 Martin Geisler <gim...@gi...> + + * phpweather.php: + + Fixed decoded of UK temperature parts with missing dew-point, + thanks to the report and explanation given by Tom McDonald and Nick + B. + +2003-05-08 19:42 Martin Geisler <gim...@gi...> + + * AUTHORS, make-release.sh, output/pw_text.php: + + Instead of rounding the $min... [truncated message content] |
From: <var...@us...> - 2016-02-10 17:06:04
|
Revision: 9787 http://sourceforge.net/p/phpwiki/code/9787 Author: vargenau Date: 2016-02-10 17:06:01 +0000 (Wed, 10 Feb 2016) Log Message: ----------- HtmlConverter plugin: check file is encoded in UTF-8 Modified Paths: -------------- trunk/lib/plugin/HtmlConverter.php trunk/lib/stdlib.php Modified: trunk/lib/plugin/HtmlConverter.php =================================================================== --- trunk/lib/plugin/HtmlConverter.php 2016-02-10 14:57:07 UTC (rev 9786) +++ trunk/lib/plugin/HtmlConverter.php 2016-02-10 17:06:01 UTC (rev 9787) @@ -59,7 +59,7 @@ 'name' => 'MAX_FILE_SIZE', 'value' => MAX_UPLOAD_SIZE))); $contents->pushContent(HTML::input(array('name' => 'userfile', - 'type' => 'file'))); + 'type' => 'file', 'required' => 'required'))); $contents->pushContent(HTML::raw(" ")); $contents->pushContent(HTML::input(array('value' => _("Convert"), 'type' => 'submit'))); @@ -73,10 +73,10 @@ $userfile_tmpname = $userfile->getTmpName(); if (!preg_match("/(\.html|\.htm)$/i", $userfile_name)) { - $message->pushContent(_("Only files with extension HTML are allowed"), HTML::br(), HTML::br()); + $message->pushContent(HTML::p(array('class' => 'error'), + _("Only files with extension HTML are allowed"))); } else { - $message->pushContent(_("Processed $userfile_name"), HTML::br(), HTML::br()); - $message->pushContent(_("Copy the output below and paste it into your Wiki page."), HTML::br()); + $message->pushContent(HTML::p(_("Processed $userfile_name"))); $message->pushContent($this->process($userfile_tmpname)); } } else { @@ -130,6 +130,11 @@ { $result = HTML(); $file = file_get_contents($file_name); + if (!is_utf8($file)) { + $result->pushContent(HTML::p(array('class' => 'error'), + _("Error: file must be encoded in UTF-8"))); + return $result; + } $file = html_entity_decode($file); $this->processA($file); @@ -180,6 +185,8 @@ // strip attributes from <pre>-Tags and add a new-line before $file = preg_replace("_<pre(\s[^>]*|)>_iU", "\n<pre>", $file); + $result->pushContent(HTML::p(_("Copy the output below and paste it into your Wiki page."))); + $outputArea = HTML::textarea(array('rows' => '30', 'cols' => '80')); $outputArea->pushContent(_($file)); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2016-02-10 14:57:07 UTC (rev 9786) +++ trunk/lib/stdlib.php 2016-02-10 17:06:01 UTC (rev 9787) @@ -2162,3 +2162,37 @@ } echo "</body></html>\n"; } + +/** + * is_utf8 - utf-8 detection + * + * @param string $str the string to analyze + * @return bool + * + * From http://www.php.net/manual/en/function.mb-detect-encoding.php#85294 + */ +function is_utf8($str) { + $c=0; $b=0; + $bits=0; + $len=strlen($str); + for($i=0; $i<$len; $i++){ + $c=ord($str[$i]); + if($c > 128){ + if(($c >= 254)) return false; + elseif($c >= 252) $bits=6; + elseif($c >= 248) $bits=5; + elseif($c >= 240) $bits=4; + elseif($c >= 224) $bits=3; + elseif($c >= 192) $bits=2; + else return false; + if(($i+$bits) > $len) return false; + while($bits > 1){ + $i++; + $b=ord($str[$i]); + if($b < 128 || $b > 191) return false; + $bits--; + } + } + } + return true; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-02-10 17:34:29
|
Revision: 9789 http://sourceforge.net/p/phpwiki/code/9789 Author: vargenau Date: 2016-02-10 17:34:26 +0000 (Wed, 10 Feb 2016) Log Message: ----------- eregi_replace --> preg_replace; ereg --> preg_match Modified Paths: -------------- trunk/lib/Request.php trunk/lib/WikiUser.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2016-02-10 17:21:47 UTC (rev 9788) +++ trunk/lib/Request.php 2016-02-10 17:34:26 UTC (rev 9789) @@ -754,7 +754,7 @@ } $tmp_file .= '/' . basename($fileinfo['tmp_name']); /* ending slash in php.ini upload_tmp_dir is required. */ - if (realpath(ereg_replace('/+', '/', $tmp_file)) != realpath($fileinfo['tmp_name'])) { + if (realpath(preg_replace('#/+#', '/', $tmp_file)) != realpath($fileinfo['tmp_name'])) { trigger_error(sprintf("Uploaded tmpfile illegal: %s != %s.", $tmp_file, $fileinfo['tmp_name']) . "\n" . "Probably illegal TEMP environment or upload_tmp_dir setting. " . Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2016-02-10 17:21:47 UTC (rev 9788) +++ trunk/lib/WikiUser.php 2016-02-10 17:34:26 UTC (rev 9789) @@ -1896,7 +1896,7 @@ } $Connect = @fsockopen($ConnectAddress, 25); if ($Connect) { - if (ereg("^220", $Out = fgets($Connect, 1024))) { + if (preg_match("/^220/", $Out = fgets($Connect, 1024))) { fputs($Connect, "HELO $HTTP_HOST\r\n"); $Out = fgets($Connect, 1024); fputs($Connect, "MAIL FROM: <" . $email . ">\r\n"); @@ -1905,12 +1905,12 @@ $To = fgets($Connect, 1024); fputs($Connect, "QUIT\r\n"); fclose($Connect); - if (!ereg("^250", $From)) { + if (!preg_match("/^250/", $From)) { $result[0] = false; $result[1] = "Server rejected address: " . $From; return $result; } - if (!ereg("^250", $To)) { + if (!preg_match("/^250/", $To)) { $result[0] = false; $result[1] = "Server rejected address: " . $To; return $result; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-05-25 08:34:45
|
Revision: 9844 http://sourceforge.net/p/phpwiki/code/9844 Author: vargenau Date: 2016-05-25 08:34:43 +0000 (Wed, 25 May 2016) Log Message: ----------- RssWriter: be case consistent Modified Paths: -------------- trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/RelatedChanges.php Added Paths: ----------- trunk/lib/RssWriter091.php Removed Paths: ------------- trunk/lib/RSSWriter091.php Deleted: trunk/lib/RSSWriter091.php =================================================================== --- trunk/lib/RSSWriter091.php 2016-05-25 08:12:23 UTC (rev 9843) +++ trunk/lib/RSSWriter091.php 2016-05-25 08:34:43 UTC (rev 9844) @@ -1,134 +0,0 @@ -<?php -// ---------------------------------------------------------------------- -// phpWiki -// ---------------------------------------------------------------------- -// LICENSE -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License (GPL) -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// To read the license please visit http://www.gnu.org/copyleft/gpl.html -// ---------------------------------------------------------------------- -// Original Author of file: Lawrence Akka -// Purpose of file: Plugin and associated classes -// for outputting RecentChanges in RSS 0.91 format -// ---------------------------------------------------------------------- - -include_once 'lib/RssWriter.php'; -class RSSWriter091 extends RSSWriter -{ - function __construct() - { - $this->XmlElement('rss', array('version' => "0.91")); - $this->_items = array(); - } - - /** - * Finish construction of RSS. - */ - function finish() - { - if (isset($this->_finished)) - return; - - $channel = &$this->_channel; - $items = &$this->_items; - - if ($items) { - foreach ($items as $i) - $channel->pushContent($i); - } - $this->pushContent($channel); - $this->__spew(); - $this->_finished = true; - } - - /** - * Create a new RDF <em>typedNode</em>. - */ - function __node($type, $properties, $uri = false) - { - return new XmlElement($type, '', - $this->__elementize($properties)); - } - - /** - * Write output to HTTP client. - */ - function __spew() - { - header("Content-Type: application/xml; charset=UTF-8"); - print("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); - print("<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n"); - print("\"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n"); - $this->printXML(); - } - -} - -class _RecentChanges_RssFormatter091 - extends _RecentChanges_RSSFormatter -// This class should probably go at then of RecentChanges.php -{ - function format($changes) - { - // include_once('lib/RssWriter.php'); - $rss = new RssWriter091; - - $rss->channel($this->channel_properties()); - - if (($props = $this->image_properties())) - $rss->image($props); - if (($props = $this->textinput_properties())) - $rss->textinput($props); - - while ($rev = $changes->next()) { - $rss->addItem($this->item_properties($rev), - $this->pageURI($rev)); - } - - global $request; - $request->discardOutput(); - $rss->finish(); - $request->finish(); // NORETURN!!!! - } - - function channel_properties() - { - global $request; - - $rc_url = WikiURL($request->getArg('pagename'), array(), 'absurl'); - - return array('title' => WIKI_NAME, - 'description' => _("RecentChanges"), - 'link' => $rc_url, - 'language' => 'en-US'); - - /* FIXME: language should come from $LANG (or other config variable). */ - - /* FIXME: other things one might like in <channel>: - * managingEditor - * webmaster - * lastBuildDate - * copyright - */ - } - - function item_properties($rev) - { - $page = $rev->getPage(); - $pagename = $page->getName(); - - return array('title' => SplitPagename($pagename), - 'description' => $this->summary($rev), - 'link' => $this->pageURL($rev) - ); - } -} Copied: trunk/lib/RssWriter091.php (from rev 9843, trunk/lib/RSSWriter091.php) =================================================================== --- trunk/lib/RssWriter091.php (rev 0) +++ trunk/lib/RssWriter091.php 2016-05-25 08:34:43 UTC (rev 9844) @@ -0,0 +1,134 @@ +<?php +// ---------------------------------------------------------------------- +// phpWiki +// ---------------------------------------------------------------------- +// LICENSE +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License (GPL) +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// To read the license please visit http://www.gnu.org/copyleft/gpl.html +// ---------------------------------------------------------------------- +// Original Author of file: Lawrence Akka +// Purpose of file: Plugin and associated classes +// for outputting RecentChanges in RSS 0.91 format +// ---------------------------------------------------------------------- + +include_once 'lib/RssWriter.php'; +class RssWriter091 extends RssWriter +{ + function __construct() + { + $this->XmlElement('rss', array('version' => "0.91")); + $this->_items = array(); + } + + /** + * Finish construction of RSS. + */ + function finish() + { + if (isset($this->_finished)) + return; + + $channel = &$this->_channel; + $items = &$this->_items; + + if ($items) { + foreach ($items as $i) + $channel->pushContent($i); + } + $this->pushContent($channel); + $this->__spew(); + $this->_finished = true; + } + + /** + * Create a new RDF <em>typedNode</em>. + */ + function __node($type, $properties, $uri = false) + { + return new XmlElement($type, '', + $this->__elementize($properties)); + } + + /** + * Write output to HTTP client. + */ + function __spew() + { + header("Content-Type: application/xml; charset=UTF-8"); + print("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); + print("<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n"); + print("\"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n"); + $this->printXML(); + } + +} + +class _RecentChanges_RssFormatter091 + extends _RecentChanges_RSSFormatter +// This class should probably go at then of RecentChanges.php +{ + function format($changes) + { + // include_once('lib/RssWriter.php'); + $rss = new RssWriter091; + + $rss->channel($this->channel_properties()); + + if (($props = $this->image_properties())) + $rss->image($props); + if (($props = $this->textinput_properties())) + $rss->textinput($props); + + while ($rev = $changes->next()) { + $rss->addItem($this->item_properties($rev), + $this->pageURI($rev)); + } + + global $request; + $request->discardOutput(); + $rss->finish(); + $request->finish(); // NORETURN!!!! + } + + function channel_properties() + { + global $request; + + $rc_url = WikiURL($request->getArg('pagename'), array(), 'absurl'); + + return array('title' => WIKI_NAME, + 'description' => _("RecentChanges"), + 'link' => $rc_url, + 'language' => 'en-US'); + + /* FIXME: language should come from $LANG (or other config variable). */ + + /* FIXME: other things one might like in <channel>: + * managingEditor + * webmaster + * lastBuildDate + * copyright + */ + } + + function item_properties($rev) + { + $page = $rev->getPage(); + $pagename = $page->getName(); + + return array('title' => SplitPagename($pagename), + 'description' => $this->summary($rev), + 'link' => $this->pageURL($rev) + ); + } +} Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2016-05-25 08:12:23 UTC (rev 9843) +++ trunk/lib/plugin/RecentChanges.php 2016-05-25 08:34:43 UTC (rev 9844) @@ -1417,7 +1417,7 @@ elseif ($format == 'atom') $fmt_class = '_RecentChanges_AtomFormatter'; elseif ($format == 'rss091') { - include_once 'lib/RSSWriter091.php'; + include_once 'lib/RssWriter091.php'; $fmt_class = '_RecentChanges_RssFormatter091'; } elseif ($format == 'sidebar') $fmt_class = '_RecentChanges_SideBarFormatter'; Modified: trunk/lib/plugin/RelatedChanges.php =================================================================== --- trunk/lib/plugin/RelatedChanges.php 2016-05-25 08:12:23 UTC (rev 9843) +++ trunk/lib/plugin/RelatedChanges.php 2016-05-25 08:34:43 UTC (rev 9844) @@ -105,7 +105,7 @@ $fmt_class = '_RecentChanges_RssFormatter'; elseif ($format == 'rss2') $fmt_class = '_RecentChanges_Rss2Formatter'; elseif ($format == 'rss091') { - include_once 'lib/RSSWriter091.php'; + include_once 'lib/RssWriter091.php'; $fmt_class = '_RecentChanges_RssFormatter091'; } elseif ($format == 'sidebar') $fmt_class = '_RecentChanges_SideBarFormatter'; elseif ($format == 'box') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-05-25 09:41:58
|
Revision: 9849 http://sourceforge.net/p/phpwiki/code/9849 Author: vargenau Date: 2016-05-25 09:41:56 +0000 (Wed, 25 May 2016) Log Message: ----------- Be case consistent Modified Paths: -------------- trunk/lib/Captcha.php trunk/lib/Template.php trunk/lib/WikiPluginCached.php trunk/lib/WysiwygEdit/CKeditor.php trunk/lib/WysiwygEdit/Wikiwyg.php trunk/lib/WysiwygEdit/tinymce.php trunk/lib/editpage.php trunk/lib/loadsave.php trunk/lib/plugin/AddComment.php trunk/lib/plugin/CacheTest.php trunk/lib/plugin/Calendar.php trunk/lib/plugin/TexToPng.php trunk/lib/plugin/text2png.php Modified: trunk/lib/Captcha.php =================================================================== --- trunk/lib/Captcha.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/Captcha.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -146,10 +146,10 @@ $height =& $this->height; // Create the Image - $jpg = ImageCreate($width, $height); - $bg = ImageColorAllocate($jpg, 255, 255, 255); - $tx = ImageColorAllocate($jpg, 185, 140, 140); - ImageFilledRectangle($jpg, 0, 0, $width, $height, $bg); + $jpg = imagecreate($width, $height); + $bg = imagecolorallocate($jpg, 255, 255, 255); + $tx = imagecolorallocate($jpg, 185, 140, 140); + imagefilledrectangle($jpg, 0, 0, $width, $height, $bg); $x = rand(0, $width); $y = rand(0, $height); Modified: trunk/lib/Template.php =================================================================== --- trunk/lib/Template.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/Template.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -273,7 +273,7 @@ * For dumping pages as html to a file. * Used for action=dumphtml,action=ziphtml,format=pdf,format=xml */ -function GeneratePageasXML($content, $title, $page_revision = null, $args = array()) +function GeneratePageAsXML($content, $title, $page_revision = null, $args = array()) { global $request; Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/WikiPluginCached.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -1010,16 +1010,16 @@ $IMAGESIZE['height'] = $IMAGESIZE['rows'] * $chary + 2 * $marginy; // create blank image - $im = @ImageCreate($IMAGESIZE['width'], $IMAGESIZE['height']); + $im = @imagecreate($IMAGESIZE['width'], $IMAGESIZE['height']); - $col = ImageColorAllocate($im, $textcol[0], $textcol[1], $textcol[2]); - $bg = ImageColorAllocate($im, $bgcol[0], $bgcol[1], $bgcol[2]); + $col = imagecolorallocate($im, $textcol[0], $textcol[1], $textcol[2]); + $bg = imagecolorallocate($im, $bgcol[0], $bgcol[1], $bgcol[2]); - ImageFilledRectangle($im, 0, 0, $IMAGESIZE['width'] - 1, $IMAGESIZE['height'] - 1, $bg); + imagefilledrectangle($im, 0, 0, $IMAGESIZE['width'] - 1, $IMAGESIZE['height'] - 1, $bg); // write text lines foreach ($lines as $nr => $textstr) { - ImageString($im, $fontnr, $marginx, $marginy + $nr * $chary, + imagestring($im, $fontnr, $marginx, $marginy + $nr * $chary, $textstr, $col); } return $im; Modified: trunk/lib/WysiwygEdit/CKeditor.php =================================================================== --- trunk/lib/WysiwygEdit/CKeditor.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/WysiwygEdit/CKeditor.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -39,7 +39,7 @@ { global $WikiTheme; $WikiTheme->addMoreHeaders - (Javascript('', array('src' => $this->BasePath . 'ckeditor.js', + (JavaScript('', array('src' => $this->BasePath . 'ckeditor.js', 'language' => 'JavaScript'))); return JavaScript(" window.onload = function() Modified: trunk/lib/WysiwygEdit/Wikiwyg.php =================================================================== --- trunk/lib/WysiwygEdit/Wikiwyg.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/WysiwygEdit/Wikiwyg.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -42,7 +42,7 @@ "Wikiwyg/Wysiwyg.js", "Wikiwyg/Phpwiki.js", "Wikiwyg/HTML.js", "Wikiwyg/Toolbar.js") as $js) { $WikiTheme->addMoreHeaders - (Javascript('', array('src' => $this->BasePath . '/' . $js, + (JavaScript('', array('src' => $this->BasePath . '/' . $js, 'language' => 'JavaScript'))); } $doubleClickToEdit = ($request->getPref('doubleClickEdit') or ENABLE_DOUBLECLICKEDIT) Modified: trunk/lib/WysiwygEdit/tinymce.php =================================================================== --- trunk/lib/WysiwygEdit/tinymce.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/WysiwygEdit/tinymce.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -31,9 +31,9 @@ { global $LANG, $WikiTheme; $WikiTheme->addMoreHeaders - (Javascript('', array('src' => $this->BasePath . 'tiny_mce.js', + (JavaScript('', array('src' => $this->BasePath . 'tiny_mce.js', 'language' => 'JavaScript'))); - return Javascript(" + return JavaScript(" tinyMCE.init({ mode : 'exact', elements: '$name', Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/editpage.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -626,7 +626,7 @@ $undo_btn = $WikiTheme->getImageURL("ed_undo.png"); $undo_d_btn = $WikiTheme->getImageURL("ed_undo_d.png"); // JS_SEARCHREPLACE from walterzorn.de - $js = Javascript(" + $js = JavaScript(" uri_undo_btn = '" . $undo_btn . "' msg_undo_alt = '" . _("Undo") . "' uri_undo_d_btn = '" . $undo_d_btn . "' Modified: trunk/lib/loadsave.php =================================================================== --- trunk/lib/loadsave.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/loadsave.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -651,7 +651,7 @@ $msg = HTML(); $DUMP_MODE = $WikiTheme->DUMP_MODE; - $data = GeneratePageasXML(new Template('browse', $request, $args), + $data = GeneratePageAsXML(new Template('browse', $request, $args), $pagename, $current, $args); $WikiTheme->DUMP_MODE = $DUMP_MODE; Modified: trunk/lib/plugin/AddComment.php =================================================================== --- trunk/lib/plugin/AddComment.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/plugin/AddComment.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -93,7 +93,7 @@ if ($args['jshide']) { $div = HTML::div(array('id' => 'comments', 'style' => 'display:none;')); //$list->setAttr('style','display:none;'); - $div->pushContent(Javascript(" + $div->pushContent(JavaScript(" function togglecomments(a) { comments=document.getElementById('comments'); if (comments.style.display=='none') { Modified: trunk/lib/plugin/CacheTest.php =================================================================== --- trunk/lib/plugin/CacheTest.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/plugin/CacheTest.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -125,7 +125,7 @@ function produceGraphics($text, $font) { // The idea (and some code) is stolen from the text2png plugin - // but I did not want to use TTF. ImageString is quite ugly + // but I did not want to use TTF. Imagestring is quite ugly // and quite compatible. It's only a usage example. if ($font < 1 || $font > 5) { @@ -134,14 +134,14 @@ $font = 3; } - $ok = ($im = @ImageCreate(400, 40)); - $bg_color = ImageColorAllocate($im, 240, 240, 240); - $text_color1 = ImageColorAllocate($im, 120, 120, 120); - $text_color2 = ImageColorAllocate($im, 0, 0, 0); + $ok = ($im = @imagecreate(400, 40)); + $bg_color = imagecolorallocate($im, 240, 240, 240); + $text_color1 = imagecolorallocate($im, 120, 120, 120); + $text_color2 = imagecolorallocate($im, 0, 0, 0); - ImageFilledRectangle($im, 0, 0, 149, 49, $bg_color); - ImageString($im, $font, 11, 12, $text, $text_color1); - ImageString($im, $font, 10, 10, $text, $text_color2); + imagefilledrectangle($im, 0, 0, 149, 49, $bg_color); + imagestring($im, $font, 11, 12, $text, $text_color1); + imagestring($im, $font, 10, 10, $text, $text_color2); if (!$ok) { // simple error handling by WikiPluginImageCache Modified: trunk/lib/plugin/Calendar.php =================================================================== --- trunk/lib/plugin/Calendar.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/plugin/Calendar.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -119,7 +119,7 @@ $fs = $this->args['wday_format']; $row = HTML::tr(); - $row->setattr('class', 'cal-dayname'); + $row->setAttr('class', 'cal-dayname'); if ($this->args['display_weeknum']) $row->pushContent(HTML::td(array('class' => 'cal-dayname align-center'), _("Wk"))); Modified: trunk/lib/plugin/TexToPng.php =================================================================== --- trunk/lib/plugin/TexToPng.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/plugin/TexToPng.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -287,7 +287,7 @@ file_exists($tempfiles . '.png'); if ($ok) { - if (!($img = ImageCreateFromPNG($tempfiles . '.png'))) { + if (!($img = imagecreatefrompng($tempfiles . '.png'))) { $this->dbg("Could not open just created image file: $tempfiles"); $ok = false; } Modified: trunk/lib/plugin/text2png.php =================================================================== --- trunk/lib/plugin/text2png.php 2016-05-25 09:22:44 UTC (rev 9848) +++ trunk/lib/plugin/text2png.php 2016-05-25 09:41:56 UTC (rev 9849) @@ -164,7 +164,7 @@ // get ready to draw $s = ImageTTFBBox($fontsize, 0, $ttfont, $text); - $im = @ImageCreate(abs($s[4]) + 20, abs($s[7]) + 10); + $im = @imagecreate(abs($s[4]) + 20, abs($s[7]) + 10); if (empty($im)) { $error_html = _("PHP was unable to create a new GD image stream. Read 'lib/plugin/text2png.php' for details."); // FIXME: Error manager does not transform URLs passed @@ -175,27 +175,27 @@ return HTML::p($error_html); } $rgb = $this->hexcolor($backcolor, array(255, 255, 255)); - $bg_color = ImageColorAllocate($im, $rgb[0], $rgb[1], $rgb[2]); + $bg_color = imagecolorallocate($im, $rgb[0], $rgb[1], $rgb[2]); if ($with_shadow) { $rgb = $this->hexcolor($shadowcolor, array(175, 175, 175)); - $text_color = ImageColorAllocate($im, $rgb[0], $rgb[1], $rgb[2]); + $text_color = imagecolorallocate($im, $rgb[0], $rgb[1], $rgb[2]); // shadow is 1 pixel down and 2 pixels right ImageTTFText($im, $fontsize, 0, 12, abs($s[7]) + 6, $text_color, $ttfont, $text); } // draw text $rgb = $this->hexcolor($fontcolor, array(0, 0, 0)); - $text_color = ImageColorAllocate($im, $rgb[0], $rgb[1], $rgb[2]); + $text_color = imagecolorallocate($im, $rgb[0], $rgb[1], $rgb[2]); ImageTTFText($im, $fontsize, 0, 10, abs($s[7]) + 5, $text_color, $ttfont, $text); /** * An alternate text drawing method in case ImageTTFText * doesn't work. **/ - //ImageString($im, 2, 10, 40, $text, $text_color); + //imagestring($im, 2, 10, 40, $text, $text_color); // To dump directly to browser: //header("Content-type: image/png"); - //ImagePng($im); + //imagepng($im); // to save to file: $success = ImagePng($im, $filepath . $filename); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-05-25 12:16:31
|
Revision: 9853 http://sourceforge.net/p/phpwiki/code/9853 Author: vargenau Date: 2016-05-25 12:16:28 +0000 (Wed, 25 May 2016) Log Message: ----------- Be case consistent Modified Paths: -------------- trunk/lib/Captcha.php trunk/lib/Template.php trunk/lib/plugin/RecentChanges.php trunk/lib/upgrade.php Modified: trunk/lib/Captcha.php =================================================================== --- trunk/lib/Captcha.php 2016-05-25 10:30:28 UTC (rev 9852) +++ trunk/lib/Captcha.php 2016-05-25 12:16:28 UTC (rev 9853) @@ -102,7 +102,7 @@ function get_dictionary_word() { // Load In the Word List - $fp = fopen(findfile("lib/captcha/dictionary"), "r"); + $fp = fopen(findFile("lib/captcha/dictionary"), "r"); $text = array(); while (!feof($fp)) $text[] = trim(fgets($fp, 1024)); @@ -170,7 +170,7 @@ elseif ($y > $height - 10) $y = $height - 11; $x += rand($size, $size * 2); imagettftext($jpg, $size, $angle, $x, $y, $tx, - realpath(findfile("lib/captcha/Vera.ttf")), + realpath(findFile("lib/captcha/Vera.ttf")), $word[$i]); } Modified: trunk/lib/Template.php =================================================================== --- trunk/lib/Template.php 2016-05-25 10:30:28 UTC (rev 9852) +++ trunk/lib/Template.php 2016-05-25 12:16:28 UTC (rev 9853) @@ -294,7 +294,7 @@ $WikiTheme->DUMP_MODE = 'HTML'; // FIXME: unfatal errors and login requirements - $html = asXML(new Template('htmldump', $request, $args)); + $html = AsXML(new Template('htmldump', $request, $args)); $HIDE_TOOLBARS = false; //$WikiTheme->DUMP_MODE = false; Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2016-05-25 10:30:28 UTC (rev 9852) +++ trunk/lib/plugin/RecentChanges.php 2016-05-25 12:16:28 UTC (rev 9853) @@ -688,7 +688,7 @@ $linkurl->setAttr('target', '_content'); $linkurl->setAttr('rel', 'nofollow'); // FIXME: Smelly hack to get smaller diff buttons in sidebar - $linkurl = new RawXML(str_replace('<img ', '<img style="height:2ex" ', asXML($linkurl))); + $linkurl = new RawXML(str_replace('<img ', '<img style="height:2ex" ', AsXML($linkurl))); return $linkurl; } @@ -697,7 +697,7 @@ $linkurl = parent::historyLink($rev); $linkurl->setAttr('target', '_content'); // FIXME: Smelly hack to get smaller history buttons in sidebar - $linkurl = new RawXML(str_replace('<img ', '<img style="height:2ex" ', asXML($linkurl))); + $linkurl = new RawXML(str_replace('<img ', '<img style="height:2ex" ', AsXML($linkurl))); return $linkurl; } Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2016-05-25 10:30:28 UTC (rev 9852) +++ trunk/lib/upgrade.php 2016-05-25 12:16:28 UTC (rev 9853) @@ -818,7 +818,7 @@ 'button'))))); $form->printXml(); echo "</div><!-- content -->\n"; - echo asXML(Template("bottom")); + echo AsXML(Template("bottom")); echo "</body></html>\n"; $this->request->finish(); exit(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-05-25 12:30:12
|
Revision: 9854 http://sourceforge.net/p/phpwiki/code/9854 Author: vargenau Date: 2016-05-25 12:30:10 +0000 (Wed, 25 May 2016) Log Message: ----------- Be case consistent Modified Paths: -------------- trunk/lib/BlockParser.php trunk/lib/Template.php trunk/lib/WikiPluginCached.php trunk/lib/editpage.php trunk/lib/plugin/RecentChanges.php trunk/lib/upgrade.php Modified: trunk/lib/BlockParser.php =================================================================== --- trunk/lib/BlockParser.php 2016-05-25 12:16:28 UTC (rev 9853) +++ trunk/lib/BlockParser.php 2016-05-25 12:30:10 UTC (rev 9854) @@ -242,7 +242,7 @@ //return ; $where = $this->where(); $tab = str_repeat('____', $this->getDepth()) . $tab; - printXML(HTML::div("$tab $msg: at: '", + PrintXML(HTML::div("$tab $msg: at: '", HTML::samp($where), "'")); flush(); Modified: trunk/lib/Template.php =================================================================== --- trunk/lib/Template.php 2016-05-25 12:16:28 UTC (rev 9853) +++ trunk/lib/Template.php 2016-05-25 12:30:10 UTC (rev 9854) @@ -266,7 +266,7 @@ if (!isset($args['HEADER'])) $args['HEADER'] = $title; - printXML(new Template('html', $request, $args)); + PrintXML(new Template('html', $request, $args)); } /** Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2016-05-25 12:16:28 UTC (rev 9853) +++ trunk/lib/WikiPluginCached.php 2016-05-25 12:30:10 UTC (rev 9854) @@ -1054,7 +1054,7 @@ // It is important that you close any pipes before calling // proc_close in order to avoid a deadlock proc_close($process); - if (empty($buf)) printXML($this->error($stderr)); + if (empty($buf)) PrintXML($this->error($stderr)); return $buf; } return ''; Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2016-05-25 12:16:28 UTC (rev 9853) +++ trunk/lib/editpage.php 2016-05-25 12:30:10 UTC (rev 9854) @@ -644,7 +644,7 @@ $WikiTheme->addMoreHeaders($js); $WikiTheme->addMoreAttr('body', "SearchReplace", " onload='define_f()'"); } else { // from an actionpage: WikiBlog, AddComment, WikiForum - printXML($js); + PrintXML($js); } } else { $WikiTheme->addMoreAttr('body', "editfocus", "document.getElementById('edit-content]').editarea.focus()"); @@ -660,9 +660,9 @@ $WikiTheme->addMoreHeaders($init); $WikiTheme->addMoreHeaders($js); } else { // from an actionpage: WikiBlog, AddComment, WikiForum - printXML($init); - printXML($js); - printXML(JavaScript('define_f()')); + PrintXML($init); + PrintXML($js); + PrintXML(JavaScript('define_f()')); } $toolbar = HTML::div(array('class' => 'edit-toolbar', 'id' => 'toolbar')); $toolbar->pushContent(HTML::input(array('src' => $WikiTheme->getImageURL("ed_save.png"), Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2016-05-25 12:16:28 UTC (rev 9853) +++ trunk/lib/plugin/RecentChanges.php 2016-05-25 12:30:10 UTC (rev 9854) @@ -451,7 +451,7 @@ $sidebar_button = $WikiTheme->makeButton("sidebar", 'javascript:addPanel();', 'sidebaricon', array('title' => _("Click to add this feed to your sidebar"), 'style' => 'font-size:9pt;font-weight:normal; vertical-align:middle;')); - $addsidebarjsclick = asXML($sidebar_button); + $addsidebarjsclick = AsXML($sidebar_button); $jsc = JavaScript("if ((typeof window.sidebar == 'object') &&\n" . " (typeof window.sidebar.addPanel == 'function'))\n" . " {\n" @@ -744,11 +744,11 @@ printf("<title>" . $title . "</title>\n"); global $WikiTheme; $css = $WikiTheme->getCSS(); - $css->PrintXML(); + $css->printXML(); printf("</head>\n"); printf("<body class=\"sidebar\">\n"); - $html->PrintXML(); + $html->printXML(); echo '<a href="http://www.feedvalidator.org/check.cgi?url=http://phpwiki.fr/RecentChanges?format=rss"><img src="themes/default/buttons/valid-rss.png" alt="[Valid RSS]" title="Validate the RSS feed" width="44" height="15" /></a>'; printf("\n</body>\n"); printf("</html>\n"); Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2016-05-25 12:16:28 UTC (rev 9853) +++ trunk/lib/upgrade.php 2016-05-25 12:30:10 UTC (rev 9854) @@ -816,7 +816,7 @@ HTML::raw(' '), Button("submit:dbadmin[cancel]", _("Cancel"), 'button'))))); - $form->printXml(); + $form->printXML(); echo "</div><!-- content -->\n"; echo AsXML(Template("bottom")); echo "</body></html>\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-07-12 16:15:07
|
Revision: 9878 http://sourceforge.net/p/phpwiki/code/9878 Author: vargenau Date: 2016-07-12 16:15:03 +0000 (Tue, 12 Jul 2016) Log Message: ----------- Standard PhpWiki header Modified Paths: -------------- trunk/lib/ArchiveCleaner.php trunk/lib/CachedMarkup.php trunk/lib/Captcha.php trunk/lib/ExternalReferrer.php trunk/lib/HtmlParser.php trunk/lib/IniConfig.php trunk/lib/InlineParser.php trunk/lib/MailNotify.php trunk/lib/PagePerm.php trunk/lib/PageType.php trunk/lib/Request.php trunk/lib/RssParser.php trunk/lib/SemanticWeb.php trunk/lib/SpamBlocklist.php trunk/lib/WikiGroup.php trunk/lib/XmlParser.php trunk/lib/XmlRpcServer.php trunk/lib/config.php trunk/lib/diff.php trunk/lib/diff3.php trunk/lib/difflib.php trunk/lib/display.php trunk/lib/install.php trunk/lib/main.php trunk/lib/pdf.php trunk/lib/upgrade.php Modified: trunk/lib/ArchiveCleaner.php =================================================================== --- trunk/lib/ArchiveCleaner.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/ArchiveCleaner.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* Copyright (C) 2002 Geoffrey T. Dairiki <da...@da...> * * This file is part of PhpWiki. Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/CachedMarkup.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* Copyright (C) 2002 Geoffrey T. Dairiki <da...@da...> * Copyright (C) 2004-2010 $ThePhpWikiProgrammingTeam * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent Modified: trunk/lib/Captcha.php =================================================================== --- trunk/lib/Captcha.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/Captcha.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /** * Session Captcha v1.0 * by Gavin M. Roy <gm...@bt...> Modified: trunk/lib/ExternalReferrer.php =================================================================== --- trunk/lib/ExternalReferrer.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/ExternalReferrer.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /** * Detect external referrers * Currently only search engines, and highlight the searched item. Modified: trunk/lib/HtmlParser.php =================================================================== --- trunk/lib/HtmlParser.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/HtmlParser.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,10 +1,4 @@ <?php - -/** - * HtmlParser Class: Conversion HTML => wikimarkup - * Requires XmlParser, XmlElement and the expat (or now the libxml) library. This is all in core. - */ - /* * Copyright (C) 2004 Reini Urban * @@ -26,6 +20,11 @@ */ /** + * HtmlParser Class: Conversion HTML => wikimarkup + * Requires XmlParser, XmlElement and the expat (or now the libxml) library. This is all in core. + */ + +/** * Base class to implement html => wikitext converters, * extendable for various wiki syntax versions. * This is needed to be able to use htmlarea-alike editors, Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/IniConfig.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,17 +1,4 @@ <?php - -/** - * A configurator intended to read its config from a PHP-style INI file, - * instead of a PHP file. - * - * Pass a filename to the IniConfig() function and it will read all its - * definitions from there, all by itself, and proceed to do a mass-define - * of all valid PHPWiki config items. In this way, we can hopefully be - * totally backwards-compatible with the old index.php method, while still - * providing a much tastier on-going experience. - * - * @author: Joby Walker, Reini Urban, Matthew Palmer - */ /* * Copyright 2004,2005,2006,2007 $ThePhpWikiProgrammingTeam * Copyright 2008-2010 Marc-Etienne Vargenau, Alcatel-Lucent @@ -34,6 +21,19 @@ */ /** + * A configurator intended to read its config from a PHP-style INI file, + * instead of a PHP file. + * + * Pass a filename to the IniConfig() function and it will read all its + * definitions from there, all by itself, and proceed to do a mass-define + * of all valid PHPWiki config items. In this way, we can hopefully be + * totally backwards-compatible with the old index.php method, while still + * providing a much tastier on-going experience. + * + * @author: Joby Walker, Reini Urban, Matthew Palmer + */ + +/** * DONE: * - Convert the value lists to provide defaults, so that every "if * (defined())" and "if (!defined())" can fuck off to the dismal hole Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/InlineParser.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* Copyright (C) 2002 Geoffrey T. Dairiki <da...@da...> * Copyright (C) 2004-2010 Reini Urban * Copyright (C) 2008-2010 Marc-Etienne Vargenau, Alcatel-Lucent @@ -20,6 +19,7 @@ * with PhpWiki; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ + /** * This is the code which deals with the inline part of the * wiki-markup. Modified: trunk/lib/MailNotify.php =================================================================== --- trunk/lib/MailNotify.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/MailNotify.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* Copyright (C) 2006-2007,2009 Reini Urban * Copyright (C) 2009 Marc-Etienne Vargenau, Alcatel-Lucent * Modified: trunk/lib/PagePerm.php =================================================================== --- trunk/lib/PagePerm.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/PagePerm.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* * Copyright 2004,2007 $ThePhpWikiProgrammingTeam * Copyright 2009-2010 Marc-Etienne Vargenau, Alcatel-Lucent Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/PageType.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* * Copyright 1999,2000,2001,2002,2003,2004,2005,2006 $ThePhpWikiProgrammingTeam * Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/Request.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* * Copyright (C) 2002,2004,2005,2006,2009 $ThePhpWikiProgrammingTeam * Modified: trunk/lib/RssParser.php =================================================================== --- trunk/lib/RssParser.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/RssParser.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,16 +1,4 @@ <?php - -/** - * Simple RSSParser Class - * Based on Duncan Gough RSSParser class - * Copyleft Arnaud Fontaine - * Licence : GPL - * See lib/plugin/RssFeed.php and lib/XmlParser.php - * - * The myth of RSS compatibility: - * http://diveintomark.org/archives/2004/02/04/incompatible-rss - */ - /* * This file is part of PhpWiki. * @@ -30,6 +18,17 @@ */ /** + * Simple RSSParser Class + * Based on Duncan Gough RSSParser class + * Copyleft Arnaud Fontaine + * Licence : GPL + * See lib/plugin/RssFeed.php and lib/XmlParser.php + * + * The myth of RSS compatibility: + * http://diveintomark.org/archives/2004/02/04/incompatible-rss + */ + +/** * 2004-04-09 16:30:50 rurban: * added fsockopen allow_url_fopen = Off workaround * 2004-04-12 20:04:12 rurban: Modified: trunk/lib/SemanticWeb.php =================================================================== --- trunk/lib/SemanticWeb.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/SemanticWeb.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,4 +1,24 @@ <?php +/* + * Copyright 2004,2007 Reini Urban + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + /** * What to do on ?format=rdf What to do on ?format=owl * @@ -77,29 +97,8 @@ * http://www.ontoweb.org/ * http://www.semwebcentral.org/ (OWL on top of FusionForge) * - * * Author: Reini Urban <ru...@x-...> */ -/*============================================================================*/ -/* - * Copyright 2004,2007 Reini Urban - * - * This file is part of PhpWiki. - * - * PhpWiki is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PhpWiki is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with PhpWiki; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ require_once 'lib/RssWriter.php'; require_once 'lib/TextSearchQuery.php'; Modified: trunk/lib/SpamBlocklist.php =================================================================== --- trunk/lib/SpamBlocklist.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/SpamBlocklist.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* Copyright (C) 2005 Reini Urban * * This file is part of PhpWiki. Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/WikiGroup.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* * Copyright (C) 2003, 2004 $ThePhpWikiProgrammingTeam * Copyright (C) 2010 Marc-Etienne Vargenau, Alcatel-Lucent Modified: trunk/lib/XmlParser.php =================================================================== --- trunk/lib/XmlParser.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/XmlParser.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,4 +1,21 @@ <?php +/* + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ /** * Base XmlParser Class. @@ -20,24 +37,6 @@ * esp. $this->root is lost. So we have to this into a global. */ -/* - * This file is part of PhpWiki. - * - * PhpWiki is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * PhpWiki is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with PhpWiki; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - /** * class XmlParser - Parse into a tree of XmlElement nodes. * @@ -49,7 +48,6 @@ */ class XmlParser { - public $_parser, $root, $current, $previous, $parent; function XmlParser($encoding = '') Modified: trunk/lib/XmlRpcServer.php =================================================================== --- trunk/lib/XmlRpcServer.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/XmlRpcServer.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,10 +1,8 @@ <?php - -/* Copyright (C) 2002, Lawrence Akka <la...@us...> +/* + * Copyright (C) 2002, Lawrence Akka <la...@us...> * Copyright (C) 2004,2005,2006,2007 $ThePhpWikiProgrammingTeam * - * LICENCE - * ======= * This file is part of PhpWiki. * * PhpWiki is free software; you can redistribute it and/or modify @@ -20,7 +18,9 @@ * You should have received a copy of the GNU General Public License along * with PhpWiki; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * + */ + +/* * LIBRARY USED - POSSIBLE PROBLEMS * ================================ * Modified: trunk/lib/config.php =================================================================== --- trunk/lib/config.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/config.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* * NOTE: The settings here should probably not need to be changed. * The user-configurable settings have been moved to IniConfig.php Modified: trunk/lib/diff.php =================================================================== --- trunk/lib/diff.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/diff.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,12 +1,28 @@ <?php +/* + * Copyright (C) 2000, 2001 Geoffrey T. Dairiki <da...@da...> + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ // diff.php // // PhpWiki diff output code. // -// Copyright (C) 2000, 2001 Geoffrey T. Dairiki <da...@da...> -// You may copy this code freely under the conditions of the GPL. -// require_once 'lib/difflib.php'; Modified: trunk/lib/diff3.php =================================================================== --- trunk/lib/diff3.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/diff3.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,12 +1,27 @@ <?php +/* + * Copyright (C) 2001 Geoffrey T. Dairiki <da...@da...> + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ // diff3.php // // A class for computing three way diffs -// -// Copyright (C) 2001 Geoffrey T. Dairiki <da...@da...> -// You may copy this code freely under the conditions of the GPL. -// require_once 'lib/difflib.php'; Modified: trunk/lib/difflib.php =================================================================== --- trunk/lib/difflib.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/difflib.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,12 +1,27 @@ <?php +/* + * Copyright (C) 2000, 2001 Geoffrey T. Dairiki <da...@da...> + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ // difflib.php // // A PHP diff engine for phpwiki. -// -// Copyright (C) 2000, 2001 Geoffrey T. Dairiki <da...@da...> -// You may copy this code freely under the conditions of the GPL. -// abstract class _DiffOp { Modified: trunk/lib/display.php =================================================================== --- trunk/lib/display.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/display.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* Copyright (C) 2004-2011 $ThePhpWikiProgrammingTeam * * This file is part of PhpWiki. Modified: trunk/lib/install.php =================================================================== --- trunk/lib/install.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/install.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* * Copyright 2004 $ThePhpWikiProgrammingTeam * Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/main.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* * Copyright 1999-2008 $ThePhpWikiProgrammingTeam * Copyright (C) 2008-2010 Marc-Etienne Vargenau, Alcatel-Lucent Modified: trunk/lib/pdf.php =================================================================== --- trunk/lib/pdf.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/pdf.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* * Copyright (C) 2003 Olivier PLATHEY * Copyright (C) 200? Don Sebà Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2016-07-12 08:17:25 UTC (rev 9877) +++ trunk/lib/upgrade.php 2016-07-12 16:15:03 UTC (rev 9878) @@ -1,5 +1,4 @@ <?php - /* * Copyright 2004,2005,2006,2007 $ThePhpWikiProgrammingTeam * Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-07-12 16:39:01
|
Revision: 9879 http://sourceforge.net/p/phpwiki/code/9879 Author: vargenau Date: 2016-07-12 16:38:59 +0000 (Tue, 12 Jul 2016) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/diff.php trunk/lib/diff3.php trunk/lib/difflib.php Modified: trunk/lib/diff.php =================================================================== --- trunk/lib/diff.php 2016-07-12 16:15:03 UTC (rev 9878) +++ trunk/lib/diff.php 2016-07-12 16:38:59 UTC (rev 9879) @@ -91,8 +91,7 @@ list ($orig_words, $orig_stripped) = $this->_split($orig_lines); list ($final_words, $final_stripped) = $this->_split($final_lines); - $this->MappedDiff($orig_words, $final_words, - $orig_stripped, $final_stripped); + parent::__construct($orig_words, $final_words, $orig_stripped, $final_stripped); } private function _split($lines) Modified: trunk/lib/diff3.php =================================================================== --- trunk/lib/diff3.php 2016-07-12 16:15:03 UTC (rev 9878) +++ trunk/lib/diff3.php 2016-07-12 16:38:59 UTC (rev 9879) @@ -29,7 +29,7 @@ { public $type = 'diff3'; - function _Diff3_Block($orig = false, $final1 = false, $final2 = false) + function __construct($orig = false, $final1 = false, $final2 = false) { $this->orig = $orig ? $orig : array(); $this->final1 = $final1 ? $final1 : array(); Modified: trunk/lib/difflib.php =================================================================== --- trunk/lib/difflib.php 2016-07-12 16:15:03 UTC (rev 9878) +++ trunk/lib/difflib.php 2016-07-12 16:38:59 UTC (rev 9879) @@ -46,7 +46,7 @@ { public $type = 'copy'; - function _DiffOp_Copy($orig, $final = false) + function __construct($orig, $final = false) { if (!is_array($final)) $final = $orig; @@ -64,7 +64,7 @@ { public $type = 'delete'; - function _DiffOp_Delete($lines) + function __construct($lines) { $this->orig = $lines; $this->final = false; @@ -80,7 +80,7 @@ { public $type = 'add'; - function _DiffOp_Add($lines) + function __construct($lines) { $this->final = $lines; $this->orig = false; @@ -96,7 +96,7 @@ { public $type = 'change'; - function _DiffOp_Change($orig, $final) + function __construct($orig, $final) { $this->orig = $orig; $this->final = $final; @@ -530,14 +530,13 @@ public $edits; /** - * Constructor. * Computes diff between sequences of strings. * * @param $from_lines array An array of strings. * (Typically these are lines from a file.) * @param $to_lines array An array of strings. */ - function Diff($from_lines, $to_lines) + function __construct($from_lines, $to_lines) { $eng = new _DiffEngine; $this->edits = $eng->diff($from_lines, $to_lines); @@ -603,8 +602,6 @@ extends Diff { /** - * Constructor. - * * Computes diff between sequences of strings. * * This can be used to compute things like @@ -625,14 +622,14 @@ * @param $mapped_to_lines array This array should * have the same number of elements as $to_lines. */ - function MappedDiff($from_lines, $to_lines, - $mapped_from_lines, $mapped_to_lines) + function __construct($from_lines, $to_lines, + $mapped_from_lines, $mapped_to_lines) { assert(sizeof($from_lines) == sizeof($mapped_from_lines)); assert(sizeof($to_lines) == sizeof($mapped_to_lines)); - $this->Diff($mapped_from_lines, $mapped_to_lines); + parent::__construct($mapped_from_lines, $mapped_to_lines); $xi = $yi = 0; // Optimizing loop invariants: @@ -868,7 +865,7 @@ */ class BlockDiffFormatter extends DiffFormatter { - function BlockDiffFormatter($context_lines = 4) + function __construct($context_lines = 4) { $this->leading_context_lines = $context_lines; $this->trailing_context_lines = $context_lines; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-07-19 14:28:39
|
Revision: 9885 http://sourceforge.net/p/phpwiki/code/9885 Author: vargenau Date: 2016-07-19 14:28:36 +0000 (Tue, 19 Jul 2016) Log Message: ----------- Refactor: rename identifiers starting with underscore Modified Paths: -------------- trunk/lib/diff.php trunk/lib/diff3.php trunk/lib/difflib.php Modified: trunk/lib/diff.php =================================================================== --- trunk/lib/diff.php 2016-07-19 14:27:10 UTC (rev 9884) +++ trunk/lib/diff.php 2016-07-19 14:28:36 UTC (rev 9885) @@ -26,61 +26,61 @@ require_once 'lib/difflib.php'; -class _HWLDF_WordAccumulator +class HWLDF_WordAccumulator { function __construct() { - $this->_lines = array(); - $this->_line = false; - $this->_group = false; - $this->_tag = '~begin'; + $this->lines = array(); + $this->line = false; + $this->group = false; + $this->tag = '~begin'; } - private function _flushGroup($new_tag) + private function flushGroup($new_tag) { - if ($this->_group !== false) { - if (!$this->_line) - $this->_line = HTML(); - $this->_line->pushContent($this->_tag - ? new HtmlElement($this->_tag, - $this->_group) - : $this->_group); + if ($this->group !== false) { + if (!$this->line) + $this->line = HTML(); + $this->line->pushContent($this->tag + ? new HtmlElement($this->tag, + $this->group) + : $this->group); } - $this->_group = ''; - $this->_tag = $new_tag; + $this->group = ''; + $this->tag = $new_tag; } - private function _flushLine($new_tag) + private function flushLine($new_tag) { - $this->_flushGroup($new_tag); - if ($this->_line) - $this->_lines[] = $this->_line; - $this->_line = HTML(); + $this->flushGroup($new_tag); + if ($this->line) + $this->lines[] = $this->line; + $this->line = HTML(); } public function addWords($words, $tag = '') { - if ($tag != $this->_tag) - $this->_flushGroup($tag); + if ($tag != $this->tag) + $this->flushGroup($tag); foreach ($words as $word) { // new-line should only come as first char of word. if ($word === "") continue; if ($word[0] == "\n") { - $this->_group .= " "; - $this->_flushLine($tag); + $this->group .= " "; + $this->flushLine($tag); $word = substr($word, 1); } assert(!strstr($word, "\n")); - $this->_group .= $word; + $this->group .= $word; } } public function getLines() { - $this->_flushLine('~done'); - return $this->_lines; + $this->flushLine('~done'); + return $this->lines; } } @@ -88,13 +88,13 @@ { function __construct($orig_lines, $final_lines) { - list ($orig_words, $orig_stripped) = $this->_split($orig_lines); - list ($final_words, $final_stripped) = $this->_split($final_lines); + list ($orig_words, $orig_stripped) = $this->split_lines($orig_lines); + list ($final_words, $final_stripped) = $this->split_lines($final_lines); parent::__construct($orig_words, $final_words, $orig_stripped, $final_stripped); } - private function _split($lines) + private function split_lines($lines) { // FIXME: fix POSIX char class. if (!preg_match_all('/ ( [^\S\n]+ | [[:alnum:]]+ | . ) (?: (?!< \n) [^\S\n])? /xs', @@ -108,7 +108,7 @@ public function orig() { - $orig = new _HWLDF_WordAccumulator; + $orig = new HWLDF_WordAccumulator(); foreach ($this->edits as $edit) { if ($edit->type == 'copy') @@ -119,9 +119,9 @@ return $orig->getLines(); } - public function _final() + public function finalize() { - $final = new _HWLDF_WordAccumulator; + $final = new HWLDF_WordAccumulator(); foreach ($this->edits as $edit) { if ($edit->type == 'copy') @@ -145,44 +145,44 @@ class HtmlUnifiedDiffFormatter extends UnifiedDiffFormatter { /** - * @var HtmlElement $_top + * @var HtmlElement $top */ - public $_top; + public $top; /** - * @var HtmlElement $_block + * @var HtmlElement $block */ - public $_block; + public $block; function __construct($context_lines = 4) { parent::__construct($context_lines); } - protected function _start_diff() + protected function start_diff() { - $this->_top = HTML::div(array('class' => 'diff')); + $this->top = HTML::div(array('class' => 'diff')); } - protected function _end_diff() + protected function end_diff() { - $val = $this->_top; - unset($this->_top); + $val = $this->top; + unset($this->top); return $val; } - protected function _start_block($header) + protected function start_block($header) { - $this->_block = HTML::div(array('class' => 'block'), + $this->block = HTML::div(array('class' => 'block'), HTML::samp($header)); } - protected function _end_block() + protected function end_block() { - $this->_top->pushContent($this->_block); - unset($this->_block); + $this->top->pushContent($this->block); + unset($this->block); } - protected function _lines($lines, $class, $prefix = false, $elem = false) + protected function lines($lines, $class, $prefix = false, $elem = false) { if (!$prefix) $prefix = HTML::raw(' '); @@ -195,29 +195,29 @@ $prefix), $line, HTML::raw(' '))); } - $this->_block->pushContent($div); + $this->block->pushContent($div); } - protected function _context($lines) + protected function context($lines) { - $this->_lines($lines, 'context'); + $this->lines($lines, 'context'); } - protected function _deleted($lines) + protected function deleted($lines) { - $this->_lines($lines, 'deleted', '-', 'del'); + $this->lines($lines, 'deleted', '-', 'del'); } - protected function _added($lines) + protected function added($lines) { - $this->_lines($lines, 'added', '+', 'ins'); + $this->lines($lines, 'added', '+', 'ins'); } - protected function _changed($orig, $final) + protected function changed($orig, $final) { $diff = new WordLevelDiff($orig, $final); - $this->_lines($diff->orig(), 'original', '-'); - $this->_lines($diff->_final(), 'final', '+'); + $this->lines($diff->orig(), 'original', '-'); + $this->lines($diff->finalize(), 'final', '+'); } } @@ -378,7 +378,7 @@ $new->get('summary')))); } } else { - $fmt = new HtmlUnifiedDiffFormatter; + $fmt = new HtmlUnifiedDiffFormatter(); $html->pushContent($fmt->format($diff)); } Modified: trunk/lib/diff3.php =================================================================== --- trunk/lib/diff3.php 2016-07-19 14:27:10 UTC (rev 9884) +++ trunk/lib/diff3.php 2016-07-19 14:28:36 UTC (rev 9885) @@ -25,7 +25,7 @@ require_once 'lib/difflib.php'; -class _Diff3_Block +class Diff3_Block { public $type = 'diff3'; @@ -38,17 +38,17 @@ public function merged() { - if (!isset($this->_merged)) { + if (!isset($this->merged)) { if ($this->final1 === $this->final2) - $this->_merged = &$this->final1; + $this->merged = &$this->final1; elseif ($this->final1 === $this->orig) - $this->_merged = &$this->final2; + $this->merged = &$this->final2; elseif ($this->final2 === $this->orig) - $this->_merged = &$this->final1; + $this->merged = &$this->final1; else - $this->_merged = false; + $this->merged = false; } - return $this->_merged; + return $this->merged; } public function is_conflict() @@ -57,7 +57,7 @@ } } -class _Diff3_CopyBlock extends _Diff3_Block +class Diff3_CopyBlock extends Diff3_Block { public $type = 'copy'; @@ -79,7 +79,7 @@ } } -class _Diff3_BlockBuilder +class Diff3_BlockBuilder { public $orig; public $final1; @@ -87,17 +87,17 @@ function __construct() { - $this->_init(); + $this->init(); } - private function _init() + private function init() { $this->orig = array(); $this->final1 = array(); $this->final2 = array(); } - private function _append(&$array, $lines) + private function append(&$array, $lines) { array_splice($array, sizeof($array), 0, $lines); } @@ -105,19 +105,19 @@ public function input($lines) { if ($lines) - $this->_append($this->orig, $lines); + $this->append($this->orig, $lines); } public function out1($lines) { if ($lines) - $this->_append($this->final1, $lines); + $this->append($this->final1, $lines); } public function out2($lines) { if ($lines) - $this->_append($this->final2, $lines); + $this->append($this->final2, $lines); } private function is_empty() @@ -130,8 +130,8 @@ if ($this->is_empty()) return false; else { - $block = new _Diff3_Block($this->orig, $this->final1, $this->final2); - $this->_init(); + $block = new Diff3_Block($this->orig, $this->final1, $this->final2); + $this->init(); return $block; } } @@ -141,16 +141,16 @@ { function __construct($orig, $final1, $final2) { - $eng = new _DiffEngine; + $eng = new DiffEngine(); $this->ConflictingBlocks = 0; //Conflict counter - $this->blocks = $this->__diff3($eng->diff($orig, $final1), + $this->blocks = $this->diff3blocks($eng->diff($orig, $final1), $eng->diff($orig, $final2)); } - private function __diff3($edits1, $edits2) + private function diff3blocks($edits1, $edits2) { $blocks = array(); - $bb = new _Diff3_BlockBuilder; + $bb = new Diff3_BlockBuilder(); $e1 = current($edits1); $e2 = current($edits2); @@ -164,7 +164,7 @@ $ncopy = min($e1->norig(), $e2->norig()); assert($ncopy > 0); - $blocks[] = new _Diff3_CopyBlock(array_slice($e1->orig, 0, $ncopy)); + $blocks[] = new Diff3_CopyBlock(array_slice($e1->orig, 0, $ncopy)); if ($e1->norig() > $ncopy) { array_splice($e1->orig, 0, $ncopy); Modified: trunk/lib/difflib.php =================================================================== --- trunk/lib/difflib.php 2016-07-19 14:27:10 UTC (rev 9884) +++ trunk/lib/difflib.php 2016-07-19 14:28:36 UTC (rev 9885) @@ -23,7 +23,7 @@ // // A PHP diff engine for phpwiki. -abstract class _DiffOp +abstract class DiffOp { public $type; public $orig; @@ -42,7 +42,7 @@ } } -class _DiffOp_Copy extends _DiffOp +class DiffOp_Copy extends DiffOp { public $type = 'copy'; @@ -56,11 +56,11 @@ public function reverse() { - return new _DiffOp_Copy($this->final, $this->orig); + return new DiffOp_Copy($this->final, $this->orig); } } -class _DiffOp_Delete extends _DiffOp +class DiffOp_Delete extends DiffOp { public $type = 'delete'; @@ -72,11 +72,11 @@ public function reverse() { - return new _DiffOp_Add($this->orig); + return new DiffOp_Add($this->orig); } } -class _DiffOp_Add extends _DiffOp +class DiffOp_Add extends DiffOp { public $type = 'add'; @@ -88,11 +88,11 @@ public function reverse() { - return new _DiffOp_Delete($this->final); + return new DiffOp_Delete($this->final); } } -class _DiffOp_Change extends _DiffOp +class DiffOp_Change extends DiffOp { public $type = 'change'; @@ -104,7 +104,7 @@ public function reverse() { - return new _DiffOp_Change($this->final, $this->orig); + return new DiffOp_Change($this->final, $this->orig); } } @@ -128,7 +128,7 @@ * @author Geoffrey T. Dairiki * @access private */ -class _DiffEngine +class DiffEngine { public $xchanged; public $ychanged; @@ -187,11 +187,11 @@ } // Find the LCS. - $this->_compareseq(0, sizeof($this->xv), 0, sizeof($this->yv)); + $this->compareseq(0, sizeof($this->xv), 0, sizeof($this->yv)); // Merge edits when possible - $this->_shift_boundaries($from_lines, $this->xchanged, $this->ychanged); - $this->_shift_boundaries($to_lines, $this->ychanged, $this->xchanged); + $this->shift_boundaries($from_lines, $this->xchanged, $this->ychanged); + $this->shift_boundaries($to_lines, $this->ychanged, $this->xchanged); // Compute the edit operations. $edits = array(); @@ -208,7 +208,7 @@ ++$yi; } if ($copy) - $edits[] = new _DiffOp_Copy($copy); + $edits[] = new DiffOp_Copy($copy); // Find deletes & adds. $delete = array(); @@ -220,10 +220,11 @@ $add[] = $to_lines[$yi++]; if ($delete && $add) - $edits[] = new _DiffOp_Change($delete, $add); + $edits[] = new DiffOp_Change($delete, $add); elseif ($delete) - $edits[] = new _DiffOp_Delete($delete); elseif ($add) - $edits[] = new _DiffOp_Add($add); + $edits[] = new DiffOp_Delete($delete); + elseif ($add) + $edits[] = new DiffOp_Add($add); } return $edits; } @@ -244,7 +245,7 @@ * match. The caller must trim matching lines from the beginning and end * of the portions it is going to specify. */ - private function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) + private function diag($xoff, $xlim, $yoff, $ylim, $nchunks) { $flip = false; @@ -284,7 +285,7 @@ reset($matches); while (list ($junk, $y) = each($matches)) if (empty($this->in_seq[$y])) { - $k = $this->_lcs_pos($y); + $k = $this->lcs_pos($y); assert($k > 0); $ymids[$k] = $ymids[$k - 1]; break; @@ -298,7 +299,7 @@ $this->seq[$k] = $y; $this->in_seq[$y] = 1; } elseif (empty($this->in_seq[$y])) { - $k = $this->_lcs_pos($y); + $k = $this->lcs_pos($y); assert($k > 0); $ymids[$k] = $ymids[$k - 1]; } @@ -318,7 +319,7 @@ return array($this->lcs, $seps); } - private function _lcs_pos($ypos) + private function lcs_pos($ypos) { $end = $this->lcs; if ($end == 0 || $ypos > $this->seq[$end]) { @@ -355,7 +356,7 @@ * Note that XLIM, YLIM are exclusive bounds. * All line numbers are origin-0 and discarded lines are not counted. */ - private function _compareseq($xoff, $xlim, $yoff, $ylim) + private function compareseq($xoff, $xlim, $yoff, $ylim) { // Slide down the bottom initial diagonal. while ($xoff < $xlim && $yoff < $ylim @@ -379,7 +380,7 @@ //$nchunks = max(2,min(8,(int)$nchunks)); $nchunks = min(7, $xlim - $xoff, $ylim - $yoff) + 1; list ($lcs, $seps) - = $this->_diag($xoff, $xlim, $yoff, $ylim, $nchunks); + = $this->diag($xoff, $xlim, $yoff, $ylim, $nchunks); } if ($lcs == 0) { @@ -394,7 +395,7 @@ reset($seps); $pt1 = $seps[0]; while ($pt2 = next($seps)) { - $this->_compareseq($pt1[0], $pt2[0], $pt1[1], $pt2[1]); + $this->compareseq($pt1[0], $pt2[0], $pt1[1], $pt2[1]); $pt1 = $pt2; } } @@ -412,7 +413,7 @@ * * This is extracted verbatim from analyze.c (GNU diffutils-2.7). */ - private function _shift_boundaries($lines, &$changed, $other_changed) + private function shift_boundaries($lines, &$changed, $other_changed) { $i = 0; $j = 0; @@ -538,7 +539,7 @@ */ function __construct($from_lines, $to_lines) { - $eng = new _DiffEngine; + $eng = new DiffEngine(); $this->edits = $eng->diff($from_lines, $to_lines); } @@ -583,7 +584,7 @@ * * @return array The sequence of strings. */ - public function _final() + public function finalize() { $lines = array(); @@ -691,7 +692,7 @@ $nlead = $this->leading_context_lines; $ntrail = $this->trailing_context_lines; - $this->_start_diff(); + $this->start_diff(); $x0 = 0; $y0 = 0; @@ -703,9 +704,9 @@ } else { if ($ntrail) { $context = array_slice($edit->orig, 0, $ntrail); - $block[] = new _DiffOp_Copy($context); + $block[] = new DiffOp_Copy($context); } - $this->_block($x0, $ntrail + $xi - $x0, + $this->block($x0, $ntrail + $xi - $x0, $y0, $ntrail + $yi - $y0, $block); $block = false; @@ -719,7 +720,7 @@ $y0 = $yi - sizeof($context); $block = array(); if ($context) - $block[] = new _DiffOp_Copy($context); + $block[] = new DiffOp_Copy($context); } $block[] = $edit; } @@ -731,41 +732,44 @@ } if (is_array($block)) - $this->_block($x0, $xi - $x0, + $this->block($x0, $xi - $x0, $y0, $yi - $y0, $block); - return $this->_end_diff(); + return $this->end_diff(); } - private function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) + private function block($xbeg, $xlen, $ybeg, $ylen, &$edits) { - $this->_start_block($this->_block_header($xbeg, $xlen, $ybeg, $ylen)); + $this->start_block($this->block_header($xbeg, $xlen, $ybeg, $ylen)); foreach ($edits as $edit) { if ($edit->type == 'copy') - $this->_context($edit->orig); + $this->context($edit->orig); elseif ($edit->type == 'add') - $this->_added($edit->final); elseif ($edit->type == 'delete') - $this->_deleted($edit->orig); elseif ($edit->type == 'change') - $this->_changed($edit->orig, $edit->final); else + $this->added($edit->final); + elseif ($edit->type == 'delete') + $this->deleted($edit->orig); + elseif ($edit->type == 'change') + $this->changed($edit->orig, $edit->final); + else trigger_error("Unknown edit type", E_USER_ERROR); } - $this->_end_block(); + $this->end_block(); } - protected function _start_diff() + protected function start_diff() { ob_start(); } - protected function _end_diff() + protected function end_diff() { $val = ob_get_contents(); ob_end_clean(); return $val; } - protected function _block_header($xbeg, $xlen, $ybeg, $ylen) + protected function block_header($xbeg, $xlen, $ybeg, $ylen) { if ($xlen > 1) $xbeg .= "," . ($xbeg + $xlen - 1); @@ -775,41 +779,41 @@ return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg; } - protected function _start_block($header) + protected function start_block($header) { echo $header; } - protected function _end_block() + protected function end_block() { } - protected function _lines($lines, $prefix = ' ') + protected function lines($lines, $prefix = ' ') { foreach ($lines as $line) echo "$prefix $line\n"; } - protected function _context($lines) + protected function context($lines) { - $this->_lines($lines); + $this->lines($lines); } - protected function _added($lines) + protected function added($lines) { - $this->_lines($lines, ">"); + $this->lines($lines, ">"); } - protected function _deleted($lines) + protected function deleted($lines) { - $this->_lines($lines, "<"); + $this->lines($lines, "<"); } - protected function _changed($orig, $final) + protected function changed($orig, $final) { - $this->_deleted($orig); + $this->deleted($orig); echo "---\n"; - $this->_added($final); + $this->added($final); } } @@ -826,7 +830,7 @@ $this->trailing_context_lines = $context_lines; } - protected function _block_header($xbeg, $xlen, $ybeg, $ylen) + protected function block_header($xbeg, $xlen, $ybeg, $ylen) { if ($xlen != 1) $xbeg .= "," . $xlen; @@ -835,20 +839,20 @@ return "@@ -$xbeg +$ybeg @@\n"; } - protected function _added($lines) + protected function added($lines) { - $this->_lines($lines, "+"); + $this->lines($lines, "+"); } - protected function _deleted($lines) + protected function deleted($lines) { - $this->_lines($lines, "-"); + $this->lines($lines, "-"); } - protected function _changed($orig, $final) + protected function changed($orig, $final) { - $this->_deleted($orig); - $this->_added($final); + $this->deleted($orig); + $this->added($final); } } @@ -871,7 +875,7 @@ $this->trailing_context_lines = $context_lines; } - protected function _lines($lines, $prefix = '') + protected function lines($lines, $prefix = '') { if (!$prefix == '') echo "$prefix\n"; @@ -881,24 +885,24 @@ echo "$prefix\n"; } - protected function _added($lines) + protected function added($lines) { - $this->_lines($lines, ">>>>>>>"); + $this->lines($lines, ">>>>>>>"); } - protected function _deleted($lines) + protected function deleted($lines) { - $this->_lines($lines, "<<<<<<<"); + $this->lines($lines, "<<<<<<<"); } - protected function _block_header($xbeg, $xlen, $ybeg, $ylen) + protected function block_header($xbeg, $xlen, $ybeg, $ylen) { return ""; } - protected function _changed($orig, $final) + protected function changed($orig, $final) { - $this->_deleted($orig); - $this->_added($final); + $this->deleted($orig); + $this->added($final); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-07-21 12:15:11
|
Revision: 9898 http://sourceforge.net/p/phpwiki/code/9898 Author: vargenau Date: 2016-07-21 12:15:07 +0000 (Thu, 21 Jul 2016) Log Message: ----------- _PageList_Column: use __construct Modified Paths: -------------- trunk/lib/plugin/FullTextSearch.php trunk/lib/plugin/LinkSearch.php trunk/lib/plugin/ListPages.php trunk/lib/plugin/SemanticSearch.php trunk/lib/plugin/WantedPages.php trunk/lib/plugin/WikiTranslation.php trunk/lib/wikilens/PageListColumns.php Modified: trunk/lib/plugin/FullTextSearch.php =================================================================== --- trunk/lib/plugin/FullTextSearch.php 2016-07-21 10:16:06 UTC (rev 9897) +++ trunk/lib/plugin/FullTextSearch.php 2016-07-21 12:15:07 UTC (rev 9898) @@ -168,10 +168,10 @@ { private $parentobj; - function _PageList_Column_WantedPages_links(&$params) + function __construct(&$params) { $this->parentobj =& $params[3]; - $this->_PageList_Column($params[0], $params[1], $params[2]); + parent::__construct($params[0], $params[1], $params[2]); } function _getValue($page, $revision_handle) Modified: trunk/lib/plugin/LinkSearch.php =================================================================== --- trunk/lib/plugin/LinkSearch.php 2016-07-21 10:16:06 UTC (rev 9897) +++ trunk/lib/plugin/LinkSearch.php 2016-07-21 12:15:07 UTC (rev 9898) @@ -170,7 +170,7 @@ class _PageList_Column_LinkSearch_link extends _PageList_Column { - function _PageList_Column_LinkSearch_link($field, $heading, &$pagelist) + function __construct($field, $heading, &$pagelist) { $this->_field = $field; $this->_heading = $heading; Modified: trunk/lib/plugin/ListPages.php =================================================================== --- trunk/lib/plugin/ListPages.php 2016-07-21 10:16:06 UTC (rev 9897) +++ trunk/lib/plugin/ListPages.php 2016-07-21 12:15:07 UTC (rev 9898) @@ -137,10 +137,10 @@ // how many back-/forwardlinks for this page class _PageList_Column_ListPages_count extends _PageList_Column { - function _PageList_Column_ListPages_count($field, $display, $backwards = false) + function __construct($field, $display, $backwards = false) { $this->_direction = $backwards; - return $this->_PageList_Column($field, $display, 'center'); + parent::__construct($field, $display, 'center'); } function _getValue($page, $revision_handle) Modified: trunk/lib/plugin/SemanticSearch.php =================================================================== --- trunk/lib/plugin/SemanticSearch.php 2016-07-21 10:16:06 UTC (rev 9897) +++ trunk/lib/plugin/SemanticSearch.php 2016-07-21 12:15:07 UTC (rev 9898) @@ -436,7 +436,7 @@ class _PageList_Column_SemanticSearch_relation extends _PageList_Column { - function _PageList_Column_SemanticSearch_relation($field, $heading, &$pagelist) + function __construct($field, $heading, &$pagelist) { $this->_field = $field; $this->_heading = $heading; Modified: trunk/lib/plugin/WantedPages.php =================================================================== --- trunk/lib/plugin/WantedPages.php 2016-07-21 10:16:06 UTC (rev 9897) +++ trunk/lib/plugin/WantedPages.php 2016-07-21 12:15:07 UTC (rev 9898) @@ -158,10 +158,10 @@ // which links to the missing page class _PageList_Column_WantedPages_wanted extends _PageList_Column { - function _PageList_Column_WantedPages_wanted(&$params) + function __construct(&$params) { $this->parentobj =& $params[3]; - $this->_PageList_Column($params[0], $params[1], $params[2]); + parent::__construct($params[0], $params[1], $params[2]); } function _getValue($page, $revision_handle) @@ -183,10 +183,10 @@ */ class _PageList_Column_WantedPages_links extends _PageList_Column { - function _PageList_Column_WantedPages_links(&$params) + function __construct(&$params) { $this->parentobj =& $params[3]; - $this->_PageList_Column($params[0], $params[1], $params[2]); + parent::__construct($params[0], $params[1], $params[2]); } function _getValue($page, $revision_handle) Modified: trunk/lib/plugin/WikiTranslation.php =================================================================== --- trunk/lib/plugin/WikiTranslation.php 2016-07-21 10:16:06 UTC (rev 9897) +++ trunk/lib/plugin/WikiTranslation.php 2016-07-21 12:15:07 UTC (rev 9898) @@ -494,7 +494,7 @@ class _PageList_Column_customlang extends _PageList_Column { - function _PageList_Column_customlang($field, $from_lang, $plugin) + function __construct($field, $from_lang, $plugin) { /** * @var WikiRequest $request @@ -512,7 +512,7 @@ $this->_field = substr($field, 7); //$heading = $field; $this->dbi = &$request->getDbh(); - $this->_PageList_Column_base($this->_field); + _PageList_Column_base::__construct($this->_field); } function _getValue($page, $revision_handle) Modified: trunk/lib/wikilens/PageListColumns.php =================================================================== --- trunk/lib/wikilens/PageListColumns.php 2016-07-21 10:16:06 UTC (rev 9897) +++ trunk/lib/wikilens/PageListColumns.php 2016-07-21 12:15:07 UTC (rev 9898) @@ -60,7 +60,7 @@ function __construct($params) { $this->_pagelist =& $params[3]; - $this->_PageList_Column($params[0], $params[1], $params[2]); + _PageList_Column::__construct($params[0], $params[1], $params[2]); $this->_selectedBuddies = $this->_pagelist->getOption('selectedBuddies'); } @@ -93,7 +93,7 @@ function __construct($params) { $this->_pagelist =& $params[3]; - $this->_PageList_Column($params[0], $params[1], $params[2]); + _PageList_Column::__construct($params[0], $params[1], $params[2]); $this->_selectedBuddies = $this->_pagelist->getOption('selectedBuddies'); } @@ -117,7 +117,7 @@ function __construct($params) { $this->_pagelist =& $params[3]; - $this->_PageList_Column($params[0], $params[1], $params[2]); + _PageList_Column::__construct($params[0], $params[1], $params[2]); $this->_selectedBuddies = $this->_pagelist->getOption('selectedBuddies'); } @@ -159,7 +159,7 @@ $this->_user =& RatingsUserFactory::getUser($GLOBALS['request']->_user->_userid); } } - $this->_PageList_Column($params[0], $params[1], $params[2]); + parent::__construct($params[0], $params[1], $params[2]); $this->_dimension = $this->_pagelist->getOption('dimension'); if (!$this->_dimension) $this->_dimension = 0; } @@ -230,7 +230,7 @@ function __construct($params) { $this->_pagelist =& $params[3]; - $this->_PageList_Column($params[0], $params[1], $params[2]); + _PageList_Column::__construct($params[0], $params[1], $params[2]); $this->_dimension = $this->_pagelist->getOption('dimension'); if (!$this->_dimension) $this->_dimension = 0; } @@ -287,9 +287,8 @@ $this->_active_ratings_user =& RatingsUserFactory::getUser($active_user->getId()); $this->_pagelist =& $params[3]; - $this->_PageList_Column($params[0], $params[1], $params[2]); + parent::__construct($params[0], $params[1], $params[2]); $this->_dimension = $this->_pagelist->getOption('dimension'); - ; if (!$this->_dimension) $this->_dimension = 0; $this->_users = $this->_pagelist->getOption('users'); } @@ -342,7 +341,7 @@ // No, I don't know exactly why, but this needs to be a reference for // the memoization in pearson_similarity and mean_rating to work $this->_active_ratings_user = new RatingsUser($active_user->getId()); - $this->_PageList_Column($params[0], $params[1], $params[2]); + _PageList_Column::__construct($params[0], $params[1], $params[2]); if (!empty($params[3])) { $this->_pagelist =& $params[3]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-10-07 08:51:26
|
Revision: 9941 http://sourceforge.net/p/phpwiki/code/9941 Author: vargenau Date: 2016-10-07 08:51:23 +0000 (Fri, 07 Oct 2016) Log Message: ----------- Add file header Modified Paths: -------------- trunk/lib/WysiwygEdit/CKeditor.php trunk/lib/WysiwygEdit/Wikiwyg.php trunk/lib/WysiwygEdit/htmlarea2.php trunk/lib/WysiwygEdit/htmlarea3.php trunk/lib/WysiwygEdit/spaw.php trunk/lib/WysiwygEdit/tinymce.php trunk/lib/WysiwygEdit.php Modified: trunk/lib/WysiwygEdit/CKeditor.php =================================================================== --- trunk/lib/WysiwygEdit/CKeditor.php 2016-10-06 17:07:22 UTC (rev 9940) +++ trunk/lib/WysiwygEdit/CKeditor.php 2016-10-07 08:51:23 UTC (rev 9941) @@ -1,4 +1,26 @@ <?php +/** + * Copyright © 2005 Reini Urban + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * SPDX-License-Identifier: GPL-2.0+ + * + */ /** * CKeditor is compatible with most internet browsers Modified: trunk/lib/WysiwygEdit/Wikiwyg.php =================================================================== --- trunk/lib/WysiwygEdit/Wikiwyg.php 2016-10-06 17:07:22 UTC (rev 9940) +++ trunk/lib/WysiwygEdit/Wikiwyg.php 2016-10-07 08:51:23 UTC (rev 9941) @@ -1,4 +1,27 @@ <?php +/** + * Copyright © 2006 Reini Urban, Jean-Nicolas Gereone + * Copyright © 2007 Sabri Labbenes + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * SPDX-License-Identifier: GPL-2.0+ + * + */ /** * Wikiwyg is compatible with most internet browsers which Modified: trunk/lib/WysiwygEdit/htmlarea2.php =================================================================== --- trunk/lib/WysiwygEdit/htmlarea2.php 2016-10-06 17:07:22 UTC (rev 9940) +++ trunk/lib/WysiwygEdit/htmlarea2.php 2016-10-07 08:51:23 UTC (rev 9941) @@ -1,4 +1,26 @@ <?php +/** + * Copyright © 2005 Reini Urban + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * SPDX-License-Identifier: GPL-2.0+ + * + */ /** * requires installation into themes/default/htmlarea2/ Modified: trunk/lib/WysiwygEdit/htmlarea3.php =================================================================== --- trunk/lib/WysiwygEdit/htmlarea3.php 2016-10-06 17:07:22 UTC (rev 9940) +++ trunk/lib/WysiwygEdit/htmlarea3.php 2016-10-07 08:51:23 UTC (rev 9941) @@ -1,4 +1,26 @@ <?php +/** + * Copyright © 2005 Reini Urban + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * SPDX-License-Identifier: GPL-2.0+ + * + */ /** * requires installation into themes/default/htmlarea3/ Modified: trunk/lib/WysiwygEdit/spaw.php =================================================================== --- trunk/lib/WysiwygEdit/spaw.php 2016-10-06 17:07:22 UTC (rev 9940) +++ trunk/lib/WysiwygEdit/spaw.php 2016-10-07 08:51:23 UTC (rev 9941) @@ -1,7 +1,28 @@ <?php /** - * Just IE 5.5+ and Gecko + * Copyright © 2005 Reini Urban * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * SPDX-License-Identifier: GPL-2.0+ + * + */ + +/** * Download: http://sourceforge.net/projects/spaw * requires installation of spaw as lib/spaw * modify lib/spaw/config/spaw_control.config.php to your needs. Modified: trunk/lib/WysiwygEdit/tinymce.php =================================================================== --- trunk/lib/WysiwygEdit/tinymce.php 2016-10-06 17:07:22 UTC (rev 9940) +++ trunk/lib/WysiwygEdit/tinymce.php 2016-10-07 08:51:23 UTC (rev 9941) @@ -1,4 +1,26 @@ <?php +/** + * Copyright © 2005 Reini Urban + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * SPDX-License-Identifier: GPL-2.0+ + * + */ /** * Multiple browser support, currently Mozilla (PC, Mac and Linux), Modified: trunk/lib/WysiwygEdit.php =================================================================== --- trunk/lib/WysiwygEdit.php 2016-10-06 17:07:22 UTC (rev 9940) +++ trunk/lib/WysiwygEdit.php 2016-10-07 08:51:23 UTC (rev 9941) @@ -1,4 +1,26 @@ <?php +/** + * Copyright © 2005-2006 Reini Urban + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * SPDX-License-Identifier: GPL-2.0+ + * + */ /** * Baseclass for WysiwygEdit/* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |