1 | <?php |
||
28 | class CallableDir extends RequestPlugin |
||
29 | { |
||
30 | use \Jaxon\Features\Translator; |
||
31 | |||
32 | /** |
||
33 | * The callable registrar |
||
34 | * |
||
35 | * @var CallableRegistry |
||
36 | */ |
||
37 | protected $xRegistry; |
||
38 | |||
39 | /** |
||
40 | * The class constructor |
||
41 | * |
||
42 | * @param CallableRegistry $xRegistry |
||
43 | */ |
||
44 | public function __construct(CallableRegistry $xRegistry) |
||
48 | |||
49 | /** |
||
50 | * Return the name of this plugin |
||
51 | * |
||
52 | * @return string |
||
53 | */ |
||
54 | public function getName() |
||
58 | |||
59 | /** |
||
60 | * Check the directory |
||
61 | * |
||
62 | * @param string $sDirectory The path of teh directory being registered |
||
63 | * |
||
64 | * @return string |
||
65 | * @throws \Jaxon\Exception\Error |
||
66 | */ |
||
67 | private function checkDirectory($sDirectory) |
||
80 | |||
81 | /** |
||
82 | * Check the options |
||
83 | * |
||
84 | * @param array|string $aOptions The associated options |
||
85 | * |
||
86 | * @return array |
||
87 | * @throws \Jaxon\Exception\Error |
||
88 | */ |
||
89 | private function checkOptions($aOptions) |
||
109 | |||
110 | /** |
||
111 | * Register a callable class |
||
112 | * |
||
113 | * @param string $sType The type of request handler being registered |
||
114 | * @param string $sDirectory The path of teh directory being registered |
||
115 | * @param array|string $aOptions The associated options |
||
116 | * |
||
117 | * @return boolean |
||
118 | */ |
||
119 | public function register($sType, $sDirectory, $aOptions) |
||
149 | |||
150 | /** |
||
151 | * Generate a hash for the registered callable objects |
||
152 | * |
||
153 | * @return string |
||
154 | */ |
||
155 | public function generateHash() |
||
159 | |||
160 | /** |
||
161 | * Generate client side javascript code for the registered callable objects |
||
162 | * |
||
163 | * @return string |
||
164 | */ |
||
165 | public function getScript() |
||
169 | |||
170 | /** |
||
171 | * Check if this plugin can process the incoming Jaxon request |
||
172 | * |
||
173 | * @return boolean |
||
174 | */ |
||
175 | public function canProcessRequest() |
||
179 | |||
180 | /** |
||
181 | * Process the incoming Jaxon request |
||
182 | * |
||
183 | * @return boolean |
||
184 | */ |
||
185 | public function processRequest() |
||
189 | } |
||
190 |