logo       


CVS: phpwiki/lib DB_Session.php,1.11,1.12 HtmlElement.php,1.36,1.37 IniConf: msg#00254

Subject: CVS: phpwiki/lib DB_Session.php,1.11,1.12 HtmlElement.php,1.36,1.37 IniConfig.php,1.10,1.11 InlineParser.php,1.37,1.38 PageType.php,1.27,1.28 Request.php,1.48,1.49 RssParser.php,1.4,1.5 WikiDB.php,1.45,1.46 WikiPluginCached.php,1.7,1.8 plugincache-config.php,1.4,1.5 stdlib.php,1.171,1.172
Update of /cvsroot/phpwiki/phpwiki/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8678

Modified Files:
        DB_Session.php HtmlElement.php IniConfig.php InlineParser.php 
        PageType.php Request.php RssParser.php WikiDB.php 
        WikiPluginCached.php plugincache-config.php stdlib.php 
Log Message:
locking table specific for better databases

Index: DB_Session.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/DB_Session.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -2 -b -p -d -r1.11 -r1.12
--- DB_Session.php      19 Apr 2004 18:27:45 -0000      1.11
+++ DB_Session.php      26 Apr 2004 20:44:34 -0000      1.12
@@ -172,4 +172,5 @@ extends DB_Session
         
         $dbh = &$this->_connect();
+        //$dbh->unlock(false,1);
         $table = $this->_table;
         $qid = $dbh->quote($id);
@@ -286,5 +287,5 @@ extends DB_Session
         static $parsed = false;
         $dbh = &$this->_dbh;
