[pLog-svn] r2260 - in plog/trunk/class: cache net

ork at devel.plogworld.net ork at devel.plogworld.net
Tue Jun 21 12:29:16 GMT 2005


Author: ork
Date: 2005-06-21 12:29:15 +0000 (Tue, 21 Jun 2005)
New Revision: 2260

Modified:
   plog/trunk/class/cache/bloginfomanager.class.php
   plog/trunk/class/cache/cache.class.php
   plog/trunk/class/net/linkparser.class.php
Log:
changed a few things at the linkparser. i don't see why the regexp array
should be global. and it doesn't work the way it should on php5 either..
now its fine :)


Modified: plog/trunk/class/cache/bloginfomanager.class.php
===================================================================
--- plog/trunk/class/cache/bloginfomanager.class.php	2005-06-21 11:01:05 UTC (rev 2259)
+++ plog/trunk/class/cache/bloginfomanager.class.php	2005-06-21 12:29:15 UTC (rev 2260)
@@ -1,5 +1,7 @@
 <?php
 
+    require_once( PLOG_CLASS_PATH . "class/object/object.class.php" );
+
     class BlogInfoManager extends Object
     {
 

Modified: plog/trunk/class/cache/cache.class.php
===================================================================
--- plog/trunk/class/cache/cache.class.php	2005-06-21 11:01:05 UTC (rev 2259)
+++ plog/trunk/class/cache/cache.class.php	2005-06-21 12:29:15 UTC (rev 2260)
@@ -1,6 +1,7 @@
 <?php
 
     require_once( PLOG_CLASS_PATH . "class/object/object.class.php" );
+    require_once( PLOG_CLASS_PATH . "class/template/templatesets/templateset.class.php" );
 
    /**
     * Provides a singleton for storing and retrieving data from a global cache.

Modified: plog/trunk/class/net/linkparser.class.php
===================================================================
--- plog/trunk/class/net/linkparser.class.php	2005-06-21 11:01:05 UTC (rev 2259)
+++ plog/trunk/class/net/linkparser.class.php	2005-06-21 12:29:15 UTC (rev 2260)
@@ -1,35 +1,7 @@
 <?php
 
+    require_once( PLOG_CLASS_PATH."class/object/object.class.php" );
 
-    include_once( PLOG_CLASS_PATH."class/object/object.class.php" );
-    
-    //
-    // list of tags that can be used to generate valid urls, and its
-    // corresponding format
-    //
-    $urlRewriteTags = array(
-                '{blogname}' => '([_0-9a-zA-Z-]+)?',
-                '{blogid}' => '([0-9]+)?',
-				'{blogowner}' => '([_0-9a-zA-Z-]+)?', 
-                '{op}' => '([_0-9a-z-]+)?',
-                '{year}' => '([0-9]{4})?',
-                '{month}' => '([0-9]{2})?',
-                '{day}' => '([0-9]{2})?',
-                '{hours}' => '([0-9]{2})?',
-                '{minutes}' => '([0-9]{2})?',
-                '{postname}' => '([_0-9a-zA-Z-]+)?',
-                '{postid}' => '([0-9]+)?',
-                '{catname}' => '([_0-9a-zA-Z-]+)?',
-                '{catid}' => '([0-9]+)?',
-				'{username}' => '([_0-9a-zA-Z-]+)?',
-                '{userid}' => '([0-9]+)?',
-                '{templatename}' => '([_0-9a-zA-Z-.]+)?',
-                '{resourceid}' => '([0-9]+)?',
-                '{resourcename}' => '([_0-9a-zA-Z-. \(\)\[\]]+)?',
-                '{albumid}' => '([0-9]+)?',
-                '{albumname}' => '([_0-9a-zA-Z- ]+)?'
-            );
-
     /**
      * \ingroup Net
      *
@@ -44,23 +16,48 @@
      */
     class LinkParser extends Object
     {
-    
+
+        // list of tags that can be used to generate valid urls, and its
+        // corresponding format
+        var $urlRewriteTags = array(
+                  '{blogname}' => '([_0-9a-zA-Z-]+)?',
+                  '{blogid}' => '([0-9]+)?',
+                  '{blogowner}' => '([_0-9a-zA-Z-]+)?', 
+                  '{op}' => '([_0-9a-z-]+)?',
+                  '{year}' => '([0-9]{4})?',
+                  '{month}' => '([0-9]{2})?',
+                  '{day}' => '([0-9]{2})?',
+                  '{hours}' => '([0-9]{2})?',
+                  '{minutes}' => '([0-9]{2})?',
+                  '{postname}' => '([_0-9a-zA-Z-]+)?',
+                  '{postid}' => '([0-9]+)?',
+                  '{catname}' => '([_0-9a-zA-Z-]+)?',
+                  '{catid}' => '([0-9]+)?',
+                  '{username}' => '([_0-9a-zA-Z-]+)?',
+                  '{userid}' => '([0-9]+)?',
+                  '{templatename}' => '([_0-9a-zA-Z-.]+)?',
+                  '{resourceid}' => '([0-9]+)?',
+                  '{resourcename}' => '([_0-9a-zA-Z-. \(\)\[\]]+)?',
+                  '{albumid}' => '([0-9]+)?',
+                  '{albumname}' => '([_0-9a-zA-Z- ]+)?'
+              );
+
         var $_linkFormat;
-        
+
         function LinkParser( $linkFormat )
         {
             $this->Object();
-            
+
             $this->_linkFormat = $linkFormat;
         }
-        
+
         function parseLink( $url )
         {
             $uri = $url;
-            
-            global $urlRewriteTags;
-            $rewritecode = array_keys( $urlRewriteTags );
-            $rewritereplace = array_values( $urlRewriteTags );
+
+            //global $urlRewriteTags;
+            $rewritecode = array_keys( $this->urlRewriteTags );
+            $rewritereplace = array_values( $this->urlRewriteTags );
         
             // Turn the structure into a regular expression
             $matchre = str_replace( "/", "/", $this->_linkFormat );




More information about the pLog-svn mailing list