OSDN Git Service

Remove unused $script. Added array inits. Added many bla nk lines
[pukiwiki/pukiwiki.git] / config.php
index 93e9935..3ccbaee 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: config.php,v 1.4 2003/04/29 00:38:14 arino Exp $
+// $Id: config.php,v 1.7 2003/08/02 02:02:44 arino Exp $
 //
 /*
  * ¥×¥é¥°¥¤¥ó¤ÎÀßÄê¤òPukiWiki¤Î¥Ú¡¼¥¸¤Ëµ­½Ò¤¹¤ë
@@ -35,17 +35,22 @@ define('CONFIG_BASE',':config/');
 class Config
 {
        // ¥Ú¡¼¥¸Ì¾
-       var $page;
+       var $name,$page;
        // Í×ÁÇ
-       var $objs;
+       var $objs = array();
        
        function Config($name)
        {
+               $this->name = $name;
                $this->page = CONFIG_BASE.$name;
        }
        // ¥Ú¡¼¥¸¤òÆɤ߹þ¤à
        function read()
        {
+               if (!is_page($this->page))
+               {
+                       return FALSE;
+               }
                $this->objs = array();
                $obj = &new ConfigTable('');
                foreach (get_source($this->page) as $line)
@@ -105,6 +110,8 @@ class Config
                        }
                }
                $this->objs[$obj->title] = $obj;
+               
+               return TRUE;
        }
        // ÇÛÎó¤ò¼èÆÀ¤¹¤ë
        function &get($title)
@@ -129,7 +136,7 @@ class Config
        {
                if (!array_key_exists($title,$this->objs))
                {
-                       $this->objs[$title] = &new ConfigTable(array('*'.trim($title)."\n"));
+                       $this->objs[$title] = &new ConfigTable('*'.trim($title)."\n");
                }
                return $this->objs[$title];
        }