Skip to content

Commit 7fab7be

Browse files
committed
Update header
1 parent 5650415 commit 7fab7be

12 files changed

+90
-90
lines changed

compress.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/**
55
* @package Routiny
66
* @copyright © 2010
7-
* @author Nikita Titov <nikita@zencode.ru>
7+
* @author Nikita Titov <nmtitov@ya.ru>
88
*/
99
/**
1010
* This script packs Routiny code from /lib directory into one file

compressed/rt.php

+79-79
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
1-
<?php
2-
3-
/**
4-
* @package Routiny
5-
* @copyright &copy; 2010
6-
* @author Nikita Titov <nikita@zencode.ru>
7-
*/
8-
class Rt {
9-
10-
private $router;
11-
12-
public function __construct() {
13-
$this->router = new RtRouter();
14-
}
15-
16-
public function __call($name, $arguments) {
17-
if (RtHelper::checkHTTPMethod($name)) {
18-
if (isset($arguments[0])) {
19-
return $this->store($name, $arguments[0]);
20-
}
21-
} elseif (RtHelper::checkDecorator($name)) {
22-
if (isset($arguments[0])) {
23-
return $this->decorate($name, $arguments[0]);
24-
} else {
25-
return $this->decorate($name);
26-
}
27-
}
28-
}
29-
30-
private function store($method, $route) {
31-
$this->router->saveRoute($method, $route);
32-
//defining a GET handler also automatically defines HEAD handler
33-
if ('GET' == $method) {
34-
$this->router->saveRoute('HEAD', $route);
35-
}
36-
return $this;
37-
}
38-
39-
private function decorate($name, $params=null) {
40-
$this->router->saveDecoratorParams($name, $params);
41-
return $this;
42-
}
43-
44-
public function format_by_request() {
45-
$type = $this->router->getType();
46-
if (!is_null($type)) {
47-
$this->decorate($type);
48-
} else {
49-
$this->decorate('view');
50-
}
51-
return $this;
52-
}
53-
54-
public function dispatch($function) {
55-
$this->router->saveFunction($function);
56-
return $this;
57-
}
58-
59-
public function run() {
60-
$action = $this->router->getAction();
61-
$decorators = $this->router->getDecorators();
62-
if (!empty($decorators)) {
63-
foreach ($decorators as $name => $params) {
64-
$decorator = 'Rt' . $name;
65-
$action = new $decorator($action, $params);
66-
}
67-
}
68-
echo $action->perform();
69-
}
70-
71-
}
1+
<?php
2+
3+
/**
4+
* @package Routiny
5+
* @copyright &copy; 2010
6+
* @author Nikita Titov <nmtitov@ya.ru>
7+
*/
8+
class Rt {
9+
10+
private $router;
11+
12+
public function __construct() {
13+
$this->router = new RtRouter();
14+
}
15+
16+
public function __call($name, $arguments) {
17+
if (RtHelper::checkHTTPMethod($name)) {
18+
if (isset($arguments[0])) {
19+
return $this->store($name, $arguments[0]);
20+
}
21+
} elseif (RtHelper::checkDecorator($name)) {
22+
if (isset($arguments[0])) {
23+
return $this->decorate($name, $arguments[0]);
24+
} else {
25+
return $this->decorate($name);
26+
}
27+
}
28+
}
29+
30+
private function store($method, $route) {
31+
$this->router->saveRoute($method, $route);
32+
//defining a GET handler also automatically defines HEAD handler
33+
if ('GET' == $method) {
34+
$this->router->saveRoute('HEAD', $route);
35+
}
36+
return $this;
37+
}
38+
39+
private function decorate($name, $params=null) {
40+
$this->router->saveDecoratorParams($name, $params);
41+
return $this;
42+
}
43+
44+
public function format_by_request() {
45+
$type = $this->router->getType();
46+
if (!is_null($type)) {
47+
$this->decorate($type);
48+
} else {
49+
$this->decorate('view');
50+
}
51+
return $this;
52+
}
53+
54+
public function dispatch($function) {
55+
$this->router->saveFunction($function);
56+
return $this;
57+
}
58+
59+
public function run() {
60+
$action = $this->router->getAction();
61+
$decorators = $this->router->getDecorators();
62+
if (!empty($decorators)) {
63+
foreach ($decorators as $name => $params) {
64+
$decorator = 'Rt' . $name;
65+
$action = new $decorator($action, $params);
66+
}
67+
}
68+
echo $action->perform();
69+
}
70+
71+
}
7272

7373

