cleaned up structure, fixed bugs
This commit is contained in:
parent
9119550d1c
commit
1979f850f9
6 changed files with 74 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
[connection:development:default]
|
[connection:development:default]
|
||||||
host = localhost
|
host = 127.0.0.1
|
||||||
user = root
|
user = root
|
||||||
password =
|
password =
|
||||||
database = seinheit_ch
|
database = seinheit_ch
|
|
@ -9,6 +9,11 @@
|
||||||
*/
|
*/
|
||||||
abstract class Katharsis_Controller_Plugin_Abstract
|
abstract class Katharsis_Controller_Plugin_Abstract
|
||||||
{
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->_con = Katharsis_DatabaseConnector::getConnection();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overwrite this method, if you want something to be processed
|
* Overwrite this method, if you want something to be processed
|
||||||
* _before_ the controller is called
|
* _before_ the controller is called
|
||||||
|
|
|
@ -29,8 +29,5 @@ class Katharsis_Controller_Plugin_Autorender extends Katharsis_Controller_Plugin
|
||||||
|
|
||||||
$view = Katharsis_View::getInstance();
|
$view = Katharsis_View::getInstance();
|
||||||
echo $view->render('main');
|
echo $view->render('main');
|
||||||
|
|
||||||
var_dump($view->render('main'));
|
|
||||||
die('');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -339,7 +339,7 @@ class Katharsis_Db5
|
||||||
if($field === null)
|
if($field === null)
|
||||||
{
|
{
|
||||||
$result = $this->_fetch($statement, self::FETCHMODE_ARRAY, true);
|
$result = $this->_fetch($statement, self::FETCHMODE_ARRAY, true);
|
||||||
return $result[0];
|
return isset($result[0]) ? $result[0] : null;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
$result = $this->_fetch($statement, self::FETCHMODE_ASSOC, true);
|
$result = $this->_fetch($statement, self::FETCHMODE_ASSOC, true);
|
||||||
|
|
66
library/Katharsis/Registry.php
Normal file
66
library/Katharsis/Registry.php
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Katharsis Registry
|
||||||
|
* Global data pool
|
||||||
|
*
|
||||||
|
* @author Karl Pannek <info@katharsis.in>
|
||||||
|
* @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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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 Katharsis_Controller_Plugin_Autorender());
|
||||||
|
|
||||||
Katharsis_Controller_Plugin::registerPlugin(new DidgeridooArtwork_Controller_Plugin_Access());
|
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 {
|
try {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue