/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: config.php,v 1.3 2003/03/14 04:05:48 panda Exp $
+// $Id: config.php,v 1.7 2003/08/02 02:02:44 arino Exp $
//
/*
* ¥×¥é¥°¥¤¥ó¤ÎÀßÄê¤òPukiWiki¤Î¥Ú¡¼¥¸¤Ëµ½Ò¤¹¤ë
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)
if ($head == '*')
{
+ // ¸«½Ð¤·¤Î¸ÇÍIDÉô¤òºï½ü
+ $line = preg_replace('/^(\*{1,3}.*)\[#[A-Za-z][\w-]+\](.*)$/','$1$2',$line);
+
if ($level == 1)
{
$this->objs[$obj->title] = $obj;
}
}
$this->objs[$obj->title] = $obj;
+
+ return TRUE;
}
// ÇÛÎó¤ò¼èÆÀ¤¹¤ë
function &get($title)
{
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];
}