[CS-Project-svn_notify] SF.net SVN: cs-project:[1001] trunk/1.2
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-10-26 14:53:18
|
Revision: 1001 http://cs-project.svn.sourceforge.net/cs-project/?rev=1001&view=rev Author: crazedsanity Date: 2009-10-26 14:53:07 +0000 (Mon, 26 Oct 2009) Log Message: ----------- Version string now pulled from main VERSION file. /includes/content.inc: * Moved creation of $db, connection of database handle, and setting of the "VERSION_STRING" or "cs-version_string" template vars into a shared include file so it reports the proper version string. /includes/help.inc: * same as content.inc * removed some commented-out code. /includes/login.inc: * same as content.inc * remove setting of cs-project_version template var /includes/setup.inc: * set VERSION_STRING using config::get_version(). /includes/shared.inc [NEW]: * create $db var * connect $db * set VERSION_STRING and cs-version_string template vars using projectClass::get_version() instead of reading from main config file. /lib/config.class.php: * __construct(): -- call set_version_file_location() so code calling it's get_version() or get_project() method (from cs_versionAbstract{}) will get the proper strings returned. /lib/mainRecordClass.php: * MAIN::: -- extends cs_versionAbstract * __construct(): -- call set_version_file_location(). Modified Paths: -------------- trunk/1.2/includes/content.inc trunk/1.2/includes/help.inc trunk/1.2/includes/login.inc trunk/1.2/includes/setup.inc trunk/1.2/lib/config.class.php trunk/1.2/lib/mainRecordClass.php Added Paths: ----------- trunk/1.2/includes/shared.inc Modified: trunk/1.2/includes/content.inc =================================================================== --- trunk/1.2/includes/content.inc 2009-10-26 12:29:02 UTC (rev 1000) +++ trunk/1.2/includes/content.inc 2009-10-26 14:53:07 UTC (rev 1001) @@ -9,10 +9,6 @@ */ -$db = new cs_phpDB; -$db->connect(get_config_db_params()); -$page->db = $db; - $page->session = new Session($page->db); //initialize everything we need to display the page & remember stuff in the session. @@ -22,9 +18,7 @@ $page->ftsSections = $sectionArr; -$page->add_template_var('cs-project_version', VERSION_STRING); - //done with redirection. Here's where we define if they have to be logged-in, and then run the fast_templating engine. //TODO: update this to be "cs-content friendly". :) $mustBeLoggedIn = 1; Modified: trunk/1.2/includes/help.inc =================================================================== --- trunk/1.2/includes/help.inc 2009-10-26 12:29:02 UTC (rev 1000) +++ trunk/1.2/includes/help.inc 2009-10-26 14:53:07 UTC (rev 1001) @@ -4,15 +4,6 @@ */ -$page->add_template_var('cs-project_version', VERSION_STRING); - - -$db = new cs_phpDB; -$db->connect(get_config_db_params()); -$page->db = $db; - - -#$titlePart = NULL; $titlePart = "Help"; if(ISDEVSITE) { Modified: trunk/1.2/includes/login.inc =================================================================== --- trunk/1.2/includes/login.inc 2009-10-26 12:29:02 UTC (rev 1000) +++ trunk/1.2/includes/login.inc 2009-10-26 14:53:07 UTC (rev 1001) @@ -11,11 +11,7 @@ $page->clear_content("header"); -$db = new cs_phpDB; -$db->connect(get_config_db_params()); -$page->db = $db; -$page->add_template_var('cs-project_version', VERSION_STRING); $page->add_template_var('MAINTABLE_EXTRA', 'align="center"'); if(isset($_GET['loginDestination']) && strlen($_GET['loginDestination'])) { Modified: trunk/1.2/includes/setup.inc =================================================================== --- trunk/1.2/includes/setup.inc 2009-10-26 12:29:02 UTC (rev 1000) +++ trunk/1.2/includes/setup.inc 2009-10-26 14:53:07 UTC (rev 1001) @@ -71,7 +71,7 @@ } - $page->add_template_var("VERSION_STRING", read_version_file()); + $page->add_template_var("VERSION_STRING", $configObj->get_version()); $page->rip_all_block_rows('stepData'); $page->clear_content('infobar'); Added: trunk/1.2/includes/shared.inc =================================================================== --- trunk/1.2/includes/shared.inc (rev 0) +++ trunk/1.2/includes/shared.inc 2009-10-26 14:53:07 UTC (rev 1001) @@ -0,0 +1,27 @@ +<?php +/* + * Created on Oct 26, 2009 + * + * SVN INFORMATION::: + * ------------------- + * Last Author::::::::: $Author$ + * Current Revision:::: $Revision$ + * Repository Location: $HeadURL$ + * Last Updated:::::::: $Date$ + */ + + +try { + $db = new cs_phpDB; + $db->connect(get_config_db_params()); + $page->db = $db; + + $tProj = new projectClass($db); + $page->add_template_var('cs-project_version', $tProj->get_version()); + $page->add_template_var('VERSION_STRING', $tProj->get_version()); + unset($tProj); +} +catch(exception $e) { + //nothing to see here, move along (probably not setup yet). +} +?> Property changes on: trunk/1.2/includes/shared.inc ___________________________________________________________________ Added: svn:keywords + Author Revision HeadURL Date Modified: trunk/1.2/lib/config.class.php =================================================================== --- trunk/1.2/lib/config.class.php 2009-10-26 12:29:02 UTC (rev 1000) +++ trunk/1.2/lib/config.class.php 2009-10-26 14:53:07 UTC (rev 1001) @@ -20,6 +20,8 @@ $this->gf = new cs_globalFunctions(); $this->fs = new cs_fileSystem(dirname(__FILE__) .'/..'); + $this->set_version_file_location(dirname(__FILE__) .'/../VERSION'); + $this->fileName = dirname(__FILE__) .'/'. CONFIG_FILENAME; if(!is_null($fileName) && strlen($fileName)) { $this->fileName = $fileName; Modified: trunk/1.2/lib/mainRecordClass.php =================================================================== --- trunk/1.2/lib/mainRecordClass.php 2009-10-26 12:29:02 UTC (rev 1000) +++ trunk/1.2/lib/mainRecordClass.php 2009-10-26 14:53:07 UTC (rev 1001) @@ -12,7 +12,7 @@ */ -class mainRecord { +class mainRecord extends cs_versionAbstract { public $db; public $isHelpdeskIssue = FALSE; @@ -31,6 +31,8 @@ //========================================================================= function __construct() { + $this->set_version_file_location(dirname(__FILE__) .'/../VERSION'); + //these are fairly generic, & can be updated easily. $this->updateableFieldsArr = array( 'group_id' => 'numeric', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |