diff --git a/backend/lib/Controller/Channel.php b/backend/lib/Controller/ChannelController.php similarity index 98% rename from backend/lib/Controller/Channel.php rename to backend/lib/Controller/ChannelController.php index 3457f8d..9b6d189 100644 --- a/backend/lib/Controller/Channel.php +++ b/backend/lib/Controller/ChannelController.php @@ -30,7 +30,7 @@ use \Volkszaehler\Model; * @author Steffen Vogel * @package channel */ -class Channel extends Controller { +class ChannelController extends Controller { // TODO authentification/indentification public function get() { diff --git a/backend/lib/Controller/Data.php b/backend/lib/Controller/DataController.php similarity index 98% rename from backend/lib/Controller/Data.php rename to backend/lib/Controller/DataController.php index 2499464..4024513 100644 --- a/backend/lib/Controller/Data.php +++ b/backend/lib/Controller/DataController.php @@ -31,7 +31,7 @@ use Volkszaehler\Util; * @todo call via redirect from Controller\Channel * @package data */ -class Data extends Controller { +class DataController extends Controller { /** * @todo authentification/indentification diff --git a/backend/lib/Controller/Group.php b/backend/lib/Controller/GroupController.php similarity index 97% rename from backend/lib/Controller/Group.php rename to backend/lib/Controller/GroupController.php index e73e051..8d6863a 100644 --- a/backend/lib/Controller/Group.php +++ b/backend/lib/Controller/GroupController.php @@ -28,7 +28,7 @@ namespace Volkszaehler\Controller; * @author Steffen Vogel (info@steffenvogel.de) * @package group */ -class Group extends Controller { +class GroupController extends Controller { /** * diff --git a/backend/lib/Dispatcher.php b/backend/lib/Dispatcher.php index e796f81..7288308 100644 --- a/backend/lib/Dispatcher.php +++ b/backend/lib/Dispatcher.php @@ -81,15 +81,15 @@ class Dispatcher { case 'png': case 'jpeg': case 'gif': - $this->view = new View\JpGraph($request, $response, $format); + $this->view = new View\JpGraphView($request, $response, $format); break; case 'json': case 'xml': $controller = 'channel'; case 'csv': - $viewClassName = 'Volkszaehler\View\\' . strtoupper($format) . '\\' . ucfirst($controller); - if (!(\Volkszaehler\Util\ClassLoader::classExists($viewClassName)) || !is_subclass_of($viewClassName, '\Volkszaehler\View\View')) { + $viewClassName = 'Volkszaehler\View\\' . strtoupper($format) . '\\' . strtoupper($format) . ucfirst($controller) . 'View'; + if (!(Util\ClassLoader::classExists($viewClassName)) || !is_subclass_of($viewClassName, '\Volkszaehler\View\View')) { throw new \InvalidArgumentException('\'' . $viewClassName . '\' is not a valid View'); } @@ -103,8 +103,8 @@ class Dispatcher { } // initialize controller - $controllerClassName = 'Volkszaehler\Controller\\' . ucfirst(strtolower($request->getParameter('controller'))); - if (!(\Volkszaehler\Util\ClassLoader::classExists($controllerClassName)) || !is_subclass_of($controllerClassName, '\Volkszaehler\Controller\Controller')) { + $controllerClassName = 'Volkszaehler\Controller\\' . ucfirst(strtolower($request->getParameter('controller'))) . 'Controller'; + if (!(Util\ClassLoader::classExists($controllerClassName)) || !is_subclass_of($controllerClassName, '\Volkszaehler\Controller\Controller')) { throw new \InvalidArgumentException('\'' . $controllerClassName . '\' is not a valid controller'); } $this->controller = new $controllerClassName($this->view, $this->em); diff --git a/backend/lib/Interpreter/Meter.php b/backend/lib/Interpreter/MeterInterpreter.php similarity index 98% rename from backend/lib/Interpreter/Meter.php rename to backend/lib/Interpreter/MeterInterpreter.php index 7803d96..e292b74 100644 --- a/backend/lib/Interpreter/Meter.php +++ b/backend/lib/Interpreter/MeterInterpreter.php @@ -29,7 +29,7 @@ namespace Volkszaehler\Interpreter; * @author Steffen Vogel (info@steffenvogel.de) * */ -class Meter extends Interpreter { +class MeterInterpreter extends Interpreter { /** * calculates the consumption for interval speciefied by $from and $to diff --git a/backend/lib/Interpreter/Sensor.php b/backend/lib/Interpreter/SensorInterpreter.php similarity index 98% rename from backend/lib/Interpreter/Sensor.php rename to backend/lib/Interpreter/SensorInterpreter.php index 98f74be..662b31b 100644 --- a/backend/lib/Interpreter/Sensor.php +++ b/backend/lib/Interpreter/SensorInterpreter.php @@ -28,7 +28,7 @@ namespace Volkszaehler\Interpreter; * @package data * @author Steffen Vogel */ -class Sensor extends Interpreter { +class SensorInterpreter extends Interpreter { /** * diff --git a/backend/lib/Logger/Flukso.php b/backend/lib/Logger/FluksoLogger.php similarity index 96% rename from backend/lib/Logger/Flukso.php rename to backend/lib/Logger/FluksoLogger.php index 6594fd7..6713567 100644 --- a/backend/lib/Logger/Flukso.php +++ b/backend/lib/Logger/FluksoLogger.php @@ -31,7 +31,7 @@ namespace Volkszaehler\Logger; * @author Steffen Vogel * @todo to be implemented */ -class Flukso implements Logger { +class FluksoLogger implements Logger { } diff --git a/backend/lib/Model/Channel.php b/backend/lib/Model/Channel.php index 9401d2c..9043c30 100644 --- a/backend/lib/Model/Channel.php +++ b/backend/lib/Model/Channel.php @@ -92,7 +92,7 @@ class Channel extends Entity { * obtain channels data interpreter to calculate statistical information */ public function getInterpreter(\Doctrine\ORM\EntityManager $em) { - $interpreterClassName = 'Volkszaehler\Interpreter\\' . ucfirst(self::$indicators[$this->indicator][0]); + $interpreterClassName = 'Volkszaehler\Interpreter\\' . ucfirst(self::$indicators[$this->indicator][0]) . 'Interpreter'; if (!(\Volkszaehler\Util\ClassLoader::classExists($interpreterClassName)) || !is_subclass_of($interpreterClassName, '\Volkszaehler\Interpreter\Interpreter')) { throw new \InvalidArgumentException('\'' . $interpreterClassName . '\' is not a valid Interpreter'); } diff --git a/backend/lib/View/CSV/Data.php b/backend/lib/View/CSV/CSVDataView.php similarity index 96% rename from backend/lib/View/CSV/Data.php rename to backend/lib/View/CSV/CSVDataView.php index b7fa976..54ca39c 100644 --- a/backend/lib/View/CSV/Data.php +++ b/backend/lib/View/CSV/CSVDataView.php @@ -28,7 +28,7 @@ namespace Volkszaehler\View\CSV; * @author Steffen Vogel * @package data */ -class Data extends CSV { +class CSVDataView extends CSVView { public function add($obj, $data) { $this->csv = array_merge($this->csv, $data); } diff --git a/backend/lib/View/CSV/CSV.php b/backend/lib/View/CSV/CSVView.php similarity index 98% rename from backend/lib/View/CSV/CSV.php rename to backend/lib/View/CSV/CSVView.php index 851581b..4500c0d 100644 --- a/backend/lib/View/CSV/CSV.php +++ b/backend/lib/View/CSV/CSVView.php @@ -34,7 +34,7 @@ use Volkszaehler\Util; * @author Steffen Vogel * @package default */ -abstract class CSV extends View\View { +abstract class CSVView extends View\View { protected $csv = array(); protected $header = array(); protected $footer = array(); diff --git a/backend/lib/View/HTTP/Request.php b/backend/lib/View/HTTP/Request.php index 06f4ac3..60c85d1 100644 --- a/backend/lib/View/HTTP/Request.php +++ b/backend/lib/View/HTTP/Request.php @@ -63,7 +63,7 @@ class Request { * setter & getter */ public function getHeader($header) { return $this->headers[$header]; } - public function getMethod() { return $this->method; }; + public function getMethod() { return $this->method; } public function getParameter($name, $method = 'get') { return (isset($this->parameters[$method][$name])) ? $this->parameters[$method][$name] : NULL; } diff --git a/backend/lib/View/JSON/Channel.php b/backend/lib/View/JSON/JSONChannelView.php similarity index 97% rename from backend/lib/View/JSON/Channel.php rename to backend/lib/View/JSON/JSONChannelView.php index c762c0c..de1de23 100644 --- a/backend/lib/View/JSON/Channel.php +++ b/backend/lib/View/JSON/JSONChannelView.php @@ -30,7 +30,7 @@ namespace Volkszaehler\View\JSON; * @author Steffen Vogel * @package channel */ -class Channel extends JSON { +class JSONChannelView extends JSONView { public function add(\Volkszaehler\Model\Channel $obj, array $data = NULL) { $channel['uuid'] = (string) $obj->getUuid(); diff --git a/backend/lib/View/JSON/Group.php b/backend/lib/View/JSON/JSONGroupView.php similarity index 97% rename from backend/lib/View/JSON/Group.php rename to backend/lib/View/JSON/JSONGroupView.php index 8d30abe..915a073 100644 --- a/backend/lib/View/JSON/Group.php +++ b/backend/lib/View/JSON/JSONGroupView.php @@ -28,7 +28,7 @@ namespace Volkszaehler\View\JSON; * @author Steffen Vogel * @package group */ -class Group extends JSON { +class JSONGroupView extends JSONView { public function add(\Volkszaehler\Model\Group $obj, $recursive = FALSE) { $group['uuid'] = (string) $obj->getUuid(); diff --git a/backend/lib/View/JSON/JSON.php b/backend/lib/View/JSON/JSONView.php similarity index 98% rename from backend/lib/View/JSON/JSON.php rename to backend/lib/View/JSON/JSONView.php index 17790aa..7b70377 100644 --- a/backend/lib/View/JSON/JSON.php +++ b/backend/lib/View/JSON/JSONView.php @@ -35,7 +35,7 @@ use Volkszaehler\Util; * @package default * @author Steffen Vogel */ -abstract class JSON extends View\View { +abstract class JSONView extends View\View { protected $json = array(); /** diff --git a/backend/lib/View/JpGraph.php b/backend/lib/View/JpGraphView.php similarity index 92% rename from backend/lib/View/JpGraph.php rename to backend/lib/View/JpGraphView.php index f9bbd88..7e5dc22 100644 --- a/backend/lib/View/JpGraph.php +++ b/backend/lib/View/JpGraphView.php @@ -36,7 +36,7 @@ require_once \Volkszaehler\BACKEND_DIR . '/lib/vendor/JpGraph/jpgraph_date.php'; * @link http://jpgraph.net/ * @todo add caching */ -class JpGraph extends View { +class JpGraphView extends View { /** * indicator => ynaxis[n] mapping */ @@ -133,14 +133,14 @@ class JpGraph extends View { $yaxis = $this->graph->yaxis; } else { - $this->axes[$obj->getIndicator()] = $count - 1; + $this->axes[$channel->getIndicator()] = $count - 1; - $this->graph->SetYScale($this->axes[$obj->getIndicator()],'lin'); + $this->graph->SetYScale($this->axes[$channel->getIndicator()],'lin'); - $yaxis = $this->graph->ynaxis[$this->axes[$obj->getIndicator()]]; + $yaxis = $this->graph->ynaxis[$this->axes[$channel->getIndicator()]]; } - $yaxis->title->Set($obj->getUnit()); + $yaxis->title->Set($channel->getUnit()); $yaxis->SetFont(FF_ARIAL); $yaxis->title->SetFont(FF_ARIAL); @@ -148,7 +148,7 @@ class JpGraph extends View { $yaxis->SetTitleMargin('50'); } - return $this->axes[$obj->getIndicator()]; + return $this->axes[$channel->getIndicator()]; } /** diff --git a/backend/lib/View/XML/Channel.php b/backend/lib/View/XML/XMLChannelView.php similarity index 98% rename from backend/lib/View/XML/Channel.php rename to backend/lib/View/XML/XMLChannelView.php index b5aa641..897062f 100644 --- a/backend/lib/View/XML/Channel.php +++ b/backend/lib/View/XML/XMLChannelView.php @@ -32,7 +32,7 @@ use Volkszaehler\View\HTTP; * @author Steffen Vogel * @package channel */ -class Channel extends XML { +class XMLChannelView extends XMLView { public function __construct(HTTP\Request $request, HTTP\Response $response) { parent::__construct($request, $response); diff --git a/backend/lib/View/XML/Group.php b/backend/lib/View/XML/XMLGroupView.php similarity index 97% rename from backend/lib/View/XML/Group.php rename to backend/lib/View/XML/XMLGroupView.php index 47da824..ad6775f 100644 --- a/backend/lib/View/XML/Group.php +++ b/backend/lib/View/XML/XMLGroupView.php @@ -30,7 +30,7 @@ use Volkszaehler\View\HTTP; * @author Steffen Vogel * @package group */ -class Group extends XML { +class XMLGroupView extends XMLView { protected $xml; public function __construct(HTTP\Request $request, HTTP\Request $response) { diff --git a/backend/lib/View/XML/XML.php b/backend/lib/View/XML/XMLView.php similarity index 98% rename from backend/lib/View/XML/XML.php rename to backend/lib/View/XML/XMLView.php index 3a12b1b..19ca6a4 100644 --- a/backend/lib/View/XML/XML.php +++ b/backend/lib/View/XML/XMLView.php @@ -32,7 +32,7 @@ use Volkszaehler\Util; * @author Steffen Vogel * @package default */ -abstract class XML extends View\View { +abstract class XMLView extends View\View { protected $xmlDoc; public function __construct(HTTP\Request $request, HTTP\Response $response) { diff --git a/share/tools/generate_docs.php b/share/tools/generate_docs.php index abb535c..3e90ff7 100644 --- a/share/tools/generate_docs.php +++ b/share/tools/generate_docs.php @@ -55,8 +55,8 @@ exec($cmd, $output, $rc); if ($rc == 0) { # update dokumentation - //$cmd = $vzDir . '/phpdoc/phpdoc -c ' . $vzDir . '/github/share/tools/phpdoc.ini'; - $cmd = 'php5 ' . $vzDir . '/phpdoctor/phpdoc.php ' . $vzDir . '/github/share/tools/phpdoctor.ini'; + $cmd = $vzDir . '/phpdoc/phpdoc -c ' . $vzDir . '/github/share/tools/phpdoc.ini'; + //$cmd = 'php5 ' . $vzDir . '/phpdoctor/phpdoc.php ' . $vzDir . '/github/share/tools/phpdoctor.ini'; $output[] = PHP_EOL . $cmd . PHP_EOL; exec($cmd, $output, $rc); }