From: <var...@us...> - 2016-07-28 07:38:56
|
Revision: 9915 http://sourceforge.net/p/phpwiki/code/9915 Author: vargenau Date: 2016-07-28 07:38:54 +0000 (Thu, 28 Jul 2016) Log Message: ----------- Rename DebugInfo as DebugBackendInfo in upgrade Modified Paths: -------------- trunk/lib/upgrade.php Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2016-07-27 14:58:50 UTC (rev 9914) +++ trunk/lib/upgrade.php 2016-07-28 07:38:54 UTC (rev 9915) @@ -128,6 +128,7 @@ $this->_rename_page_helper("Help/_BackendInfoPlugin", "Help/DebugBackendInfoPlugin"); $this->_rename_page_helper("Help/_WikiTranslationPlugin", "Help/WikiTranslationPlugin"); $this->_rename_page_helper("Help/Advice Mediawiki users", "Help/Advice for Mediawiki users"); + $this->_rename_page_helper("DebugInfo", "DebugBackendInfo"); $this->_rename_page_helper("_GroupInfo", "GroupAuthInfo"); //never officially existed $this->_rename_page_helper("InterWikiKarte", "InterWikiListe"); // german only This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-12-01 15:07:19
|
Revision: 9978 http://sourceforge.net/p/phpwiki/code/9978 Author: vargenau Date: 2016-12-01 15:07:17 +0000 (Thu, 01 Dec 2016) Log Message: ----------- Add whitespace Modified Paths: -------------- trunk/lib/upgrade.php Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2016-11-28 11:15:37 UTC (rev 9977) +++ trunk/lib/upgrade.php 2016-12-01 15:07:17 UTC (rev 9978) @@ -212,7 +212,7 @@ private function _rename_page_helper($oldname, $pagename) { - echo sprintf(_("rename %s to %s"), $oldname, $pagename), " ..."; + echo sprintf(_("rename %s to %s"), $oldname, $pagename), " ... "; if ($this->dbi->isWikiPage($oldname) and !$this->dbi->isWikiPage($pagename)) { if ($this->dbi->_backend->rename_page($oldname, $pagename)) { echo _("OK"), " <br />\n"; @@ -432,7 +432,7 @@ $prefix = isset($DBParams['prefix']) ? $DBParams['prefix'] : ''; $tables = $this->dbi->_backend->listOfTables(); foreach (explode(':', 'session:pref:member') as $table) { - echo sprintf(_("Check for table %s"), $table), " ..."; + echo sprintf(_("Check for table %s"), $table), " ... "; if (!in_array($prefix . $table, $tables)) { $this->installTable($table, $backend_type); } else { @@ -452,7 +452,7 @@ if (ACCESS_LOG_SQL and $this->isSQL) { $table = "accesslog"; - echo sprintf(_("Check for table %s"), $table), " ..."; + echo sprintf(_("Check for table %s"), $table), " ... "; if (!in_array($prefix . $table, $tables)) { $this->installTable($table, $backend_type); } else { @@ -461,7 +461,7 @@ } if ($this->isSQL and (class_exists("RatingsUserFactory") or $this->dbi->isWikiPage(_("RateIt")))) { $table = "rating"; - echo sprintf(_("Check for table %s"), $table), " ..."; + echo sprintf(_("Check for table %s"), $table), " ... "; if (!in_array($prefix . $table, $tables)) { $this->installTable($table, $backend_type); } else { @@ -528,7 +528,7 @@ // mysql >= 4.0.4 requires LOCK TABLE privileges if (substr($backend_type, 0, 5) == 'mysql') { - echo _("Check for mysql LOCK TABLE privilege"), " ..."; + echo _("Check for mysql LOCK TABLE privilege"), " ... "; $mysql_version = $this->dbi->_backend->_serverinfo['version']; if ($mysql_version > 400.40) { if (!empty($this->dbi->_backend->_parsedDSN)) @@ -582,7 +582,7 @@ if ($this->phpwiki_version >= 1030.099 and substr($backend_type, 0, 5) == 'mysql' and DATABASE_TYPE != 'PDO' ) { - echo _("Check for mysql page.id auto_increment flag"), " ..."; + echo _("Check for mysql page.id auto_increment flag"), " ... "; assert(!empty($page_tbl)); $database = $this->dbi->_backend->database(); $fields = mysql_list_fields($database, $page_tbl, $this->dbi->_backend->connection()); @@ -619,7 +619,7 @@ // Illegal mix of collations (latin1_bin,IMPLICIT) and // (utf8_general_ci, COERCIBLE) for operation '=']) if (isWindows() and substr($backend_type, 0, 5) == 'mysql') { - echo _("Check for mysql 4.1.x/5.0.0 binary search on Windows problem"), " ..."; + echo _("Check for mysql 4.1.x/5.0.0 binary search on Windows problem"), " ... "; $mysql_version = $this->dbi->_backend->_serverinfo['version']; if ($mysql_version < 401.0) { echo sprintf(_("version <em>%s</em>"), $mysql_version), " ", @@ -668,7 +668,7 @@ } } if ($this->isSQL and ACCESS_LOG_SQL & 2) { - echo _("Check for ACCESS_LOG_SQL passwords in POST requests"), " ..."; + echo _("Check for ACCESS_LOG_SQL passwords in POST requests"), " ... "; // Don't display passwords in POST requests (up to 2005-02-04 12:03:20) $res = $this->dbi->genericSqlIter("SELECT time_stamp, remote_host, " . "request_args FROM ${prefix}accesslog WHERE request_args LIKE " . @@ -691,7 +691,7 @@ echo _("OK"), "<br />\n"; if ($this->phpwiki_version >= 1030.13) { - echo _("Check for ACCESS_LOG_SQL remote_host varchar(50)"), " ..."; + echo _("Check for ACCESS_LOG_SQL remote_host varchar(50)"), " ... "; $database = $this->dbi->_backend->database(); $accesslog_tbl = $prefix . 'accesslog'; $fields = $this->dbi->_backend->listOfFields($database, $accesslog_tbl); @@ -904,7 +904,7 @@ private function _upgrade_relation_links() { if ($this->phpwiki_version >= 1030.12200610 and $this->isSQL) { - echo _("Check for relation field in link table"), " ..."; + echo _("Check for relation field in link table"), " ... "; $database = $this->dbi->_backend->database(); $prefix = isset($DBParams['prefix']) ? $DBParams['prefix'] : ''; $link_tbl = $prefix . 'link'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-12-05 13:20:07
|
Revision: 9982 http://sourceforge.net/p/phpwiki/code/9982 Author: vargenau Date: 2016-12-05 13:20:05 +0000 (Mon, 05 Dec 2016) Log Message: ----------- Respect <h*> hierarchy Modified Paths: -------------- trunk/lib/upgrade.php Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2016-12-05 12:46:40 UTC (rev 9981) +++ trunk/lib/upgrade.php 2016-12-05 13:20:05 UTC (rev 9982) @@ -421,7 +421,7 @@ $backend_type = $this->dbi->_backend->backendType(); if ($this->isSQL) { - echo "<h4>", _("Backend type: "), $backend_type, "</h4>\n"; + echo "<p>", _("Backend type: "), $backend_type, "</p>\n"; $prefix = isset($DBParams['prefix']) ? $DBParams['prefix'] : ''; $tables = $this->dbi->_backend->listOfTables(); foreach (explode(':', 'session:pref:member') as $table) { @@ -705,8 +705,7 @@ if ($this->db_version < $this->current_db_version) { $this->dbi->set_db_version($this->current_db_version); $this->db_version = $this->dbi->get_db_version(); - echo _("db version: upgrade to "), $this->db_version, " "; - echo _("OK"), "<br />\n"; + echo _("db version: upgrade to "), $this->db_version, " ... ", _("OK"), "<br />\n"; flush(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-12-06 20:24:18
|
Revision: 9990 http://sourceforge.net/p/phpwiki/code/9990 Author: vargenau Date: 2016-12-06 20:24:16 +0000 (Tue, 06 Dec 2016) Log Message: ----------- Remove lock_tables_priv stuff Modified Paths: -------------- trunk/lib/upgrade.php Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2016-12-05 18:05:10 UTC (rev 9989) +++ trunk/lib/upgrade.php 2016-12-06 20:24:16 UTC (rev 9990) @@ -519,57 +519,6 @@ CREATE INDEX linkrelation ON link (relation); */ - // mysql >= 4.0.4 requires LOCK TABLE privileges - if (substr($backend_type, 0, 5) == 'mysql') { - echo _("Check for mysql LOCK TABLE privilege"), " ... "; - $mysql_version = $this->dbi->_backend->_serverinfo['version']; - if ($mysql_version > 400.40) { - if (!empty($this->dbi->_backend->_parsedDSN)) - $parseDSN = $this->dbi->_backend->_parsedDSN; - elseif (function_exists('parseDSN')) // ADODB or PDO - $parseDSN = parseDSN($DBParams['dsn']); else // pear - $parseDSN = DB::parseDSN($DBParams['dsn']); - $username = $this->dbi->_backend->qstr($parseDSN['username']); - // on db level - $query = "SELECT lock_tables_priv FROM mysql.db WHERE user='$username'"; - //mysql_select_db("mysql", $this->dbi->_backend->connection()); - $db_fields = $this->dbi->_backend->listOfFields("mysql", "db"); - if (!strstr(strtolower(join(':', $db_fields)), "lock_tables_priv")) { - echo join(':', $db_fields); - die("lock_tables_priv missing. The DB Admin must run mysql_fix_privilege_tables"); - } - $row = $this->dbi->_backend->getRow($query); - if (isset($row[0]) and $row[0] == 'N') { - $this->dbi->genericSqlQuery("UPDATE mysql.db SET lock_tables_priv='Y'" - . " WHERE mysql.user='$username'"); - $this->dbi->genericSqlQuery("FLUSH PRIVILEGES"); - echo "mysql.db user='$username'", _("fixed"), "<br />\n"; - } elseif (!$row) { - // or on user level - $query = "SELECT lock_tables_priv FROM mysql.user WHERE user='$username'"; - $row = $this->dbi->_backend->getRow($query); - if ($row and $row[0] == 'N') { - $this->dbi->genericSqlQuery("UPDATE mysql.user SET lock_tables_priv='Y'" - . " WHERE mysql.user='$username'"); - $this->dbi->genericSqlQuery("FLUSH PRIVILEGES"); - echo "mysql.user user='$username'", _("fixed"), "<br />\n"; - } elseif (!$row) { - echo ' <span style="color: red; font-weight: bold;">' . _("FAILED") . "</span>" - . " Neither mysql.db nor mysql.user has a user='$username'" - . " or the lock_tables_priv field", - "<br />\n"; - } else { - echo _("OK"), "<br />\n"; - } - } else { - echo _("OK"), "<br />\n"; - } - //mysql_select_db($this->dbi->_backend->database(), $this->dbi->_backend->connection()); - } else { - echo sprintf(_("version <em>%s</em> not affected"), $mysql_version), "<br />\n"; - } - } - // 1.3.10 mysql requires page.id auto_increment // mysql, mysqli or mysqlt if ($this->phpwiki_version >= 1030.099 and substr($backend_type, 0, 5) == 'mysql' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-12-07 09:09:59
|
Revision: 9991 http://sourceforge.net/p/phpwiki/code/9991 Author: vargenau Date: 2016-12-07 09:09:56 +0000 (Wed, 07 Dec 2016) Log Message: ----------- rename_page_helper("TemplateTalk", "Template/Talk") Modified Paths: -------------- trunk/lib/upgrade.php Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2016-12-06 20:24:16 UTC (rev 9990) +++ trunk/lib/upgrade.php 2016-12-07 09:09:56 UTC (rev 9991) @@ -132,8 +132,9 @@ $this->_rename_page_helper("Help/_WikiTranslationPlugin", "Help/WikiTranslationPlugin"); $this->_rename_page_helper("Help/Advice Mediawiki users", "Help/Advice for Mediawiki users"); $this->_rename_page_helper("DebugInfo", "DebugBackendInfo"); - $this->_rename_page_helper("_GroupInfo", "GroupAuthInfo"); //never officially existed - $this->_rename_page_helper("InterWikiKarte", "InterWikiListe"); // german only + $this->_rename_page_helper("_GroupInfo", "GroupAuthInfo"); // never officially existed + $this->_rename_page_helper("InterWikiKarte", "InterWikiListe"); // German only + $this->_rename_page_helper("TemplateTalk", "Template/Talk"); $path = findFile('pgsrc'); $pgsrc = new FileSet($path); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2019-09-02 08:50:39
|
Revision: 10140 http://sourceforge.net/p/phpwiki/code/10140 Author: vargenau Date: 2019-09-02 08:50:38 +0000 (Mon, 02 Sep 2019) Log Message: ----------- mysql_list_fields and mysql_num_fields removed in PHP 7 Modified Paths: -------------- trunk/lib/upgrade.php Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2019-07-30 12:21:39 UTC (rev 10139) +++ trunk/lib/upgrade.php 2019-09-02 08:50:38 UTC (rev 10140) @@ -528,6 +528,7 @@ echo _("Check for mysql page.id auto_increment flag"), " ... "; assert(!empty($page_tbl)); $database = $this->dbi->_backend->database(); + // mysql_list_fields and mysql_num_fields removed in PHP 7 $fields = mysql_list_fields($database, $page_tbl, $this->dbi->_backend->connection()); $columns = mysql_num_fields($fields); for ($i = 0; $i < $columns; $i++) { @@ -588,6 +589,7 @@ extract($this->dbi->_backend->_table_names); assert(!empty($page_tbl)); $database = $this->dbi->_backend->database(); + // mysql_list_fields and mysql_num_fields removed in PHP 7 $fields = mysql_list_fields($database, $page_tbl, $this->dbi->_backend->connection()); $columns = mysql_num_fields($fields); for ($i = 0; $i < $columns; $i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-29 16:44:31
|
Revision: 10395 http://sourceforge.net/p/phpwiki/code/10395 Author: vargenau Date: 2021-07-29 16:44:29 +0000 (Thu, 29 Jul 2021) Log Message: ----------- lib/upgrade.php: remove code using mysql_list_fields, mysql_num_fields, mysql_field_name, mysql_field_flags, mysql_free_result Modified Paths: -------------- trunk/lib/upgrade.php Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2021-07-29 15:46:37 UTC (rev 10394) +++ trunk/lib/upgrade.php 2021-07-29 16:44:29 UTC (rev 10395) @@ -515,103 +515,6 @@ } } - /* TODO: - ALTER TABLE link ADD relation INT DEFAULT 0; - CREATE INDEX linkrelation ON link (relation); - */ - - // 1.3.10 mysql requires page.id auto_increment - // mysql, mysqli or mysqlt - if ($this->phpwiki_version >= 1030.099 and substr($backend_type, 0, 5) == 'mysql' - and DATABASE_TYPE != 'PDO' - ) { - echo _("Check for mysql page.id auto_increment flag"), " ... "; - assert(!empty($page_tbl)); - $database = $this->dbi->_backend->database(); - // mysql_list_fields and mysql_num_fields removed in PHP 7 - $fields = mysql_list_fields($database, $page_tbl, $this->dbi->_backend->connection()); - $columns = mysql_num_fields($fields); - for ($i = 0; $i < $columns; $i++) { - if (mysql_field_name($fields, $i) == 'id') { - $flags = mysql_field_flags($fields, $i); - //DONE: something was wrong with ADODB here. - if (!strstr(strtolower($flags), "auto_increment")) { - echo "<b>", _("ADDING"), "</b>", " ... "; - // MODIFY col_def valid since mysql 3.22.16, - // older mysql's need CHANGE old_col col_def - $this->dbi->genericSqlQuery("ALTER TABLE $page_tbl CHANGE id" - . " id INT NOT NULL AUTO_INCREMENT"); - $fields = mysql_list_fields($database, $page_tbl); - if (!strstr(strtolower(mysql_field_flags($fields, $i)), "auto_increment")) - echo ' <span style="color: red; font-weight: bold;">' . _("FAILED") . "</span><br />\n"; - else - echo _("OK"), "<br />\n"; - } else { - echo _("OK"), "<br />\n"; - } - break; - } - } - mysql_free_result($fields); - } - - // Check for mysql 4.1.x/5.0.0a binary search problem. - // http://bugs.mysql.com/bug.php?id=4398 - // "select * from page where LOWER(pagename) like '%search%'" does not apply LOWER! - // Confirmed for 4.1.0alpha,4.1.3-beta,5.0.0a; not yet tested for 4.1.2alpha, - // On windows only, though utf8 would be useful elsewhere also. - // Illegal mix of collations (latin1_bin,IMPLICIT) and - // (utf8_general_ci, COERCIBLE) for operation '=']) - if (isWindows() and substr($backend_type, 0, 5) == 'mysql') { - echo _("Check for mysql 4.1.x/5.0.0 binary search on Windows problem"), " ... "; - $mysql_version = $this->dbi->_backend->_serverinfo['version']; - if ($mysql_version < 401.0) { - echo sprintf(_("version <em>%s</em>"), $mysql_version), " ", - _("not affected"), "<br />\n"; - } elseif ($mysql_version >= 401.6) { // FIXME: since which version? - $row = $this->dbi->_backend->getRow("SHOW CREATE TABLE $page_tbl"); - $result = join(" ", $row); - if (strstr(strtolower($result), "character set") - and strstr(strtolower($result), "collate") - ) { - echo _("OK"), "<br />\n"; - } else { - $charset = 'UTF-8'; - $this->dbi->genericSqlQuery("ALTER TABLE $page_tbl CHANGE pagename " - . "pagename VARCHAR(100) " - . "CHARACTER SET '$charset' COLLATE '$charset" . "_bin' NOT NULL"); - echo sprintf(_("version <em>%s</em>"), $mysql_version), - " <b>", _("FIXED"), "</b>", - "<br />\n"; - } - } elseif (DATABASE_TYPE != 'PDO') { - // check if already fixed - extract($this->dbi->_backend->_table_names); - assert(!empty($page_tbl)); - $database = $this->dbi->_backend->database(); - // mysql_list_fields and mysql_num_fields removed in PHP 7 - $fields = mysql_list_fields($database, $page_tbl, $this->dbi->_backend->connection()); - $columns = mysql_num_fields($fields); - for ($i = 0; $i < $columns; $i++) { - if (mysql_field_name($fields, $i) == 'pagename') { - $flags = mysql_field_flags($fields, $i); - // I think it was fixed with 4.1.6, but I tested it only with 4.1.8 - if ($mysql_version > 401.0 and $mysql_version < 401.6) { - // remove the binary flag - if (strstr(strtolower($flags), "binary")) { - // FIXME: on duplicate pagenames this will fail! - $this->dbi->genericSqlQuery("ALTER TABLE $page_tbl CHANGE pagename" - . " pagename VARCHAR(100) NOT NULL"); - echo sprintf(_("version <em>%s</em>"), $mysql_version), - "<b>", _("FIXED"), "</b>" - , "<br />\n"; - } - } - break; - } - } - } - } if ($this->isSQL and ACCESS_LOG_SQL & 2) { echo _("Check for ACCESS_LOG_SQL passwords in POST requests"), " ... "; // Don't display passwords in POST requests (up to 2005-02-04 12:03:20) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-29 17:14:44
|
Revision: 10396 http://sourceforge.net/p/phpwiki/code/10396 Author: vargenau Date: 2021-07-29 17:14:42 +0000 (Thu, 29 Jul 2021) Log Message: ----------- lib/upgrade.php: add members, simplify code Modified Paths: -------------- trunk/lib/upgrade.php Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2021-07-29 16:44:29 UTC (rev 10395) +++ trunk/lib/upgrade.php 2021-07-29 17:14:42 UTC (rev 10396) @@ -57,14 +57,17 @@ public $error_caught; public $_configUpdates; public $check_args; + private $dbi; + private $request; + private $phpwiki_version; + private $isSQL; + private $db_version; function __construct(&$request) { $this->request =& $request; - $this->dbi =& $request->_dbi; // no reference for dbadmin ? + $this->dbi =& $request->_dbi; $this->phpwiki_version = $this->current_db_version = phpwiki_version(); - //$this->current_db_version = 1030.13; // should be stored in the db. should be phpwiki_version - $this->db_version = $this->dbi->get_db_version(); $this->isSQL = $this->dbi->_backend->isSQL(); } @@ -412,7 +415,6 @@ echo "<h2>", sprintf(_("Check for necessary %s updates"), _("database")), " - ", DATABASE_TYPE, "</h2>\n"; - $dbadmin = $this->request->getArg('dbadmin'); echo _("db version: we want "), $this->current_db_version, "\n<br />"; echo _("db version: we have "), $this->db_version, "\n<br />"; if ($this->db_version >= $this->current_db_version) { @@ -534,9 +536,9 @@ $count++; } if ($count > 0) - echo "<b>", _("FIXED"), "</b>", "<br />\n"; + echo "<b>" . _("FIXED") . "</b><br />\n"; else - echo _("OK"), "<br />\n"; + echo _("OK") . "<br />\n"; if ($this->phpwiki_version >= 1030.13) { echo _("Check for ACCESS_LOG_SQL remote_host varchar(50)"), " ... "; @@ -570,43 +572,36 @@ * put _cached_html from pagedata into a new separate blob, * not into the huge serialized string. * - * It is only rarelely needed: for current page only, if-not-modified, + * It is only rarely needed: for current page only, if-not-modified, * but was extracted for every simple page iteration. */ - private function _upgrade_cached_html($verbose = true) + private function _upgrade_cached_html() { if (!$this->isSQL) - return 0; - $count = 0; + return; if ($this->phpwiki_version >= 1030.10) { - if ($verbose) - echo _("Check for extra page.cached_html column"), " ... "; + echo _("Check for extra page.cached_html column"), " ... "; $database = $this->dbi->_backend->database(); extract($this->dbi->_backend->_table_names); $fields = $this->dbi->_backend->listOfFields($database, $page_tbl); if (!$fields) { echo _("SKIP"), "<br />\n"; - return 0; + return; } if (!strstr(strtolower(join(':', $fields)), "cached_html")) { - if ($verbose) - echo "<b>", _("ADDING"), "</b>", " ... "; + echo "<b>", _("ADDING"), "</b>", " ... "; $backend_type = $this->dbi->_backend->backendType(); if (substr($backend_type, 0, 5) == 'mysql') $this->dbi->genericSqlQuery("ALTER TABLE $page_tbl ADD cached_html MEDIUMBLOB"); else $this->dbi->genericSqlQuery("ALTER TABLE $page_tbl ADD cached_html BLOB"); - if ($verbose) - echo "<b>", _("CONVERTING"), "</b>", " ... "; + echo "<b>", _("CONVERTING"), "</b>", " ... "; $count = $this->_convert_cached_html(); - if ($verbose) - echo $count, " ", _("OK"), "<br />\n"; + echo $count, " ", _("OK"), "<br />\n"; } else { - if ($verbose) - echo _("OK"), "<br />\n"; + echo _("OK"), "<br />\n"; } } - return $count; } /** @@ -715,7 +710,7 @@ // todo: skip $reason = sprintf(_("%s not found in %s"), $match, $filename); unlink($out); - return array($found, $reason); + return array(false, $reason); } else { @unlink("$file.bak"); @rename($file, "$file.bak"); @@ -780,6 +775,12 @@ public $method_cb; public $check_cb; public $reason; + public array $applicable_args; + public object $parent; + private array $check_args; + private string $notice; + private string $_db_key; + private $upgrade; /** * Add an upgrade item to be checked. @@ -906,13 +907,13 @@ { public function _applicable_defined() { - return (boolean)defined($this->applicable_args[0]); + return defined($this->applicable_args[0]); } public function _applicable_defined_and_empty() { $const = $this->applicable_args[0]; - return (boolean)(defined($const) and !constant($const)); + return defined($const) and !constant($const); } public function default_method($args) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-29 19:32:26
|
Revision: 10399 http://sourceforge.net/p/phpwiki/code/10399 Author: vargenau Date: 2021-07-29 19:32:25 +0000 (Thu, 29 Jul 2021) Log Message: ----------- lib/upgrade.php: remove unused functions installTable and _convert_cached_html Modified Paths: -------------- trunk/lib/upgrade.php Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2021-07-29 19:11:48 UTC (rev 10398) +++ trunk/lib/upgrade.php 2021-07-29 19:32:25 UTC (rev 10399) @@ -152,7 +152,8 @@ if ($translation == $pagename) $this->doPgsrcUpdate($pagename, $path, $filename); elseif (findLocalizedFile('pgsrc/' . urlencode($translation), 1)) - $this->doPgsrcUpdate($translation, $loc_path, urlencode($translation)); else + $this->doPgsrcUpdate($translation, $loc_path, urlencode($translation)); + else $this->doPgsrcUpdate($pagename, $path, $filename); } } @@ -238,200 +239,6 @@ } /** - * TODO: Search table definition in appropriate schema - * and create it. - * Supported: mysql and generic SQL, for ADODB and PearDB. - */ - private function installTable($table, $backend_type) - { - global $DBParams; - if (!$this->isSQL) - return; - echo _("MISSING"), " ... \n"; - /* - $schema = findFile("schemas/${backend_type}.sql"); - if (!$schema) { - echo " ",_("FAILED"),": ",sprintf(_("no schema %s found"), - "schemas/${backend_type}.sql")," ... <br />\n"; - return false; - } - */ - extract($this->dbi->_backend->_table_names); - $prefix = isset($DBParams['prefix']) ? $DBParams['prefix'] : ''; - switch ($table) { - case 'session': - assert($session_tbl); - if ($backend_type == 'mysql') { - $this->dbi->genericSqlQuery(" -CREATE TABLE $session_tbl ( - sess_id CHAR(32) NOT NULL DEFAULT '', - sess_data BLOB NOT NULL, - sess_date INT UNSIGNED NOT NULL, - sess_ip CHAR(15) NOT NULL, - PRIMARY KEY (sess_id), - INDEX (sess_date) -)"); - } else { - $this->dbi->genericSqlQuery(" -CREATE TABLE $session_tbl ( - sess_id CHAR(32) NOT NULL DEFAULT '', - sess_data " . ($backend_type == 'pgsql' ? 'TEXT' : 'BLOB') . " NOT NULL, - sess_date INT, - sess_ip CHAR(15) NOT NULL -)"); - $this->dbi->genericSqlQuery("CREATE UNIQUE INDEX sess_id ON $session_tbl (sess_id)"); - } - $this->dbi->genericSqlQuery("CREATE INDEX sess_date on session (sess_date)"); - echo " ", _("CREATED"); - break; - case 'pref': - $pref_tbl = $prefix . 'pref'; - if ($backend_type == 'mysql') { - $this->dbi->genericSqlQuery(" -CREATE TABLE $pref_tbl ( - userid CHAR(48) BINARY NOT NULL UNIQUE, - prefs TEXT NULL DEFAULT '', - PRIMARY KEY (userid) -)"); - } else { - $this->dbi->genericSqlQuery(" -CREATE TABLE $pref_tbl ( - userid CHAR(48) NOT NULL, - prefs TEXT NULL DEFAULT '' -)"); - $this->dbi->genericSqlQuery("CREATE UNIQUE INDEX userid ON $pref_tbl (userid)"); - } - echo " ", _("CREATED"); - break; - case 'member': - $member_tbl = $prefix . 'member'; - if ($backend_type == 'mysql') { - $this->dbi->genericSqlQuery(" -CREATE TABLE $member_tbl ( - userid CHAR(48) BINARY NOT NULL, - groupname CHAR(48) BINARY NOT NULL DEFAULT 'users', - INDEX (userid), - INDEX (groupname) -)"); - } else { - $this->dbi->genericSqlQuery(" -CREATE TABLE $member_tbl ( - userid CHAR(48) NOT NULL, - groupname CHAR(48) NOT NULL DEFAULT 'users' -)"); - $this->dbi->genericSqlQuery("CREATE INDEX userid ON $member_tbl (userid)"); - $this->dbi->genericSqlQuery("CREATE INDEX groupname ON $member_tbl (groupname)"); - } - echo " ", _("CREATED"); - break; - case 'rating': - $rating_tbl = $prefix . 'rating'; - if ($backend_type == 'mysql') { - $this->dbi->genericSqlQuery(" -CREATE TABLE $rating_tbl ( - dimension INT(4) NOT NULL, - raterpage INT(11) NOT NULL, - rateepage INT(11) NOT NULL, - ratingvalue FLOAT NOT NULL, - rateeversion INT(11) NOT NULL, - tstamp TIMESTAMP(14) NOT NULL, - PRIMARY KEY (dimension, raterpage, rateepage) -)"); - } else { - $this->dbi->genericSqlQuery(" -CREATE TABLE $rating_tbl ( - dimension INT(4) NOT NULL, - raterpage INT(11) NOT NULL, - rateepage INT(11) NOT NULL, - ratingvalue FLOAT NOT NULL, - rateeversion INT(11) NOT NULL, - tstamp TIMESTAMP(14) NOT NULL -)"); - $this->dbi->genericSqlQuery("CREATE UNIQUE INDEX rating" - . " ON $rating_tbl (dimension, raterpage, rateepage)"); - } - echo " ", _("CREATED"); - break; - case 'accesslog': - $log_tbl = $prefix . 'accesslog'; - // fields according to http://www.outoforder.cc/projects/apache/mod_log_sql/docs-2.0/#id2756178 - /* - A User Agent agent varchar(255) Mozilla/4.0 (compat; MSIE 6.0; Windows) - a CGi request arguments request_args varchar(255) user=Smith&cart=1231&item=532 - b Bytes transfered bytes_sent int unsigned 32561 - c??? Text of cookie cookie varchar(255) Apache=sdyn.fooonline.net 1300102700823 - f Local filename requested request_file varchar(255) /var/www/html/books-cycroad.html - H HTTP request_protocol request_protocol varchar(10) HTTP/1.1 - h Name of remote host remote_host varchar(50) blah.foobar.com - I Request ID (from modd_unique_id) id char(19) POlFcUBRH30AAALdBG8 - l Ident user info remote_logname varcgar(50) bobby - M Machine ID??? machine_id varchar(25) web01 - m HTTP request method request_method varchar(10) GET - P httpd cchild PID child_pid smallint unsigned 3215 - p http port server_port smallint unsigned 80 - R Referer referer varchar(255) http://www.biglinks4u.com/linkpage.html - r Request in full form request_line varchar(255) GET /books-cycroad.html HTTP/1.1 - S Time of request in UNIX time_t format time_stamp int unsigned 1005598029 - T Seconds to service request request_duration smallint unsigned 2 - t Time of request in human format request_time char(28) [02/Dec/2001:15:01:26 -0800] - U Request in simple form request_uri varchar(255) /books-cycroad.html - u User info from HTTP auth remote_user varchar(50) bobby - v Virtual host servicing the request virtual_host varchar(255) - */ - $this->dbi->genericSqlQuery(" -CREATE TABLE $log_tbl ( - time_stamp int unsigned, - remote_host varchar(100), - remote_user varchar(50), - request_method varchar(10), - request_line varchar(255), - request_args varchar(255), - request_uri varchar(255), - request_time char(28), - status smallint unsigned, - bytes_sent smallint unsigned, - referer varchar(255), - agent varchar(255), - request_duration float -)"); - $this->dbi->genericSqlQuery("CREATE INDEX log_time ON $log_tbl (time_stamp)"); - $this->dbi->genericSqlQuery("CREATE INDEX log_host ON $log_tbl (remote_host)"); - echo " ", _("CREATED"); - break; - } - echo "<br />\n"; - } - - /** - * move _cached_html for all pages from pagedata into a new separate blob. - * decoupled from action=upgrade, so that it can be used by a WikiAdminUtils button also. - */ - private function _convert_cached_html() - { - if (!$this->isSQL) - return 0; - - $pages = $this->dbi->getAllPages(); - $cache =& $this->dbi->_cache; - $count = 0; - extract($this->dbi->_backend->_table_names); - while ($page = $pages->next()) { - $pagename = $page->getName(); - $data = $this->dbi->_backend->get_pagedata($pagename); - if (!empty($data['_cached_html'])) { - $cached_html = $data['_cached_html']; - $data['_cached_html'] = ''; - $cache->update_pagedata($pagename, $data); - // store as blob, not serialized - $this->dbi->genericSqlQuery("UPDATE $page_tbl SET cached_html=? WHERE pagename=?", - array($cached_html, $pagename)); - $count++; - } - } - return $count; - } - - /** * preg_replace over local file. * Only line-orientated matches possible. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-29 19:44:35
|
Revision: 10400 http://sourceforge.net/p/phpwiki/code/10400 Author: vargenau Date: 2021-07-29 19:44:34 +0000 (Thu, 29 Jul 2021) Log Message: ----------- lib/upgrade.php: remove unused error_caught Modified Paths: -------------- trunk/lib/upgrade.php Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2021-07-29 19:32:25 UTC (rev 10399) +++ trunk/lib/upgrade.php 2021-07-29 19:44:34 UTC (rev 10400) @@ -54,7 +54,6 @@ class Upgrade { public $current_db_version; - public $error_caught; public $_configUpdates; public $check_args; public $dbi; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-08-03 16:59:15
|
Revision: 10417 http://sourceforge.net/p/phpwiki/code/10417 Author: vargenau Date: 2021-08-03 16:59:09 +0000 (Tue, 03 Aug 2021) Log Message: ----------- We must be compatible with PHP 5 Modified Paths: -------------- trunk/lib/upgrade.php Modified: trunk/lib/upgrade.php =================================================================== --- trunk/lib/upgrade.php 2021-08-03 16:12:35 UTC (rev 10416) +++ trunk/lib/upgrade.php 2021-08-03 16:59:09 UTC (rev 10417) @@ -341,11 +341,11 @@ public $method_cb; public $check_cb; public $reason; - public array $applicable_args; - public object $parent; - private array $check_args; - private string $notice; - private string $_db_key; + public /* array */ $applicable_args; + public /* object */ $parent; + private /* array */ $check_args; + private /* string */ $notice; + private /* string */ $_db_key; private $upgrade; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |