[Nextcms-commits] CVS: nextcms class.Cache.php,1.1.1.1,1.2 class.Log.php,1.3,1.4 class.Site.php,1.3,
Status: Alpha
Brought to you by:
andrejb
|
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 ----
|