-        if (!$dbh) {
+        if (!$dbh or !is_resource($dbh->_connectionID)) {
             if (!$parsed) $parsed = parseDSN($DBParams['dsn']);
             $this->_dbh = &ADONewConnection($parsed['phptype']); // Probably 
only MySql works just now

Index: HtmlElement.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/HtmlElement.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -2 -b -p -d -r1.36 -r1.37
--- HtmlElement.php     19 Apr 2004 21:51:41 -0000      1.36
+++ HtmlElement.php     26 Apr 2004 20:44:34 -0000      1.37
@@ -6,5 +6,5 @@
  * This code is now php5 compatible. --2004-04-19 23:51:43 rurban
  */
-require_once("lib/XmlElement.php");
+require_once(dirname(__FILE__)."/XmlElement.php");
 
 /**
@@ -512,4 +512,7 @@ function IfJavaScript($if_content = fals
 /**
  $Log$
+ Revision 1.37  2004/04/26 20:44:34  rurban
+ locking table specific for better databases
+
  Revision 1.36  2004/04/19 21:51:41  rurban
  php5 compatibility: it works!

Index: IniConfig.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/IniConfig.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -2 -b -p -d -r1.10 -r1.11
--- IniConfig.php       26 Apr 2004 13:22:32 -0000      1.10
+++ IniConfig.php       26 Apr 2004 20:44:34 -0000      1.11
@@ -124,5 +124,5 @@ function IniConfig($file) {
         
         // calculate them later: old or dynamic constants
-        if (in_array($item,array('USE_PATH_INFO','USE_DB_SESSION',
+        if (!$val and in_array($item,array('USE_PATH_INFO','USE_DB_SESSION',
                                  'ALLOW_HTTP_AUTH_LOGIN','ALLOW_LDAP_LOGIN',
                                  'ALLOW_IMAP_LOGIN','ALLOW_USER_LOGIN',
@@ -163,5 +163,6 @@ function IniConfig($file) {
     $DBParams['directory'] = @$rs['DATABASE_DIRECTORY'];
     $DBParams['timeout'] = @$rs['DATABASE_TIMEOUT'];
-    if (!defined('USE_DB_SESSION') and $DBParams['db_session_table']) {
+    if (!defined('USE_DB_SESSION') and $DBParams['db_session_table'] and 
+        in_array($DBParams['dbtype'],array('SQL','ADODB','dba'))) {
         define('USE_DB_SESSION', true);
     }
@@ -492,4 +493,7 @@ function fix_configs() {
 
 // $Log$
+// Revision 1.11  2004/04/26 20:44:34  rurban
+// locking table specific for better databases
+//
 // Revision 1.10  2004/04/26 13:22:32  rurban
 // calculate bool old or dynamic constants later

Index: InlineParser.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/InlineParser.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -2 -b -p -d -r1.37 -r1.38

Index: PageType.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/PageType.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -2 -b -p -d -r1.27 -r1.28
--- PageType.php        19 Apr 2004 23:13:03 -0000      1.27
+++ PageType.php        26 Apr 2004 20:44:34 -0000      1.28
@@ -427,5 +427,5 @@ class PageFormatter_pdf extends PageForm
         $pdf->SetTitle($pagename);
         $pdf->SetAuthor($this->_page->get('author'));
-        $pdf->SetCreator(WikiUrl($pagename,false,1));
+        $pdf->SetCreator(WikiURL($pagename,false,1));
         $pdf->AliasNbPages();
         $pdf->AddPage();

Index: Request.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/Request.php,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -2 -b -p -d -r1.48 -r1.49
--- Request.php 13 Apr 2004 09:13:50 -0000      1.48
+++ Request.php 26 Apr 2004 20:44:34 -0000      1.49
@@ -2,5 +2,5 @@
 rcs_id('$Id$');
 /*
- Copyright (C) 2004 $ThePhpWikiProgrammingTeam
+ Copyright (C) 2002,2004 $ThePhpWikiProgrammingTeam
  
  This file is part of PhpWiki.
@@ -459,5 +459,5 @@ class Request_SessionVars {
             $val->action = $GLOBALS['request']->getArg('action');
         }
-        if (!function_usable('ini_get') or ini_get('register_globals')) {
+        if (!function_usable('get_cfg_var') or 
get_cfg_var('register_globals')) {
             // This is funky but necessary, at least in some PHP's
             $GLOBALS[$key] = $val;
@@ -541,5 +541,5 @@ class Request_CookieVars {
    [\winnt\php.ini]
    You must set "upload_tmp_dir" = "/tmp/" or "C:/tmp/"
-   Best on the same drive as apache, with foreard slashes 
+   Best on the same drive as apache, with forward slashes 
    and with ending slash!
    Otherwise "\\" => "" and the uploaded file will not be found.
@@ -961,4 +961,7 @@ class HTTP_ValidatorSet {
 
 // $Log$
+// Revision 1.49  2004/04/26 20:44:34  rurban
+// locking table specific for better databases
+//
 // Revision 1.48  2004/04/13 09:13:50  rurban
 // sf.net bug #933183 and http://bugs.php.net/17557

Index: RssParser.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/RssParser.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -2 -b -p -d -r1.4 -r1.5
--- RssParser.php       18 Apr 2004 01:11:51 -0000      1.4
+++ RssParser.php       26 Apr 2004 20:44:34 -0000      1.5
@@ -128,7 +128,8 @@ class RSSParser {
             while ($data = fread($fp, 4096))  {
                 xml_parse($xml_parser, $data, feof($fp)) or 
-                    die(sprintf("XML error: %s at line %d", 
+                    trigger_error(sprintf("XML error: %s at line %d", 
                                 
xml_error_string(xml_get_error_code($xml_parser)), 
-                                xml_get_current_line_number($xml_parser)));
+                                          
xml_get_current_line_number($xml_parser)),
+                                  E_USER_WARNING);
             }
             fclose($fp);
@@ -152,7 +153,8 @@ class RSSParser {
             }
             xml_parse($xml_parser, $data, true) or 
-                die(sprintf("XML error: %s at line %d", 
+                trigger_error(sprintf("XML error: %s at line %d", 
                             xml_error_string(xml_get_error_code($xml_parser)), 
-                            xml_get_current_line_number($xml_parser)));
+                                      
xml_get_current_line_number($xml_parser)),
+                              E_USER_WARNING);
         }
         xml_parser_free($xml_parser);
@@ -161,4 +163,7 @@ class RSSParser {
 
 // $Log$
+// Revision 1.5  2004/04/26 20:44:34  rurban
+// locking table specific for better databases
+//
 // Revision 1.4  2004/04/18 01:11:51  rurban
 // more numeric pagename fixes.

Index: WikiDB.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB.php,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -2 -b -p -d -r1.45 -r1.46
--- WikiDB.php  20 Apr 2004 00:06:03 -0000      1.45
+++ WikiDB.php  26 Apr 2004 20:44:34 -0000      1.46
@@ -169,10 +169,4 @@ class WikiDB {
     }
 
-        
-    // Do we need this?
-    //function nPages() { 
-    //}
-
-
     /**
      * Determine whether page exists (in non-default form).
@@ -250,4 +244,8 @@ class WikiDB {
     }
 
+    // Do we need this?
+    //function nPages() { 
+    //}
+    // Yes, for paging. Renamed.
     function numPages($filter=false, $exclude='') {
        if (method_exists($this->_backend,'numPages'))
@@ -568,8 +566,8 @@ class WikiDB_Page 
             return;
 
-        $backend->lock();
+        $backend->lock(array('page','version'));
         $latestversion = $cache->get_latest_version($pagename);
         if ($latestversion && $version == $latestversion) {
-            $backend->unlock();
+            $backend->unlock(array('page','version'));
             trigger_error(sprintf("Attempt to delete most recent revision of 
'%s'",
                                   $pagename), E_USER_ERROR);
@@ -578,6 +576,5 @@ class WikiDB_Page 
 
         $cache->delete_versiondata($pagename, $version);
-               
-        $backend->unlock();
+        $backend->unlock(array('page','version'));
     }
 
@@ -618,8 +615,8 @@ class WikiDB_Page 
             return;
 
-        $backend->lock();
+        $backend->lock(array('version'));
         $latestversion = $backend->get_latest_version($pagename);
         if ($latestversion && $version == $latestversion) {
-            $backend->unlock();
+            $backend->unlock(array('version'));
             trigger_error(sprintf("Attempt to merge most recent revision of 
'%s'",
                                   $pagename), E_USER_ERROR);
@@ -630,5 +627,5 @@ class WikiDB_Page 
         if (!$versiondata) {
             // Not there? ... we're done!
-            $backend->unlock();
+            $backend->unlock(array('version'));
             return;
         }
@@ -650,5 +647,5 @@ class WikiDB_Page 
 
         $cache->delete_versiondata($pagename, $version);
-        $backend->unlock();
+        $backend->unlock(array('version'));
     }
 
@@ -680,5 +677,5 @@ class WikiDB_Page 
         $pagename = &$this->_pagename;
                 
-        $backend->lock();
+        $backend->lock(array('version','page','recent','links','nonempty'));
 
         $latestversion = $backend->get_latest_version($pagename);
@@ -687,5 +684,5 @@ class WikiDB_Page 
 
         if ($version != WIKIDB_FORCE_CREATE && $version != $newversion) {
-            $backend->unlock();
+            $backend->unlock(array('version','page','recent','links'));
             return false;
         }
@@ -731,5 +728,5 @@ class WikiDB_Page 
         $backend->set_links($pagename, $links);
 
-        $backend->unlock();
+        $backend->unlock(array('version','page','recent','links','nonempty'));
 
         return new WikiDB_PageRevision($this->_wikidb, $pagename, $newversion,
@@ -759,10 +756,8 @@ class WikiDB_Page 
 
        $backend = &$this->_wikidb->_backend;
-       $backend->lock();
        $newrevision = $this->createRevision($version, $wikitext, $meta, 
$links);
        if ($newrevision)
             if (!defined('WIKIDB_NOCACHE_MARKUP') or !WIKIDB_NOCACHE_MARKUP)
                 $this->set('_cached_html', $formatted->pack());
-       $backend->unlock();
 
        // FIXME: probably should have some global state information
@@ -839,5 +834,5 @@ class WikiDB_Page 
         $previous = $backend->get_previous_version($this->_pagename, $version);
         if ($previous) {
-            $difflink = WikiUrl($this->_pagename,array('action'=>'diff'),true);
+            $difflink = WikiURL($this->_pagename,array('action'=>'diff'),true);
             $cache = &$this->_wikidb->_cache;
             $this_content = explode("\n", $wikitext);
@@ -857,5 +852,5 @@ class WikiDB_Page 
             
         } else {
-            $difflink = WikiUrl($this->_pagename,array(),true);
+            $difflink = WikiURL($this->_pagename,array(),true);
             if (!isset($meta['mtime'])) $meta['mtime'] = time();
             $content = $this->_pagename . " " . $version . " " .  
Iso8601DateTime($meta['mtime']) . "\n";
@@ -1721,4 +1716,7 @@ class WikiDB_cache 
 
 // $Log$
+// Revision 1.46  2004/04/26 20:44:34  rurban
+// locking table specific for better databases
+//
 // Revision 1.45  2004/04/20 00:06:03  rurban
 // themable paging support

Index: WikiPluginCached.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiPluginCached.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -2 -b -p -d -r1.7 -r1.8
--- WikiPluginCached.php        17 Feb 2004 12:17:34 -0000      1.7
+++ WikiPluginCached.php        26 Apr 2004 20:44:34 -0000      1.8
@@ -33,5 +33,5 @@ require_once "lib/plugincache-config.php
 // @require_once('Cache.php');
 // if (!class_exists('Cache'))
-require_once('lib/pear/Cache.php'); // We have to create your own copy here.
+require_once('Cache.php'); // We have to create your own copy here.
 
 define('PLUGIN_CACHED_HTML',0);

Index: plugincache-config.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugincache-config.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -2 -b -p -d -r1.4 -r1.5
--- plugincache-config.php      26 Apr 2004 13:43:03 -0000      1.4
+++ plugincache-config.php      26 Apr 2004 20:44:34 -0000      1.5
@@ -3,5 +3,5 @@
  Copyright (C) 2002 Johannes Große (Johannes Große)
 
- This file is (not yet) part of PhpWiki.
+ This file is part of PhpWiki.
 
  PhpWiki is free software; you can redistribute it and/or modify

Index: stdlib.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -2 -b -p -d -r1.171 -r1.172
--- stdlib.php  19 Apr 2004 23:13:03 -0000      1.171
+++ stdlib.php  26 Apr 2004 20:44:34 -0000      1.172
@@ -74,4 +74,12 @@ function MangleXmlIdentifier($str) {

 }

 

+function UnMangleXmlIdentifier($str) {
+    if ($str == 'empty.')
+        return '';
+    return preg_replace('/x(\w\w)\./e',
+                        "sprintf('%c', hex('\\0'))",
+                        $str);
+}
+
 /**

  * Generates a valid URL for a given Wiki pagename.

@@ -1383,4 +1391,7 @@ function obj2hash ($obj, $exclude = fals
 

 // $Log$
+// Revision 1.172  2004/04/26 20:44:34  rurban
+// locking table specific for better databases
+//
 // Revision 1.171  2004/04/19 23:13:03  zorloc
 // Connect the rest of PhpWiki to the IniConfig system.  Also the keyword 
regular expression is not a config setting



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe