nextcms-commits Mailing List for nextCMS
Status: Alpha
Brought to you by:
andrejb
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
(5) |
Apr
(4) |
May
(4) |
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Andrej B. <an...@us...> - 2003-01-08 18:35:52
|
Update of /cvsroot/nextcms/nextcms/extensions
In directory sc8-pr-cvs1:/tmp/cvs-serv5003/extensions
Modified Files:
filemodtime.php filesize.php textreader.php
Log Message:
* printerversion bug fixed
* minor changes
Index: filemodtime.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/extensions/filemodtime.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** filemodtime.php 14 Jul 2002 13:54:33 -0000 1.1
--- filemodtime.php 8 Jan 2003 18:35:49 -0000 1.2
***************
*** 11,15 ****
return date("d.m.Y", $filemodtime);
} else
! printError("Die Filesize Extension kann die angegebene Datei '$file' nicht finden.");
}
--- 11,15 ----
return date("d.m.Y", $filemodtime);
} else
! printError("Die FileModTime Extension kann die angegebene Datei '$file' nicht finden.");
}
***************
*** 19,25 ****
$file = $this->page->site->getUrlByID($paramList['id']);
return $this->getFileModTime($file);
! } else if (isset($paramList['file']))
! return $this->getFileModTime($paramList['file']);
! else
return "";
}
--- 19,26 ----
$file = $this->page->site->getUrlByID($paramList['id']);
return $this->getFileModTime($file);
! } else if (isset($paramList['file'])) {
! $file = relToAbs($paramList['file'], dirname($this->page->content->filename));
! return $this->getFileModTime($file);
! } else
return "";
}
Index: filesize.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/extensions/filesize.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** filesize.php 14 Jul 2002 13:54:33 -0000 1.1
--- filesize.php 8 Jan 2003 18:35:49 -0000 1.2
***************
*** 19,25 ****
$file = $this->page->site->getUrlByID($paramList['id']);
return $this->getFilesize($file);
! } else if (isset($paramList['file']))
! return $this->getFilesize($paramList['file']);
! else
return "";
}
--- 19,26 ----
$file = $this->page->site->getUrlByID($paramList['id']);
return $this->getFilesize($file);
! } else if (isset($paramList['file'])) {
! $file = relToAbs($paramList['file'], dirname($this->page->content->filename));
! return $this->getFilesize($file);
! } else
return "";
}
Index: textreader.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/extensions/textreader.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** textreader.php 14 Jul 2002 13:54:33 -0000 1.1
--- textreader.php 8 Jan 2003 18:35:49 -0000 1.2
***************
*** 12,18 ****
$file = $this->page->site->getUrlByID($paramList['id']);
return $this->getFile($file);
! } else if (isset($paramList['file']))
! return $this->getFile($paramList['file']);
! else
return "";
}
--- 12,19 ----
$file = $this->page->site->getUrlByID($paramList['id']);
return $this->getFile($file);
! } else if (isset($paramList['file'])) {
! $file = relToAbs($paramList['file'], dirname($this->page->content->filename));
! return $this->getFile($file);
! } else
return "";
}
|
|
From: Andrej B. <an...@us...> - 2003-01-08 18:35:52
|
Update of /cvsroot/nextcms/nextcms
In directory sc8-pr-cvs1:/tmp/cvs-serv5003
Modified Files:
class.Cache.php class.Page.php class.Site.php processor.php
xml.php
Log Message:
* printerversion bug fixed
* minor changes
Index: class.Cache.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Cache.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** class.Cache.php 27 May 2002 23:50:10 -0000 1.5
--- class.Cache.php 8 Jan 2003 18:35:48 -0000 1.6
***************
*** 31,35 ****
foreach ($check_file as $filename) {
if (file_exists($docroot . $filename)) {
! if (fileatime($docroot . $filename) > $this->filemtime) {
fclose($cache_file); return;
}
--- 31,35 ----
foreach ($check_file as $filename) {
if (file_exists($docroot . $filename)) {
! if (filemtime($docroot . $filename) > $this->filemtime) {
fclose($cache_file); return;
}
Index: class.Page.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Page.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** class.Page.php 31 Dec 2002 11:14:35 -0000 1.8
--- class.Page.php 8 Jan 2003 18:35:48 -0000 1.9
***************
*** 46,50 ****
// check if we can handle the requested url
if (!isset($url)) {
! header('HTTP/1.0 404 Not Found');// exit;
printError("404 URL '$virtual_url' is not attached to any site on this server.");
}
--- 46,50 ----
// check if we can handle the requested url
if (!isset($url)) {
! //header('HTTP/1.0 404 Not Found'); exit;
printError("404 URL '$virtual_url' is not attached to any site on this server.");
}
***************
*** 120,125 ****
$docache = false;
! $INPUT = &$GLOBALS['input_vars'];
! switch ($INPUT['show']) {
case 'printerversion':
$this->template = $this->getTemplate($pagenode_path, "printerversion");
--- 120,124 ----
$docache = false;
! switch ($GLOBALS['INPUT']['show']) {
case 'printerversion':
$this->template = $this->getTemplate($pagenode_path, "printerversion");
***************
*** 240,244 ****
}
! $ext_instance = $this->loadExtention($field_name);
if (isset($ext_instance)) {
--- 239,243 ----
}
! $ext_instance = $this->loadExtension($field_name);
if (isset($ext_instance)) {
***************
*** 246,256 ****
}
! if (isset($GLOBALS['input_vars'][$field_name]))
! return $GLOBALS['input_vars'][$field_name];
return '{' . "$field_name" . '}';
}
! function loadExtention($name) {
global $document_root, $settings;
--- 245,255 ----
}
! if (isset($GLOBALS['INPUT'][$field_name]))
! return $GLOBALS['INPUT'][$field_name];
return '{' . "$field_name" . '}';
}
! function loadExtension($name) {
global $document_root, $settings;
***************
*** 407,411 ****
if (($type == CLOSED_TAG) || ($type == START_TAG)) {
if (isset($node['attributes']['name']))
! $ext_instance = $this->loadExtention($node['attributes']['name']);
else
return "";
--- 406,410 ----
if (($type == CLOSED_TAG) || ($type == START_TAG)) {
if (isset($node['attributes']['name']))
! $ext_instance = $this->loadExtension($node['attributes']['name']);
else
return "";
Index: class.Site.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Site.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** class.Site.php 14 Jul 2002 13:54:32 -0000 1.8
--- class.Site.php 8 Jan 2003 18:35:48 -0000 1.9
***************
*** 40,44 ****
if (!isset($this->root))
$this->root = dirname($this->filename);
! if ($this->root == '/')
$this->root = '';
--- 40,44 ----
if (!isset($this->root))
$this->root = dirname($this->filename);
! if ($this->root == '/' || $this->root == '\\')
$this->root = '';
Index: processor.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** processor.php 31 Dec 2002 03:54:38 -0000 1.8
--- processor.php 8 Jan 2003 18:35:48 -0000 1.9
***************
*** 12,16 ****
// disable cache for developing
! // $cache->is_cached = false;
if ($cache->is_cached) {
--- 12,16 ----
// disable cache for developing
! $cache->is_cached = false;
if ($cache->is_cached) {
***************
*** 44,49 ****
// could be unsafe (just for testing)
if (strpos($code, "<contentpage") === false) {
! //virtual($file);
! die($code);
}
}
--- 44,49 ----
// could be unsafe (just for testing)
if (strpos($code, "<contentpage") === false) {
! virtual($file);
! //die($code);
}
}
***************
*** 73,87 ****
// collect POST variables
if (is_array($_POST))
! $INPUT = $_POST;
else
! $INPUT = $GLOBALS['HTTP_POST_VARS'];
!
! $INPUT = array_merge($GET, $POST);
$url = parse_url($GET['file']);
! if (isset($url['query']))
! parse_str($url['query'], $GET);
! else
! $GET = array();
// workaround for unix homedirs e.g. http://domain.tld/~username
--- 73,86 ----
// collect POST variables
if (is_array($_POST))
! $POST = $_POST;
else
! $POST = $GLOBALS['HTTP_POST_VARS'];
+ // collect stealth mode GET variables
$url = parse_url($GET['file']);
! if (isset($url['query'])) {
! parse_str($url['query'], $addToGet);
! $GET = array_merge($addToGet, $GET);
! }
// workaround for unix homedirs e.g. http://domain.tld/~username
***************
*** 89,92 ****
--- 88,92 ----
// $GET['file'] = $url['path'];
+ $INPUT = array_merge($GET, $POST);
$vurl = $url['path'];
Index: xml.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/xml.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
|
|
From: Andrej B. <an...@us...> - 2003-01-04 00:11:06
|
Update of /cvsroot/nextcms/nextcms In directory sc8-pr-cvs1:/tmp/cvs-serv22783 Modified Files: utils.php Log Message: * bugfix in utils.php -------------------------------------------------------------------- Index: utils.php =================================================================== RCS file: /cvsroot/nextcms/nextcms/utils.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** utils.php 31 Dec 2002 03:48:45 -0000 1.6 --- utils.php 4 Jan 2003 00:11:03 -0000 1.7 *************** *** 189,193 **** $GLOBALS['SERVER'] = $_SERVER; else ! $GLOBALS['SERVER'] = $GLOBALS['HTTP_GET_VARS']; if (!isset($GLOBALS['document_root'])) --- 189,193 ---- $GLOBALS['SERVER'] = $_SERVER; else ! $GLOBALS['SERVER'] = $GLOBALS['HTTP_SERVER_VARS']; if (!isset($GLOBALS['document_root'])) |
|
From: Andrej B. <an...@us...> - 2002-12-31 11:14:39
|
Update of /cvsroot/nextcms/nextcms
In directory sc8-pr-cvs1:/tmp/cvs-serv7876
Modified Files:
class.Page.php
Log Message:
* bug fixed
----------------------------------------------------------------------
Index: class.Page.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Page.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** class.Page.php 31 Dec 2002 03:54:38 -0000 1.7
--- class.Page.php 31 Dec 2002 11:14:35 -0000 1.8
***************
*** 240,248 ****
}
-
$ext_instance = $this->loadExtention($field_name);
if (isset($ext_instance)) {
! return $ext_instance->getCode();
}
--- 240,247 ----
}
$ext_instance = $this->loadExtention($field_name);
if (isset($ext_instance)) {
! return $ext_instance->getCode($param_list);
}
|
|
From: Andrej B. <an...@us...> - 2002-12-31 03:54:42
|
Update of /cvsroot/nextcms/nextcms
In directory sc8-pr-cvs1:/tmp/cvs-serv21350
Modified Files:
class.Page.php class.Template.php processor.php
Log Message:
* some other minor changes
----------------------------------------------------------------------
Index: class.Page.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Page.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** class.Page.php 14 Jul 2002 13:54:32 -0000 1.6
--- class.Page.php 31 Dec 2002 03:54:38 -0000 1.7
***************
*** 120,125 ****
$docache = false;
! $input_vars = &$GLOBALS['input_vars'];
! switch ($input_vars['show']) {
case 'printerversion':
$this->template = $this->getTemplate($pagenode_path, "printerversion");
--- 120,125 ----
$docache = false;
! $INPUT = &$GLOBALS['input_vars'];
! switch ($INPUT['show']) {
case 'printerversion':
$this->template = $this->getTemplate($pagenode_path, "printerversion");
***************
*** 272,276 ****
if ($key[0] == "C") {$out .= $line;}
if ($key[0] == "V") {
! $out .= $this->getFieldCode($line,array());
}
if ($key == "B:section") {
--- 272,279 ----
if ($key[0] == "C") {$out .= $line;}
if ($key[0] == "V") {
! if (is_array($line))
! $out .= $this->getFieldCode($line['name'],$line['paramList']);
! else
! $out .= $this->getFieldCode($line,array());
}
if ($key == "B:section") {
***************
*** 411,414 ****
--- 414,418 ----
$nodepath = $node['parent'] . '/' . 'ext[' . $node['uniquenum'] . ']';
$children = $this->content->xmltree->getChild($nodepath, 'parameter');
+ $paramList = array();
foreach ($children as $child) {
$attrList = $this->content->xmltree->getAttributes($child);
Index: class.Template.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Template.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** class.Template.php 30 Apr 2002 23:58:18 -0000 1.2
--- class.Template.php 31 Dec 2002 03:54:38 -0000 1.3
***************
*** 24,27 ****
--- 24,28 ----
$this->parseTemplate();
+ //exit(print_r($this->block));
}
***************
*** 72,77 ****
while ($index < count($this->template[$tplnum])) {
if ($this->noident)
! $this->template[$tplnum][$index] = ltrim($this->template[$tplnum][$index]);
!
if ($ignore) {
--- 73,77 ----
while ($index < count($this->template[$tplnum])) {
if ($this->noident)
! $this->template[$tplnum][$index] = ltrim($this->template[$tplnum][$index]);
if ($ignore) {
***************
*** 125,180 ****
}
} else {
! //explode current template line on the curly bracket '{'
! $sstr = explode("{", $this->template[$tplnum][$index]);
! reset($sstr);
! if (current($sstr) != '') {
! //the template didn't start with a '{',
! //so the first element of the array $sstr is just code
! $this->block[$blockname]["C:$coderow"] = current($sstr);
$coderow++;
}
! $sstrlength = sizeof($sstr);
!
! for ($i=1;$i < $sstrlength; $i++) {
! next($sstr);
! //find the position of the end curly bracket '}'
! $pos = strpos(current($sstr), '}');
if (($pos !== false) && ($pos > 0) ) {
! //it seems that the end curly bracket '}' is found
! //and at least on position 1, to eliminate '{}' (empty var = no var)
! //
! //note: position 1 taken without the '{', because we did explode on '{'
!
! $strlength = strlen( current($sstr) );
! $varname = substr( current($sstr), 0, $pos);
! //test varname on spaces
! if (strstr($varname, ' ')) {
! //it seems that the varname contains at least one white space
! //so, it isn't a variable, we can save it as code
! $this->block[$blockname]["C:$coderow"] = '{'. current($sstr);
! $coderow++;
! } else {
! //save the variable
$this->block[$blockname]["V:$varrow" ] = $varname;
$varrow++;
- //is there some code after the varname left?
if( ($pos + 1) != $strlength ) {
! //yes there is, save that code
! $this->block[$blockname]["C:$coderow"] = substr(current($sstr), ($pos + 1), ($strlength - ($pos + 1)));
$coderow++;
}
}
} else {
! //no end curly bracket '}' found
! //so, the curly bracket is part of the text (example: javascript function)
! //save it as code, with the '{'
! $this->block[$blockname]["C:$coderow"] = '{'. current($sstr);
$coderow++;
}
--- 125,177 ----
}
} else {
! $searchString = explode("{", $this->template[$tplnum][$index]);
! reset($searchString);
! if (current($searchString) != '') {
! $this->block[$blockname]["C:$coderow"] = current($searchString);
$coderow++;
}
! $searchStringLength = sizeof($searchString);
! for ($i=1;$i < $searchStringLength; $i++) {
! next($searchString);
! $pos = strpos(current($searchString), '}');
if (($pos !== false) && ($pos > 0) ) {
! $strlength = strlen(current($searchString));
! $varname = substr(current($searchString), 0, $pos);
!
! if (!strstr($varname, ' ')) {
$this->block[$blockname]["V:$varrow" ] = $varname;
$varrow++;
if( ($pos + 1) != $strlength ) {
! $this->block[$blockname]["C:$coderow"] = substr(current($searchString), ($pos + 1), ($strlength - ($pos + 1)));
! $coderow++;
! }
! } else if (preg_match('/^(\S+)\((.*)\)}/', current($searchString), $myRegs)) {
!
! // unsafe implementation, just for testing
! $params = explode(" ", $myRegs[2]);
! foreach($params as $param) {
! list($key, $value) = explode("=", $param);
! $paramList[$key] = substr($value, 1, strlen($value) - 2);
! }
! $this->block[$blockname]["V:$varrow" ] = array("name" => $myRegs[1], "paramList" => $paramList);
! $varrow++;
!
! if( ($pos + 1) != $strlength ) {
! $this->block[$blockname]["C:$coderow"] = substr(current($searchString), ($pos + 1), ($strlength - ($pos + 1)));
$coderow++;
}
+ } else {
+ $this->block[$blockname]["C:$coderow"] = '{'. current($searchString);
+ $coderow++;
}
} else {
! $this->block[$blockname]["C:$coderow"] = '{'. current($searchString);
$coderow++;
}
***************
*** 192,196 ****
return $initdev;
}
-
}
?>
--- 189,192 ----
Index: processor.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** processor.php 14 Jul 2002 13:54:32 -0000 1.7
--- processor.php 31 Dec 2002 03:54:38 -0000 1.8
***************
*** 50,56 ****
function setupInputVars() {
! global $document_root, $input_vars, $file, $vurl, $settings;
! if (isset($document_root)) unset($document_root);
if (!include('processor.conf.php')) {
--- 50,56 ----
function setupInputVars() {
! global $document_root, $file, $vurl, $settings, $GET, $POST, $INPUT;
! if (isset($document_root)) unset($document_root);
if (!include('processor.conf.php')) {
***************
*** 65,83 ****
! $get_vars = $GLOBALS['HTTP_GET_VARS'];
! $url = parse_url($get_vars['file']);
if (isset($url['query']))
! parse_str($url['query'], $get_vars);
else
! $get_vars = array();
! $get_vars['file'] = $url['path'];
- $input_vars = array_merge($get_vars, $GLOBALS['HTTP_POST_VARS']);
$vurl = $url['path'];
! if (!empty($get_vars['show']))
! $vurl .= "?show=" . $get_vars['show'];
if (!isset($document_root)) {
--- 65,96 ----
! // collect GET variables
! if (is_array($_GET))
! $GET = $_GET;
! else
! $GET = $GLOBALS['HTTP_GET_VARS'];
+ // collect POST variables
+ if (is_array($_POST))
+ $INPUT = $_POST;
+ else
+ $INPUT = $GLOBALS['HTTP_POST_VARS'];
! $INPUT = array_merge($GET, $POST);
!
! $url = parse_url($GET['file']);
if (isset($url['query']))
! parse_str($url['query'], $GET);
else
! $GET = array();
!
! // workaround for unix homedirs e.g. http://domain.tld/~username
! $GET['file'] = ereg_replace ("/~[^/]+", '', $url['path']);
! // $GET['file'] = $url['path'];
$vurl = $url['path'];
! if (!empty($GET['show']))
! $vurl .= "?show=" . $GET['show'];
if (!isset($document_root)) {
***************
*** 85,92 ****
}
!
! if (!isset($input_vars['file'])) die(); else $file = $input_vars['file'];
! if (!isset($input_vars['show'])) $input_vars['show'] = "";
! if (!isset($input_vars['action'])) $input_vars['action'] = "";
if (strpos($file, '..') !== false) {
--- 98,104 ----
}
! if (!isset($INPUT['file'])) die(); else $file = $INPUT['file'];
! if (!isset($INPUT['show'])) $INPUT['show'] = "";
! if (!isset($INPUT['action'])) $INPUT['action'] = "";
if (strpos($file, '..') !== false) {
|
|
From: Andrej B. <an...@us...> - 2002-12-31 03:50:52
|
Update of /cvsroot/nextcms/nextcms/extensions
In directory sc8-pr-cvs1:/tmp/cvs-serv20946/extensions
Modified Files:
location.php
Log Message:
----------------------------------------------------------------------
Index: location.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/extensions/location.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** location.php 14 Jul 2002 16:39:24 -0000 1.1
--- location.php 31 Dec 2002 03:50:48 -0000 1.2
***************
*** 2,6 ****
class location extends Extension {
function getCode() {
! $site_pagetree = array_reverse($this->page->site->xmltree->getAncestorOrSelfLimited($this->pagenode_path, "/site[1]/pages[1]", "page"));
$prechars = "";
$location = "";
--- 2,6 ----
class location extends Extension {
function getCode() {
! $site_pagetree = array_reverse($this->page->site->xmltree->getAncestorOrSelfLimited($this->page->pagenode_path, "/site[1]/pages[1]", "page"));
$prechars = "";
$location = "";
|
|
From: Andrej B. <an...@us...> - 2002-12-31 03:48:48
|
Update of /cvsroot/nextcms/nextcms
In directory sc8-pr-cvs1:/tmp/cvs-serv19271
Modified Files:
utils.php
Log Message:
remind: The was only tested on Apache and Apache 2
----------------------------------------------------------------------
Index: utils.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/utils.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** utils.php 14 Jul 2002 13:54:32 -0000 1.5
--- utils.php 31 Dec 2002 03:48:45 -0000 1.6
***************
*** 13,91 ****
}
! function getOS() {
! $SERVER_SOFTWARE = getenv('SERVER_SOFTWARE');
! $PATH = getenv('PATH');
!
! if (stristr($SERVER_SOFTWARE, 'Win'))
! return 'win';
! if (stristr ($SERVER_SOFTWARE, 'Microsoft'))
! return 'win';
! if (stristr ($SERVER_SOFTWARE, 'Unix'))
! return 'nix';
!
! if (stristr ($PATH, 'C:'))
! return 'win';
! if (stristr ($PATH, '/X11'))
! return 'nix';
! }
function getDocRoot() {
! $PATH_TRANSLATED = $GLOBALS['HTTP_SERVER_VARS']['PATH_TRANSLATED'];
! $SCRIPT_FILENAME = getenv('SCRIPT_FILENAME');
! $SelfDir = getScriptPath();
! if ( getOS() == 'win' ) {
! $SelfDir = strtolower($SelfDir);
! $Directory = $PATH_TRANSLATED;
! $Directory = str_replace ('\\\\', '\\', $Directory );
! $temp = str_replace ('\\', '/', $Directory );
! $SelfPos = strpos ( $temp, $SelfDir );
! } else {
! if (getAPI() == 'cgi' AND isset ($PATH_TRANSLATED))
! $Directory = $PATH_TRANSLATED;
! else
! $Directory = $SCRIPT_FILENAME;
! if (!empty($SelfDir))
! $SelfPos = strpos ( $Directory, $SelfDir );
! else
! $SelfPos = false;
! }
! return str_replace ('\\', '/', substr ( $Directory, 0, $SelfPos ) );
! }
! function getScriptPath() {
! $SCRIPT_NAME = getenv('SCRIPT_NAME');
! // may be not correct
! $PATH_INFO = getenv('PATH_INFO');
! if (getAPI() == 'cgi')
! if (getOS() == 'win')
! return dirname ($PATH_INFO);
! else
! if (getOS() == 'nix' AND !empty($PATH_INFO))
! return dirname ($PATH_INFO);
! return dirname ($SCRIPT_NAME);
! }
! function getAPI() {
! $SERVER_SOFTWARE = getenv('SERVER_SOFTWARE');
! $sapi_type = php_sapi_name();
! if (stristr($sapi_type,"apache"))
! return 'mod';
! if (stristr($sapi_type , "isapi"))
! return 'mod';
! if (stristr($sapi_type , "cgi"))
! return 'cgi';
! if ( stristr( $SERVER_SOFTWARE, 'PHP' ) AND !stristr( $SERVER_SOFTWARE, 'SCRIPT' ))
! return 'mod';
! return 'cgi';
}
/**
* relToAbs() turns a relative path into a absolute
--- 13,107 ----
}
!
! /**
! * getDocRoot() determines the document root. This function is now free of
! * phpCMS code.
! * Reminder: only tested on apache and apache 2
! *
! */
function getDocRoot() {
! global $SERVER;
! if (isset($SERVER['PHP_SELF']))
! $PHP_SELF = $SERVER['PHP_SELF'];
! else if (isset($GLOBALS['$PHP_SELF']))
! $PHP_SELF = $GLOBALS['PHP_SELF'];
! if (isset($SERVER['SCRIPT_NAME']))
! $SCRIPT_NAME = $SERVER['SCRIPT_NAME'];
!
! if (isset($SERVER['SCRIPT_FILENAME']))
! $SCRIPT_FILENAME = $SERVER['SCRIPT_FILENAME'];
! if (isset($SERVER['PATH_TRANSLATED']))
! $PATH_TRANSLATED = $SERVER['PATH_TRANSLATED'];
!
! if (isset($SERVER['PATH_INFO']))
! $PATH_INFO = $SERVER['PATH_INFO'];
!
! if (isset($SERVER['$SERVER_SOFTWARE']))
! $SERVER_SOFTWARE = $SERVER['$SERVER_SOFTWARE'];
!
! if (isset($PHP_SELF))
! $scriptName = $PHP_SELF;
! else if (isset($SCRIPT_NAME))
! $scriptName = $SCRIPT_NAME;
! else if (isset($PATH_INFO))
! $scriptName = $PATH_INFO;
! else
! printError("Can't autodetect document root.");
!
! $scriptName = str_replace('//','/', str_replace('\\','/',$scriptName));
!
! // workaround for unix homedirs e.g. http://domain.tld/~username
! $scriptName = ereg_replace ("/~[^/]+", '', $scriptName);
! if (isset($SCRIPT_FILENAME))
! $scriptPath = $SCRIPT_FILENAME;
! else if (isset($PATH_TRANSLATED))
! $scriptPath = $PATH_TRANSLATED;
! else
! printError("Can't autodetect document root.");
! $scriptPath = str_replace('//','/', str_replace('\\','/',$scriptPath));
!
!
! $documentRoot = substr_replace($scriptPath, '', strlen($scriptPath) - strlen($scriptName));
!
! /*
!
! // just some testing stuff
! if (!isset($SERVER_SOFTWARE)) $SERVER_SOFTWARE = '';
! if (!isset($PATH_INFO)) $PATH_INFO = '';
! if (!isset($PATH_TRANSLATED)) $PATH_TRANSLATED = '';
!
! print "\$SERVER_SOFTWARE = '$SERVER_SOFTWARE'<br/>\n";
! print "\$DOCUMENT_ROOT = '".$SERVER['DOCUMENT_ROOT']."'<br/>\n";
! print "<p><b>Scriptnames:</b><br/>\n";
! print "\$SCRIPT_NAME = '$SCRIPT_NAME'<br/>\n";
! print "\$PHP_SELF = '$PHP_SELF'<br/>\n";
! print "\$PATH_INFO = '$PATH_INFO'<br/>\n";
! print "</p>";
!
! print "<p><b>Scriptpath:</b><br/>\n";
! print "\$SCRIPT_FILENAME = '$SCRIPT_FILENAME'<br/>\n";
! print "\$PATH_TRANSLATED = '$PATH_TRANSLATED'<br/>\n";
! print "</p>";
! print "<br/>\$scriptName = '$scriptName'<br/>\n";
! print "\$scriptPath = '$scriptPath'<br/>\n";
! print "\$documentRoot = '$documentRoot'<br/>\n";
!
! */
!
! return $documentRoot;
}
+
/**
* relToAbs() turns a relative path into a absolute
***************
*** 169,173 ****
--- 185,197 ----
$GLOBALS['loaded_files_enabled'] = true;
+ // collect SERVER variables
+ if (is_array($_SERVER))
+ $GLOBALS['SERVER'] = $_SERVER;
+ else
+ $GLOBALS['SERVER'] = $GLOBALS['HTTP_GET_VARS'];
+
if (!isset($GLOBALS['document_root']))
$document_root = getDocRoot();
+
+
?>
|
|
From: Andrej B. <an...@us...> - 2002-12-31 03:45:30
|
Update of /cvsroot/nextcms/nextcms
In directory sc8-pr-cvs1:/tmp/cvs-serv18547
Modified Files:
processor.conf.php-dist
Log Message:
* fixed missing comma bug
----------------------------------------------------------------------
Index: processor.conf.php-dist
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.conf.php-dist,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** processor.conf.php-dist 14 Jul 2002 16:29:27 -0000 1.10
--- processor.conf.php-dist 31 Dec 2002 03:45:25 -0000 1.11
***************
*** 39,44 ****
'ExtVMenu' => "$this->EXTENSION_DIR/vmenu.php",
'sitemap' => "$this->EXTENSION_DIR/sitemap.php",
! 'index' => "$this->EXTENSION_DIR/index.php"
! 'location' => "$this->EXTENSION_DIR/location.php"
'TextReader' => "$this->EXTENSION_DIR/textreader.php",
'Filesize' => "$this->EXTENSION_DIR/filesize.php",
--- 39,44 ----
'ExtVMenu' => "$this->EXTENSION_DIR/vmenu.php",
'sitemap' => "$this->EXTENSION_DIR/sitemap.php",
! 'index' => "$this->EXTENSION_DIR/index.php",
! 'location' => "$this->EXTENSION_DIR/location.php",
'TextReader' => "$this->EXTENSION_DIR/textreader.php",
'Filesize' => "$this->EXTENSION_DIR/filesize.php",
|
|
From: Andrej B. <an...@us...> - 2002-07-14 16:39:27
|
Update of /cvsroot/nextcms/nextcms/extensions
In directory usw-pr-cvs1:/tmp/cvs-serv11043
Added Files:
location.php
Log Message:
* added location
--- NEW FILE: location.php ---
<?php
class location extends Extension {
function getCode() {
$site_pagetree = array_reverse($this->page->site->xmltree->getAncestorOrSelfLimited($this->pagenode_path, "/site[1]/pages[1]", "page"));
$prechars = "";
$location = "";
foreach ($site_pagetree as $entry) {
$nodeatt = &$this->page->site->xmltree->getAttributes($entry);
$docfile = $this->page->site->getVirtualUrlByPath($entry);
$docname = $nodeatt["name"];
$location .= $prechars . "<a href=\"$docfile\" class=\"location\">$docname</a>";
$prechars = " > ";
}
if (!empty($location)) return $location;
return " ";
}
}
?>
|
|
From: Andrej B. <an...@us...> - 2002-07-14 16:29:30
|
Update of /cvsroot/nextcms/nextcms In directory usw-pr-cvs1:/tmp/cvs-serv8777 Modified Files: processor.conf.php-dist Log Message: * fixed bug in processor.conf.php-dist Index: processor.conf.php-dist =================================================================== RCS file: /cvsroot/nextcms/nextcms/processor.conf.php-dist,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** processor.conf.php-dist 14 Jul 2002 13:54:32 -0000 1.9 --- processor.conf.php-dist 14 Jul 2002 16:29:27 -0000 1.10 *************** *** 41,47 **** 'index' => "$this->EXTENSION_DIR/index.php" 'location' => "$this->EXTENSION_DIR/location.php" ! 'TextReader' => "$EXTENSION_DIR/textreader.php", ! 'Filesize' => "$EXTENSION_DIR/filesize.php", ! 'FileModTime' => "$EXTENSION_DIR/filemodtime.php", ); --- 41,47 ---- 'index' => "$this->EXTENSION_DIR/index.php" 'location' => "$this->EXTENSION_DIR/location.php" ! 'TextReader' => "$this->EXTENSION_DIR/textreader.php", ! 'Filesize' => "$this->EXTENSION_DIR/filesize.php", ! 'FileModTime' => "$this->EXTENSION_DIR/filemodtime.php", ); |
|
From: Andrej B. <an...@us...> - 2002-07-14 13:54:36
|
Update of /cvsroot/nextcms/nextcms/extensions
In directory usw-pr-cvs1:/tmp/cvs-serv2268/extensions
Added Files:
filemodtime.php filesize.php textreader.php
Log Message:
* added parameter support for extensions (works for content files only)
* added three new extensions
* FileModTime for the modification time of a specific file
* Filesize for the size of a specific file
* TextReader for the content of a specific text file
--- NEW FILE: filemodtime.php ---
<?php
class FileModTime extends Extension {
var $paramList;
function getFileModTime($file) {
if (file_exists($GLOBALS['document_root'] . $file)) {
$filemodtime = filemtime($GLOBALS['document_root'] . $file);
if (isset($this->paramList['timeformat']))
return date($this->paramList['timeformat'], $filemodtime);
else
return date("d.m.Y", $filemodtime);
} else
printError("Die Filesize Extension kann die angegebene Datei '$file' nicht finden.");
}
function getCode($paramList) {
$this->paramList = $paramList;
if (isset($paramList['id'])) {
$file = $this->page->site->getUrlByID($paramList['id']);
return $this->getFileModTime($file);
} else if (isset($paramList['file']))
return $this->getFileModTime($paramList['file']);
else
return "";
}
}
?>
--- NEW FILE: filesize.php ---
<?php
class Filesize extends Extension {
var $paramList;
function getFilesize($file) {
if (file_exists($GLOBALS['document_root'] . $file)) {
$filesize = filesize($GLOBALS['document_root'] . $file);
if (isset($this->paramList['div']))
return round($filesize * 100 / $this->paramList['div']) / 100;
else
return $filesize;
} else
printError("Die Filesize Extension kann die angegebene Datei '$file' nicht finden.");
}
function getCode($paramList) {
$this->paramList = $paramList;
if (isset($paramList['id'])) {
$file = $this->page->site->getUrlByID($paramList['id']);
return $this->getFilesize($file);
} else if (isset($paramList['file']))
return $this->getFilesize($paramList['file']);
else
return "";
}
}
?>
--- NEW FILE: textreader.php ---
<?php
class TextReader extends Extension {
function getFile($file) {
if (file_exists($GLOBALS['document_root'] . $file))
return loadFile($file);
else
printError("Die TextReader Extension kann die angegebene Datei '$file' nicht finden.");
}
function getCode($paramList) {
if (isset($paramList['id'])) {
$file = $this->page->site->getUrlByID($paramList['id']);
return $this->getFile($file);
} else if (isset($paramList['file']))
return $this->getFile($paramList['file']);
else
return "";
}
}
?>
|
|
From: Andrej B. <an...@us...> - 2002-07-14 13:54:36
|
Update of /cvsroot/nextcms/nextcms
In directory usw-pr-cvs1:/tmp/cvs-serv2268
Modified Files:
class.Extension.php class.Page.php class.Site.php
processor.conf.php-dist processor.php utils.php xml.php
Log Message:
* added parameter support for extensions (works for content files only)
* added three new extensions
* FileModTime for the modification time of a specific file
* Filesize for the size of a specific file
* TextReader for the content of a specific text file
Index: class.Extension.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Extension.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** class.Extension.php 19 Mar 2002 17:51:04 -0000 1.1.1.1
--- class.Extension.php 14 Jul 2002 13:54:32 -0000 1.2
***************
*** 7,11 ****
}
! function getCode() {
return "nothing implemented yet";
}
--- 7,11 ----
}
! function getCode($paramList) {
return "nothing implemented yet";
}
Index: class.Page.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Page.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** class.Page.php 27 May 2002 23:50:10 -0000 1.5
--- class.Page.php 14 Jul 2002 13:54:32 -0000 1.6
***************
*** 105,109 ****
$keywords = array();
! $keywordlists = array_reverse($this->site->xmltree->getAncestorOrSelf($pagenode_path, "/site[1]/pages[1]", "page", "keywords"));
foreach($keywordlists as $keywordlist)
--- 105,109 ----
$keywords = array();
! $keywordlists = array_reverse($this->site->xmltree->getAncestorOrSelfLimited($pagenode_path, "/site[1]/pages[1]", "page", "keywords"));
foreach($keywordlists as $keywordlist)
***************
*** 117,121 ****
$this->keywords = implode(", ", $keywords);
! $site_pagetree = array_reverse($this->site->xmltree->getAncestorOrSelf($pagenode_path, "/site[1]/pages[1]", "page"));
$docache = false;
--- 117,121 ----
$this->keywords = implode(", ", $keywords);
! $site_pagetree = array_reverse($this->site->xmltree->getAncestorOrSelfLimited($pagenode_path, "/site[1]/pages[1]", "page"));
$docache = false;
***************
*** 168,188 ****
}
- function getPageLocationCode() {
- // get pagepath code
- $site_pagetree = array_reverse($this->site->xmltree->getAncestorOrSelf($this->pagenode_path, "/site[1]/pages[1]", "page"));
- $prechars = "";
- $location = "";
- foreach ($site_pagetree as $entry) {
- $nodeatt = &$this->site->xmltree->getAttributes($entry);
- $docfile = $this->site->getVirtualUrlByPath($entry);
-
- $docname = $nodeatt["name"];
- $location .= $prechars . "<a href=\"$docfile\" class=\"location\">$docname</a>";
- $prechars = " > ";
- }
-
- return $location;
- }
-
function getFieldCode($field_name, $param_list) {
// replace predifined fields in the template with data
--- 168,171 ----
***************
*** 214,221 ****
break;
- case "location":
- return $this->getPageLocationCode();
- break;
-
case "keywords":
return $this->keywords;
--- 197,200 ----
***************
*** 419,429 ****
break;
case "ext":
! if (($type == CLOSED_TAG) || ($type == END_TAG)) {
! $ext_instance = $this->loadExtention($node['attributes']['name']);
if (isset($ext_instance)) {
! $startcode = $ext_instance->getCode();
! $startcode;
}
}
--- 398,424 ----
break;
+ case "parameter":
+ return "";
+ break;
+
case "ext":
! if (($type == CLOSED_TAG) || ($type == START_TAG)) {
! if (isset($node['attributes']['name']))
! $ext_instance = $this->loadExtention($node['attributes']['name']);
! else
! return "";
!
! $nodepath = $node['parent'] . '/' . 'ext[' . $node['uniquenum'] . ']';
! $children = $this->content->xmltree->getChild($nodepath, 'parameter');
! foreach ($children as $child) {
! $attrList = $this->content->xmltree->getAttributes($child);
! if (!isset($attrList['name']) || !isset($attrList['value']))
! printError("Ein ext Tag wurde falsch verwendet.\n\n" . "Es sollte wie folgt aussehen: \n" .
! "<ext name=\"extension\">\n<parameter name=\"file\" value=\"filename\"/>\n</ext>");
! $paramList[$attrList['name']] = $attrList['value'];
! }
if (isset($ext_instance)) {
! $startcode = $ext_instance->getCode($paramList);
}
}
Index: class.Site.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Site.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** class.Site.php 27 May 2002 23:50:10 -0000 1.7
--- class.Site.php 14 Jul 2002 13:54:32 -0000 1.8
***************
*** 120,123 ****
--- 120,127 ----
}
+ function getLocationNodes($path) {
+ return $this->xmltree->getAncestorOrSelf($this->page->pagenode_path, "page");
+ }
+
/**
* setTemplate() gets all the template information out of the site XMLTree
***************
*** 156,160 ****
if (empty($template_id)) {
! $parents = $this->xmltree->getAncestorOrSelf($nodepath, '/pages[1]', false, 'template');
if (!empty($parents))
$template_id = $this->xmltree->getAttribute($parents[0], 'template');
--- 160,164 ----
if (empty($template_id)) {
! $parents = $this->xmltree->getAncestorOrSelfLimited($nodepath, '/site[1]/pages[1]', null, 'template');
if (!empty($parents))
$template_id = $this->xmltree->getAttribute($parents[0], 'template');
Index: processor.conf.php-dist
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.conf.php-dist,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** processor.conf.php-dist 27 May 2002 23:50:10 -0000 1.8
--- processor.conf.php-dist 14 Jul 2002 13:54:32 -0000 1.9
***************
*** 40,43 ****
--- 40,47 ----
'sitemap' => "$this->EXTENSION_DIR/sitemap.php",
'index' => "$this->EXTENSION_DIR/index.php"
+ 'location' => "$this->EXTENSION_DIR/location.php"
+ 'TextReader' => "$EXTENSION_DIR/textreader.php",
+ 'Filesize' => "$EXTENSION_DIR/filesize.php",
+ 'FileModTime' => "$EXTENSION_DIR/filemodtime.php",
);
Index: processor.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** processor.php 28 May 2002 00:48:48 -0000 1.6
--- processor.php 14 Jul 2002 13:54:32 -0000 1.7
***************
*** 67,71 ****
$get_vars = $GLOBALS['HTTP_GET_VARS'];
- $vurl = $get_vars['file'];
$url = parse_url($get_vars['file']);
--- 67,70 ----
***************
*** 75,82 ****
$get_vars = array();
$get_vars['file'] = $url['path'];
-
$input_vars = array_merge($get_vars, $GLOBALS['HTTP_POST_VARS']);
if (!isset($document_root)) {
include_once('utils.php');
--- 74,84 ----
$get_vars = array();
$get_vars['file'] = $url['path'];
$input_vars = array_merge($get_vars, $GLOBALS['HTTP_POST_VARS']);
+ $vurl = $url['path'];
+ if (!empty($get_vars['show']))
+ $vurl .= "?show=" . $get_vars['show'];
+
if (!isset($document_root)) {
include_once('utils.php');
***************
*** 87,90 ****
--- 89,97 ----
if (!isset($input_vars['show'])) $input_vars['show'] = "";
if (!isset($input_vars['action'])) $input_vars['action'] = "";
+
+ if (strpos($file, '..') !== false) {
+ include_once('utils.php');
+ printError("Queries with relative file path are not allowed.");
+ }
}
?>
Index: utils.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/utils.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** utils.php 30 Apr 2002 23:58:18 -0000 1.4
--- utils.php 14 Jul 2002 13:54:32 -0000 1.5
***************
*** 139,142 ****
--- 139,143 ----
function printError($errormsg) {
+ $errormsg = nl2br($errormsg);
print "<html><head><meta name=\"ROBOTS\" content=\"NOINDEX, NOFOLLOW\" /><title>Process Error</title></head>\n";
print "<body bgcolor=\"#EEEEEE\">\n";
Index: xml.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/xml.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** xml.php 27 May 2002 23:50:10 -0000 1.3
--- xml.php 14 Jul 2002 13:54:32 -0000 1.4
***************
*** 3,23 ****
define('XML_TEXT', 4);
class XMLTree {
! var $topnode;
! var $treepath;
! var $xml_parser;
! var $nodes;
! var $root;
! var $ids;
! var $tmpdata;
! function XMLTree() {
! $this->treepath = "";
! $this->node = NULL;
! $this->nodes = NULL;
! $this->root = NULL;
! $this->ids = NULL;
! $this->tmpdata = "";
! }
// tree navigation and modification part
--- 3,60 ----
define('XML_TEXT', 4);
+ /**
+ * XMLTree is the representation of an XML-Document.
+ *
+ * The Class can be used to retrieve data from XML-Documents. It parses the document
+ * saves it's structure in an associative array and has a set of methodes to work
+ * with this structure.
+ *
+ * @version $Revision$
+ * @author Andrej Bisin <An...@Bi...>
+ * @access public
+ */
+
class XMLTree {
! /**
! * This associateve array contains a list of all document nodes.
! *
! * @var array
! */
! var $nodes = array();
! /**
! * Path of the current bide
! *
! * @var string
! */
! var $treepath = '';
!
! /**
! * Refercence to our XML parser.
! *
! * @var resource
! */
! var $xml_parser = NULL;
!
! /**
! * The path to the root element
! *
! * @var string
! */
! var $root = '';
!
! /**
! * Counter of the occurrence number of specific node names.
! *
! * @var array
! */
! var $ids = array();
!
! /**
! * Temporary space for text data.
! *
! * @var string
! */
! var $tmpdata = '';
// tree navigation and modification part
***************
*** 35,45 ****
}
} else {
! foreach ($nodelist as $nodepath) {
! if (($this->nodes[$nodepath]['name'] == $tagname) &&
! (isset($this->nodes[$nodepath]['attributes'][$attname]))) {
! if (empty($attvalue)) {
! array_push($new_nodelist, $nodepath);
! } else if ($this->nodes[$nodepath]['attributes'][$attname] == $attvalue) {
! array_push($new_nodelist, $nodepath);
}
}
--- 72,98 ----
}
} else {
! if (is_array($attname)) {
! foreach ($nodelist as $nodepath) {
! if ($this->nodes[$nodepath]['name'] == $tagname) {
! $bad = false;
! foreach ($attname as $key => $val) {
! if (!empty($attvalue))
! if ($this->nodes[$nodepath]['attributes'][$key] != $val)
! $bad = true;
! }
!
! if (!$bad)
! array_push($new_nodelist, $nodepath);
! }
! }
! } else {
! foreach ($nodelist as $nodepath) {
! if (($this->nodes[$nodepath]['name'] == $tagname) &&
! (isset($this->nodes[$nodepath]['attributes'][$attname]))) {
! if (empty($attvalue)) {
! array_push($new_nodelist, $nodepath);
! } else if ($this->nodes[$nodepath]['attributes'][$attname] == $attvalue) {
! array_push($new_nodelist, $nodepath);
! }
}
}
***************
*** 47,56 ****
}
} else {
! foreach ($nodelist as $nodepath) {
! if (isset($this->nodes[$nodepath]['attributes'][$attname])) {
! if (empty($attvalue)) {
array_push($new_nodelist, $nodepath);
! } else if ($this->nodes[$nodepath]['attributes'][$attname] == $attvalue) {
array_push($new_nodelist, $nodepath);
}
}
--- 100,123 ----
}
} else {
! if (is_array($attname)) {
! foreach ($nodelist as $nodepath) {
! $bad = false;
! foreach ($attname as $key => $val) {
! if (!empty($attvalue))
! if ($this->nodes[$nodepath]['attributes'][$key] != $val)
! $bad = true;
! }
!
! if (!$bad)
array_push($new_nodelist, $nodepath);
! }
! } else if (!empty($attname)) {
! foreach ($nodelist as $nodepath) {
! if (isset($this->nodes[$nodepath]['attributes'][$attname])) {
! if (empty($attvalue)) {
! array_push($new_nodelist, $nodepath);
! } else if ($this->nodes[$nodepath]['attributes'][$attname] == $attvalue) {
array_push($new_nodelist, $nodepath);
+ }
}
}
***************
*** 86,89 ****
--- 153,166 ----
}
+ /**
+ * Returns the value of an attribute.
+ *
+ * @access public
+ * @param string $path The full document path of the node, from which the attribute
+ * should be retrieved.
+ * @param string $name The name of attribute, which should be retrieved.
+ * @return string The attribute value.
+ * @see getAttributes(), setAttribute()
+ */
function getAttribute($path, $name) {
if (isset($this->nodes[$path]['attributes'][$name]))
***************
*** 91,94 ****
--- 168,181 ----
}
+ /**
+ * Set attributes to a node.
+ *
+ * @access private
+ * @param string $path The full document path of the node, the attribute
+ * should be added to.
+ * @param string $name The name of attribute, which should be set.
+ * @param string $value The value of attribute, which should be set.
+ * @see getAttribute(), getAttributes()
+ */
function setAttribute($path, $name, $value) {
if (isset($this->nodes[$path]['attributes'][$name]))
***************
*** 96,99 ****
--- 183,196 ----
}
+ /**
+ * Retrieves a list of all attributes of a node.
+ *
+ * @access public
+ * @param string $path The full document path of the node, from which the attributes
+ * should be retrieved.
+ * @return array The returned associative array contains all attributes of the
+ * specified node.
+ * @see getAttribute(), setAttribute()
+ */
function getAttributes($path) {
if (isset($this->nodes[$path]))
***************
*** 101,104 ****
--- 198,209 ----
}
+ /**
+ * Returns the name of the xml node.
+ *
+ * @access public
+ * @param string $path The full document path of the node, from which the name
+ * should be retrieved.
+ * @return string The returned string contains the name of the node.
+ */
function getName($path) {
if (isset($this->nodes[$path]))
***************
*** 106,127 ****
}
function getDepth($path) {
return $this->nodes[$path]['depth'];
}
function getNode($path, $recursive, $tagname = "", $attname = "", $attvalue = "") {
return $this->getNeededNodes($this->getAllNodes($path, $recursive), $tagname, $attname, $attvalue);
}
! function getAncestorOrSelf($path, $dstpath = null, $tagname = "", $attname = "", $attvalue = "") {
$nodelist = array();
! if (isset($dstpath)) {
! while ($path != $dstpath) {
! array_push($nodelist, $path);
! $path = $this->nodes[$path]['parent'];
! if (empty($path)) break;
! }
! } else {
$path = $this->nodes[$path]['parent'];
array_push($nodelist, $path);
--- 211,297 ----
}
+ /**
+ * Returns depth level the is xml tree.
+ *
+ * @access public
+ * @param string $path The full document path of the node, from which the depth
+ * level should be retrieved.
+ * @return integer The returned integer contains the depth level of the specified
+ * node.
+ */
function getDepth($path) {
return $this->nodes[$path]['depth'];
}
+ /**
+ * Returns all subnodes.
+ *
+ * @access private
+ * @return array The returned array represents a set of document nodes.
+ */
function getNode($path, $recursive, $tagname = "", $attname = "", $attvalue = "") {
return $this->getNeededNodes($this->getAllNodes($path, $recursive), $tagname, $attname, $attvalue);
}
!
! /**
! * Returns all child nodes.
! *
! * @access public
! * @return array The returned array represents a set of document nodes.
! */
! function getChild($path, $tagname = "", $attname = "", $attvalue = "") {
! return $this->getNeededNodes($this->getAllNodes($path, false), $tagname, $attname, $attvalue);
! }
!
! /**
! * Returns all descendent nodes.
! *
! * @access public
! * @return array The returned array represents a set of document nodes.
! */
! function getDescendant($path, $tagname = "", $attname = "", $attvalue = "") {
! return $this->getNeededNodes($this->getAllNodes($path, true), $tagname, $attname, $attvalue);
! }
!
! /**
! * Returns all descendent plus the self node.
! *
! * @access public
! * @return array The returned array represents a set of document nodes.
! */
! function getDescendantOrSelf($path, $tagname = "", $attname = "", $attvalue = "") {
! return array_merge(array($path), $this->getNeededNodes($this->getAllNodes($path, true), $tagname, $attname, $attvalue));
! }
!
! /**
! * Returns all ancestor nodes.
! *
! * @access public
! * @return array The returned array represents a set of document nodes.
! */
! function getAncestor($path, $tagname = "", $attname = "", $attvalue = "") {
$nodelist = array();
! while (!empty($path)) {
! $path = $this->nodes[$path]['parent'];
! array_push($nodelist, $path);
! }
!
! return $this->getNeededNodes($nodelist, $tagname, $attname, $attvalue);
! }
!
! /**
! * Returns all ancestor plus the self node.
! *
! * @access public
! * @return array The returned array represents a set of document nodes.
! */
! function getAncestorOrSelf($path, $tagname = "", $attname = "", $attvalue = "") {
! $nodelist = array();
!
! array_push($nodelist, $path);
!
! while (!empty($path)) {
$path = $this->nodes[$path]['parent'];
array_push($nodelist, $path);
***************
*** 131,134 ****
--- 301,343 ----
}
+ /**
+ * Returns all ancestor plus the self node between $path and $dstpath.
+ *
+ * @access public
+ * @return array The returned array represents a set of document nodes.
+ */
+ function getAncestorOrSelfLimited($path, $dstpath = null, $tagname = "", $attname = "", $attvalue = "") {
+ $nodelist = array();
+
+ array_push($nodelist, $path);
+
+ while ($path != $dstpath) {
+ $path = $this->nodes[$path]['parent'];
+ array_push($nodelist, $path);
+ if (empty($path)) break;
+ }
+
+ return $this->getNeededNodes($nodelist, $tagname, $attname, $attvalue);
+ }
+
+ /**
+ * Returns the self node.
+ *
+ * @access public
+ * @return array The returned array represents a set of document nodes.
+ */
+ function getSelf($path, $tagname = "", $attname = "", $attvalue = "") {
+ if (!empty($tagname) || !empty($attname) || !empty($attvalue))
+ return $this->getNeededNodes(array($path), $tagname, $attname, $attvalue);
+ else
+ return array($path);
+ }
+
+ /**
+ * Returns the parent node.
+ *
+ * @access public
+ * @return array The returned array represents a set of document nodes.
+ */
function getParent($path, $tagname = "", $attname = "", $attvalue = "") {
$nodelist[0] = $this->nodes[$path]['parent'];
***************
*** 136,143 ****
--- 345,365 ----
}
+ /**
+ * Returns all sibling nodes.
+ *
+ * @access public
+ * @return array The returned array represents a set of document nodes.
+ */
+
function getSibling($path, $tagname = "", $attname = "", $attvalue = "") {
return $this->getNeededNodes($this->getAllNodes($this->nodes[$path]['parent'], false), $tagname, $attname, $attvalue);
}
+ /**
+ * Returns the node text data.
+ *
+ * @access public
+ * @return string
+ */
function getTagData($path, $recursive = false) {
$data = array();
***************
*** 154,157 ****
--- 376,385 ----
// parser part
+ /**
+ * Parses the XML-Document given by string.
+ *
+ * @access public
+ */
+
function parseXML($xmlstring, $withdata = true, $filename = "") {
$this->xml_parser = xml_parser_create();
***************
*** 186,189 ****
--- 414,423 ----
}
+ /**
+ * Parses the XML-Document given by filename.
+ *
+ * @access public
+ */
+
function parseXMLFile($xml_filename, $withdata = true) {
$this->parseXML(join("", file($xml_filename)));
***************
*** 191,197 ****
/**
! * serialize() serializes the XMLTree
*
! * @access public
*/
--- 425,432 ----
/**
! * Serializes the XMLTree.
*
! * @access public
! * @return string
*/
***************
*** 291,294 ****
--- 526,539 ----
}
}
+
+ /**
+ * Adds a new node to the XMLTree.
+ *
+ * @access private
+ * @param string
+ * @param string
+ * @param integer
+ * @return string Full document path to the added node.
+ */
function addNode($path, $name, $type) {
|
|
From: Andrej B. <an...@us...> - 2002-05-28 00:48:51
|
Update of /cvsroot/nextcms/nextcms
In directory usw-pr-cvs1:/tmp/cvs-serv23808
Modified Files:
processor.php
Log Message:
Index: processor.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** processor.php 27 May 2002 23:50:10 -0000 1.5
--- processor.php 28 May 2002 00:48:48 -0000 1.6
***************
*** 12,16 ****
// disable cache for developing
! $cache->is_cached = false;
if ($cache->is_cached) {
--- 12,16 ----
// disable cache for developing
! // $cache->is_cached = false;
if ($cache->is_cached) {
|
Update of /cvsroot/nextcms/nextcms
In directory usw-pr-cvs1:/tmp/cvs-serv31215
Modified Files:
class.Cache.php class.Log.php class.Mapper.php class.Page.php
class.Site.php processor.conf.php-dist processor.php xml.php
Log Message:
* some bugs fixed
* {parent_url} added
Index: class.Cache.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Cache.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** class.Cache.php 14 May 2002 16:16:00 -0000 1.4
--- class.Cache.php 27 May 2002 23:50:10 -0000 1.5
***************
*** 6,18 ****
function Cache($url = null) {
$this->is_cached = false;
if (!isset($url)) return;
! if (!isset($GLOBALS['CACHE_DIR'])) return;
$docroot = $GLOBALS['document_root'];
! $cache_filename = $docroot . $GLOBALS['CACHE_DIR'] . "/" . md5($url);
if (!file_exists($cache_filename)) return;
--- 6,19 ----
function Cache($url = null) {
+ global $settings;
$this->is_cached = false;
if (!isset($url)) return;
! if (!isset($settings->CACHE_DIR)) return;
$docroot = $GLOBALS['document_root'];
! $cache_filename = $docroot . $settings->CACHE_DIR . "/" . md5($url);
if (!file_exists($cache_filename)) return;
***************
*** 51,57 ****
}
! function writeFile($file, $data, $check_mod_files) {
! if (isset($GLOBALS['CACHE_DIR'])) {
! $cache_dir = $GLOBALS['document_root'] . $GLOBALS['CACHE_DIR'];
if (!file_exists($cache_dir))
--- 52,58 ----
}
! function writeFile($data, $check_mod_files) {
! if (isset($GLOBALS['settings']->CACHE_DIR)) {
! $cache_dir = $GLOBALS['document_root'] . $GLOBALS['settings']->CACHE_DIR;
if (!file_exists($cache_dir))
***************
*** 59,63 ****
printError("Das Cacheverzeichnis $cache_dir existiert nicht und es konnte auch nicht angelegt werden.");
! $cache_filename = $GLOBALS['CACHE_DIR'] . "/" . md5($file);
$cachefile = fopen($GLOBALS['document_root'] . $cache_filename, "w");
--- 60,64 ----
printError("Das Cacheverzeichnis $cache_dir existiert nicht und es konnte auch nicht angelegt werden.");
! $cache_filename = $GLOBALS['settings']->CACHE_DIR . "/" . md5($GLOBALS['vurl']);
$cachefile = fopen($GLOBALS['document_root'] . $cache_filename, "w");
Index: class.Log.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Log.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** class.Log.php 2 May 2002 17:13:47 -0000 1.5
--- class.Log.php 27 May 2002 23:50:10 -0000 1.6
***************
*** 2,16 ****
class Log {
function Log($filename = "") {
! $log_filename = $GLOBALS['document_root'] . $GLOBALS['LOG_FILE'];
! if (!empty($GLOBALS["LOG_FILE"])) {
$logdir = dirname($log_filename);
if (!file_exists($logdir))
if (!mkdir($logdir, 0777))
! printError("Das Logfile Verzeichnis '" . dirname($GLOBALS['LOG_FILE']) . "' existiert nicht und es konnte auch nicht angelegt werden");
if (!is_writeable($logdir))
! printError("Es bestehen keine Schreibrechte auf das Cacheverzeichnis '" . dirname($GLOBALS['LOG_FILE']) . "'.");
if (file_exists($log_filename)) {
--- 2,17 ----
class Log {
function Log($filename = "") {
! global $settings;
! $log_filename = $GLOBALS['document_root'] . $settings->LOG_FILE;
! if (!empty($settings->LOG_FILE)) {
$logdir = dirname($log_filename);
if (!file_exists($logdir))
if (!mkdir($logdir, 0777))
! printError("Das Logfile Verzeichnis '" . dirname($settings->LOG_FILE) . "' existiert nicht und es konnte auch nicht angelegt werden");
if (!is_writeable($logdir))
! printError("Es bestehen keine Schreibrechte auf das Cacheverzeichnis '" . dirname($settings->LOG_FILE) . "'.");
if (file_exists($log_filename)) {
***************
*** 29,34 ****
$remote_addr = getenv('REMOTE_ADDR');
! if (isset($GLOBALS['RESOLVE_HOST_NAMES']))
! if ($GLOBALS['RESOLVE_HOST_NAMES'])
$remote_addr = gethostbyaddr($remote_addr);
--- 30,35 ----
$remote_addr = getenv('REMOTE_ADDR');
! if (isset($settings->RESOLVE_HOST_NAMES))
! if ($settings->RESOLVE_HOST_NAMES)
$remote_addr = gethostbyaddr($remote_addr);
***************
*** 37,57 ****
fclose($f);
! if (isset($GLOBALS['LOG_MAX_SIZE'])) {
! if (filesize($log_filename) > ($GLOBALS['LOG_MAX_SIZE'] << 10)) {
! if (isset($GLOBALS['LOG_COMPRESSION_COMMAND'])) {
! if (isset($GLOBALS['LOG_COMPRESSION_EXTENSION']))
! $ext = $GLOBALS['LOG_COMPRESSION_EXTENSION']; else $ext = '';
!
! $testname = $log_filename . '.' . date('Ymd');
!
! $outfile = $testname . $ext;
! for ($i=1;file_exists($outfile);$i++)
! $outfile = $testname . '.' . $i . $ext;
!
! $trans = array('{infile}' => $log_filename, '{outfile}' => $outfile);
! $cmd = strtr($GLOBALS['LOG_COMPRESSION_COMMAND'], $trans);
! exec($cmd);
! }
! unlink($log_filename);
}
}
--- 38,70 ----
fclose($f);
! // on high server load the next part has some bugs
!
! if (isset($settings->LOG_MAX_SIZE)) {
! if (filesize($log_filename) > ($settings->LOG_MAX_SIZE << 10)) {
! // check again, if it is really the size of the file
! clearstatcache();
! if (filesize($log_filename) > ($settings->LOG_MAX_SIZE << 10))
! if (isset($settings->LOG_COMPRESSION_COMMAND)) {
! if (isset($settings->LOG_COMPRESSION_EXTENSION))
! $ext = $settings->LOG_COMPRESSION_EXTENSION; else $ext = 'bak';
!
! $testname = $log_filename . '.' . date('Ymd');
!
! $infile = $testname;
! for ($i=1;file_exists($infile . $ext);$i++)
! $infile = $testname . '.' . $i;
!
!
! $outfile = $infile . $ext;
! rename($log_filename, $infile);
!
! $trans = array('{infile}' => $infile, '{outfile}' => $outfile);
! $cmd = strtr($settings->LOG_COMPRESSION_COMMAND, $trans);
! exec($cmd);
! clearstatcache();
! unlink($in_file);
! } else {
! unlink($log_filename);
! }
}
}
Index: class.Mapper.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Mapper.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** class.Mapper.php 14 May 2002 16:16:00 -0000 1.2
--- class.Mapper.php 27 May 2002 23:50:10 -0000 1.3
***************
*** 12,16 ****
function Mapper($disable_cache = false) {
disableLoadedFiles();
! $site_file = $GLOBALS['SITE_FILES'];
if (!$disable_cache)
--- 12,16 ----
function Mapper($disable_cache = false) {
disableLoadedFiles();
! $site_file = $GLOBALS['settings']->SITE_FILES;
if (!$disable_cache)
***************
*** 38,43 ****
foreach ($site_file as $key => $file) {
! if (isset($this->site[$key]))
! if (!(fileatime($GLOBALS['document_root'] . '/' . $this->site[$key]['file']) > $this->site[$key]['modtime']))
continue;
else
--- 38,48 ----
foreach ($site_file as $key => $file) {
! if (isset($this->site[$key])) {
! $sfile = $GLOBALS['document_root'] . '/' . $this->site[$key]['file'];
! if (!file_exists($sfile)) {
! unset($this->site[$key]['file']);
! continue;
! }
! if (!(fileatime($sfile) > $this->site[$key]['modtime']))
continue;
else
***************
*** 47,51 ****
unset($this->virtual_url[$vurl]);
}
!
$this->mapping_is_modified = true;
--- 52,56 ----
unset($this->virtual_url[$vurl]);
}
! }
$this->mapping_is_modified = true;
***************
*** 100,108 ****
function writeCache() {
! if (isset($GLOBALS['CACHE_DIR'])) {
unset($this->mapping_is_modified);
! $cache_dir = $GLOBALS['document_root'] . $GLOBALS['CACHE_DIR'];
! $cache_filename = $GLOBALS['CACHE_DIR'] . "/" . 'mappercache';
! $check_mod_files = $GLOBALS['SITE_FILES'];
if (!file_exists($cache_dir))
--- 105,113 ----
function writeCache() {
! if (isset($GLOBALS['settings']->CACHE_DIR)) {
unset($this->mapping_is_modified);
! $cache_dir = $GLOBALS['document_root'] . $GLOBALS['settings']->CACHE_DIR;
! $cache_filename = $GLOBALS['settings']->CACHE_DIR . "/" . 'mappercache';
! $check_mod_files = $GLOBALS['settings']->CACHE_DIR;
if (!file_exists($cache_dir))
***************
*** 120,125 ****
function readCache() {
! if (isset($GLOBALS['CACHE_DIR'])) {
! $cache_dir = $GLOBALS['document_root'] . $GLOBALS['CACHE_DIR'];
$cache_filename = $cache_dir . "/" . 'mappercache';
--- 125,130 ----
function readCache() {
! if (isset($GLOBALS['settings']->CACHE_DIR)) {
! $cache_dir = $GLOBALS['document_root'] . $GLOBALS['settings']->CACHE_DIR;
$cache_filename = $cache_dir . "/" . 'mappercache';
Index: class.Page.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Page.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** class.Page.php 30 Apr 2002 23:58:18 -0000 1.4
--- class.Page.php 27 May 2002 23:50:10 -0000 1.5
***************
*** 18,21 ****
--- 18,22 ----
var $pagenode_path;
+ var $parentpage_path;
var $lastpage_path;
var $nextpage_path;
***************
*** 45,49 ****
// check if we can handle the requested url
if (!isset($url)) {
! //header('HTTP/1.0 404 Not Found'); exit;
printError("404 URL '$virtual_url' is not attached to any site on this server.");
}
--- 46,50 ----
// check if we can handle the requested url
if (!isset($url)) {
! header('HTTP/1.0 404 Not Found');// exit;
printError("404 URL '$virtual_url' is not attached to any site on this server.");
}
***************
*** 61,70 ****
// create a new site object
! $this->site = new Site($GLOBALS['SITE_FILES'][$this->siteid]);
// get the pagenode of the page we want to create
! $ret = $this->site->getPageLastNext($this->content->filename);
if (empty($ret))
! printError("Die Seite '" . $this->content->filename . "' wurde in '" . $this->site->filename . "' nicht definiert.");
$this->pagenode_path = $ret['this'];
--- 62,71 ----
// create a new site object
! $this->site = new Site($GLOBALS['settings']->SITE_FILES[$this->siteid]);
// get the pagenode of the page we want to create
! $ret = $this->site->getPageLastNext($this->virtual_url);
if (empty($ret))
! printError("Die Seite '" . $this->virtual_url . "' wurde in '" . $this->site->filename . "' nicht definiert.");
$this->pagenode_path = $ret['this'];
***************
*** 74,77 ****
--- 75,80 ----
if (isset($ret['next']))
$this->nextpage_path = $ret['next'];
+ if (isset($ret['parent']))
+ $this->parentpage_path = $ret['parent'];
// ident support is broken, so it is disabled
***************
*** 102,106 ****
$keywords = array();
! $keywordlists = array_reverse($this->site->xmltree->getParent($pagenode_path, "/site[1]/pages[1]", "page", "keywords"));
foreach($keywordlists as $keywordlist)
--- 105,109 ----
$keywords = array();
! $keywordlists = array_reverse($this->site->xmltree->getAncestorOrSelf($pagenode_path, "/site[1]/pages[1]", "page", "keywords"));
foreach($keywordlists as $keywordlist)
***************
*** 114,118 ****
$this->keywords = implode(", ", $keywords);
! $site_pagetree = array_reverse($this->site->xmltree->getParent($pagenode_path, "/site[1]/pages[1]", "page"));
$docache = false;
--- 117,121 ----
$this->keywords = implode(", ", $keywords);
! $site_pagetree = array_reverse($this->site->xmltree->getAncestorOrSelf($pagenode_path, "/site[1]/pages[1]", "page"));
$docache = false;
***************
*** 121,124 ****
--- 124,128 ----
case 'printerversion':
$this->template = $this->getTemplate($pagenode_path, "printerversion");
+ $docache = true;
break;
***************
*** 166,170 ****
function getPageLocationCode() {
// get pagepath code
! $site_pagetree = array_reverse($this->site->xmltree->getParent($this->pagenode_path, "/site[1]/pages[1]", "page"));
$prechars = "";
$location = "";
--- 170,174 ----
function getPageLocationCode() {
// get pagepath code
! $site_pagetree = array_reverse($this->site->xmltree->getAncestorOrSelf($this->pagenode_path, "/site[1]/pages[1]", "page"));
$prechars = "";
$location = "";
***************
*** 224,237 ****
case "last_url":
if (isset($this->lastpage_path))
! return $this->site->getPageFile($this->lastpage_path);
else
! return $this->content->filename;
break;
case "next_url":
if (isset($this->nextpage_path))
! return $this->site->getPageFile($this->nextpage_path);
else
! return $this->content->filename;
break;
--- 228,248 ----
case "last_url":
if (isset($this->lastpage_path))
! return $this->site->getVirtualUrlByPath($this->lastpage_path);
else
! return $this->virtual_url;
break;
case "next_url":
if (isset($this->nextpage_path))
! return $this->site->getVirtualUrlByPath($this->nextpage_path);
else
! return $this->virtual_url;
! break;
!
! case "parent_url":
! if (isset($this->parentpage_path))
! return $this->site->getVirtualUrlByPath($this->parentpage_path);
! else
! return $this->virtual_url;
break;
***************
*** 264,271 ****
function loadExtention($name) {
! global $document_root;
! if (isset($GLOBALS["EXTENSIONS"][$name]))
! $extension = $GLOBALS["EXTENSIONS"][$name];
if (isset($extension)) {
--- 275,282 ----
function loadExtention($name) {
! global $document_root, $settings;
! if (isset($settings->EXTENSIONS[$name]))
! $extension = $settings->EXTENSIONS[$name];
if (isset($extension)) {
***************
*** 604,613 ****
function writeCacheFile() {
! if (isset($GLOBALS['CACHE_DIR'])) {
! include_once('class.Cache.php');
! $cache = new Cache();
! $cache->writeFile($this->virtual_url, $this->htmlpage, array_unique($GLOBALS['loaded_files']));
! }
}
--- 615,622 ----
function writeCacheFile() {
! include_once('class.Cache.php');
! $cache = new Cache();
! $cache->writeFile($this->htmlpage, array_unique($GLOBALS['loaded_files']));
}
Index: class.Site.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Site.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** class.Site.php 14 May 2002 16:16:00 -0000 1.6
--- class.Site.php 27 May 2002 23:50:10 -0000 1.7
***************
*** 7,10 ****
--- 7,11 ----
var $filename;
var $root;
+
var $id;
var $url;
***************
*** 80,86 ****
*/
! function getPageLastNext($file) {
$dirname = dirname($this->filename);
! $pathlist = $this->xmltree->getNode("/site[1]/pages[1]", true, "page", "file");
// check if there are entries on pathlist
--- 81,87 ----
*/
! function getPageLastNext($vurl) {
$dirname = dirname($this->filename);
! $pathlist = $this->xmltree->getNode("/site[1]/pages[1]", true, "page");
// check if there are entries on pathlist
***************
*** 89,93 ****
$num = count($pathlist);
for ($i=0;$i<$num;$i++) {
! if (relToAbs($this->xmltree->getAttribute($pathlist[$i],'file'), $dirname) == $file) {
$name = $this->xmltree->getAttribute($pathlist[$i], 'name');
if (empty($name))
--- 90,95 ----
$num = count($pathlist);
for ($i=0;$i<$num;$i++) {
!
! if ($vurl == $this->getVirtualUrlByPath($pathlist[$i])) {
$name = $this->xmltree->getAttribute($pathlist[$i], 'name');
if (empty($name))
***************
*** 96,107 ****
--- 98,119 ----
$ret = array();
+
if ($i>0)
$ret['last'] = $pathlist[$i-1];
if (($i+1)<$num)
$ret['next'] = $pathlist[$i+1];
+
$ret['this'] = $pathlist[$i];
+ $parent = $this->xmltree->getParent($pathlist[$i], 'page');
+
+ if (!empty($parent)) {
+ $ret['parent'] = $parent[0];
+ }
+
return $ret;
+
}
+
}
}
***************
*** 144,148 ****
if (empty($template_id)) {
! $parents = $this->xmltree->getParent($nodepath, '/pages[1]', false, 'template');
if (!empty($parents))
$template_id = $this->xmltree->getAttribute($parents[0], 'template');
--- 156,160 ----
if (empty($template_id)) {
! $parents = $this->xmltree->getAncestorOrSelf($nodepath, '/pages[1]', false, 'template');
if (!empty($parents))
$template_id = $this->xmltree->getAttribute($parents[0], 'template');
Index: processor.conf.php-dist
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.conf.php-dist,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** processor.conf.php-dist 2 May 2002 17:13:47 -0000 1.7
--- processor.conf.php-dist 27 May 2002 23:50:10 -0000 1.8
***************
*** 1,3 ****
! <?php
// The document_root can be detected automaticly.
// If you exprience problems with the automatic detection
--- 1,3 ----
! <?php class Settings { function Settings() {
// The document_root can be detected automaticly.
// If you exprience problems with the automatic detection
***************
*** 5,50 ****
// manually.
! // $document_root = '/usr/local/httpd/htdocs';
// The install path of nextcms.
! $INSTALL_DIR = '/nextcms';
! // The path in which the extensions are in.
! $EXTENSION_DIR = $INSTALL_DIR . "/extensions";
!
! // if $LOG_FILE is set logging is enabled
// remember to set write permissions
! $LOG_DIR = $INSTALL_DIR . '/logs';
! $LOG_FILE = $LOG_DIR . '/site.log';
// maximum log file size in kbyte
! // $LOG_MAX_SIZE = 1000;
// command which is called when log size limit is reached
! // $LOG_COMPRESSION_COMMAND = "gzip -c {infile} > {outfile}";
! // $LOG_COMPRESSION_EXTENSION = ".gz";
! // if $CACHE_DIR is set caching is enabled
// remember to set write permissions
! $CACHE_DIR = $INSTALL_DIR . '/cache';
// each site should be registered here
! $SITE_FILES = Array('demo_site' => '/demosite/demo.site.xml');
// each extension should be registered here
! $EXTENSIONS = Array('ExtHMenu' => "$EXTENSION_DIR/hmenu.php",
! 'ExtVMenu' => "$EXTENSION_DIR/vmenu.php",
! 'sitemap' => "$EXTENSION_DIR/sitemap.php",
! 'index' => "$EXTENSION_DIR/index.php");
// check if the requested file is a contentfile and should
// be handled by the cms
! $CHECK_IF_CONTENTFILE = true;
// should host names be resolved
! $RESOLVE_HOST_NAMES = true;
// sending a last modified header can lower your traffic
! $SEND_LAST_MODIFIED_HEADER = false;
!
! ?>
--- 5,53 ----
// manually.
! // $this->DOCUMENT_ROOT = '/usr/local/httpd/htdocs';
// The install path of nextcms.
! $this->INSTALL_DIR = '/nextcms';
! // if $this->LOG_FILE is set logging is enabled
// remember to set write permissions
! $this->LOG_DIR = $this->INSTALL_DIR . '/logs';
! $this->LOG_FILE = $this->LOG_DIR . '/site.log';
// maximum log file size in kbyte
! // $this->LOG_MAX_SIZE = 1000;
// command which is called when log size limit is reached
! // $this->LOG_COMPRESSION_COMMAND = "gzip -c {infile} > {outfile}";
! // $this->LOG_COMPRESSION_EXTENSION = ".gz";
! // if $this->CACHE_DIR is set caching is enabled
// remember to set write permissions
! $this->CACHE_DIR = $this->INSTALL_DIR . '/cache';
// each site should be registered here
! $this->SITE_FILES = Array(
! 'demo_site' => '/demosite/demo.site.xml'
! );
+ // The path in which the extensions are in.
+ $this->EXTENSION_DIR = $this->INSTALL_DIR . "/extensions";
+
// each extension should be registered here
! $this->EXTENSIONS = Array(
! 'ExtHMenu' => "$this->EXTENSION_DIR/hmenu.php",
! 'ExtVMenu' => "$this->EXTENSION_DIR/vmenu.php",
! 'sitemap' => "$this->EXTENSION_DIR/sitemap.php",
! 'index' => "$this->EXTENSION_DIR/index.php"
! );
// check if the requested file is a contentfile and should
// be handled by the cms
! $this->CHECK_IF_CONTENTFILE = true;
// should host names be resolved
! $this->RESOLVE_HOST_NAMES = true;
// sending a last modified header can lower your traffic
! $this->SEND_LAST_MODIFIED_HEADER = false;
! }}?>
Index: processor.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** processor.php 30 Apr 2002 23:58:18 -0000 1.4
--- processor.php 27 May 2002 23:50:10 -0000 1.5
***************
*** 1,65 ****
<?php
ob_start('ob_gzhandler');
! if (!include('processor.conf.php')) {
! include_once('utils.php');
! printError("Can't find the config file processor.conf.php.");
! }
!
! // include_once('utils.php');
! // startTimer();
!
! if (!isset($document_root)) {
! include_once('utils.php');
! $document_root = getDocRoot();
! }
! $input_vars = getGetParams();
! if (!isset($input_vars['file'])) die(); else $file = $input_vars['file'];
! if (!isset($input_vars['show'])) $input_vars['show'] = "";
! if (!isset($input_vars['action'])) $input_vars['action'] = "";
! if ($CHECK_IF_CONTENTFILE) checkContent($file);
! if ($input_vars['action'] == 'edit') {
! include_once('utils.php');
! // include('class.Admin.php');
! // $admin = new Admin($file);
} else {
! include('class.Cache.php');
! $cache = new Cache($file);
!
! //$cache->is_cached = false;
!
! if ($cache->is_cached && empty($input_vars['show'])) {
! $cache->show();
! } else {
! include_once('utils.php');
! include('class.Page.php');
! $page = new Page($file);
! $page->show();
! }
! if (isset($GLOBALS['LOG_FILE'])) {
! include('class.Log.php');
! $log = new Log($file);
! }
}
- // stopTimer();
if (isset($totaltime))
print "<br>\n<div align=\"center\"><b>created in: $totaltime sec</b></div>";
- function getGetParams() {
- $get_vars = $GLOBALS['HTTP_GET_VARS'];
- $url = parse_url($get_vars['file']);
- if (isset($url['query']))
- parse_str($url['query'], $get_vars);
- else
- $get_vars = array();
- $get_vars['file'] = $url['path'];
-
- return array_merge($get_vars, $GLOBALS['HTTP_POST_VARS']);
- }
/**
--- 1,34 ----
<?php
+ // compress output when it is possible
ob_start('ob_gzhandler');
! // load config file (processor.conf.php)
! setupInputVars();
! if ($settings->CHECK_IF_CONTENTFILE) checkContent($file);
! include('class.Cache.php');
! $cache = new Cache($vurl);
!
! // disable cache for developing
! $cache->is_cached = false;
! if ($cache->is_cached) {
! $cache->show();
} else {
! include_once('utils.php');
! include('class.Page.php');
! $page = new Page($file);
! $page->show();
! }
! if (isset($settings->LOG_FILE)) {
! include('class.Log.php');
! $log = new Log($file);
}
if (isset($totaltime))
print "<br>\n<div align=\"center\"><b>created in: $totaltime sec</b></div>";
/**
***************
*** 69,73 ****
global $document_root;
include_once('utils.php');
!
if (!file_exists($document_root . $file)) return;
$code = loadFile($file);
--- 38,42 ----
global $document_root;
include_once('utils.php');
!
if (!file_exists($document_root . $file)) return;
$code = loadFile($file);
***************
*** 75,80 ****
--- 44,90 ----
// could be unsafe (just for testing)
if (strpos($code, "<contentpage") === false) {
+ //virtual($file);
die($code);
}
}
+
+ function setupInputVars() {
+ global $document_root, $input_vars, $file, $vurl, $settings;
+
+ if (isset($document_root)) unset($document_root);
+
+ if (!include('processor.conf.php')) {
+ include_once('utils.php');
+ printError("Can't find the config file processor.conf.php.");
+ }
+
+ $settings = new Settings();
+
+ if (isset($settings->DOCUMENT_ROOT))
+ $document_root = $settings->DOCUMENT_ROOT;
+
+
+ $get_vars = $GLOBALS['HTTP_GET_VARS'];
+
+ $vurl = $get_vars['file'];
+
+ $url = parse_url($get_vars['file']);
+ if (isset($url['query']))
+ parse_str($url['query'], $get_vars);
+ else
+ $get_vars = array();
+ $get_vars['file'] = $url['path'];
+
+
+ $input_vars = array_merge($get_vars, $GLOBALS['HTTP_POST_VARS']);
+
+ if (!isset($document_root)) {
+ include_once('utils.php');
+ }
+
+
+ if (!isset($input_vars['file'])) die(); else $file = $input_vars['file'];
+ if (!isset($input_vars['show'])) $input_vars['show'] = "";
+ if (!isset($input_vars['action'])) $input_vars['action'] = "";
+ }
?>
Index: xml.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/xml.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** xml.php 30 Apr 2002 23:58:18 -0000 1.2
--- xml.php 27 May 2002 23:50:10 -0000 1.3
***************
*** 114,121 ****
}
! function getParent($path, $dstpath, $tagname = "", $attname = "", $attvalue = "") {
$nodelist = array();
-
if (isset($dstpath)) {
while ($path != $dstpath) {
--- 114,120 ----
}
! function getAncestorOrSelf($path, $dstpath = null, $tagname = "", $attname = "", $attvalue = "") {
$nodelist = array();
if (isset($dstpath)) {
while ($path != $dstpath) {
***************
*** 125,133 ****
}
} else {
- array_push($nodelist, $path);
$path = $this->nodes[$path]['parent'];
! if (empty($path)) break;
}
return $this->getNeededNodes($nodelist, $tagname, $attname, $attvalue);
}
--- 124,136 ----
}
} else {
$path = $this->nodes[$path]['parent'];
! array_push($nodelist, $path);
}
+ return $this->getNeededNodes($nodelist, $tagname, $attname, $attvalue);
+ }
+
+ function getParent($path, $tagname = "", $attname = "", $attvalue = "") {
+ $nodelist[0] = $this->nodes[$path]['parent'];
return $this->getNeededNodes($nodelist, $tagname, $attname, $attvalue);
}
|
|
From: Andrej B. <an...@us...> - 2002-05-14 16:16:04
|
Update of /cvsroot/nextcms/nextcms
In directory usw-pr-cvs1:/tmp/cvs-serv1052
Modified Files:
class.Cache.php class.Mapper.php class.Site.php
Log Message:
* fixed minor cache bug
* fixed mapper bug (some pages couldn't be accessed)
Index: class.Cache.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Cache.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** class.Cache.php 30 Apr 2002 23:58:18 -0000 1.3
--- class.Cache.php 14 May 2002 16:16:00 -0000 1.4
***************
*** 30,34 ****
foreach ($check_file as $filename) {
if (file_exists($docroot . $filename)) {
! if (filemtime($docroot . $filename) > $this->filemtime) {
fclose($cache_file); return;
}
--- 30,34 ----
foreach ($check_file as $filename) {
if (file_exists($docroot . $filename)) {
! if (fileatime($docroot . $filename) > $this->filemtime) {
fclose($cache_file); return;
}
Index: class.Mapper.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Mapper.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** class.Mapper.php 30 Apr 2002 23:58:18 -0000 1.1
--- class.Mapper.php 14 May 2002 16:16:00 -0000 1.2
***************
*** 12,16 ****
function Mapper($disable_cache = false) {
disableLoadedFiles();
-
$site_file = $GLOBALS['SITE_FILES'];
--- 12,15 ----
***************
*** 40,44 ****
foreach ($site_file as $key => $file) {
if (isset($this->site[$key]))
! if (!(filemtime($GLOBALS['document_root'] . '/' . $this->site[$key]['file']) > $this->site[$key]['modtime']))
continue;
else
--- 39,43 ----
foreach ($site_file as $key => $file) {
if (isset($this->site[$key]))
! if (!(fileatime($GLOBALS['document_root'] . '/' . $this->site[$key]['file']) > $this->site[$key]['modtime']))
continue;
else
***************
*** 56,60 ****
$csite['root'] = $site->root;
$csite['file'] = $file;
! $csite['modtime'] = filemtime($GLOBALS['document_root'] . '/' . $file);
$csite['pageid'] = array();
--- 55,59 ----
$csite['root'] = $site->root;
$csite['file'] = $file;
! $csite['modtime'] = fileatime($GLOBALS['document_root'] . '/' . $file);
$csite['pageid'] = array();
Index: class.Site.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Site.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** class.Site.php 30 Apr 2002 23:58:18 -0000 1.5
--- class.Site.php 14 May 2002 16:16:00 -0000 1.6
***************
*** 58,61 ****
--- 58,62 ----
*/
+ /*
function getPageNode($file) {
$dirname = dirname($this->filename);
***************
*** 77,80 ****
--- 78,82 ----
}
}
+ */
function getPageLastNext($file) {
***************
*** 198,202 ****
$url = $this->xmltree->getAttribute($this->id[$id], 'url');
if (!isset($url)) $url = $this->xmltree->getAttribute($this->id[$id], 'file');
! if (!isset($url)) return;
if (!strstr($url, ':'))
$url = relToAbs($url, dirname($this->filename));
--- 200,204 ----
$url = $this->xmltree->getAttribute($this->id[$id], 'url');
if (!isset($url)) $url = $this->xmltree->getAttribute($this->id[$id], 'file');
! if (!isset($url)) continue;
if (!strstr($url, ':'))
$url = relToAbs($url, dirname($this->filename));
|
|
From: Andrej B. <an...@us...> - 2002-05-02 17:13:51
|
Update of /cvsroot/nextcms/nextcms
In directory usw-pr-cvs1:/tmp/cvs-serv23512
Modified Files:
class.Log.php processor.conf.php-dist
Log Message:
experimental logfile compression
Index: class.Log.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Log.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** class.Log.php 5 Apr 2002 14:45:09 -0000 1.4
--- class.Log.php 2 May 2002 17:13:47 -0000 1.5
***************
*** 36,39 ****
--- 36,59 ----
fclose($f);
+
+ if (isset($GLOBALS['LOG_MAX_SIZE'])) {
+ if (filesize($log_filename) > ($GLOBALS['LOG_MAX_SIZE'] << 10)) {
+ if (isset($GLOBALS['LOG_COMPRESSION_COMMAND'])) {
+ if (isset($GLOBALS['LOG_COMPRESSION_EXTENSION']))
+ $ext = $GLOBALS['LOG_COMPRESSION_EXTENSION']; else $ext = '';
+
+ $testname = $log_filename . '.' . date('Ymd');
+
+ $outfile = $testname . $ext;
+ for ($i=1;file_exists($outfile);$i++)
+ $outfile = $testname . '.' . $i . $ext;
+
+ $trans = array('{infile}' => $log_filename, '{outfile}' => $outfile);
+ $cmd = strtr($GLOBALS['LOG_COMPRESSION_COMMAND'], $trans);
+ exec($cmd);
+ }
+ unlink($log_filename);
+ }
+ }
}
}
Index: processor.conf.php-dist
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.conf.php-dist,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** processor.conf.php-dist 30 Apr 2002 23:58:18 -0000 1.6
--- processor.conf.php-dist 2 May 2002 17:13:47 -0000 1.7
***************
*** 18,21 ****
--- 18,28 ----
$LOG_FILE = $LOG_DIR . '/site.log';
+ // maximum log file size in kbyte
+ // $LOG_MAX_SIZE = 1000;
+
+ // command which is called when log size limit is reached
+ // $LOG_COMPRESSION_COMMAND = "gzip -c {infile} > {outfile}";
+ // $LOG_COMPRESSION_EXTENSION = ".gz";
+
// if $CACHE_DIR is set caching is enabled
// remember to set write permissions
|
|
From: Andrej B. <an...@us...> - 2002-04-30 23:58:21
|
Update of /cvsroot/nextcms/nextcms
In directory usw-pr-cvs1:/tmp/cvs-serv24337
Modified Files:
class.Cache.php class.Content.php class.Page.php
class.Site.php class.Template.php processor.conf.php-dist
processor.php utils.php xml.php
Added Files:
.htaccess class.Mapper.php
Log Message:
* add a mapper class
* some bugs fixed
* some minor code changes
* warning: previous extension may not compatible with this version
--- NEW FILE: .htaccess ---
Deny from all
<Files ~ "^\processor.php">
Allow from all
</Files>
--- NEW FILE: class.Mapper.php ---
<?php
define('MAPPER_VERSION', 1);
include_once('xml.php');
include_once('class.Site.php');
class Mapper {
var $site;
var $virtual_url;
var $version = MAPPER_VERSION;
function Mapper($disable_cache = false) {
disableLoadedFiles();
$site_file = $GLOBALS['SITE_FILES'];
if (!$disable_cache)
$cached = $this->readCache();
else
$cached = false;
if ($this->version != MAPPER_VERSION) {
$this = new Mapper(true);
return;
}
if (!$cached) {
$this->site = array();
$this->virtual_url = array();
} else foreach ($this->site as $siteid => $site) {
if (!isset($site_file[$siteid])) {
unset($this->site[$siteid]);
$this->mapping_is_modified = true;
}
}
if (!isset($this->mapping_is_modified))
$this->mapping_is_modified = false;
foreach ($site_file as $key => $file) {
if (isset($this->site[$key]))
if (!(filemtime($GLOBALS['document_root'] . '/' . $this->site[$key]['file']) > $this->site[$key]['modtime']))
continue;
else
foreach ($this->virtual_url as $vurl => $pageid) {
list($siteid) = explode(':', $pageid);
if ($siteid === $key)
unset($this->virtual_url[$vurl]);
}
$this->mapping_is_modified = true;
$site = new Site($file);
$csite['root'] = $site->root;
$csite['file'] = $file;
$csite['modtime'] = filemtime($GLOBALS['document_root'] . '/' . $file);
$csite['pageid'] = array();
$csite['pageid'] = $site->getIDUrlList();
$virtual_url = $site->getVirtualUrlIDList();
foreach ($virtual_url as $vurl => $id) {
$this->virtual_url[$vurl] = $key . ':' . $id;
}
unset($site);
$this->site[$key] = $csite;
}
if ($this->mapping_is_modified)
$this->writeCache();
enableLoadedFiles();
}
function getUrlByID($id) {
list($siteid, $pageid) = explode(":", $id);
if (isset($this->site[$siteid]))
return $this->site[$siteid]['pageid'][$pageid];
}
function getUrlByVirtualUrl($virtual_url) {
if (isset($this->virtual_url[$virtual_url])) {
list($siteid, $pageid) = explode(":", $this->virtual_url[$virtual_url]);
return $this->site[$siteid]['pageid'][$pageid];
}
}
function getIDByVirtualUrl($virtual_url) {
if (isset($this->virtual_url[$virtual_url]))
return $this->virtual_url[$virtual_url];
}
function getVirtualUrlByID($id) {
$virtual_url = array_search($id, $this->virtual_url);
if ($virtual_url !== false)
return $virtual_url;
}
function writeCache() {
if (isset($GLOBALS['CACHE_DIR'])) {
unset($this->mapping_is_modified);
$cache_dir = $GLOBALS['document_root'] . $GLOBALS['CACHE_DIR'];
$cache_filename = $GLOBALS['CACHE_DIR'] . "/" . 'mappercache';
$check_mod_files = $GLOBALS['SITE_FILES'];
if (!file_exists($cache_dir))
if (!mkdir($cache_dir, 0777))
printError("Das Cacheverzeichnis $cache_dir existiert nicht und es konnte auch nicht angelegt werden.");
$cachefile = fopen($GLOBALS['document_root'] . $cache_filename, "w");
if (!$cachefile) return;
if (!flock($cachefile, LOCK_EX)) return;
fwrite($cachefile,serialize($this));
fclose($cachefile);
}
}
function readCache() {
if (isset($GLOBALS['CACHE_DIR'])) {
$cache_dir = $GLOBALS['document_root'] . $GLOBALS['CACHE_DIR'];
$cache_filename = $cache_dir . "/" . 'mappercache';
if (!file_exists($cache_filename))
return false;
$cachefile = fopen($cache_filename, "r");
if (!$cachefile) return false;
$contents = fread ($cachefile, filesize ($cache_filename));
fclose($cachefile);
$this = unserialize($contents);
} else return false;
return true;
}
}
?>
Index: class.Cache.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Cache.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** class.Cache.php 5 Apr 2002 14:45:09 -0000 1.2
--- class.Cache.php 30 Apr 2002 23:58:18 -0000 1.3
***************
*** 44,48 ****
function show() {
! //header ("Last-Modified: " . gmdate ("D, d M Y H:i:s", $this->filemtime) . " GMT");
print $this->cache_data;
}
--- 44,51 ----
function show() {
! global $SEND_LAST_MODIFIED_HEADER;
! if ($SEND_LAST_MODIFIED_HEADER)
! header ("Last-Modified: " . gmdate ("D, d M Y H:i:s", $this->filemtime) . " GMT");
!
print $this->cache_data;
}
Index: class.Content.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Content.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** class.Content.php 19 Mar 2002 17:51:04 -0000 1.1.1.1
--- class.Content.php 30 Apr 2002 23:58:18 -0000 1.2
***************
*** 30,34 ****
function Content($file) {
! $this->document_root = getDocRoot();
$this->filename = $file;
--- 30,34 ----
function Content($file) {
! $this->document_root = $GLOBALS['document_root'];
$this->filename = $file;
***************
*** 40,56 ****
$this->content = loadFile($this->filename);
$this->xmltree->parseXML($this->content, true);
-
- // get the site filename from parsed content file
- $this->site_name = $this->xmltree->getAttribute("/contentpage[1]", "site");
- $this->site_filename = relToAbs($this->xmltree->getAttribute("/contentpage[1]", "sitefile"), dirname($this->filename));
-
- // if we know the site name we can get the site filename
- if (!empty($this->site_name)) {
- $this->site_filename = $GLOBALS["SITE_FILES"][$this->site_name];
- if (!isset($this->site_filename))
- printError("Fehler in '$this->filename'. Es gibt keine Site-Datei, die dem Name '$this->site_name' zugeordnet ist.");
- } else if (empty($this->site_filename)) {
- printError("Die Content-Datei '$this->filename' wurde keiner Site zugeordnet.");
- }
// get the title
--- 40,43 ----
Index: class.Page.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Page.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** class.Page.php 25 Mar 2002 15:57:42 -0000 1.3
--- class.Page.php 30 Apr 2002 23:58:18 -0000 1.4
***************
*** 1,4 ****
--- 1,5 ----
<?php
include_once('xml.php');
+ include_once('class.Mapper.php');
include_once('class.Site.php');
include_once('class.Content.php');
***************
*** 7,10 ****
--- 8,13 ----
class Page {
var $document_root;
+ var $url;
+ var $virtual_url;
var $pagetitle;
***************
*** 18,21 ****
--- 21,25 ----
var $nextpage_path;
+ var $mapper;
var $site;
var $content;
***************
*** 29,51 ****
! function Page($url) {
$this->stack = array();
! $this->document_root = getDocRoot();
// check if we can handle the requested url
! if (!file_exists($this->document_root . $url)) {
//header('HTTP/1.0 404 Not Found'); exit;
! printError("404 '$url' not found");
}
// create a new content object
$this->content = new Content($url);
- if (!file_exists($this->document_root . '/' . $this->content->site_filename))
- printError("Die in '" . $this->content->filename . "' angegebene Site-Datei '" .
- $this->content->site_filename . "' wurde nicht gefunden.");
// create a new site object
! $this->site = new Site($this->content->site_filename);
// get the pagenode of the page we want to create
--- 33,65 ----
! function Page($virtual_url) {
$this->stack = array();
! $this->document_root = $GLOBALS['document_root'];
+ $this->mapper = new Mapper();
+
+ $this->virtual_url = $virtual_url;
+ $url = $this->mapper->getUrlByVirtualUrl($virtual_url);
+
// check if we can handle the requested url
! if (!isset($url)) {
//header('HTTP/1.0 404 Not Found'); exit;
! printError("404 URL '$virtual_url' is not attached to any site on this server.");
! }
!
! list($this->siteid, $this->pageid) = explode(':', $this->mapper->getIDByVirtualUrl($virtual_url));
!
! $this->url = $url;
!
! if (!file_exists($this->document_root . $url)) {
! printError("Die Datei '$url' existiert nicht.");
}
// create a new content object
$this->content = new Content($url);
// create a new site object
! $this->site = new Site($GLOBALS['SITE_FILES'][$this->siteid]);
// get the pagenode of the page we want to create
***************
*** 61,65 ****
$this->nextpage_path = $ret['next'];
! // ident is disabled
$this->identchars = '';
$this->noident = true;
--- 75,79 ----
$this->nextpage_path = $ret['next'];
! // ident support is broken, so it is disabled
$this->identchars = '';
$this->noident = true;
***************
*** 88,92 ****
$keywords = array();
! $keywordlists = array_reverse($this->site->xmltree->getParent($pagenode_path, "/site[1]/pages[1]", "", "keywords"));
foreach($keywordlists as $keywordlist)
--- 102,106 ----
$keywords = array();
! $keywordlists = array_reverse($this->site->xmltree->getParent($pagenode_path, "/site[1]/pages[1]", "page", "keywords"));
foreach($keywordlists as $keywordlist)
***************
*** 100,104 ****
$this->keywords = implode(", ", $keywords);
! $site_pagetree = array_reverse($this->site->xmltree->getParent($pagenode_path, "/site[1]/pages[1]", ""));
$docache = false;
--- 114,118 ----
$this->keywords = implode(", ", $keywords);
! $site_pagetree = array_reverse($this->site->xmltree->getParent($pagenode_path, "/site[1]/pages[1]", "page"));
$docache = false;
***************
*** 106,114 ****
switch ($input_vars['show']) {
case 'printerversion':
! $this->template = $this->site->getTemplate($pagenode_path, "printerversion");
break;
default:
! $this->template = $this->site->getTemplate($pagenode_path);
$docache = true;
break;
--- 120,128 ----
switch ($input_vars['show']) {
case 'printerversion':
! $this->template = $this->getTemplate($pagenode_path, "printerversion");
break;
default:
! $this->template = $this->getTemplate($pagenode_path);
$docache = true;
break;
***************
*** 130,133 ****
--- 144,153 ----
}
+ function &getTemplate($pagenode_path, $template_att = '') {
+ if (empty($template_att))
+ return new Template($this->site->getTemplate($pagenode_path));
+ else
+ return new Template($this->site->getTemplate($pagenode_path, $template_att));
+ }
function getContentCode() {
***************
*** 146,155 ****
function getPageLocationCode() {
// get pagepath code
! $site_pagetree = array_reverse($this->site->xmltree->getParent($this->pagenode_path, "/site[1]/pages[1]", ""));
$prechars = "";
$location = "";
foreach ($site_pagetree as $entry) {
$nodeatt = &$this->site->xmltree->getAttributes($entry);
! $docfile = relToAbs($nodeatt["file"], dirname($this->site->filename));
$docname = $nodeatt["name"];
$location .= $prechars . "<a href=\"$docfile\" class=\"location\">$docname</a>";
--- 166,176 ----
function getPageLocationCode() {
// get pagepath code
! $site_pagetree = array_reverse($this->site->xmltree->getParent($this->pagenode_path, "/site[1]/pages[1]", "page"));
$prechars = "";
$location = "";
foreach ($site_pagetree as $entry) {
$nodeatt = &$this->site->xmltree->getAttributes($entry);
! $docfile = $this->site->getVirtualUrlByPath($entry);
!
$docname = $nodeatt["name"];
$location .= $prechars . "<a href=\"$docfile\" class=\"location\">$docname</a>";
***************
*** 216,220 ****
case "this_url":
! return $this->content->filename;
break;
--- 237,241 ----
case "this_url":
! return $this->site->getVirtualUrlByID($this->pageid);
break;
***************
*** 236,239 ****
--- 257,263 ----
}
+ if (isset($GLOBALS['input_vars'][$field_name]))
+ return $GLOBALS['input_vars'][$field_name];
+
return '{' . "$field_name" . '}';
}
***************
*** 309,314 ****
if ($id == 'self')
! $refurl = $this->content->filename;
else
$refurl = $this->site->getUrlByID($id);
if (empty($refurl))
--- 333,340 ----
if ($id == 'self')
! $refurl = $this->site->getVirtualUrlByID($this->pageid);
else
+ $refurl = $this->site->getVirtualUrlByID($id);
+ if (empty($refurl))
$refurl = $this->site->getUrlByID($id);
if (empty($refurl))
***************
*** 339,348 ****
foreach ($node['attributes'] as $key => $value) $startcode .= " " . $key . '="' . $value . '"';
$startcode .= ">";
! if (!empty($id))
$name = $this->site->getNameByID($id);
! if (empty($name))
! $startcode .= 'link';
! else
! $startcode .= $this->site->getNameByID($id);
$startcode .= "</" . $nodename . ">";
--- 365,375 ----
foreach ($node['attributes'] as $key => $value) $startcode .= " " . $key . '="' . $value . '"';
$startcode .= ">";
! if (!empty($id)) {
$name = $this->site->getNameByID($id);
! if (empty($name))
! $startcode .= 'link';
! else
! $startcode .= $this->site->getNameByID($id);
! }
$startcode .= "</" . $nodename . ">";
***************
*** 356,360 ****
$node['attributes']['border'] = 0;
! $node['attributes']['src'] = $this->site->getUrlByID($node['attributes']['ref']);
unset($node['attributes']['ref']);
}
--- 383,391 ----
$node['attributes']['border'] = 0;
! $refurl = $this->site->getVirtualUrlByID($node['attributes']['ref']);
! if (empty($refurl))
! $refurl = $this->site->getUrlByID($node['attributes']['ref']);
!
! $node['attributes']['src'] = $refurl;
unset($node['attributes']['ref']);
}
***************
*** 577,581 ****
$cache = new Cache();
! $cache->writeFile($this->content->filename, $this->htmlpage, array_unique($GLOBALS['loaded_files']));
}
}
--- 608,612 ----
$cache = new Cache();
! $cache->writeFile($this->virtual_url, $this->htmlpage, array_unique($GLOBALS['loaded_files']));
}
}
***************
*** 589,593 ****
function show() {
! print($this->htmlpage);
}
}
--- 620,629 ----
function show() {
! if (!isset($this->send_as_mail))
! print($this->htmlpage);
! else {
! mail($this->send_as_mail['email'], $this->send_as_mail['subject'], $this->htmlpage);
! print("E-Mail an " . $this->send_as_mail['email'] . " versand.");
! }
}
}
Index: class.Site.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Site.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** class.Site.php 5 Apr 2002 14:45:09 -0000 1.4
--- class.Site.php 30 Apr 2002 23:58:18 -0000 1.5
***************
*** 8,11 ****
--- 8,15 ----
var $root;
var $id;
+ var $url;
+ var $virtual_url;
+
+ var $no_id_counter;
var $template_files;
***************
*** 20,25 ****
function Site($file) {
! $this->document_root = $GLOBALS['document_root'];
!
// is there such a site file ?
$this->filename = $file;
--- 24,29 ----
function Site($file) {
! $this->no_id_counter = 0;
!
// is there such a site file ?
$this->filename = $file;
***************
*** 35,38 ****
--- 39,44 ----
if (!isset($this->root))
$this->root = dirname($this->filename);
+ if ($this->root == '/')
+ $this->root = '';
$this->title = $this->xmltree->getAttribute('/site[1]', 'title');
***************
*** 40,46 ****
$this->title = "";
- // get some data from template section of the site file
- $this->setTemplates();
-
$this->setIDs();
}
--- 46,49 ----
***************
*** 110,113 ****
--- 113,118 ----
function setTemplates() {
+ $this->template_files = array();
+ $this->template_nodes = array();
$templates = $this->xmltree->getNode("/site[1]/templates[1]", false, "template");
foreach($templates as $template) {
***************
*** 131,134 ****
--- 136,142 ----
function getTemplate($nodepath, $template_att = "file") {
+ if (!isset($this->template_files) || !isset($this->template_nodes))
+ $this->setTemplates();
+
$template_id = $this->xmltree->getAttribute($nodepath, 'template');
***************
*** 157,161 ****
$template_file_path = relToAbs($template_file, dirname($this->filename));
! return new Template($template_file_path);
}
--- 165,169 ----
$template_file_path = relToAbs($template_file, dirname($this->filename));
! return $template_file_path;
}
***************
*** 167,188 ****
function setIDs() {
! $nodepath = array_merge($this->xmltree->getNode("/site[1]/resources[1]", true, 'resource', 'id'),
! $this->xmltree->getNode('/site[1]/pages[1]', true, 'page', 'id'));
! foreach ($nodepath as $path) {
! $id = $this->xmltree->getAttribute($path, 'id');
! $this->id[$id] = $path;
}
}
!
function getUrlByID($id) {
! if (isset($this->id[$id])) {
! $url = $this->xmltree->getAttribute($this->id[$id], 'url');
! if (!isset($url)) $url = $this->xmltree->getAttribute($this->id[$id], 'file');
! if (!isset($url)) return;
! if (strstr($url, ':'))
! return $url;
! else
! return relToAbs($url, dirname($this->filename));
! }
}
--- 175,241 ----
function setIDs() {
! $this->id = array();
! $this->virtual_url = array();
! // $nodepath = array_merge($this->xmltree->getNode("/site[1]/resources[1]", true, 'resource'),
! // $this->xmltree->getNode('/site[1]/pages[1]', true, 'page'));
! for ($i=0;$i<2;$i++) {
! if ($i == 0) $nodepath = $this->xmltree->getNode('/site[1]/resources[1]', true, 'resource');
! if ($i == 1) $nodepath = $this->xmltree->getNode('/site[1]/pages[1]', true, 'page');
!
! foreach ($nodepath as $path) {
! $id = $this->xmltree->getAttribute($path, 'id');
!
! if (empty($id)) {
! $id = '_ID' . $this->no_id_counter;
! $this->no_id_counter++;
! // $this->xmltree->setAttribute($path, 'id', $id);
! }
!
! if (isset($this->id[$id])) continue;
!
! $this->id[$id] = $path;
!
! $url = $this->xmltree->getAttribute($this->id[$id], 'url');
! if (!isset($url)) $url = $this->xmltree->getAttribute($this->id[$id], 'file');
! if (!isset($url)) return;
! if (!strstr($url, ':'))
! $url = relToAbs($url, dirname($this->filename));
!
! $this->url[$id] = $url;
!
!
! $as = $this->xmltree->getAttribute($path, 'as');
! if ($i==1) {
! if (isset($as))
! $this->virtual_url[$this->generateVirtualUrl($as)] = $id;
! else
! $this->virtual_url[$url] = $id;
! }
!
! }
}
}
!
! function generateVirtualUrl($param) {
! return relToAbs($param, $this->root);
! }
!
function getUrlByID($id) {
! if (isset($this->url[$id]))
! return $this->url[$id];
! }
!
! function getVirtualUrlByID($id) {
! $vurl = array_search($id, $this->virtual_url);
! if ($vurl !== false)
! return $vurl;
! }
!
! function getVirtualUrlByPath($path) {
! // $id = $this->xmltree->getAttribute($path, 'id');
! $id = array_search($path, $this->id);
! $vurl = array_search($id, $this->virtual_url);
! if ($vurl !== false)
! return $vurl;
}
***************
*** 196,199 ****
--- 249,265 ----
return $this->id[$id];
}
+
+ function &getIDUrlList() {
+ $id = array();
+ foreach ($this->id as $key => $value) {
+ $id[$key] = $this->getUrlByID($key);
+ }
+
+ return $id;
+ }
+
+ function &getVirtualUrlIDList() {
+ return $this->virtual_url;
+ }
}
?>
Index: class.Template.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Template.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** class.Template.php 19 Mar 2002 17:51:06 -0000 1.1.1.1
--- class.Template.php 30 Apr 2002 23:58:18 -0000 1.2
***************
*** 1,7 ****
<?php
- /**
- * some parts of this class are based on TemplatePower
- *
- */
class Template {
var $filename;
--- 1,3 ----
***************
*** 13,25 ****
function Template($file) {
! if (isset($GLOBALS['NOIDENT']))
! $this->noident = $GLOBALS['NOIDENT'];
! else
! $this->noident = false;
!
!
$this->template = array();
! $this->document_root = getDocRoot();
$this->filename = $file;
--- 9,18 ----
function Template($file) {
! // ident support is broken so it's disabled
! $this->noident = true;
!
$this->template = array();
! $this->document_root = $GLOBALS['document_root'];
$this->filename = $file;
Index: processor.conf.php-dist
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.conf.php-dist,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** processor.conf.php-dist 5 Apr 2002 14:51:42 -0000 1.5
--- processor.conf.php-dist 30 Apr 2002 23:58:18 -0000 1.6
***************
*** 1,12 ****
<?php
! $PARSER_DIR = '/nextCMS';
! $EXTENSION_DIR = $PARSER_DIR . "/extensions";
// if $LOG_FILE is set logging is enabled
! $LOG_DIR = $PARSER_DIR . '/logs';
$LOG_FILE = $LOG_DIR . '/site.log';
// if $CACHE_DIR is set caching is enabled
! $CACHE_DIR = $PARSER_DIR . '/cache';
// each site should be registered here
--- 1,24 ----
<?php
! // The document_root can be detected automaticly.
! // If you exprience problems with the automatic detection
! // or for speed reasons you can setup the document root
! // manually.
!
! // $document_root = '/usr/local/httpd/htdocs';
!
! // The install path of nextcms.
! $INSTALL_DIR = '/nextcms';
!
! // The path in which the extensions are in.
! $EXTENSION_DIR = $INSTALL_DIR . "/extensions";
// if $LOG_FILE is set logging is enabled
! // remember to set write permissions
! $LOG_DIR = $INSTALL_DIR . '/logs';
$LOG_FILE = $LOG_DIR . '/site.log';
// if $CACHE_DIR is set caching is enabled
! // remember to set write permissions
! $CACHE_DIR = $INSTALL_DIR . '/cache';
// each site should be registered here
***************
*** 25,31 ****
// should host names be resolved
$RESOLVE_HOST_NAMES = true;
- // the document_root can be detected automaticly
- // should only be used for speed reasons
- // $document_root = '/usr/local/httpd/htdocs';
?>
--- 37,43 ----
// should host names be resolved
$RESOLVE_HOST_NAMES = true;
+
+ // sending a last modified header can lower your traffic
+ $SEND_LAST_MODIFIED_HEADER = false;
?>
Index: processor.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** processor.php 5 Apr 2002 14:45:09 -0000 1.3
--- processor.php 30 Apr 2002 23:58:18 -0000 1.4
***************
*** 1,18 ****
<?php
- include('processor.conf.php');
-
- //startTimer();
-
ob_start('ob_gzhandler');
if (!isset($document_root)) {
! include('utils.php');
$document_root = getDocRoot();
}
! $input_vars = getGetParams(); if (!isset($input_vars['file'])) die(); else
! $file = $input_vars['file']; if (!isset($input_vars['show']))
! $input_vars['show'] = ""; if (!isset($input_vars['action']))
! $input_vars['action'] = "";
if ($CHECK_IF_CONTENTFILE) checkContent($file);
--- 1,22 ----
<?php
ob_start('ob_gzhandler');
+ if (!include('processor.conf.php')) {
+ include_once('utils.php');
+ printError("Can't find the config file processor.conf.php.");
+ }
+
+ // include_once('utils.php');
+ // startTimer();
+
if (!isset($document_root)) {
! include_once('utils.php');
$document_root = getDocRoot();
}
! $input_vars = getGetParams();
! if (!isset($input_vars['file'])) die(); else $file = $input_vars['file'];
! if (!isset($input_vars['show'])) $input_vars['show'] = "";
! if (!isset($input_vars['action'])) $input_vars['action'] = "";
if ($CHECK_IF_CONTENTFILE) checkContent($file);
***************
*** 20,28 ****
if ($input_vars['action'] == 'edit') {
include_once('utils.php');
! include('class.Admin.php');
! $admin = new Admin($file);
} else {
include('class.Cache.php');
$cache = new Cache($file);
if ($cache->is_cached && empty($input_vars['show'])) {
--- 24,34 ----
if ($input_vars['action'] == 'edit') {
include_once('utils.php');
! // include('class.Admin.php');
! // $admin = new Admin($file);
} else {
include('class.Cache.php');
$cache = new Cache($file);
+
+ //$cache->is_cached = false;
if ($cache->is_cached && empty($input_vars['show'])) {
***************
*** 35,44 ****
}
! include('class.Log.php');
! $log = new Log($file);
}
! //stopTimer();
! //print "<br>\n<div align=\"center\"><b>created in: $totaltime sec</b></div>";
function getGetParams() {
--- 41,53 ----
}
! if (isset($GLOBALS['LOG_FILE'])) {
! include('class.Log.php');
! $log = new Log($file);
! }
}
! // stopTimer();
! if (isset($totaltime))
! print "<br>\n<div align=\"center\"><b>created in: $totaltime sec</b></div>";
function getGetParams() {
***************
*** 54,93 ****
}
function checkContent($file) {
include_once('utils.php');
$code = loadFile($file);
// could be unsafe (just for testing)
if (strpos($code, "<contentpage") === false) {
! print($code);
! exit();
}
! }
!
! function printError($errormsg) {
! print "<html><title>Parse Error</title><body>\n";
! print "<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" bgcolor=\"#f8ecc4\">\n";
! print "<tr><td>";
! print "<font size=\"4\">" . $errormsg . "</font>";
! print "</td></tr>";
! print "</table>\n";
! print "\n</body></html>";
! exit();
! }
!
! // activate this if you want
! /*
! function startTimer() {
! global $starttime;
! $mtime = explode(" ",microtime());
! $starttime = $mtime[1] + $mtime[0];
! }
!
! function stopTimer() {
! global $totaltime, $starttime;
! $mtime = explode(" ",microtime());
! $endtime = $mtime[1] + $mtime[0];
! $totaltime = round($endtime - $starttime,5);
! }
! */
?>
--- 63,80 ----
}
+ /**
+ * check whether the reqested file is a html file
+ */
function checkContent($file) {
+ global $document_root;
include_once('utils.php');
+
+ if (!file_exists($document_root . $file)) return;
$code = loadFile($file);
// could be unsafe (just for testing)
if (strpos($code, "<contentpage") === false) {
! die($code);
}
! }
?>
Index: utils.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/utils.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** utils.php 5 Apr 2002 14:45:09 -0000 1.3
--- utils.php 30 Apr 2002 23:58:18 -0000 1.4
***************
*** 119,126 ****
*/
function loadFile($filename, $in_lines = false) {
! global $loaded_files, $document_root;
$file = $document_root . $filename;
- if (!isset($loaded_files))
- $loaded_files = array();
if (!file_exists($file)) printError("Die Datei '$file' kann nicht gefunden werden.");
if (!is_readable($file)) printError("Es fehlen die Rechte zum Zugriff auf die Datei '$file'.");
--- 119,124 ----
*/
function loadFile($filename, $in_lines = false) {
! global $loaded_files, $loaded_files_enabled, $document_root;
$file = $document_root . $filename;
if (!file_exists($file)) printError("Die Datei '$file' kann nicht gefunden werden.");
if (!is_readable($file)) printError("Es fehlen die Rechte zum Zugriff auf die Datei '$file'.");
***************
*** 135,143 ****
}
! array_push($loaded_files,$filename);
return $file_contents;
}
! $document_root = getDocRoot();
?>
--- 133,172 ----
}
! if ($loaded_files_enabled) array_push($loaded_files,$filename);
return $file_contents;
}
+
+ function printError($errormsg) {
+ print "<html><head><meta name=\"ROBOTS\" content=\"NOINDEX, NOFOLLOW\" /><title>Process Error</title></head>\n";
+ print "<body bgcolor=\"#EEEEEE\">\n";
+ print "<table border=\"0\" cellpadding=\"5\" cellspacing=\"1\" bgcolor=\"#000000\" align=\"center\" width=\"600\">\n";
+ print "<tr bgcolor=\"#f8ecc4\"><td>\n";
+ print "<h2>Error:</h2>\n";
+ print "<font size=\"4\">" . $errormsg . "</font>";
+ print "</td></tr>\n";
+ print "</table>\n";
+ print "\n</body></html>";
+ exit();
+ }
!
! if (!function_exists('array_search')) {
! function array_search($str, $vars) {
! foreach ($vars as $key => $val) {
! if ($val == $str)
! return $key;
! }
! return false;
! }
! }
!
! function enableLoadedFiles() {$GLOBALS['loaded_files_enabled'] = true;}
! function disableLoadedFiles() {$GLOBALS['loaded_files_enabled'] = false;}
!
! $GLOBALS['loaded_files'] = array();
! $GLOBALS['loaded_files_enabled'] = true;
!
! if (!isset($GLOBALS['document_root']))
! $document_root = getDocRoot();
?>
Index: xml.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/xml.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** xml.php 19 Mar 2002 17:51:06 -0000 1.1.1.1
--- xml.php 30 Apr 2002 23:58:18 -0000 1.2
***************
*** 91,94 ****
--- 91,99 ----
}
+ function setAttribute($path, $name, $value) {
+ if (isset($this->nodes[$path]['attributes'][$name]))
+ $this->nodes[$path]['attributes'][$name] = $value;
+ }
+
function getAttributes($path) {
if (isset($this->nodes[$path]))
|
|
From: Andrej B. <an...@us...> - 2002-04-30 23:58:21
|
Update of /cvsroot/nextcms/nextcms/extensions
In directory usw-pr-cvs1:/tmp/cvs-serv24337/extensions
Modified Files:
hmenu.php index.php sitemap.php vmenu.php
Log Message:
* add a mapper class
* some bugs fixed
* some minor code changes
* warning: previous extension may not compatible with this version
Index: hmenu.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/extensions/hmenu.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** hmenu.php 19 Mar 2002 17:51:06 -0000 1.1.1.1
--- hmenu.php 30 Apr 2002 23:58:18 -0000 1.2
***************
*** 5,9 ****
$site_xmltree = &$this->page->site->xmltree;
$name = $site_xmltree->getAttribute($path, 'name');
! $file = relToAbs($site_xmltree->getAttribute($path, 'file'), dirname($this->page->site->filename));
if ($active)
--- 5,9 ----
$site_xmltree = &$this->page->site->xmltree;
$name = $site_xmltree->getAttribute($path, 'name');
! $file = $this->page->site->getVirtualUrlByPath($path);
if ($active)
***************
*** 17,21 ****
function getCode() {
$site_xmltree = &$this->page->site->xmltree;
! $menuentries = $site_xmltree->getNode("/site[1]/pages[1]/page[1]", false);
$menulinkcode = array();
$one_was_active = false;
--- 17,21 ----
function getCode() {
$site_xmltree = &$this->page->site->xmltree;
! $menuentries = $site_xmltree->getNode("/site[1]/pages[1]/page[1]", false, 'page');
$menulinkcode = array();
$one_was_active = false;
Index: index.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/extensions/index.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** index.php 25 Mar 2002 15:57:42 -0000 1.1
--- index.php 30 Apr 2002 23:58:18 -0000 1.2
***************
*** 5,9 ****
$site_xmltree = &$this->page->site->xmltree;
$name = $site_xmltree->getAttribute($path, 'name');
! $file = relToAbs($site_xmltree->getAttribute($path, 'file'), dirname($this->page->site->filename));
return "<a href=\"$file\">$name</a>";
--- 5,9 ----
$site_xmltree = &$this->page->site->xmltree;
$name = $site_xmltree->getAttribute($path, 'name');
! $file = $this->page->site->getVirtualUrlByPath($path);
return "<a href=\"$file\">$name</a>";
Index: sitemap.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/extensions/sitemap.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** sitemap.php 25 Mar 2002 15:57:42 -0000 1.1
--- sitemap.php 30 Apr 2002 23:58:18 -0000 1.2
***************
*** 7,11 ****
$id = $site_xmltree->getAttribute($path, 'id');
! $file = relToAbs($site_xmltree->getAttribute($path, 'file'), dirname($this->page->site->filename));
$css_class = "sitemap_link";
--- 7,11 ----
$id = $site_xmltree->getAttribute($path, 'id');
! $file = $this->page->site->getVirtualUrlByPath($path);
$css_class = "sitemap_link";
***************
*** 19,23 ****
$site_xmltree = &$this->page->site->xmltree;
$basepath = "/site[1]/pages[1]/page[1]";
! $menuentries = $site_xmltree->getNode($basepath, true);
$this->basedepth = $site_xmltree->getDepth($basepath) + 1;
--- 19,23 ----
$site_xmltree = &$this->page->site->xmltree;
$basepath = "/site[1]/pages[1]/page[1]";
! $menuentries = $site_xmltree->getNode($basepath, true, "page");
$this->basedepth = $site_xmltree->getDepth($basepath) + 1;
Index: vmenu.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/extensions/vmenu.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** vmenu.php 25 Mar 2002 15:57:42 -0000 1.2
--- vmenu.php 30 Apr 2002 23:58:18 -0000 1.3
***************
*** 5,9 ****
$site_xmltree = &$this->page->site->xmltree;
$name = $site_xmltree->getAttribute($path, 'name');
! $file = relToAbs($site_xmltree->getAttribute($path, 'file'), dirname($this->page->site->filename));
if ($active)
--- 5,9 ----
$site_xmltree = &$this->page->site->xmltree;
$name = $site_xmltree->getAttribute($path, 'name');
! $file = $this->page->site->getVirtualUrlByPath($path);
if ($active)
***************
*** 17,21 ****
function getCode() {
$site_xmltree = &$this->page->site->xmltree;
! $menuentries = $site_xmltree->getNode("/site[1]/pages[1]/page[1]", false);
$menulinkcode = array();
$one_was_active = false;
--- 17,21 ----
function getCode() {
$site_xmltree = &$this->page->site->xmltree;
! $menuentries = $site_xmltree->getNode("/site[1]/pages[1]/page[1]", false, "page");
$menulinkcode = array();
$one_was_active = false;
|
|
From: Andrej B. <an...@us...> - 2002-04-05 15:29:57
|
Update of /cvsroot/nextcms/nextcms
In directory usw-pr-cvs1:/tmp/cvs-serv16556
Modified Files:
class.Cache.php class.Log.php class.Site.php
processor.conf.php-dist processor.php utils.php
Log Message:
made ready for the first release
Index: class.Cache.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Cache.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** class.Cache.php 19 Mar 2002 17:51:04 -0000 1.1.1.1
--- class.Cache.php 5 Apr 2002 14:45:09 -0000 1.2
***************
*** 50,55 ****
function writeFile($file, $data, $check_mod_files) {
if (isset($GLOBALS['CACHE_DIR'])) {
$cache_filename = $GLOBALS['CACHE_DIR'] . "/" . md5($file);
! $cachefile = fopen(getDocRoot() . $cache_filename, "w");
if (!$cachefile) return;
if (!flock($cachefile, LOCK_EX)) return;
--- 50,62 ----
function writeFile($file, $data, $check_mod_files) {
if (isset($GLOBALS['CACHE_DIR'])) {
+ $cache_dir = $GLOBALS['document_root'] . $GLOBALS['CACHE_DIR'];
+
+ if (!file_exists($cache_dir))
+ if (!mkdir($cache_dir, 0777))
+ printError("Das Cacheverzeichnis $cache_dir existiert nicht und es konnte auch nicht angelegt werden.");
+
$cache_filename = $GLOBALS['CACHE_DIR'] . "/" . md5($file);
!
! $cachefile = fopen($GLOBALS['document_root'] . $cache_filename, "w");
if (!$cachefile) return;
if (!flock($cachefile, LOCK_EX)) return;
Index: class.Log.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Log.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** class.Log.php 25 Mar 2002 14:34:23 -0000 1.3
--- class.Log.php 5 Apr 2002 14:45:09 -0000 1.4
***************
*** 5,8 ****
--- 5,17 ----
if (!empty($GLOBALS["LOG_FILE"])) {
+ $logdir = dirname($log_filename);
+
+ if (!file_exists($logdir))
+ if (!mkdir($logdir, 0777))
+ printError("Das Logfile Verzeichnis '" . dirname($GLOBALS['LOG_FILE']) . "' existiert nicht und es konnte auch nicht angelegt werden");
+
+ if (!is_writeable($logdir))
+ printError("Es bestehen keine Schreibrechte auf das Cacheverzeichnis '" . dirname($GLOBALS['LOG_FILE']) . "'.");
+
if (file_exists($log_filename)) {
if (!is_writeable($log_filename))
Index: class.Site.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Site.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** class.Site.php 25 Mar 2002 15:57:42 -0000 1.3
--- class.Site.php 5 Apr 2002 14:45:09 -0000 1.4
***************
*** 33,36 ****
--- 33,38 ----
// get siteroot directory
$this->root = $this->xmltree->getAttribute('/site[1]', 'siteroot');
+ if (!isset($this->root))
+ $this->root = dirname($this->filename);
$this->title = $this->xmltree->getAttribute('/site[1]', 'title');
Index: processor.conf.php-dist
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.conf.php-dist,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** processor.conf.php-dist 25 Mar 2002 10:21:56 -0000 1.3
--- processor.conf.php-dist 5 Apr 2002 14:45:09 -0000 1.4
***************
*** 11,15 ****
// each site should be registered here
! $SITE_FILES = Array('sitename_site' => '/sitename/sitename.site.xml');
// each extension should be registered here
--- 11,15 ----
// each site should be registered here
! $SITE_FILES = Array('demo_site' => '/demo/demo.site.xml');
// each extension should be registered here
Index: processor.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** processor.php 19 Mar 2002 19:18:37 -0000 1.2
--- processor.php 5 Apr 2002 14:45:09 -0000 1.3
***************
*** 65,68 ****
--- 65,79 ----
}
+ function printError($errormsg) {
+ print "<html><title>Parse Error</title><body>\n";
+ print "<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" bgcolor=\"#f8ecc4\">\n";
+ print "<tr><td>";
+ print "<font size=\"4\">" . $errormsg . "</font>";
+ print "</td></tr>";
+ print "</table>\n";
+ print "\n</body></html>";
+ exit();
+ }
+
// activate this if you want
/*
Index: utils.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/utils.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** utils.php 25 Mar 2002 15:57:42 -0000 1.2
--- utils.php 5 Apr 2002 14:45:09 -0000 1.3
***************
*** 87,105 ****
return 'cgi';
}
- /**
- * printError() displays the a error message if an error occurs and exits the script
- *
- */
- function printError($errormsg) {
- print "<html><title>Parse Error</title><body>\n";
- print "<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" bgcolor=\"#f8ecc4\">\n";
- print "<tr><td>";
- print "<font size=\"4\">" . $errormsg . "</font>";
- print "</td></tr>";
- print "</table>\n";
- print "\n</body></html>";
- exit();
- }
/**
* relToAbs() turns a relative path into a absolute
--- 87,91 ----
|
|
From: Andrej B. <an...@us...> - 2002-04-05 14:51:51
|
Update of /cvsroot/nextcms/nextcms
In directory usw-pr-cvs1:/tmp/cvs-serv18201
Modified Files:
processor.conf.php-dist
Log Message:
minor bugfix
Index: processor.conf.php-dist
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.conf.php-dist,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** processor.conf.php-dist 5 Apr 2002 14:45:09 -0000 1.4
--- processor.conf.php-dist 5 Apr 2002 14:51:42 -0000 1.5
***************
*** 11,15 ****
// each site should be registered here
! $SITE_FILES = Array('demo_site' => '/demo/demo.site.xml');
// each extension should be registered here
--- 11,15 ----
// each site should be registered here
! $SITE_FILES = Array('demo_site' => '/demosite/demo.site.xml');
// each extension should be registered here
|
|
From: Andrej B. <an...@us...> - 2002-03-25 15:57:46
|
Update of /cvsroot/nextcms/nextcms/extensions
In directory usw-pr-cvs1:/tmp/cvs-serv29990/extensions
Modified Files:
vmenu.php
Added Files:
index.php sitemap.php
Log Message:
added new extensions
added {sitetitle} to templates
minor changes and fixes
--- NEW FILE: index.php ---
<?php
class index extends Extension {
function createLink($path) {
$site_xmltree = &$this->page->site->xmltree;
$name = $site_xmltree->getAttribute($path, 'name');
$file = relToAbs($site_xmltree->getAttribute($path, 'file'), dirname($this->page->site->filename));
return "<a href=\"$file\">$name</a>";
}
function getCode() {
$site_xmltree = &$this->page->site->xmltree;
$menuentries = $site_xmltree->getNode($this->page->pagenode_path, false);
$menulinkcode = array();
$code = "<dl>\n";
foreach ($menuentries as $path) {
$code .= "<dt>" . $this->createLink($path) . "</dt>\n";
$file = relToAbs($site_xmltree->getAttribute($path, 'file'), dirname($this->page->site->filename));
$cfile = new Content($file);
if (!empty($cfile->description))
$code .= "<dt>" . $cfile->description . "</dt>\n";
$code .= "<dt> </dt>";
}
$code .= "</dl>\n";
return $code;
}
}
?>
--- NEW FILE: sitemap.php ---
<?php
class sitemap extends Extension {
function createLink($path) {
$site_xmltree = &$this->page->site->xmltree;
$name = $site_xmltree->getAttribute($path, 'name');
$id = $site_xmltree->getAttribute($path, 'id');
$file = relToAbs($site_xmltree->getAttribute($path, 'file'), dirname($this->page->site->filename));
$css_class = "sitemap_link";
$ident = str_repeat(" ", ($site_xmltree->getDepth($path) - $this->basedepth) * 4);
return "$ident<a class=\"$css_class\" href=\"$file\"><b>$name</b></a>";
}
function getCode() {
$site_xmltree = &$this->page->site->xmltree;
$basepath = "/site[1]/pages[1]/page[1]";
$menuentries = $site_xmltree->getNode($basepath, true);
$this->basedepth = $site_xmltree->getDepth($basepath) + 1;
$menulinkcode = array();
foreach ($menuentries as $entry) {
array_push($menulinkcode, $this->createLink($entry));
}
return implode("<br>\n", $menulinkcode);
}
}
?>
Index: vmenu.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/extensions/vmenu.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** vmenu.php 19 Mar 2002 17:51:06 -0000 1.1.1.1
--- vmenu.php 25 Mar 2002 15:57:42 -0000 1.2
***************
*** 19,23 ****
$menuentries = $site_xmltree->getNode("/site[1]/pages[1]/page[1]", false);
$menulinkcode = array();
!
foreach ($menuentries as $entry) {
--- 19,23 ----
$menuentries = $site_xmltree->getNode("/site[1]/pages[1]/page[1]", false);
$menulinkcode = array();
! $one_was_active = false;
foreach ($menuentries as $entry) {
|
|
From: Andrej B. <an...@us...> - 2002-03-25 15:57:46
|
Update of /cvsroot/nextcms/nextcms
In directory usw-pr-cvs1:/tmp/cvs-serv29990
Modified Files:
class.Page.php class.Site.php utils.php
Log Message:
added new extensions
added {sitetitle} to templates
minor changes and fixes
Index: class.Page.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Page.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** class.Page.php 19 Mar 2002 19:18:37 -0000 1.2
--- class.Page.php 25 Mar 2002 15:57:42 -0000 1.3
***************
*** 173,176 ****
--- 173,180 ----
break;
+ case "sitetitle":
+ return $this->site->title;
+ break;
+
case "title":
return $this->pagetitle;
Index: class.Site.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Site.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** class.Site.php 25 Mar 2002 09:47:32 -0000 1.2
--- class.Site.php 25 Mar 2002 15:57:42 -0000 1.3
***************
*** 11,14 ****
--- 11,15 ----
var $template_files;
var $template_nodes;
+ var $title;
/**
***************
*** 32,35 ****
--- 33,40 ----
// get siteroot directory
$this->root = $this->xmltree->getAttribute('/site[1]', 'siteroot');
+
+ $this->title = $this->xmltree->getAttribute('/site[1]', 'title');
+ if (!isset($this->title))
+ $this->title = "";
// get some data from template section of the site file
Index: utils.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/utils.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** utils.php 19 Mar 2002 17:51:06 -0000 1.1.1.1
--- utils.php 25 Mar 2002 15:57:42 -0000 1.2
***************
*** 17,30 ****
$PATH = getenv('PATH');
! if ( stristr ( $SERVER_SOFTWARE, 'Win' ) )
return 'win';
! if ( stristr ( $SERVER_SOFTWARE, 'Microsoft' ) )
return 'win';
! if ( stristr ( $SERVER_SOFTWARE, 'Unix' ) )
return 'nix';
! if ( stristr ( $PATH, 'C:' ) )
return 'win';
! if ( stristr ( $PATH, '/X11' ) )
return 'nix';
}
--- 17,30 ----
$PATH = getenv('PATH');
! if (stristr($SERVER_SOFTWARE, 'Win'))
return 'win';
! if (stristr ($SERVER_SOFTWARE, 'Microsoft'))
return 'win';
! if (stristr ($SERVER_SOFTWARE, 'Unix'))
return 'nix';
! if (stristr ($PATH, 'C:'))
return 'win';
! if (stristr ($PATH, '/X11'))
return 'nix';
}
***************
*** 90,94 ****
* printError() displays the a error message if an error occurs and exits the script
*
- * @access private
*/
--- 90,93 ----
***************
*** 105,109 ****
/**
* relToAbs() turns a relative path into a absolute
! * exsample: ../index.html to /siteroot/index.html
*
* @param $path is the relative input path
--- 104,108 ----
/**
* relToAbs() turns a relative path into a absolute
! * example: ../index.html to /siteroot/index.html
*
* @param $path is the relative input path
***************
*** 128,133 ****
return $retpath;
}
/**
! * loadFile() returns the contents of a file and displays a error message one occurs
*
*/
--- 127,133 ----
return $retpath;
}
+
/**
! * loadFile() returns the contents of a file and displays a error message if one occurs
*
*/
|
|
From: Andrej B. <an...@us...> - 2002-03-25 14:34:32
|
Update of /cvsroot/nextcms/nextcms
In directory usw-pr-cvs1:/tmp/cvs-serv32651
Modified Files:
class.Log.php
Log Message:
fixed bug in the Log class
Index: class.Log.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Log.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** class.Log.php 25 Mar 2002 10:21:56 -0000 1.2
--- class.Log.php 25 Mar 2002 14:34:23 -0000 1.3
***************
*** 22,26 ****
if (isset($GLOBALS['RESOLVE_HOST_NAMES']))
if ($GLOBALS['RESOLVE_HOST_NAMES'])
! gethostbyaddr($remote_addr);
fputs($f, $remote_addr . " - " . $remote_user . ' ' . date('[d/M/Y:H:i:s O]', time()) . ' "' . getenv('REQUEST_METHOD') . ' ' . getenv('REQUEST_URI') . ' ' . getenv('SERVER_PROTOCOL') . '" '. getenv('REDIRECT_STATUS') . ' ' . '-' . ' "' . $referer . '" "' . getenv('HTTP_USER_AGENT') . '" ' . "\n");
--- 22,26 ----
if (isset($GLOBALS['RESOLVE_HOST_NAMES']))
if ($GLOBALS['RESOLVE_HOST_NAMES'])
! $remote_addr = gethostbyaddr($remote_addr);
fputs($f, $remote_addr . " - " . $remote_user . ' ' . date('[d/M/Y:H:i:s O]', time()) . ' "' . getenv('REQUEST_METHOD') . ' ' . getenv('REQUEST_URI') . ' ' . getenv('SERVER_PROTOCOL') . '" '. getenv('REDIRECT_STATUS') . ' ' . '-' . ' "' . $referer . '" "' . getenv('HTTP_USER_AGENT') . '" ' . "\n");
|
|
From: Andrej B. <an...@us...> - 2002-03-25 10:21:59
|
Update of /cvsroot/nextcms/nextcms
In directory usw-pr-cvs1:/tmp/cvs-serv27877
Modified Files:
class.Log.php processor.conf.php-dist
Log Message:
added new option for processor.conf RESOLVE_HOST_NAMES
Index: class.Log.php
===================================================================
RCS file: /cvsroot/nextcms/nextcms/class.Log.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** class.Log.php 19 Mar 2002 17:51:04 -0000 1.1.1.1
--- class.Log.php 25 Mar 2002 10:21:56 -0000 1.2
***************
*** 18,23 ****
$referer = getenv('HTTP_REFERER');
if (empty($referer)) $referer = '-';
! fputs($f, getenv('REMOTE_ADDR') . " - " . $remote_user . ' ' . date('[d/M/Y:H:i:s O]', time()) . ' "' . getenv('REQUEST_METHOD') . ' ' . getenv('REQUEST_URI') . ' ' . getenv('SERVER_PROTOCOL') . '" '. getenv('REDIRECT_STATUS') . ' ' . '-' . ' "' . $referer . '" "' . getenv('HTTP_USER_AGENT') . '" ' . "\n");
fclose($f);
--- 18,28 ----
$referer = getenv('HTTP_REFERER');
if (empty($referer)) $referer = '-';
+
+ $remote_addr = getenv('REMOTE_ADDR');
+ if (isset($GLOBALS['RESOLVE_HOST_NAMES']))
+ if ($GLOBALS['RESOLVE_HOST_NAMES'])
+ gethostbyaddr($remote_addr);
! fputs($f, $remote_addr . " - " . $remote_user . ' ' . date('[d/M/Y:H:i:s O]', time()) . ' "' . getenv('REQUEST_METHOD') . ' ' . getenv('REQUEST_URI') . ' ' . getenv('SERVER_PROTOCOL') . '" '. getenv('REDIRECT_STATUS') . ' ' . '-' . ' "' . $referer . '" "' . getenv('HTTP_USER_AGENT') . '" ' . "\n");
fclose($f);
Index: processor.conf.php-dist
===================================================================
RCS file: /cvsroot/nextcms/nextcms/processor.conf.php-dist,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** processor.conf.php-dist 19 Mar 2002 19:18:37 -0000 1.2
--- processor.conf.php-dist 25 Mar 2002 10:21:56 -0000 1.3
***************
*** 15,23 ****
// each extension should be registered here
$EXTENSIONS = Array('ExtHMenu' => "$EXTENSION_DIR/hmenu.php",
! 'ExtVMenu' => "$EXTENSION_DIR/vmenu.php");
// check if the requested file is a contentfile and should
// be handled by the cms
$CHECK_IF_CONTENTFILE = true;
// the document_root can be detected automaticly
--- 15,28 ----
// each extension should be registered here
$EXTENSIONS = Array('ExtHMenu' => "$EXTENSION_DIR/hmenu.php",
! 'ExtVMenu' => "$EXTENSION_DIR/vmenu.php",
! 'sitemap' => "$EXTENSION_DIR/sitemap.php",
! 'index' => "$EXTENSION_DIR/index.php");
// check if the requested file is a contentfile and should
// be handled by the cms
$CHECK_IF_CONTENTFILE = true;
+
+ // should host names be resolved
+ $RESOLVE_HOST_NAMES = true;
// the document_root can be detected automaticly
|
|
From: Andrej B. <an...@us...> - 2002-03-25 09:47:36
|
Update of /cvsroot/nextcms/nextcms In directory usw-pr-cvs1:/tmp/cvs-serv29945 Modified Files: class.Site.php Log Message: fixed mailto: bug in resources all urls containing a : will now be handled as absolute urls Index: class.Site.php =================================================================== RCS file: /cvsroot/nextcms/nextcms/class.Site.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** class.Site.php 19 Mar 2002 17:51:05 -0000 1.1.1.1 --- class.Site.php 25 Mar 2002 09:47:32 -0000 1.2 *************** *** 173,177 **** if (!isset($url)) $url = $this->xmltree->getAttribute($this->id[$id], 'file'); if (!isset($url)) return; ! if (strstr($url, '://') || strstr($url, 'javascript:')) return $url; else --- 173,177 ---- if (!isset($url)) $url = $this->xmltree->getAttribute($this->id[$id], 'file'); if (!isset($url)) return; ! if (strstr($url, ':')) return $url; else |