[jasmine-commit] SF.net SVN: newsphp: [125] trunk/jasmine
Brought to you by:
christoph_berg,
red-
|
From: <chr...@us...> - 2007-08-07 15:34:20
|
Revision: 125
http://newsphp.svn.sourceforge.net/newsphp/?rev=125&view=rev
Author: christoph_berg
Date: 2007-08-07 08:34:23 -0700 (Tue, 07 Aug 2007)
Log Message:
-----------
Updated copyright data in all files (hopefully)
Updated a lot of documentation
Renaming of methods in Session class, take 2
Adapted makedoc.sh to use doxygen like configuration variables
Added reference operator to some method parameters
Modified Paths:
--------------
trunk/jasmine/classes/Connection.class.php
trunk/jasmine/classes/ConnectionList.class.php
trunk/jasmine/classes/Core.class.php
trunk/jasmine/classes/Extension.class.php
trunk/jasmine/classes/ExtensionManager.class.php
trunk/jasmine/classes/Logger.class.php
trunk/jasmine/classes/Object.class.php
trunk/jasmine/classes/Session.Class.php
trunk/jasmine/classes/exceptions.class.php
trunk/jasmine/dotests.sh
trunk/jasmine/makedoc.sh
trunk/jasmine/modules/DB/DB.class.php
trunk/jasmine/modules/Settings/Settings.class.php
trunk/jasmine/sql/mysql.sql
Modified: trunk/jasmine/classes/Connection.class.php
===================================================================
--- trunk/jasmine/classes/Connection.class.php 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/classes/Connection.class.php 2007-08-07 15:34:23 UTC (rev 125)
@@ -4,22 +4,23 @@
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
/**
* The Connection Object class
*
- * The Connection class stores the signal of the sender object and a reference
+ * Stores the signal of the sender object and a reference
* to the receiver object and its slot name.
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
+ * @todo Finish documentation
*/
final class Connection
{
Modified: trunk/jasmine/classes/ConnectionList.class.php
===================================================================
--- trunk/jasmine/classes/ConnectionList.class.php 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/classes/ConnectionList.class.php 2007-08-07 15:34:23 UTC (rev 125)
@@ -4,8 +4,8 @@
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
@@ -18,9 +18,10 @@
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
+ * @todo Implement remove function
*/
class ConnectionList
{
@@ -58,22 +59,14 @@
* Adds a new connection to the list
*
* @param string $signal Function name of the signal
- * @param mixed $recipient Reveiving object or class name
+ * @param Object $recipient Reveiving object
* @param string $slot Function name of the slot (function of receiving object)
* @param string $type Specifies, if the connection is direct or checked
* @throws MultipleConnectException if a SigSlot connection should be
* established multiple times
*/
- public function addConnection($signal, &$recipient, $slot, $type)
+ public function addConnection(&$signal, Object &$recipient, &$slot, &$type)
{
- // Check if we got a string as parameter
- if (is_string($recipient))
- {
- // Get a reference to a module instance of the selected class type
- $recipient =& ExtensionManager::getSingleton()
- ->getExtension($recipient, 'Module');
- }
-
// Check if the signal was connected before
foreach($this->Connections as &$Connection)
{
@@ -81,13 +74,16 @@
$Connection->Recipient == $recipient &&
$Connection->Slot == $slot)
{
- throw new MultipleConnectException($this->Owner, $signal, $recipient->toString(), $slot, $type);
+ throw new MultipleConnectException($this->Owner->toString(),
+ $signal,
+ $recipient->toString(),
+ $slot, $type);
return false;
}
}
// Check, if slot is really a function of the reciving Object
- $reflector =& new ReflectionClass($recipient);
+ $reflector = new ReflectionClass($recipient);
if (!($reflector->hasMethod($slot)))
{
@@ -96,7 +92,7 @@
}
// Create the new connection
- $this->Connections[] =& new Connection($signal, $recipient, $slot, $type);
+ $this->Connections[] = new Connection($signal, $recipient, $slot, $type);
return true;
}
Modified: trunk/jasmine/classes/Core.class.php
===================================================================
--- trunk/jasmine/classes/Core.class.php 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/classes/Core.class.php 2007-08-07 15:34:23 UTC (rev 125)
@@ -4,7 +4,7 @@
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
+ * @copyright (c) 2005-2007 PHPNews Team
* @version 0.1.0
* @package Jasmine
*/
@@ -23,7 +23,7 @@
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
+ * @copyright (c) 2005-2007 PHPNews Team
* @version 0.1.0
* @package Jasmine
*/
@@ -46,7 +46,7 @@
* @var User
*/
private $User = NULL;
-
+
/**
* Used theme
* @var string
@@ -66,10 +66,18 @@
parent::__construct();
// Register extension Jasmine's default extension types
- ExtensionManager::getSingleton()->addType('Module');
- ExtensionManager::getSingleton()->addType('TemplateSet');
- //ExtensionManager::getSingleton()->addType('Style');
- //ExtensionManager::getSingleton()->addType('Theme');
+ try
+ {
+ ExtensionManager::getSingleton()->addType('Module');
+ ExtensionManager::getSingleton()->addType('TemplateSet');
+ //ExtensionManager::getSingleton()->addType('Style');
+ //ExtensionManager::getSingleton()->addType('Theme');
+ }
+ catch (NoClassFoundException $x)
+ {
+ echo $x->getMessage();
+ exit 1;
+ }
}
/**
@@ -80,7 +88,7 @@
public static function &getSingleton()
{
// Check if an instance exists
- if (!isset(self::$Instance))
+ if (is_null(self::$Instance))
{
require_once('db_config.php');
@@ -94,17 +102,19 @@
//self::$Instance->setTheme();
// Create the connections
- self::$Instance->connect('__construct', 'DB', 'createConnection');
+ self::$Instance->connect('__construct',
+ ExtensionManager::getSingleton()->getExtension('DB', 'Module')
+ , 'createConnection');
// Authentificate the user
self::$Instance->User = new User();
-
+
// Emit the OnCoreCreated signal
self::$Instance->emit('__construct', $config);
// Log successful creation
Logger::getSingleton()->log(Logger::JM_INFORMATION, Logger::JM_CORE,
- 'Core created');
+ 'Core created');
}
return self::$Instance;
@@ -186,23 +196,6 @@
}
/**
- * Checks, if module is a special module
- *
- * This functions checks if the module specified by index
- * is one of the special modules defined for this application
- *
- * @param mixed $index Module name or index
- * @return bool
- */
- private function isSystemModule($index)
- {
- if (in_array($this->Modules[$index]->getName(), $this->SystemModules))
- return true;
-
- return false;
- }
-
- /**
* Sets the default theme used for this Jasmine session
*
* Asks the DB for a key named DefaultTheme. If it does not exist, the
@@ -235,7 +228,7 @@
{
$this->Theme = ExtensionManager::getSingleton()->getExtension('Jasmine, Theme');
}
-
+
// If we can't load the default theme, log it and die
Logger::getSingleton(Logger::JM_ERROR, Logger::JM_CORE,
"Theme {$name} could not be loaded "
@@ -243,7 +236,7 @@
die("Default Theme ${name} could not be loaded. Exiting...");
}
}
-
+
/**
* Enter description here...
*
@@ -253,7 +246,7 @@
public function getNextID($Table, $Column = NULL)
{
$this->db =& ExtensionManager::getSingleton()->getExtension('DB', 'Module');
-
+
if($Column != NULL)
{
$NumRows = $this->db->getRows($this->db->query('SELECT '. $Column .' FROM '. $Table .' ORDER BY '.$Column.' DESC'));
@@ -267,11 +260,11 @@
return $ID;
}
-
+
/**
* Friendly Neighbourhood Refresh Script!
*/
- public function Refresh($Path = NULL)
+ public function Refresh($Path = NULL)
{
if(isset($Path))
{
Modified: trunk/jasmine/classes/Extension.class.php
===================================================================
--- trunk/jasmine/classes/Extension.class.php 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/classes/Extension.class.php 2007-08-07 15:34:23 UTC (rev 125)
@@ -4,27 +4,27 @@
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
require_once('Object.class.php');
/**
- * The Extension Object class
+ * Provides an abstract template on which all extensions are based.
*
- * The Extension class is an abstract class. It declares certain functions,
- * which the user must define, when inheriting from this class, as all
- * modules will do, as defined in Jasmine rules.
- * It also provides helper functions, for example updating the XML file,
- * which the user can rely on in their extensions.
+ * The Extension class declares certain methods shared by all extensions, but
+ * because extensions are more or less different from each other, they
+ * have to be implemented by the extension developer. It also provides helper
+ * methods, which can be used by extension developers in their extensions.
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
+ * @todo Add more helper functions if necessary, refine documentation of abstract methods
*/
abstract class Extension extends Object
{
@@ -49,7 +49,7 @@
/**#@-*/
/**
- * Stores extension descriptions for every language, where a description
+ * Available descriptions for every language, where a description
* is given
* @var array
*/
@@ -62,15 +62,13 @@
protected $Installed = false;
/**
- * Default constructor
+ * Creates an extension object by setting all important information
*
- * Constructs an extension object by setting all important information
- *
- * @param string $name Extension name
- * @param string $version Extension version
- * @param bool $installed Is the extension installed?
- * @param string $description optional Extension description
- * @param string $image optional Extension image
+ * @param string Extension name
+ * @param string Extension version
+ * @param bool Is the extension installed?
+ * @param string optional Extension description
+ * @param string optional Extension image
*/
public function __construct($name, $version, $installed, $description = '', $image = '')
{
@@ -80,13 +78,13 @@
$this->Installed = $installed;
$this->Image = $image;
- // Call the parent constructor
parent::__construct();
}
/**
* Returns the name of the module
- * @return string
+ *
+ * @return string module name
*/
public function getName()
{
@@ -95,7 +93,8 @@
/**
* Returns the version of the module
- * @return string
+ *
+ * @return string module version
*/
public function getVersion()
{
@@ -126,7 +125,8 @@
/**
* Returns the image filename of the module
- * @return string
+ *
+ * @return string module image filename
*/
public function getImage()
{
@@ -135,7 +135,8 @@
/**
* Returns, if the module is installed
- * @return bool
+ *
+ * @return bool true if extension is installed, false otherwise
*/
public function isInstalled()
{
Modified: trunk/jasmine/classes/ExtensionManager.class.php
===================================================================
--- trunk/jasmine/classes/ExtensionManager.class.php 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/classes/ExtensionManager.class.php 2007-08-07 15:34:23 UTC (rev 125)
@@ -4,8 +4,8 @@
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
@@ -13,16 +13,15 @@
require_once('Logger.class.php');
/**
- * The ExtensionManager Object class
+ * Provides all necessary operations for managing extensions in a consistent
+ * way.
*
- * The ExtensionManager provides alle necessary operations for managing
- * extensions in a consistent way.
- *
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
+ * @todo Reenable connection creation, revise helper functions
*/
final class ExtensionManager extends Object
{
@@ -59,7 +58,7 @@
{
// Log successful creation
Logger::getSingleton()->log(Logger::JM_INFORMATION, Logger::JM_CORE,
- 'ExtensionManager created');
+ 'ExtensionManager created');
}
/**
@@ -70,10 +69,9 @@
public static function &getSingleton()
{
// Check if an instance exists
- if (!isset(self::$Instance))
+ if (is_null(self::$Instance))
{
- $c = __CLASS__;
- self::$Instance = new $c;
+ self::$Instance = new ExtensionManager;
}
return self::$Instance;
@@ -89,14 +87,14 @@
public function loadExtensions()
{
Logger::getSingleton()->log(Logger::JM_DEBUG, Logger::JM_EM,
- 'Loading all extensions');
+ 'Loading all extensions');
// Check for extension directories
if (empty($this->Paths))
{
// Log it and just return
Logger::getSingleton()->log(Logger::JM_INFORMATION, Logger::JM_EM,
- 'No extension directories registered');
+ 'No extension directories registered');
return;
}
@@ -118,7 +116,7 @@
$extIter = new DirectoryIterator($dEntry->getPathname());
Logger::getSingleton()->log(Logger::JM_DEBUG, Logger::JM_EM,
- "Searching for XML file in {$extIter->getPath()}");
+ "Searching for XML file in {$extIter->getPath()}");
// Search the subdirectory
foreach ($extIter as $eEntry)
@@ -146,7 +144,7 @@
$this->Factories[$extType]->createFromXml($eEntry->getPathname());
Logger::getSingleton()->log(Logger::JM_INFORMATION, Logger::JM_EM,
- "Loaded extension {$extName}. Type is "
+ "Loaded extension {$extName}. Type is "
."{$extType}.");
}
}
@@ -196,70 +194,23 @@
{
Logger::getSingleton()->log(Logger::JM_ERROR, Logger::JM_EM,
"Extension type {$name} will not "
- .'be added, because a factory '
+ .'be added, because a factory '
.'object cannot be created.');
return;
}
// Add section to extension array
$this->Extensions[$name] = array();
+
// Add path to extension paths
$this->Paths[] = strtolower($name) . 's';
}
-
+
Logger::getSingleton()->log(Logger::JM_DEBUG, Logger::JM_EM,
- "Extension type {$name} added");
+ "Extension type {$name} added");
}
/**
- * Helper function to set the installed attribute
- *
- * The extension's XML file is loaded and the installed attribute is set
- * to the given value.
- *
- * @param string $XmlFile Extension name or index
- * @param boolean $installed Specifies if the extension is installed
- */
- public function setInstalled($XmlFile, $installed)
- {
- // Convert bool to string
- $installed = $installed ? 'true' : 'false';
-
- // Load XML file
- $this->loadXmlFile($XmlFile, 'extension.xsd');
-
- // Update installed attribute
- $this->updateXmlAttribute('installed', $installed);
-
- // Save XML file
- $this->saveXmlFile($XmlFile);
- }
-
- /**
- * Helper function to set the activated attribute
- *
- * The extension's XML file is loaded and the installed attribute is set
- * to the given value.
- *
- * @param mixed $index Extension name or index
- * @param boolean $activated Specifies if the extension is activated
- */
- public function setActivated($XmlFile, $activated)
- {
- // Convert bool to string
- $activated = $activated ? 'true' : 'false';
-
- // Load XML file
- $this->loadXmlFile($XmlFile);
-
- // Update activated attribute
- $this->updateXmlAttribute('activated', $activated);
-
- // Save XML file
- $this->saveXmlFile($XmlFile);
- }
-
- /**
* Registers a new factory for a given type
*
* @param string $type Type for which the validator should be loaded
@@ -297,16 +248,19 @@
* Returns a reference to a factory for a given extension type
*
* @param string $type Type for which a factory should be returned
+ * @return Factory Reference to requested factory
+ * @throw NoSuchExtensionTypeException if a factory for an extension
+ * type is requested, which does not exist
*/
public function &getFactory($type)
{
// Check if type is registered
if (!array_key_exists($type, $this->Validators))
{
- throw new NoValidatorException($type);
+ throw new NoSuchExtensionTypeException($type);
}
- return $this->Validators[$type];
+ return $this->Factories[$type];
}
/**
@@ -317,23 +271,74 @@
*
* @param string $name Name of the extension
* @param int $type Type of the extension
- * @return Extension Reference to extension
- * @throws NonExistingExtensionException if a given type+name combination
- * was not registered as an extension
+ * @return Extension Reference to requested extension
+ * @throws NoSuchExtensionTypeException if an extension type is requested
+ * which does not exist
+ * @throws NoSuchExtensionException if a given type+name combination
+ * is requested which does not exist
*/
public function &getExtension($name, $type)
{
// Check, if extension type is known
if (!array_key_exists($type, $this->Extensions))
{
+ throw new NoSuchExtensionTypeException($type);
}
// Check, if an extension with the specified name can be found
if (!array_key_exists($name, $this->Extensions[$type]))
{
- throw new NonExistingExtensionException($name);
+ throw new NoSuchExtensionException($name);
}
return $this->Extensions[$type][$name];
}
+
+ /**
+ * Helper function to set the activated attribute
+ *
+ * The extension's XML file is loaded and the installed attribute is set
+ * to the given value.
+ *
+ * @param mixed $index Extension name or index
+ * @param boolean $activated Specifies if the extension is activated
+ */
+ public function setActivated($XmlFile, $activated)
+ {
+ // Convert bool to string
+ $activated = $activated ? 'true' : 'false';
+
+ // Load XML file
+ $this->loadXmlFile($XmlFile);
+
+ // Update activated attribute
+ $this->updateXmlAttribute('activated', $activated);
+
+ // Save XML file
+ $this->saveXmlFile($XmlFile);
+ }
+
+ /**
+ * Helper function to set the installed attribute
+ *
+ * The extension's XML file is loaded and the installed attribute is set
+ * to the given value.
+ *
+ * @param string $XmlFile Extension name or index
+ * @param boolean $installed Specifies if the extension is installed
+ */
+ public function setInstalled($XmlFile, $installed)
+ {
+ // Convert bool to string
+ $installed = $installed ? 'true' : 'false';
+
+ // Load XML file
+ $this->loadXmlFile($XmlFile, 'extension.xsd');
+
+ // Update installed attribute
+ $this->updateXmlAttribute('installed', $installed);
+
+ // Save XML file
+ $this->saveXmlFile($XmlFile);
+ }
}
Modified: trunk/jasmine/classes/Logger.class.php
===================================================================
--- trunk/jasmine/classes/Logger.class.php 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/classes/Logger.class.php 2007-08-07 15:34:23 UTC (rev 125)
@@ -4,11 +4,13 @@
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
+require_once('Object.class.php');
+
/**
* The Logger Object class
*
@@ -17,8 +19,8 @@
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
class Logger extends Object
@@ -79,10 +81,9 @@
public static function &getSingleton()
{
// Check if an instance exists
- if (!isset(self::$Instance))
+ if (is_null(self::$Instance))
{
- $c = __CLASS__;
- self::$Instance = new $c;
+ self::$Instance = new Logger;
}
return self::$Instance;
Modified: trunk/jasmine/classes/Object.class.php
===================================================================
--- trunk/jasmine/classes/Object.class.php 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/classes/Object.class.php 2007-08-07 15:34:23 UTC (rev 125)
@@ -4,8 +4,8 @@
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
@@ -15,12 +15,12 @@
* The Object class
*
* This class is the base class for all of Jasmine's classes. It implements
- * functionality so that the signals and slots system works.
+ * functionality so that every child class can use the signals and slots system.
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
abstract class Object
@@ -35,13 +35,11 @@
public $List = NULL;
/**
- * Default Constructor
- *
- * Initialises the connection list
+ * Creates an empty connection list
*/
protected function __construct()
{
- $this->List =& new ConnectionList($this->__toString());
+ $this->List = new ConnectionList($this->__toString());
}
/**
@@ -61,12 +59,11 @@
public function connect($signal, $receiver, $method, $type = Object::DirectConnection)
{
// Check, if signal is really a function of this object
- $reflector =& new ReflectionClass($this);
+ $reflector = new ReflectionClass($this);
if (!($reflector->hasMethod($signal)))
{
throw new NonExistingFunctionException(get_class($this->Owner), $signal);
- return false;
}
return $this->List->addConnection($signal, $receiver, $method, $type);
@@ -89,7 +86,7 @@
public function emit($signal)
{
// Check for existing signal
- $reflector =& new ReflectionClass($this);
+ $reflector = new ReflectionClass($this);
if (!($reflector->hasMethod($signal)))
{
@@ -98,7 +95,7 @@
}
// Get the arguments passed with the signal
- $args =& func_get_args();
+ $args = func_get_args();
// Remove the signal name from the argument list
array_shift($args);
Modified: trunk/jasmine/classes/Session.Class.php
===================================================================
--- trunk/jasmine/classes/Session.Class.php 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/classes/Session.Class.php 2007-08-07 15:34:23 UTC (rev 125)
@@ -1,39 +1,61 @@
<?php
+/**
+ * This file implements the Jasmine::Session class.
+ *
+ * @author PHPNews Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.1.0
+ * @package Jasmine
+ */
+
+require_once('ExtensionManager.class.php');
+
+/**
+ * The Session Object Class
+ *
+ * Provides an object orientated wrapper around PHP's session handling
+ * functionality.
+ *
+ * @author PHPNews Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.1.0
+ * @package Jasmine
+ */
class Session
{
// Set instance for singleton
static private $instance;
private $SessionKey;
private $db;
-
+
public function __construct()
- {
- // Load DB Module
+ {
+ // Get a reference to the DB module
$this->db =& ExtensionManager::getSingleton()->getExtension('DB', 'Module');
-
+
// Check for Cookie Key
$this->checkCookieJar();
// Check If The Session_ID Exists
if(!isset($_SESSION['ID']))
- {
- // Before we enter duplicate entries, check of it exists as another session
+ {
+ // Before we enter duplicate entries, check if it exists as another session
if(!$this->exists('Session_Key', $this->SessionKey))
{
// Create Session
$this->createEntry();
}
-
// If it exists, update it with the newest session info
- else if($this->exists('Session_Key', $this->SessionKey))
+ else
{
// Create Session
$this->createFromKey();
}
}
-
- // or Check if a DB entry exists
- else if(isset($_SESSION['ID']))
+ // or Check if a DB entry exists
+ else
{
if(!$this->exists('Session_ID', $_SESSION['ID']))
{
@@ -46,9 +68,8 @@
{
// Create Session
$this->createWithID();
- }
-
- // Otherwise, update the DB if it's
+ }
+ // Otherwise, update the DB if it's
// The right time to update
else if(time() - $_SESSION['Time'] >= 300)
{
@@ -56,18 +77,23 @@
}
}
}
-
+
/**
- * Singleton method
+ * Returns a refernce to the single instance of the Session object
+ *
+ * @return Session Reference to single Session instance
*/
- static function getSingleton() {
- if(self::$instance == null) {
+ public static function &getSingleton()
+ {
+ // Check if an instance exists
+ if(is_null(self::$instance))
+ {
self::$instance = new Session();
- }
-
+ }
+
return self::$instance;
}
-
+
####################
#
# Public Functions
@@ -75,7 +101,7 @@
####################
/**
- * This is going to update the
+ * This is going to update the
* Users info to the DB and then
* Remove the entry from the DB
*
@@ -86,77 +112,79 @@
while($Session = $this->db->getRows($Session_SQL))
{
$User = $this->db->getRows($this->db->query('SELECT * FROM '. USERS_TABLE .' WHERE ID = \''. $_SESSION['UserID'] .'\''));
-
+
// Get User Data, Update
$NewTime = $User['Total_time'] + ($Session['Session_End'] - $Session['Session_Start']);
- $this->db->query('UPDATE '. USERS_TABLE .' SET Total_time = \''. $NewTime .'\'');
+ $this->db->query('UPDATE '. USERS_TABLE .' SET Total_time = \''. $NewTime .'\'');
// Then Kill It. Kill It Dead.
$this->haltSession('User', $_SESSION['UserID']);
}
}
-
+
/**
* When a user logs in the session
* is updated with their user id,
* so that when they log out, their
* time online can be logged.
- *
+ *
* $User = $Userdata['ID']
*
* @param UserID $User
*/
public function hijack($User)
{
- // Set UserID In Session,
+ // Set UserID In Session,
// Because it will save an
// SQL Query Later On
- $this->setSessionVars('UserID', $User);
-
+ $this->setValue('UserID', $User);
+
// Update Certain User Info
$this->db->query('UPDATE '. USERS_TABLE .' SET LoginNumber=LoginNumber+1,LastOn = \''.time().'\' WHERE ID = \'' . $User . '\'');
// Update Session WIth User ID
$this->db->query('UPDATE '. SESSIONS_TABLE .' SET User = \''. $User .'\' WHERE Session_ID = \''. $_SESSION['ID'] . '\'');
-
+
// Update Session
$this->updateSession();
}
-
+
####################
#
# Private Functions
#
####################
-
+
/**
- * Sets a $_Session Var
+ * Sets a new value of a session variable specified by key
*
- * @param Array Key Name $ArrN
- * @param Value $Value
+ * @param string $key Key of the session variable
+ * @param mixed $value New value of the session variable
*/
- private function setSessionVars($ArrN, $Value)
+ private function setValue($key, $value)
{
- $_SESSION[$ArrN] = $Value;
+ $_SESSION[$key] = $value;
}
-
+
/**
- * Checks if given is existing
+ * Checks if a given key/value combination exists in the database
*
- * @param What Feild $What
- * @param Value $This
+ * @param string $key Key of the database field
+ * @param mixed $value Value of the database field
+ * @return true if combination was found in database, false otherwise
*/
- private function exists($What, $This)
+ private function exists($key, $value)
{
- $S_Query = $this->db->query('SELECT * FROM '. SESSIONS_TABLE .' WHERE '. $What .' = \''. $This . '\'');
+ $S_Query = $this->db->query('SELECT * FROM '. SESSIONS_TABLE .' WHERE '. $key .' = \''. $value . '\'');
+
if($this->db->numRows($S_Query) != 0)
{
return true;
}
-
+
return false;
}
-
+
/**
* Create a brand spanking new session
*
@@ -166,18 +194,18 @@
// Get Session Vars
$Session_ID = Core::getSingleton()->getNextID(SESSIONS_TABLE, 'Session_ID');
$Session_Time = time();
-
- // Set $_Session Vars
- $this->setSessionVars('ID', $Session_ID);
- $this->setSessionVars('Time', $Session_Time);
-
+
+ // Set $_SESSION Vars
+ $this->setValue('ID', $Session_ID);
+ $this->setValue('Time', $Session_Time);
+
// Insert into datanase
$this->db->query('INSERT INTO '. SESSIONS_TABLE .' (Session_ID, Session_Start, Session_End, Session_Key, User)
VALUES (\'' . $Session_ID . '\', \''. $Session_Time .'\', \''. $Session_Time .'\', \''. $this->SessionKey . '\', \''. $UserID .'\')');
- }
-
+ }
+
/**
- * If the Session ID Var exists,
+ * If the Session ID Var exists,
* create it to an existing session
*/
private function createFromID()
@@ -185,14 +213,14 @@
// Get Session Vars
$Session_ID = $_SESSION['ID'];
$Session_Time = time();
-
+
// Check time and
// Set $_Session Vars
if(!isset($_SESSION['Time']))
{
- $this->setSessionVars('Time', $Session_Time);
+ $this->setValue('Time', $Session_Time);
}
-
+
if($_SESSION['UserID'] != '')
{
$UserID = $_SESSION['UserID'];
@@ -206,16 +234,16 @@
$this->db->query('INSERT INTO '. SESSIONS_TABLE .' (Session_ID, Session_Start, Session_End, Session_Key, User)
VALUES (\'' . $Session_ID . '\', \''. $Session_Time .'\', \''. $Session_Time .'\', \''. $this->SessionKey . '\', \''. $UserID .'\')');
}
-
+
/**
- * If the Session ID Var exists,
+ * If the Session ID Var exists,
* create it to an existing session
*/
private function createWithID()
{
// Insert into datanase
$this->db->query('UPDATE '. SESSIONS_TABLE .' SET Session_Key = \''. $this->SessionKey . '\' WHERE Session_ID = \''. $_SESSION['ID'].'\'');
- }
+ }
/**
* If the IP is inserted in the db
* create a session based off it
@@ -228,16 +256,14 @@
// Get Session Vars
$_SESSION['ID'] = $Result['Session_ID'];
- $Session_Time = time();
-
- // Check time and
- // Set $_Session Vars
+
+ // Check time and set $_Session Vars
if(!isset($_SESSION['Time']))
{
- $this->setSessionVars('Time', $Session_Time);
+ $this->setValue('Time', time());
}
- }
-
+ }
+
/**
* Update Session End Time
* With The Current Time
@@ -247,14 +273,14 @@
{
// Set new Session Time
$_SESSION['Time'] = time();
-
+
// Update session db time
$this->db->query('UPDATE '. SESSIONS_TABLE .' SET Session_End = \''. time() .'\' WHERE Session_ID = \''. $_SESSION['ID'] . '\'');
-
+
// Handle Sessions
$this->handleSessions();
}
-
+
/**
* This checks the db when called
* and looks for expired sessions.
@@ -274,14 +300,14 @@
if($Session['User'] != '0')
{
$NewTime = $Session['Total_time'] + ($Session['Session_End'] - $Session['Session_Start']);
- $this->db->query('UPDATE '. USERS_TABLE .' SET Total_time = \''. $NewTime .'\'');
+ $this->db->query('UPDATE '. USERS_TABLE .' SET Total_time = \''. $NewTime .'\'');
}
-
+
$this->haltSession('Session_ID', $Session['Session_ID']);
}
}
}
-
+
/**
* Kills the session in the DB
* and if a user is attached,
@@ -293,11 +319,11 @@
private function haltSession($Field, $ID)
{
$this->db->query('DELETE FROM '. SESSIONS_TABLE .' WHERE '. $Field .' = \''. $ID . '\'');
- }
+ }
/**
* This function handles the cookies
- *
+ *
* -- This fixes the session hijack
* of the same ip.
*
@@ -313,7 +339,7 @@
}
else if($_COOKIE['aGsSession'] == '')
{
- setcookie('aGsSession', $Key);
+ setcookie('aGsSession', $Key);
}
$this->SessionKey = $_COOKIE['aGsSession'];
Modified: trunk/jasmine/classes/exceptions.class.php
===================================================================
--- trunk/jasmine/classes/exceptions.class.php 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/classes/exceptions.class.php 2007-08-07 15:34:23 UTC (rev 125)
@@ -1,124 +1,120 @@
<?php
/**
- * Implements all Exceptions, which can be thrown by Jasmine
+ * Definition and implementation of all exceptions, which are throwable by
+ * Jasmine
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
+ * @copyright (c) 2005-2007 PHPNews Team
* @version 0.1.0
* @package Jasmine
*/
+require_once 'Logger.class.php';
+
/**
- * The NonExistingFunctionException class
+ * Thrown if the user tries to establish a connection to a non existent class
+ * method.
*
- * This exception is thrown if the user tries to establish a connection to a non
- * existent function. Function and class name are printed in the error string,
- * to help correcting the error.
- *
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
-class NonExistingFunctionException extends Exception
+class NoSuchMethodException extends Exception
{
/**
- * Default constructor
+ * Sets the error message
*
- * @param string $class Name of the class
- * @param string $function Name of the non existing function
+ * @param string Name of the class
+ * @param string Name of the non existing function
+ * @todo Add logger output
*/
- public function __construct($class, $function)
+ public function __construct(&$class, &$method)
{
- $message = "NonExistingFunctionException: Function {$function} does "
- ."not exist in class {$class}";
+ $message = "Method {$method} does not exist in class {$class}";
- // Call the parent constructor
parent::__construct($message);
}
}
/**
- * The NonExistingExtensionException class
+ * Thrown if the user tries to connect the same signal to the same slot twice.
*
- * This exception is thrown if for a specified class name, there is no instance
- * found, which could be returned.
- *
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
-class NonExistingExtensionException extends Exception
+class MultipleConnectException extends Exception
{
- public function __construct($class)
+ /**
+ * Sets the error message
+ *
+ * @param string Name of the sending object
+ * @param string Name of the sending object's signal
+ * @param string Name of the receiving object
+ * @param string Name of the receiving object's slot
+ * @todo Add logger output
+ */
+ public function __construct(&$sender, &$signal, &$receiver, &$slot)
{
- $message = "An instance of ${class} could not be found.";
+ $message = "Multiple connections from {$sender}::{$signal} to "
+ ."{$receiver}::{$slot} are not allowed.";
- // Call the parent constructor
parent::__construct($message);
}
}
/**
- * The UnhandeldSignalException class
+ * Thrown if a given function parameter is not of the expected type.
*
- * This exception is thrown if an sql statement contains an error
- *
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
-class UnhandeldSignalException extends Exception
+class WrongParameterTypeException extends Exception
{
/**
- * Default constructor
+ * Sets the error message
*
- * @param string $sql Failing SQL statement
+ * @param string The paramter type the function received
+ * @param string The parameter type the function expected
+ * @todo Add logger output
*/
- public function __construct($sql)
+ public function __construct(&$givenType, &$expectedType)
{
- $message = '';
+ $message = "The function expected a parameter of type ${expectedType} "
+ ."but it got ${givenType} instead.";
- // Call the parent constructor
parent::__construct($message);
}
}
/**
- * The MultipleConnectException exception
+ * Thrown if a class should be used, but is not defined before.
*
- * This exception is thrown if the user tries to connect the same signal to the
- * same slot twice.
- *
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
-class MultipleConnectException extends Exception
+class NoClassDefinitionException extends Exception
{
/**
- * Default constructor
+ * Sets the error message
*
- * @param string
- * @param string
- * @param string
- * @param string
- * @param int
+ * @param string Name of class
+ * @todo Add logger output
*/
- public function __construct($sender, $signal, $receiver, $slot, $type)
+ public function __construct(&$name)
{
- $message = "A connection between ${sender}:${signal} to ${receiver}::"
- ."${slot} cannot be established. You are not allowed to make "
- ."multiple connections between the same sender::signal to "
- ."receiver::slot";
+ $message = "The class {$name} was not defined.";
// Call the parent constructor
parent::__construct($message);
@@ -126,23 +122,26 @@
}
/**
- * The WrongParameterTypeException exception
+ * Thrown if a class tries to access the XML parser's functionality, but
+ * no XML parser was created.
*
- * This exception is thrown if a given parameter of a function is not of an
- * expected type.
- *
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
-class WrongParameterTypeException extends Exception
+final class NoXmlParserException extends Exception
{
- public function __construct($give_type, $expected_type)
+ /**
+ * Sets the error message
+ *
+ * @todo Add logger output
+ */
+ public function __construct()
{
- $message = "The function expected a parameter of type ${expected_type} "
- ."but it got ${give_type} instead.";
+ $message = 'No XML parser registered. Please register one with '
+ .'setXmlParser before using its functionality.';
// Call the parent constructor
parent::__construct($message);
@@ -150,145 +149,155 @@
}
/**
- * The NoClassFoundException exception
+ * Thrown if general IO errors, like missing files etc, occur.
*
- * This exception is thrown if a class should be used, but is not
- * defined before.
- *
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
+ * @copyright (c) 2005-2007 PHPNews Team
* @version 0.1.0
* @package Jasmine
*/
-class NoClassFoundException extends Exception
+final class FileIOException extends Exception
{
- public function __construct($name)
+ public function __construct(&$message)
{
- $message = "The class {$name} was not defined.";
-
// Call the parent constructor
parent::__construct($message);
}
}
/**
- * The NoXmlParserException exception
+ * Thrown if the XML parser finds an error while parsing an XML document.
*
- * This exception is thrown if a class tries to access the XML parser's functionality, but
- * no XML parser was created.
- *
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
-final class NoXmlParserException extends Exception
+final class XmlParseException extends Exception
{
- public function __construct()
+ /**
+ * Sets the error message
+ *
+ * @param string Name of the XML file
+ * @param string Name of the XML schema file
+ * @todo Add logger output
+ */
+ public function __construct(&$filename, &$schema = '')
{
- $message = 'No XML parser registered. Please register one with setXmlParser before using '
- .'its functionality.';
+ // A general parse error happend
+ if (empty($schema))
+ {
+ $message = "While parsing {$filename} the following error occured:\n";
+ }
+ else
+ {
+ $message = "While validating {$filename} against the XML schema {$schema} the "
+ ."following error occured:\n";
+ }
+ // Append the libxml error to the message
+ $error = libxml_get_last_error();
+ $message .= "line: {$error->line}, column: {$error->column}, {$error->message}";
+
// Call the parent constructor
parent::__construct($message);
}
}
/**
- * The FileIOException exception
+ * Thrown if a requested XML attribute is not found.
*
- * This exception is thrown if general IO errors, like missing files etc, occur.
- *
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
+ * @copyright (c) 2005-2007 PHPNews Team
* @version 0.1.0
* @package Jasmine
*/
-final class FileIOException extends Exception
+final class NoSuchAttributeException extends Exception
{
- public function __construct($message)
+ public function __construct(&$tag, &$attribute)
{
+ $message = "The tag {$tag} has no attribute {$attribute}.";
+
// Call the parent constructor
parent::__construct($message);
}
}
/**
- * The XmlParseException exception
+ * Thrown if a requested array key is not found.
*
- * This exception is thrown if the XML parser finds an error while parsing an XML document.
- *
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
-final class XmlParseException extends Exception
+final class NoSuchArrayKeyException extends Exception
{
- public function __construct($filename, $schema = '')
+ /**
+ * Sets the error message
+ *
+ * @param mixed Missing array key
+ * @todo Add logger output
+ */
+ public function __construct(&$key)
{
- // A general parse error happend
- if (empty($schema))
- {
- $message = "While parsing {$filename} the following error occured:\n";
- }
- else
- {
- $message = "While validating {$filename} against the XML schema {$schema} the "
- ."following error occured:\n";
- }
+ $message = "The key {$key} does not exist in array.";
- // Append the libxml error to the message
- $error = libxml_get_last_error();
- $message .= "line: {$error->line}, column: {$error->column}, {$error->message}";
-
// Call the parent constructor
parent::__construct($message);
}
}
/**
- * The NoSuchAttributeException
- *
- * This exception is thrown if a requested XML attribute is not found.
- *
+ * Thrown if a requested type/extension does not exist.
+ *
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
-final class NoSuchAttributeException extends Exception
+final class NoSuchExtensionException extends Exception
{
- public function __construct($tag, $attribute)
+ /**
+ * Sets the error message
+ *
+ * @param string Name of the extension
+ * @param string Name of the extension type
+ * @todo Add logger output
+ */
+ public function __construct(&$extension, &$type)
{
- $message = "The tag {$tag} has no attribute {$attribute}.";
-
- // Call the parent constructor
+ $message = "Requested extension {$extension} of type ${type} does not exist.";
+
parent::__construct($message);
}
}
/**
- * The NoSuchArrayKeyException
- *
- * This exception is thrown if a requested array key is not found.
- *
+ * Thrown if a requested extension type or factory is not found.
+ *
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.9
* @package Jasmine
*/
-final class NoSuchArrayKeyException extends Exception
+final class NoSuchExtensionTypeException extends Exception
{
- public function __construct($key)
+ /**
+ * Sets the error message
+ *
+ * @param string Name of the extension type
+ * @todo Add logger output
+ */
+ public function __construct($type)
{
- $message = "The key {$key} does not exist in array.";
+ $message = "Requested extension type {$type} does not exist.";
// Call the parent constructor
parent::__construct($message);
Modified: trunk/jasmine/dotests.sh
===================================================================
--- trunk/jasmine/dotests.sh 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/dotests.sh 2007-08-07 15:34:23 UTC (rev 125)
@@ -3,7 +3,7 @@
# Path to phpunit executable
# (don't forget the trailing slash)
-PATH_PHPUNIT="/usr/local/php5/bin/";
+PATH_PHPUNIT="/usr/bin/";
# Check for database configuration file
if [ ! -e db_config.php ]; then
Modified: trunk/jasmine/makedoc.sh
===================================================================
--- trunk/jasmine/makedoc.sh 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/makedoc.sh 2007-08-07 15:34:23 UTC (rev 125)
@@ -1,94 +1,50 @@
-#!/bin/bash
-# $Id: makedoc.sh 23 2005-08-23 15:38:46Z christoph_berg $
+#!/bin/sh
+# Creates Jasmine's API documentation
-#/**
-# * makedoc - PHPDocumentor script to save your settings
-# *
-# * Put this file inside your PHP project homedir, edit its variables and run whenever you wants to
-# * re/make your project documentation.
-# *
-# * The version of this file is the version of PHPDocumentor it is compatible.
-# *
-# * It simples run phpdoc with the parameters you set in this file.
-# * NOTE: Do not add spaces after bash variables.
-# *
-# * @copyright makedoc.sh is part of PHPDocumentor project {@link http://freshmeat.net/projects/phpdocu/} and its LGPL
-# * @author Roberto Berto <darkelder (inside) users (dot) sourceforge (dot) net>
-# * @version Release-1.1.0
-# */
+# Path to PHPDoc executable
+PATH_PHPDOC=phpdoc
+# The PROJECT_NAME tag is a single word or a sequence of words surrounded
+# by quotes that should identify the project.
-##############################
-# should be edited
-##############################
+PROJECT_NAME="Jasmine"
-#/**
-# * title of generated documentation, default is 'Generated Documentation'
-# *
-# * @var string TITLE
-# */
-TITLE="Jasmine 0.1.0 API Documentation"
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
-#/**
-# * name to use for the default package. If not specified, uses 'default'
-# *
-# * @var string PACKAGES
-# */
-PACKAGES="Jasmine"
+PROJECT_NUMBER="0.9"
-#/**
-# * name of a directory(s) to parse directory1,directory2
-# * $PWD is the directory where makedoc.sh
-# *
-# * @var string PATH_PROJECT
-# */
-PATH_PROJECT=classes,modules
+# The INPUT tag can be used to specify the directories that contain
+# documented source files. You may enter directories like "/usr/src/myproject".
+# Separate the directories with commas.
-#/**
-# * path of PHPDoc executable
-# *
-# * @var string PATH_PHPDOC
-# */
-PATH_PHPDOC=phpdoc
+INPUT="classes,modules"
-#/**
-# * where documentation will be put
-# *
-# * @var string PATH_DOCS
-# */
-PATH_DOCS=$PWD/doc
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where phpdoc was started. If left blank the current directory will be used.
-#/**
-# * what outputformat to use (html/pdf)
-# *
-# * @var string OUTPUTFORMAT
-# */
-OUTPUTFORMAT=HTML
+OUTPUT_DIRECTORY="./doc"
-#/**
-# * converter to be used
-# *
-# * @var string CONVERTER
-# */
+# Outputformat to use (html/pdf)
+OUTPUTFORMAT="HTML"
+
+# Converter to be used
CONVERTER=Smarty
-#/**
-# * template to use
-# *
-# * @var string TEMPLATE
-# */
+# Template to use
TEMPLATE=PHP
-#/**
-# * parse elements marked as private
-# *
-# * @var bool (on/off) PRIVATE
-# */
-PRIVATE=on
+# If the EXTRACT_PRIVATE tag is set to on all private members of a class
+# will be included in the documentation.
-# make documentation
-$PATH_PHPDOC -d $PATH_PROJECT -t $PATH_DOCS -ti "$TITLE" -dn $PACKAGES \
--o $OUTPUTFORMAT:$CONVERTER:$TEMPLATE -pp $PRIVATE
+EXTRACT_PRIVATE=on
-
-# vim: set expandtab :
+# Create documentation
+${PATH_PHPDOC} --directory ${INPUT} --target ${OUTPUT_DIRECTORY} \
+ --title "${PROJECT_NAME} ${PROJECT_NUMBER} API Documentation" \
+ --defaultpackagename ${PROJECT_NAME} \
+ --output ${OUTPUTFORMAT}:${CONVERTER}:${TEMPLATE} \
+ --parseprivate ${EXTRACT_PRIVATE}
Modified: trunk/jasmine/modules/DB/DB.class.php
===================================================================
--- trunk/jasmine/modules/DB/DB.class.php 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/modules/DB/DB.class.php 2007-08-07 15:34:23 UTC (rev 125)
@@ -4,8 +4,8 @@
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.5
* @package Jasmine
*/
@@ -21,11 +21,11 @@
*
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
- * @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @copyright (c) 2005-2007 PHPNews Team
+ * @version 0.5
* @package Jasmine
- *
- * TODO: add numRows function.
+ *
+ * @todo add numRows function, revise class completely
*/
class DB extends Module
{
Modified: trunk/jasmine/modules/Settings/Settings.class.php
===================================================================
--- trunk/jasmine/modules/Settings/Settings.class.php 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/modules/Settings/Settings.class.php 2007-08-07 15:34:23 UTC (rev 125)
@@ -5,7 +5,7 @@
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
* @copyright (c) 2005-2006 PHPNews Team
- * @version 0.1.0
+ * @version 0.9
* @package Jasmine
*/
@@ -17,7 +17,7 @@
* @author PHPNews Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Licence
* @copyright (c) 2003-2005 PHPNews Team
- * @version 0.1.0
+ * @version 0.9
* @package Jasmine
*/
Modified: trunk/jasmine/sql/mysql.sql
===================================================================
--- trunk/jasmine/sql/mysql.sql 2007-08-07 04:57:06 UTC (rev 124)
+++ trunk/jasmine/sql/mysql.sql 2007-08-07 15:34:23 UTC (rev 125)
@@ -2,15 +2,13 @@
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
---
+--
-- Database: `jasmine`
---
+--
--- --------------------------------------------------------
-
---
+--
-- Table structure for table `jasmine_groups`
---
+--
CREATE TABLE IF NOT EXISTS `jasmine_groups` (
`id` tinyint(3) unsigned NOT NULL auto_increment,
@@ -18,16 +16,9 @@
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Stores all definied groups' AUTO_INCREMENT=1 ;
---
--- Dumping data for table `jasmine_groups`
---
-
-
--- --------------------------------------------------------
-
---
+--
-- Table structure for table `jasmine_modules`
---
+--
CREATE TABLE IF NOT EXISTS `jasmine_modules` (
`id` tinyint(3) unsigned NOT NULL auto_increment,
@@ -35,16 +26,10 @@
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Stores all installed modules' AUTO_INCREMENT=1 ;
---
--- Dumping data for table `jasmine_modules`
---
-
--- --------------------------------------------------------
-
---
+--
-- Table structure for table `jasmine_modules_features`
---
+--
CREATE TABLE IF NOT EXISTS `jasmine_modules_features` (
`mid` tinyint(4) NOT NULL,
@@ -53,35 +38,21 @@
PRIMARY KEY (`mid`,`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Stores module features, which can be restricted via permissi';
---
--- Dumping data for table `jasmine_modules_features`
---
-
-
--- --------------------------------------------------------
-
---
+--
-- Table structure for table `jasmine_permissions_groups`
---
+--
CREATE TABLE IF NOT EXISTS `jasmine_permissions_groups` (
`gid` tinyint(3) unsigned NOT NULL,
`mid` tinyint(3) unsigned NOT NULL,
`fid` tinyint(3) unsigned NOT NULL,
- `allowed` tinyint(1) NOT NULL,
+ `allowed` tinyint(1) NOT NULL COMMENT 'Boolean values: 0 = false, 1 = true',
KEY `gid` (`gid`,`mid`,`fid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Stores permissions on a group/feature base';
---
--- Dumping data for table `jasmine_permissions_groups`
---
-
-
--- --------------------------------------------------------
-
---
+--
-- Table structure for table `jasmine_permissions_users`
---
+--
CREATE TABLE IF NOT EXISTS `jasmine_permissions_users` (
`uid` tinyint(4) NOT NULL,
@@ -91,69 +62,42 @@
PRIMARY KEY (`uid`,`mid`,`fid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Stores permissions on a user/feature base';
---
--- Dumping data for table `jasmine_permissions_users`
---
-
-
--- --------------------------------------------------------
-
---
+--
-- Table structure for table `jasmine_sessions`
---
+--
CREATE TABLE IF NOT EXISTS `jasmine_sessions` (
`Session_ID` int(4) unsigned NOT NULL,
`Session_Start` int(4) unsigned NOT NULL default '0',
- `Session_End` varchar(255) collate latin1_general_ci NOT NULL,
- `Session_Key` varchar(32) collate latin1_general_ci NOT NULL,
+ `Session_End` varchar(255) collate utf8_bin NOT NULL,
+ `Session_Key` varchar(32) collate utf8_bin NOT NULL,
`User` int(6) unsigned NOT NULL default '0',
PRIMARY KEY (`Session_ID`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci PACK_KEYS=1;
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin PACK_KEYS=1;
---
--- Dumping data for table `jasmine_sessions`
---
-
-
--- --------------------------------------------------------
-
---
+--
-- Table structure for table `jasmine_settings`
---
+--
CREATE TABLE IF NOT EXISTS `jasmine_settings` (
`variable` varchar(20) collate utf8_bin NOT NULL default '',
`value` text collate utf8_bin NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Stores various variables to configure Jasmine';
---
--- Dumping data for table `jasmine_settings`
---
-
-
--- --------------------------------------------------------
-
---
+--
-- Table structure for table `jasmine_users`
---
+--
CREATE TABLE IF NOT EXISTS `jasmine_users` (
`ID` int(13) unsigned NOT NULL default '0',
- `Username` varchar(16) collate latin1_general_ci NOT NULL default '',
- `Password` varchar(32) collate latin1_general_ci NOT NULL,
- `Email` varchar(255) collate latin1_general_ci NOT NULL default '',
- `Reg_Date` varchar(40) collate latin1_general_ci NOT NULL default '',
- `LastOn` varchar(24) collate latin1_general_ci NOT NULL default '',
- `LoginNumber` varchar(6) collate latin1_general_ci NOT NULL default '',
+ `Username` varchar(16) collate utf8_bin NOT NULL default '',
+ `Password` varchar(32) collate utf8_bin NOT NULL,
+ `Email` varchar(255) collate utf8_bin NOT NULL default '',
+ `Reg_Date` varchar(40) collate utf8_bin NOT NULL default '',
+ `LastOn` varchar(24) collate utf8_bin NOT NULL default '',
+ `LoginNumber` varchar(6) collate utf8_bin NOT NULL default '',
`Group` int(5) NOT NULL default '0',
- `Language` varchar(10) collate latin1_general_ci NOT NULL default '',
- `Total_time` varchar(32) collate latin1_general_ci NOT NULL default '',
+ `Language` varchar(10) collate utf8_bin NOT NULL default '',
+ `Total_time` varchar(32) collate utf8_bin NOT NULL default '',
PRIMARY KEY (`ID`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci PACK_KEYS=1;
-
---
--- Dumping data for table `jasmine_users`
---
-
-
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin PACK_KEYS=1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|