From 49bb30be2c3da20e99f188371b65e3f4f3098f60 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 22 Jul 2010 11:13:11 +0200 Subject: [PATCH] added phpDocumentors .ini config addded documentation --- backend/lib/Controller/Channel.php | 38 ++++++++++++------------- backend/lib/Controller/Controller.php | 13 +++++---- backend/lib/Controller/Data.php | 1 + backend/lib/Controller/Group.php | 28 +++++++++--------- backend/lib/Interpreter/Interpreter.php | 1 + share/tools/generate_docs.sh | 6 +--- 6 files changed, 43 insertions(+), 44 deletions(-) diff --git a/backend/lib/Controller/Channel.php b/backend/lib/Controller/Channel.php index 59ad0a8..3457f8d 100644 --- a/backend/lib/Controller/Channel.php +++ b/backend/lib/Controller/Channel.php @@ -26,12 +26,12 @@ use \Volkszaehler\Model; /** * channel controller - * - * @author Steffen Vogel * + * @author Steffen Vogel + * @package channel */ class Channel extends Controller { - + // TODO authentification/indentification public function get() { $dql = 'SELECT c FROM Volkszaehler\Model\Channel c'; @@ -39,64 +39,64 @@ class Channel extends Controller { if ($this->view->request->getParameter('uuid')) { // TODO add conditions } - + if ($this->view->request->getParameter('ugid')) { // TODO add conditions } - + if ($this->view->request->getParameter('indicator')) { // TODO add conditions } - + $q = $this->em->createQuery($dql); $channels = $q->getResult(); - + foreach ($channels as $channel) { $this->view->add($channel); } } - + /** * add channel - * + * * @todo validate input and throw exceptions */ public function add() { $channel = new Model\Channel\Meter($this->view->request->getParameter('indicator')); - + $channel->setName($this->view->request->getParameter('name')); $channel->setDescription($this->view->request->getParameter('description')); - + $channel->setResolution($this->view->request->getParameter('resolution')); $channel->setCost($this->view->request->getParameter('cost')); - + $this->em->persist($channel); $this->em->flush(); - + $this->view->add($channel); } - + /** * delete channel - * + * * @todo authentification/indentification */ public function delete() { $ucid = $this->view->request->getParameter('ucid'); $channel = $this->em->getRepository('Volkszaehler\Model\Channel\Channel')->findOneBy(array('uuid' => $ucid)); - + $this->em->remove($channel); $this->em->flush(); } - + /** * edit channel properties - * + * * @todo authentification/indentification * @todo to be implemented */ public function edit() { - + } } diff --git a/backend/lib/Controller/Controller.php b/backend/lib/Controller/Controller.php index 8fda019..213dde2 100644 --- a/backend/lib/Controller/Controller.php +++ b/backend/lib/Controller/Controller.php @@ -1,6 +1,7 @@ * + * @author Steffen Vogel + * @package default */ abstract class Controller { protected $view; protected $em; - + /** * constructor */ @@ -38,17 +39,17 @@ abstract class Controller { $this->view = $view; $this->em = $em; } - + /** * run controller actions - * + * * @param string $action runs the action if class method is available */ public function run($action) { if (!method_exists($this, $action)) { throw new \InvalidArgumentException('\'' . $action . '\' is not a valid controller action'); } - + $this->$action(); } } diff --git a/backend/lib/Controller/Data.php b/backend/lib/Controller/Data.php index 54fb4e6..2499464 100644 --- a/backend/lib/Controller/Data.php +++ b/backend/lib/Controller/Data.php @@ -29,6 +29,7 @@ use Volkszaehler\Util; * * @author Steffen Vogel * @todo call via redirect from Controller\Channel + * @package data */ class Data extends Controller { diff --git a/backend/lib/Controller/Group.php b/backend/lib/Controller/Group.php index 9c0c13f..e73e051 100644 --- a/backend/lib/Controller/Group.php +++ b/backend/lib/Controller/Group.php @@ -24,51 +24,51 @@ namespace Volkszaehler\Controller; /** * group controller - * - * @author Steffen Vogel (info@steffenvogel.de) * + * @author Steffen Vogel (info@steffenvogel.de) + * @package group */ class Group extends Controller { - + /** - * + * */ public function get() { // TODO get groups from entitymanager according to API specs - + foreach ($groups as $group) { $this->view->addGroup($group); } } - + /** - * + * */ public function add() { $group = new Group(); - + $group->name = $this->view->request->getParameter('name'); $group->description = $this->view->request->getParameter('description'); - + $this->em->persist($group); $this->em->flush(); - + $this->view->add($group); } - + /** * @todo authentification/indentification */ public function delete() { $group = Group::getByUuid($this->view->request->getParameter('ugid')); - + $this->em->remove($group); $this->em->flush(); } - + /** * edit group properties - * + * * @todo implement Controller\Group::edit() */ public function edit() { diff --git a/backend/lib/Interpreter/Interpreter.php b/backend/lib/Interpreter/Interpreter.php index 7bcb2d4..66fcbfb 100644 --- a/backend/lib/Interpreter/Interpreter.php +++ b/backend/lib/Interpreter/Interpreter.php @@ -39,6 +39,7 @@ interface InterpreterInterface { * interpreter superclass for all interpreters * * @author Steffen Vogel + * @package data * */ abstract class Interpreter implements InterpreterInterface { diff --git a/share/tools/generate_docs.sh b/share/tools/generate_docs.sh index 739cfe8..929a701 100644 --- a/share/tools/generate_docs.sh +++ b/share/tools/generate_docs.sh @@ -32,8 +32,4 @@ git pull cd /var/www/vz/ # update dokumentation -phpdoc/phpdoc --directory github --target docs \ ---title "volkszaehler.org Documentation" \ ---output HTML:frames:phpedit \ ---ignoresymlinks \ ---ignore backend/lib/vendor/,backend/lib/Model/Proxies/ \ No newline at end of file +phpdoc/phpdoc --config /var/www/vz/github/share/tools/phpdoc.ini