PluginProbe
Redirection / 2.9
Redirection v2.9
5.10.0 5.9.0 5.8.1 5.8.0 3.7.2 3.7.3 4.0 4.0.1 4.1 4.1.1 4.2 4.2.1 4.2.2 4.2.3 4.3 4.3.1 4.3.2 4.3.3 4.4 4.4.1 4.4.2 4.5 4.5.1 4.6.2 4.7.1 All 130 releases
← All changes | models/action.php +8 -19 4.02.9 View file →
@@ -1,14 +1,11 @@
1 1 <?php
2 2
3 3 class Red_Action {
4 - protected $code;
5 - protected $type;
6 -
7 4 function __construct( $values ) {
8 5 if ( is_array( $values ) ) {
9 6 foreach ( $values as $key => $value ) {
10 - $this->$key = $value;
7 + $this->$key = $value;
11 8 }
12 9 }
13 10 }
14 11
@@ -16,12 +13,12 @@
16 13 $avail = self::available();
17 14
18 15 if ( isset( $avail[ $name ] ) ) {
19 16 if ( ! class_exists( strtolower( $avail[ $name ][1] ) ) ) {
20 - include_once dirname( __FILE__ ) . '/../actions/' . $avail[ $name ][0];
17 + include_once dirname( __FILE__ ).'/../actions/'.$avail[ $name ][0];
21 18 }
22 19
23 - $obj = new $avail[ $name ][1]( array( 'code' => $code ) );
20 + $obj = new $avail[ $name ][1]( array( 'action_code' => $code ) );
24 21 $obj->type = $name;
25 22 return $obj;
26 23 }
27 24
@@ -28,14 +25,14 @@
28 25 return false;
29 26 }
30 27
31 28 static function available() {
32 - return array(
33 - 'url' => array( 'url.php', 'Url_Action' ),
34 - 'error' => array( 'error.php', 'Error_Action' ),
29 + return array(
30 + 'url' => array( 'url.php', 'Url_Action' ),
31 + 'error' => array( 'error.php', 'Error_Action' ),
35 32 'nothing' => array( 'nothing.php', 'Nothing_Action' ),
36 - 'random' => array( 'random.php', 'Random_Action' ),
37 - 'pass' => array( 'pass.php', 'Pass_Action' ),
33 + 'random' => array( 'random.php', 'Random_Action' ),
34 + 'pass' => array( 'pass.php', 'Pass_Action' ),
38 35 );
39 36 }
40 37
41 38 public function process_before( $code, $target ) {
@@ -43,14 +40,6 @@
43 40 }
44 41
45 42 public function process_after( $code, $target ) {
46 43 return true;
47 - }
48 -
49 - public function get_code() {
50 - return $this->code;
51 - }
52 -
53 - public function get_type() {
54 - return $this->type;
55 44 }
56 45 }