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

21
app/router/Router.php

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

6
layout/Layout.php

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

2
redis/RedisDebug.php

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

3
redis/RedisManager.php

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

3
redis/redis.php

@ -15,7 +15,8 @@
* @see https://github.com/nicolasff/phpredis
*
* @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 bool setOption() setOption(mixed $name, mixed $value) Set client option
* @method mixed getOption() getOption(mixed $name) Get client option

Loading…
Cancel
Save