7474
/**
7575
* @package Routiny
7676
* @copyright &copy; 2010
77-
* @author Nikita Titov <nikita@zencode.ru>
77+
* @author Nikita Titov <nmtitov@ya.ru>
7878
*/
7979
class RtAction implements RtIAction {
8080

@@ -123,7 +123,7 @@ public function perform() {
123123
/**
124124
* @package Routiny
125125
* @copyright &copy; 2010
126-
* @author Nikita Titov <nikita@zencode.ru>
126+
* @author Nikita Titov <nmtitov@ya.ru>
127127
*/
128128
class RtException extends Exception {
129129

@@ -133,7 +133,7 @@ class RtException extends Exception {
133133
/**
134134
* @package Routiny
135135
* @copyright &copy; 2010
136-
* @author Nikita Titov <nikita@zencode.ru>
136+
* @author Nikita Titov <nmtitov@ya.ru>
137137
*/
138138
class RtHelper {
139139
const D = "|";
@@ -198,7 +198,7 @@ public static function checkType($type) {
198198
/**
199199
* @package Routiny
200200
* @copyright &copy; 2010
201-
* @author Nikita Titov <nikita@zencode.ru>
201+
* @author Nikita Titov <nmtitov@ya.ru>
202202
*/
203203
interface RtIAction {
204204
public function perform();
@@ -208,7 +208,7 @@ public function perform();
208208
/**
209209
* @package Routiny
210210
* @copyright &copy; 2010
211-
* @author Nikita Titov <nikita@zencode.ru>
211+
* @author Nikita Titov <nmtitov@ya.ru>
212212
*/
213213
class RtJSON implements RtIAction {
214214

@@ -365,7 +365,7 @@ private function getRequestQuery() {
365365
/**
366366
* @package Routiny
367367
* @copyright &copy; 2010
368-
* @author Nikita Titov <nikita@zencode.ru>
368+
* @author Nikita Titov <nmtitov@ya.ru>
369369
*/
370370
class RtText implements RtIAction {
371371

@@ -387,7 +387,7 @@ public function perform() {
387387
/**
388388
* @package Routiny
389389
* @copyright &copy; 2010
390-
* @author Nikita Titov <nikita@zencode.ru>
390+
* @author Nikita Titov <nmtitov@ya.ru>
391391
*/
392392
class RtView implements RtIAction {
393393

@@ -530,7 +530,7 @@ public static function isAssoc($array) {
530530
/**
531531
* @package Routiny
532532
* @copyright &copy; 2010
533-
* @author Nikita Titov <nikita@zencode.ru>
533+
* @author Nikita Titov <nmtitov@ya.ru>
534534
*/
535535
class RtXSLT implements RtIAction {
536536

index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @package Routiny
55
* @copyright &copy; 2010
6-
* @author Nikita Titov <nikita@zencode.ru>
6+
* @author Nikita Titov <nmtitov@ya.ru>
77
*/
88
//Use lazy loading with files in /lib directory and
99
//you custom autoload() function with

lib/rt.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @package Routiny
55
* @copyright &copy; 2010
6-
* @author Nikita Titov <nikita@zencode.ru>
6+
* @author Nikita Titov <nmtitov@ya.ru>
77
*/
88
class Rt {
99

lib/rtaction.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @package Routiny
55
* @copyright &copy; 2010
6-
* @author Nikita Titov <nikita@zencode.ru>
6+
* @author Nikita Titov <nmtitov@ya.ru>
77
*/
88
class RtAction implements RtIAction {
99

lib/rtexception.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @package Routiny
55
* @copyright &copy; 2010
6-
* @author Nikita Titov <nikita@zencode.ru>
6+
* @author Nikita Titov <nmtitov@ya.ru>
77
*/
88
class RtException extends Exception {
99

lib/rthelper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @package Routiny
55
* @copyright &copy; 2010
6-
* @author Nikita Titov <nikita@zencode.ru>
6+
* @author Nikita Titov <nmtitov@ya.ru>
77
*/
88
class RtHelper {
99
const D = "|";

lib/rtiaction.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @package Routiny
55
* @copyright &copy; 2010
6-
* @author Nikita Titov <nikita@zencode.ru>
6+
* @author Nikita Titov <nmtitov@ya.ru>
77
*/
88
interface RtIAction {
99
public function perform();

lib/rtjson.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @package Routiny
55
* @copyright &copy; 2010
6-
* @author Nikita Titov <nikita@zencode.ru>
6+
* @author Nikita Titov <nmtitov@ya.ru>
77
*/
88
class RtJSON implements RtIAction {
99

lib/rttext.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @package Routiny
55
* @copyright &copy; 2010
6-
* @author Nikita Titov <nikita@zencode.ru>
6+
* @author Nikita Titov <nmtitov@ya.ru>
77
*/
88
class RtText implements RtIAction {
99

lib/rtview.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @package Routiny
55
* @copyright &copy; 2010
6-
* @author Nikita Titov <nikita@zencode.ru>
6+
* @author Nikita Titov <nmtitov@ya.ru>
77
*/
88
class RtView implements RtIAction {
99

lib/rtxslt.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* @package Routiny
55
* @copyright &copy; 2010
6-
* @author Nikita Titov <nikita@zencode.ru>
6+
* @author Nikita Titov <nmtitov@ya.ru>
77
*/
88
class RtXSLT implements RtIAction {
99

0 commit comments

Comments
 (0)