Browse Source

PHPdoc updated

master
Anton Terekhov 12 years ago
parent
commit
4f55333064
  1. 7
      app/FrontController.php
  2. 21
      app/router/Router.php
  3. 8
      layout/Layout.php
  4. 2
      redis/RedisDebug.php
  5. 3
      redis/RedisManager.php
  6. 3
      redis/redis.php

7
app/FrontController.php

@ -5,8 +5,6 @@
* @package Majestic * @package Majestic
* @subpackage app * @subpackage app
* @since 2010-02-24 * @since 2010-02-24
* @version SVN: $Id$
* @filesource $URL$
*/ */
class FrontController class FrontController
@ -65,6 +63,7 @@ class FrontController
/** /**
* *
* @param null $view
* @return iView * @return iView
*/ */
public function getView($view = null) public function getView($view = null)
@ -75,6 +74,7 @@ class FrontController
/** /**
* @param string $url * @param string $url
* @return FrontController
*/ */
public function setBaseUrl($url) public function setBaseUrl($url)
{ {
@ -115,6 +115,9 @@ class FrontController
throw new GeneralException('Layout class "' . $layout_class . '" not found.'); throw new GeneralException('Layout class "' . $layout_class . '" not found.');
} }
/**
* @var Layout $layout
*/
$layout = new $layout_class(); $layout = new $layout_class();
$html = $layout->fetch($action); $html = $layout->fetch($action);
if (Config::get('PROFILER')) { if (Config::get('PROFILER')) {

21
app/router/Router.php

@ -5,15 +5,18 @@
* @package Majestic * @package Majestic
* @subpackage app * @subpackage app
* @since 2010-02-25 * @since 2010-02-25
* @version SVN: $Id$
* @filesource $URL$
*/ */
class Router class Router
{ {
/**
* @var Route[]
*/
protected $routes = array(); protected $routes = array();
/**
* @var string
*/
protected $route_name; protected $route_name;
protected $default_layout = 'Default'; protected $default_layout = 'Default';
@ -33,6 +36,10 @@ class Router
$this->routes[$name] = new Route($route, $action, $params, $layout); $this->routes[$name] = new Route($route, $action, $params, $layout);
} }
/**
* @param $request
* @return bool|Route
*/
public function route($request) public function route($request)
{ {
$req = explode('/', trim($request, '/')); $req = explode('/', trim($request, '/'));
@ -48,6 +55,10 @@ class Router
return false; return false;
} }
/**
* Set default layout name
* @param string $layout
*/
public function setDefaultLayout($layout = 'Default') public function setDefaultLayout($layout = 'Default')
{ {
$this->default_layout = $layout; $this->default_layout = $layout;
@ -71,6 +82,10 @@ class Router
return $this->error_layout . 'Layout'; return $this->error_layout . 'Layout';
} }
/**
* Return current router name
* @return string
*/
public function getRouteName() public function getRouteName()
{ {
return $this->route_name; return $this->route_name;

8
layout/Layout.php

@ -56,7 +56,9 @@ abstract class Layout
abstract protected function execute(); abstract protected function execute();
/** /**
* Execute Action, insert action's result html into layout template and return Layout html
* @param Action $action * @param Action $action
* @return string
*/ */
public function fetch($action) public function fetch($action)
{ {
@ -64,7 +66,11 @@ abstract class Layout
$this->execute(); $this->execute();
return $this->view->fetch($this->getTemplate()); return $this->view->fetch($this->getTemplate());
} }
/**
* Return content of template
* @return string
*/
protected function getTemplate() protected function getTemplate()
{ {
$template = ($this->template) ? $this->template : substr(get_class($this), 0, -6/*strlen('Layout')*/); $template = ($this->template) ? $this->template : substr(get_class($this), 0, -6/*strlen('Layout')*/);

2
redis/RedisDebug.php

@ -5,8 +5,6 @@
* @package Majestic * @package Majestic
* @subpackage Redis * @subpackage Redis
* @since 2011-07-29 * @since 2011-07-29
* @version SVN: $Id$
* @filesource $URL$
*/ */
class RedisDebug class RedisDebug

3
redis/RedisManager.php

@ -15,7 +15,7 @@ class RedisManager
/** /**
* Redis connections * Redis connections
* *
* @var array
* @var Redis[]
*/ */
static protected $connections = array(); static protected $connections = array();
@ -25,6 +25,7 @@ class RedisManager
* @param string $name connection name. If not set 'default' will be used. * @param string $name connection name. If not set 'default' will be used.
* @param array $config Configuration array. * @param array $config Configuration array.
* *
* @throws GeneralException
* @return Redis * @return Redis
*/ */
static public function connect($name = 'default', $config = null) static public function connect($name = 'default', $config = null)

3
redis/redis.php

@ -15,7 +15,8 @@
* @see https://github.com/nicolasff/phpredis * @see https://github.com/nicolasff/phpredis
* *
* @method bool connect() connect(string $host, int $port = 6379, float $timeout = 0) Connect to redis * @method bool connect() connect(string $host, int $port = 6379, float $timeout = 0) Connect to redis
* @method bool pconnect() connect(string $host, int $port = 6379, float $timeout = 0, string $persistent_id) Connect to redis with reusing connection
* @method bool pconnect() pconnect(string $host, int $port = 6379, float $timeout = 0, string $persistent_id) Connect to redis with reusing connection
* @method bool select() select(int $dbindex) Switches to a given database
* @method void close() Close connection to redis * @method void close() Close connection to redis
* @method bool setOption() setOption(mixed $name, mixed $value) Set client option * @method bool setOption() setOption(mixed $name, mixed $value) Set client option
* @method mixed getOption() getOption(mixed $name) Get client option * @method mixed getOption() getOption(mixed $name) Get client option

Loading…
Cancel
Save