|
From: <var...@us...> - 2016-05-23 10:13:18
|
Revision: 9836
http://sourceforge.net/p/phpwiki/code/9836
Author: vargenau
Date: 2016-05-23 10:13:16 +0000 (Mon, 23 May 2016)
Log Message:
-----------
Use same signature as base class for functions check and rebuild
Modified Paths:
--------------
trunk/lib/WikiDB/backend/file.php
Modified: trunk/lib/WikiDB/backend/file.php
===================================================================
--- trunk/lib/WikiDB/backend/file.php 2016-05-23 09:25:13 UTC (rev 9835)
+++ trunk/lib/WikiDB/backend/file.php 2016-05-23 10:13:16 UTC (rev 9836)
@@ -679,7 +679,7 @@
*
* @return boolean True iff database is in a consistent state.
*/
- function check()
+ function check($args = false)
{
//trigger_error("check: Not Implemented", E_USER_WARNING);
}
@@ -692,7 +692,7 @@
*
* @return boolean True iff successful.
*/
- function rebuild()
+ function rebuild($args = false)
{
//trigger_error("rebuild: Not Implemented", E_USER_WARNING);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <var...@us...> - 2020-12-04 17:17:32
|
Revision: 10175
http://sourceforge.net/p/phpwiki/code/10175
Author: vargenau
Date: 2020-12-04 17:17:29 +0000 (Fri, 04 Dec 2020)
Log Message:
-----------
Use // comment syntax
Modified Paths:
--------------
trunk/lib/WikiDB/backend/file.php
Modified: trunk/lib/WikiDB/backend/file.php
===================================================================
--- trunk/lib/WikiDB/backend/file.php 2020-12-04 17:13:59 UTC (rev 10174)
+++ trunk/lib/WikiDB/backend/file.php 2020-12-04 17:17:29 UTC (rev 10175)
@@ -99,7 +99,7 @@
if (!file_exists($filename)) return NULL;
if (!filesize($filename)) return array();
if ($fd = @fopen($filename, "rb")) {
- $locked = flock($fd, 1); # Read lock
+ $locked = flock($fd, 1); // Read lock
if (!$locked) {
ExitWiki("Timeout while obtaining lock. Please try again");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <var...@us...> - 2021-06-09 17:18:19
|
Revision: 10280
http://sourceforge.net/p/phpwiki/code/10280
Author: vargenau
Date: 2021-06-09 17:18:16 +0000 (Wed, 09 Jun 2021)
Log Message:
-----------
Stricter tests in lib/WikiDB/backend/file.php
Modified Paths:
--------------
trunk/lib/WikiDB/backend/file.php
Modified: trunk/lib/WikiDB/backend/file.php
===================================================================
--- trunk/lib/WikiDB/backend/file.php 2021-06-09 15:24:58 UTC (rev 10279)
+++ trunk/lib/WikiDB/backend/file.php 2021-06-09 17:18:16 UTC (rev 10280)
@@ -559,8 +559,9 @@
foreach ($pagenames as $key => $val) {
$links = $this->_loadPageLinks($key);
foreach ($links as $key2 => $val2) {
- if ($val2['linkto'] == $pagename)
+ if (is_array($val2) and isset($val2['linkto']) and ($val2['linkto'] == $pagename)) {
array_push($out, $key);
+ }
}
}
return new WikiDB_backend_file_iter($this, $out);
@@ -754,7 +755,7 @@
unset($pagedata['pagename']);
$rec = array('pagename' => $pn,
'pagedata' => $pagedata);
- if (is_array($e[1])) {
+ if (is_array($e[1]) and isset($e[1]['relation'])) {
$rec['linkrelation'] = $e[1]['relation'];
}
//$rec['version'] = $backend->get_latest_version($pn);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <var...@us...> - 2021-06-10 08:45:52
|
Revision: 10282
http://sourceforge.net/p/phpwiki/code/10282
Author: vargenau
Date: 2021-06-10 08:45:50 +0000 (Thu, 10 Jun 2021)
Log Message:
-----------
Add function reset in lib/WikiDB/backend/file.php
Modified Paths:
--------------
trunk/lib/WikiDB/backend/file.php
Modified: trunk/lib/WikiDB/backend/file.php
===================================================================
--- trunk/lib/WikiDB/backend/file.php 2021-06-10 08:07:22 UTC (rev 10281)
+++ trunk/lib/WikiDB/backend/file.php 2021-06-10 08:45:50 UTC (rev 10282)
@@ -763,6 +763,10 @@
return $rec;
}
+ function reset()
+ {
+ }
+
function asArray()
{
reset($this->_result);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <var...@us...> - 2021-06-28 10:36:35
|
Revision: 10329
http://sourceforge.net/p/phpwiki/code/10329
Author: vargenau
Date: 2021-06-28 10:36:36 +0000 (Mon, 28 Jun 2021)
Log Message:
-----------
"each" is deprecated
Modified Paths:
--------------
trunk/lib/WikiDB/backend/file.php
Modified: trunk/lib/WikiDB/backend/file.php
===================================================================
--- trunk/lib/WikiDB/backend/file.php 2021-06-28 09:25:09 UTC (rev 10328)
+++ trunk/lib/WikiDB/backend/file.php 2021-06-28 10:36:36 UTC (rev 10329)
@@ -260,10 +260,11 @@
function _loadPageLinks($pagename)
{
$pd = $this->_loadPage('links', $pagename, 0, false);
- if ($pd != NULL)
+ if ($pd != NULL) {
return $pd;
- ;
- return array(); // no values found
+ } else {
+ return array(); // no values found
+ }
}
function _savePageLinks($pagename, $links)
@@ -739,10 +740,12 @@
if (count($this->_result) <= 0)
return false;
- $e = each($this->_result);
- if ($e == false) {
+ $key = key($this->_result);
+ if ($key === null) {
return false;
}
+ $e = [$key, current($this->_result), 'key' => $key, 'value' => current($this->_result)];
+ next($this->_result);
$pn = $e[1];
if (is_array($pn) and isset($pn['linkto'])) { // support relation link iterator
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <var...@us...> - 2021-07-15 16:41:42
|
Revision: 10349
http://sourceforge.net/p/phpwiki/code/10349
Author: vargenau
Date: 2021-07-15 16:41:39 +0000 (Thu, 15 Jul 2021)
Log Message:
-----------
lib/WikiDB/backend/file.php: _getLatestVersion --> $this->_getLatestVersion
Modified Paths:
--------------
trunk/lib/WikiDB/backend/file.php
Modified: trunk/lib/WikiDB/backend/file.php
===================================================================
--- trunk/lib/WikiDB/backend/file.php 2021-07-15 16:35:06 UTC (rev 10348)
+++ trunk/lib/WikiDB/backend/file.php 2021-07-15 16:41:39 UTC (rev 10349)
@@ -404,7 +404,7 @@
*/
public function rename_page($pagename, $to)
{
- $version = _getLatestVersion($pagename);
+ $version = $this->_getLatestVersion($pagename);
foreach ($this->_dir_names as $type => $path) {
if (is_dir($path)) {
$filename = $this->_pagename2filename($type, $pagename, $version);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <var...@us...> - 2021-08-03 11:11:29
|
Revision: 10414
http://sourceforge.net/p/phpwiki/code/10414
Author: vargenau
Date: 2021-08-03 11:11:27 +0000 (Tue, 03 Aug 2021)
Log Message:
-----------
Better test existence of _page_data
Modified Paths:
--------------
trunk/lib/WikiDB/backend/file.php
Modified: trunk/lib/WikiDB/backend/file.php
===================================================================
--- trunk/lib/WikiDB/backend/file.php 2021-08-03 11:09:52 UTC (rev 10413)
+++ trunk/lib/WikiDB/backend/file.php 2021-08-03 11:11:27 UTC (rev 10414)
@@ -190,7 +190,7 @@
// Load/Save Page-Data
function _loadPageData($pagename)
{
- if ($this->_page_data != NULL) {
+ if (isset($this->_page_data)) {
if ($this->_page_data['pagename'] == $pagename) {
return $this->_page_data;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <var...@us...> - 2021-08-11 10:35:42
|
Revision: 10483
http://sourceforge.net/p/phpwiki/code/10483
Author: vargenau
Date: 2021-08-11 10:35:39 +0000 (Wed, 11 Aug 2021)
Log Message:
-----------
Use PHP 5.3 syntax
Modified Paths:
--------------
trunk/lib/WikiDB/backend/file.php
Modified: trunk/lib/WikiDB/backend/file.php
===================================================================
--- trunk/lib/WikiDB/backend/file.php 2021-08-11 10:16:00 UTC (rev 10482)
+++ trunk/lib/WikiDB/backend/file.php 2021-08-11 10:35:39 UTC (rev 10483)
@@ -768,7 +768,7 @@
if ($key === null) {
return false;
}
- $e = [$key, current($this->_result), 'key' => $key, 'value' => current($this->_result)];
+ $e = array($key, current($this->_result), 'key' => $key, 'value' => current($this->_result));
next($this->_result);
$pn = $e[1];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <var...@us...> - 2021-08-11 13:50:25
|
Revision: 10490
http://sourceforge.net/p/phpwiki/code/10490
Author: vargenau
Date: 2021-08-11 13:50:24 +0000 (Wed, 11 Aug 2021)
Log Message:
-----------
function _parse_searchwords is public; add braces
Modified Paths:
--------------
trunk/lib/WikiDB/backend/file.php
Modified: trunk/lib/WikiDB/backend/file.php
===================================================================
--- trunk/lib/WikiDB/backend/file.php 2021-08-11 12:19:00 UTC (rev 10489)
+++ trunk/lib/WikiDB/backend/file.php 2021-08-11 13:50:24 UTC (rev 10490)
@@ -58,8 +58,9 @@
function __construct($dbparam)
{
$this->data_dir = $dbparam['directory'];
- if (file_exists($this->data_dir) and is_file($this->data_dir))
+ if (file_exists($this->data_dir) and is_file($this->data_dir)) {
unlink($this->data_dir);
+ }
if (is_dir($this->data_dir) == false) {
mkdir($this->data_dir, 0755);
}
@@ -87,10 +88,11 @@
// common file load / save functions:
protected function _pagename2filename($type, $pagename, $version)
{
- if ($version == 0)
+ if ($version == 0) {
return $this->_dir_names[$type] . '/' . urlencode($pagename);
- else
+ } else {
return $this->_dir_names[$type] . '/' . urlencode($pagename) . '--' . $version;
+ }
}
protected function _loadPage($type, $pagename, $version, $set_pagename = true)
@@ -391,8 +393,9 @@
function get_versiondata($pagename, $version, $want_content = false)
{
$vd = $this->_loadVersionData($pagename, $version);
- if ($vd == NULL)
+ if ($vd == NULL) {
return false;
+ }
return $vd;
}
@@ -723,7 +726,7 @@
return true;
}
- protected function _parse_searchwords($search)
+ function _parse_searchwords($search)
{
$search = strtolower(trim($search));
if (!$search)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <var...@us...> - 2021-09-29 09:43:34
|
Revision: 10599
http://sourceforge.net/p/phpwiki/code/10599
Author: vargenau
Date: 2021-09-29 09:43:26 +0000 (Wed, 29 Sep 2021)
Log Message:
-----------
lib/WikiDB/backend/file.php: better test _loadPage
Modified Paths:
--------------
trunk/lib/WikiDB/backend/file.php
Modified: trunk/lib/WikiDB/backend/file.php
===================================================================
--- trunk/lib/WikiDB/backend/file.php 2021-09-28 15:43:33 UTC (rev 10598)
+++ trunk/lib/WikiDB/backend/file.php 2021-09-29 09:43:26 UTC (rev 10599)
@@ -98,9 +98,16 @@
protected function _loadPage($type, $pagename, $version, $set_pagename = true)
{
$filename = $this->_pagename2filename($type, $pagename, $version);
- if (!file_exists($filename)) return NULL;
- if (!filesize($filename)) return array();
- if ($fd = @fopen($filename, "rb")) {
+ if (!file_exists($filename)) {
+ return NULL;
+ }
+ if (is_dir($filename)) {
+ return array();
+ }
+ if (!filesize($filename)) {
+ return array();
+ }
+ if ($fd = fopen($filename, "rb")) {
$locked = flock($fd, LOCK_SH); // Read lock
if (!$locked) {
ExitWiki("Timeout while obtaining lock. Please try again");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <var...@us...> - 2022-01-27 18:35:18
|
Revision: 10955
http://sourceforge.net/p/phpwiki/code/10955
Author: vargenau
Date: 2022-01-27 18:35:16 +0000 (Thu, 27 Jan 2022)
Log Message:
-----------
Put renaming in history with "file"
Modified Paths:
--------------
trunk/lib/WikiDB/backend/file.php
Modified: trunk/lib/WikiDB/backend/file.php
===================================================================
--- trunk/lib/WikiDB/backend/file.php 2022-01-27 15:12:17 UTC (rev 10954)
+++ trunk/lib/WikiDB/backend/file.php 2022-01-27 18:35:16 UTC (rev 10955)
@@ -416,6 +416,7 @@
function rename_page($pagename, $to)
{
+ global $request;
$version = $this->_getLatestVersion($pagename);
// rename page_data
$filename = $this->_pagename2filename('page_data', $pagename);
@@ -433,6 +434,8 @@
}
$this->_setLatestVersion($pagename, 0);
$this->_setLatestVersion($to, $version);
+ $this->update_pagedata($pagename, array('pagename' => $to));
+ $request->_dbi->_cache->invalidate_cache($to);
return true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|