[Cs-content-commits] SF.net SVN: cs-content:[482] trunk/1.0
PHP Templating & Includes System
Brought to you by:
crazedsanity
|
From: <cra...@us...> - 2010-08-12 15:06:13
|
Revision: 482
http://cs-content.svn.sourceforge.net/cs-content/?rev=482&view=rev
Author: crazedsanity
Date: 2010-08-12 15:06:07 +0000 (Thu, 12 Aug 2010)
Log Message:
-----------
Fixes to allow cs-content be used for command-line things.
NOTE::: if an error occurs, it still parses an HTML template. It would
probably be better to have a class that extends cs_genericPage, overriding
some of the methods to be more CLI-friendly.
/contentSystem.class.php:
* __construct():
-- ARG CHANGE: NEW ARG: #2 ($section=null)
-- only set section to REQUEST_URI if the passed $section is null
/cs_genericPage.class.php:
* print_page():
-- added a bit of debug info if something goes wrong.
Modified Paths:
--------------
trunk/1.0/contentSystem.class.php
trunk/1.0/cs_genericPage.class.php
Modified: trunk/1.0/contentSystem.class.php
===================================================================
--- trunk/1.0/contentSystem.class.php 2010-07-28 00:49:16 UTC (rev 481)
+++ trunk/1.0/contentSystem.class.php 2010-08-12 15:06:07 UTC (rev 482)
@@ -99,7 +99,7 @@
/**
* The CONSTRUCTOR. Duh.
*/
- public function __construct($siteRoot=null) {
+ public function __construct($siteRoot=null, $section=null) {
parent::__construct();
//setup the section stuff...
@@ -109,8 +109,12 @@
//figure out the section & subsection stuff.
$requestUri = preg_replace('/\/$/', '', $_SERVER['REQUEST_URI']);
$this->fullSectionArr = explode('/', $requestUri); //TODO: will this cope with an APPURL being set?
- $this->section = $this->clean_url($_SERVER['REQUEST_URI']);
+ if(is_null($section)) {
+ $section = @$_SERVER['REQUEST_URI'];
+ }
+ $this->section = $this->clean_url($section);
+
$this->initialize_locals($siteRoot);
}//end __construct()
//------------------------------------------------------------------------
Modified: trunk/1.0/cs_genericPage.class.php
===================================================================
--- trunk/1.0/cs_genericPage.class.php 2010-07-28 00:49:16 UTC (rev 481)
+++ trunk/1.0/cs_genericPage.class.php 2010-08-12 15:06:07 UTC (rev 482)
@@ -277,7 +277,7 @@
if(!strlen($out)) {
$this->gfObj->debug_print($out);
$this->gfObj->debug_print($this->mainTemplate);
- $this->gfObj->debug_print("MANUAL FILE CONTENTS::: ". htmlentities(file_get_contents($this->tmplDir .'/'. $this->mainTemplate)));
+ $this->gfObj->debug_print("MANUAL FILE CONTENTS::: ". htmlentities(file_get_contents($this->mainTemplate)));
exit(__METHOD__ .": mainTemplate (". $this->mainTemplate .") was empty...?");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|