diff --git a/config/database.config.ini b/config/database.config.ini index bc4beb9..3925417 100644 --- a/config/database.config.ini +++ b/config/database.config.ini @@ -1,5 +1,5 @@ [connection:development:default] -host = localhost +host = 127.0.0.1 user = root password = database = seinheit_ch \ No newline at end of file diff --git a/library/Katharsis/Controller/Plugin/Abstract.php b/library/Katharsis/Controller/Plugin/Abstract.php index 8877623..dd4663f 100644 --- a/library/Katharsis/Controller/Plugin/Abstract.php +++ b/library/Katharsis/Controller/Plugin/Abstract.php @@ -9,6 +9,11 @@ */ abstract class Katharsis_Controller_Plugin_Abstract { + public function __construct() + { + $this->_con = Katharsis_DatabaseConnector::getConnection(); + } + /** * Overwrite this method, if you want something to be processed * _before_ the controller is called diff --git a/library/Katharsis/Controller/Plugin/Autorender.php b/library/Katharsis/Controller/Plugin/Autorender.php index c1896cd..ce698a3 100644 --- a/library/Katharsis/Controller/Plugin/Autorender.php +++ b/library/Katharsis/Controller/Plugin/Autorender.php @@ -29,8 +29,5 @@ class Katharsis_Controller_Plugin_Autorender extends Katharsis_Controller_Plugin $view = Katharsis_View::getInstance(); echo $view->render('main'); - - var_dump($view->render('main')); - die(''); } } \ No newline at end of file diff --git a/library/Katharsis/Db5.php b/library/Katharsis/Db5.php index f5857d2..a282e43 100644 --- a/library/Katharsis/Db5.php +++ b/library/Katharsis/Db5.php @@ -339,7 +339,7 @@ class Katharsis_Db5 if($field === null) { $result = $this->_fetch($statement, self::FETCHMODE_ARRAY, true); - return $result[0]; + return isset($result[0]) ? $result[0] : null; } else { $result = $this->_fetch($statement, self::FETCHMODE_ASSOC, true); diff --git a/library/Katharsis/Registry.php b/library/Katharsis/Registry.php new file mode 100644 index 0000000..57fa296 --- /dev/null +++ b/library/Katharsis/Registry.php @@ -0,0 +1,66 @@ + + * @version 0.5.2 + * @package Katharsis + */ +class Katharsis_Registry +{ + /** + * @var Katharsis_Registry + */ + protected static $_instance = null; + + /** + * @var array + */ + protected $_params = array(); + + /** + * Singleton. Returns the same instance every time + * + * @return Katharsis_Registry + */ + public static function getInstance() + { + if(self::$_instance === null) + { + self::$_instance = new self(); + } + return self::$_instance; + } + + /** + * Magical get method, gets specific param + * + * @param string $name + * @return string + */ + public function __get($name) + { + if(array_key_exists($name, $this->_params)) + { + return $this->_params[$name]; + } + return null; + } + + /** + * Magical set method, sets specific param + * + * @param string name + * @param string value + */ + public function __set($name, $value) + { + $this->_params[$name] = $value; + } + + public function getAll() + { + return $this->_params; + } +} \ No newline at end of file diff --git a/public/index.php b/public/index.php index 03fc35a..735eb4f 100644 --- a/public/index.php +++ b/public/index.php @@ -19,7 +19,7 @@ Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plu Katharsis_Controller_Plugin::registerPlugin(new Katharsis_Controller_Plugin_Autorender()); Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_Access()); -//Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_Navigation()); +Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_Navigation()); try {