@@ -127,8 +127,7 @@ discard block |
||
127 | 127 | $button->setCssClass($this->getButtonCssClass()); |
128 | 128 | return $button; |
129 | 129 | } |
130 | - } |
|
131 | - else if($buttonType===TPagerButtonType::ImageButton) |
|
130 | + } else if($buttonType===TPagerButtonType::ImageButton) |
|
132 | 131 | { |
133 | 132 | $button = new TActiveImageButton; |
134 | 133 | $button->setImageUrl($this->getPageImageUrl($text,$commandName)); |
@@ -136,8 +135,7 @@ discard block |
||
136 | 135 | $button->Visible = true; |
137 | 136 | else |
138 | 137 | $button->Visible = false; |
139 | - } |
|
140 | - else |
|
138 | + } else |
|
141 | 139 | { |
142 | 140 | $button=new TActiveButton; |
143 | 141 | if(!$enabled) |
@@ -197,8 +195,7 @@ discard block |
||
197 | 195 | TWebControl::render($writer); |
198 | 196 | if($this->getActiveControl()->canUpdateClientSide()) |
199 | 197 | $this->getPage()->getCallbackClient()->replaceContent($this,$writer); |
200 | - } |
|
201 | - else |
|
198 | + } else |
|
202 | 199 | { |
203 | 200 | $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
204 | 201 | } |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | ); |
95 | 95 | |
96 | 96 | $this->getControls()->add($list); |
97 | - $list->setDataSource(range(1,$this->getPageCount())); |
|
97 | + $list->setDataSource(range(1, $this->getPageCount())); |
|
98 | 98 | $list->dataBind(); |
99 | 99 | $list->setSelectedIndex($this->getCurrentPageIndex()); |
100 | 100 | $list->setAutoPostBack(true); |
101 | - $list->attachEventHandler('OnSelectedIndexChanged',array($this,'listIndexChanged')); |
|
101 | + $list->attachEventHandler('OnSelectedIndexChanged', array($this, 'listIndexChanged')); |
|
102 | 102 | $list->attachEventHandler('OnCallback', array($this, 'handleCallback')); |
103 | 103 | } |
104 | 104 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * @param string CommandParameter corresponding to the OnCommand event of the button |
115 | 115 | * @return mixed the button instance |
116 | 116 | */ |
117 | - protected function createPagerButton($buttonType,$enabled,$text,$commandName,$commandParameter) |
|
117 | + protected function createPagerButton($buttonType, $enabled, $text, $commandName, $commandParameter) |
|
118 | 118 | { |
119 | 119 | if($buttonType===TPagerButtonType::LinkButton) |
120 | 120 | { |
@@ -130,12 +130,12 @@ discard block |
||
130 | 130 | } |
131 | 131 | else if($buttonType===TPagerButtonType::ImageButton) |
132 | 132 | { |
133 | - $button = new TActiveImageButton; |
|
134 | - $button->setImageUrl($this->getPageImageUrl($text,$commandName)); |
|
133 | + $button=new TActiveImageButton; |
|
134 | + $button->setImageUrl($this->getPageImageUrl($text, $commandName)); |
|
135 | 135 | if($enabled) |
136 | - $button->Visible = true; |
|
136 | + $button->Visible=true; |
|
137 | 137 | else |
138 | - $button->Visible = false; |
|
138 | + $button->Visible=false; |
|
139 | 139 | } |
140 | 140 | else |
141 | 141 | { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | if($buttonType===TPagerButtonType::ImageButton) |
148 | 148 | { |
149 | - $button->ImageUrl = $text; |
|
149 | + $button->ImageUrl=$text; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | $button->setText($text); |
@@ -170,14 +170,14 @@ discard block |
||
170 | 170 | * @param mixed $sender |
171 | 171 | * @param TCallbackEventParameter $param |
172 | 172 | */ |
173 | - public function handleCallback ($sender,$param) |
|
173 | + public function handleCallback($sender, $param) |
|
174 | 174 | { |
175 | 175 | // Update all the buttons pagers attached to the same control. |
176 | 176 | // Dropdown pagers doesn't need to be re-rendered. |
177 | 177 | $controlToPaginate=$this->getControlToPaginate(); |
178 | - foreach ($this->getNamingContainer()->findControlsByType('TActivePager', false) as $control) |
|
178 | + foreach($this->getNamingContainer()->findControlsByType('TActivePager', false) as $control) |
|
179 | 179 | { |
180 | - if ($control->getMode() !== TPagerMode::DropDownList && $control->getControlToPaginate()===$controlToPaginate) |
|
180 | + if($control->getMode()!==TPagerMode::DropDownList && $control->getControlToPaginate()===$controlToPaginate) |
|
181 | 181 | { |
182 | 182 | $control->render($param->getNewWriter()); |
183 | 183 | // FIXME : With some very fast machine, the getNewWriter() consecutive calls are in the same microsecond, resulting |
@@ -189,18 +189,18 @@ discard block |
||
189 | 189 | $this->onCallback($param); |
190 | 190 | } |
191 | 191 | |
192 | - public function render ($writer) |
|
192 | + public function render($writer) |
|
193 | 193 | { |
194 | 194 | if($this->getHasPreRendered()) |
195 | 195 | { |
196 | - $this->setDisplay(($this->getPageCount()==1)?TDisplayStyle::None:TDisplayStyle::Dynamic); |
|
196 | + $this->setDisplay(($this->getPageCount()==1) ? TDisplayStyle::None : TDisplayStyle::Dynamic); |
|
197 | 197 | TWebControl::render($writer); |
198 | 198 | if($this->getActiveControl()->canUpdateClientSide()) |
199 | - $this->getPage()->getCallbackClient()->replaceContent($this,$writer); |
|
199 | + $this->getPage()->getCallbackClient()->replaceContent($this, $writer); |
|
200 | 200 | } |
201 | 201 | else |
202 | 202 | { |
203 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
203 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
204 | 204 | } |
205 | 205 | } |
206 | 206 | } |
@@ -95,8 +95,7 @@ |
||
95 | 95 | if($this->getHasPreRendered()) { |
96 | 96 | $this->renderRepeater($writer); |
97 | 97 | if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer); |
98 | - } |
|
99 | - else { |
|
98 | + } else { |
|
100 | 99 | $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
101 | 100 | } |
102 | 101 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | parent::setDataSource($value); |
58 | 58 | if($this->getActiveControl()->canUpdateClientSide()) { |
59 | 59 | $this->renderPager(); |
60 | - $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); |
|
60 | + $this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter()); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | public function render($writer) { |
95 | 95 | if($this->getHasPreRendered()) { |
96 | 96 | $this->renderRepeater($writer); |
97 | - if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer); |
|
97 | + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(), $writer); |
|
98 | 98 | } |
99 | 99 | else { |
100 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
100 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | foreach($pager as $item) { |
112 | 112 | if($item->ControlToPaginate==$this->ID) { |
113 | 113 | $writer=$this->getResponse()->createHtmlWriter(); |
114 | - $this->getPage()->getAdapter()->registerControlToRender($item,$writer); |
|
114 | + $this->getPage()->getAdapter()->registerControlToRender($item, $writer); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * @param THtmlWriter writer for the rendering purpose |
124 | 124 | */ |
125 | 125 | private function renderRepeater($writer) { |
126 | - $writer->addAttribute('id',$this->getSurroundingTagID()); |
|
126 | + $writer->addAttribute('id', $this->getSurroundingTagID()); |
|
127 | 127 | $writer->renderBeginTag($this->getSurroundingTag()); |
128 | 128 | parent::render($writer); |
129 | 129 | $writer->renderEndTag(); |
@@ -81,8 +81,7 @@ |
||
81 | 81 | $this->_d[]=$item; |
82 | 82 | ++$this->_c; |
83 | 83 | } |
84 | - } |
|
85 | - else if($data!==null) |
|
84 | + } else if($data!==null) |
|
86 | 85 | throw new TInvalidDataTypeException('queue_data_not_iterable'); |
87 | 86 | } |
88 | 87 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @package System.Collections |
33 | 33 | * @since 3.1 |
34 | 34 | */ |
35 | -class TQueue extends TComponent implements IteratorAggregate,Countable |
|
35 | +class TQueue extends TComponent implements IteratorAggregate, Countable |
|
36 | 36 | { |
37 | 37 | /** |
38 | 38 | * internal data storage |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function contains($item) |
103 | 103 | { |
104 | - return array_search($item,$this->_d,true)!==false; |
|
104 | + return array_search($item, $this->_d, true)!==false; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | public function enqueue($item) |
142 | 142 | { |
143 | 143 | ++$this->_c; |
144 | - $this->_d[] = $item; |
|
144 | + $this->_d[]=$item; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function getIterator() |
153 | 153 | { |
154 | - return new ArrayIterator( $this->_d ); |
|
154 | + return new ArrayIterator($this->_d); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | */ |
258 | 258 | public function valid() |
259 | 259 | { |
260 | - return $this->_i<$this->_c; |
|
260 | + return $this->_i < $this->_c; |
|
261 | 261 | } |
262 | 262 | } |
263 | 263 |
@@ -70,8 +70,7 @@ |
||
70 | 70 | |
71 | 71 | echo "\n\n** PDF file quickstart.pdf created **\n\n"; |
72 | 72 | |
73 | - } |
|
74 | - else |
|
73 | + } else |
|
75 | 74 | { |
76 | 75 | echo " Unable to find pdfLatex executable $pdflatexExec"; |
77 | 76 | } |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * @var array List of requirements (required or not, check item, hint) |
29 | 29 | */ |
30 | -$requirements = array( |
|
30 | +$requirements=array( |
|
31 | 31 | array( |
32 | 32 | true, |
33 | - version_compare(PHP_VERSION,"5.3.3",">="), |
|
34 | - 'PHP version check','PHP 5.3.3 or higher required'), |
|
33 | + version_compare(PHP_VERSION, "5.3.3", ">="), |
|
34 | + 'PHP version check', 'PHP 5.3.3 or higher required'), |
|
35 | 35 | array( |
36 | 36 | true, |
37 | 37 | isset($_SERVER["HTTP_ACCEPT"]), |
@@ -49,17 +49,17 @@ discard block |
||
49 | 49 | 'REQUEST_URI required'), |
50 | 50 | array( |
51 | 51 | true, |
52 | - isset($_SERVER["PATH_INFO"]) || strpos($_SERVER["PHP_SELF"],$_SERVER["SCRIPT_NAME"])===0, |
|
52 | + isset($_SERVER["PATH_INFO"]) || strpos($_SERVER["PHP_SELF"], $_SERVER["SCRIPT_NAME"])===0, |
|
53 | 53 | '$_SERVER["PATH_INFO"] check', |
54 | 54 | 'PATH_INFO required'), |
55 | 55 | array( |
56 | 56 | true, |
57 | - class_exists('Reflection',false), |
|
57 | + class_exists('Reflection', false), |
|
58 | 58 | 'Reflection extension check', |
59 | 59 | 'Reflection extension required'), |
60 | 60 | array( |
61 | 61 | true, |
62 | - class_exists("DOMDocument",false), |
|
62 | + class_exists("DOMDocument", false), |
|
63 | 63 | 'DOM extension check', |
64 | 64 | 'DOM extension required'), |
65 | 65 | array( |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | 'JSON extension required'), |
85 | 85 | array( |
86 | 86 | false, |
87 | - class_exists("PDO",false), |
|
87 | + class_exists("PDO", false), |
|
88 | 88 | 'PDO extension check', |
89 | 89 | 'PDO extension optional'), |
90 | 90 | array( |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | 'SOAP extension optional'), |
150 | 150 | ); |
151 | 151 | |
152 | -$results = "<table class=\"result\">\n"; |
|
153 | -$conclusion = 0; |
|
152 | +$results="<table class=\"result\">\n"; |
|
153 | +$conclusion=0; |
|
154 | 154 | foreach($requirements as $requirement) |
155 | 155 | { |
156 | - list($required,$expression,$aspect,$hint)=$requirement; |
|
156 | + list($required, $expression, $aspect, $hint)=$requirement; |
|
157 | 157 | //eval('$ret='.$expression.';'); |
158 | 158 | $ret=$expression; |
159 | 159 | if($required) |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | $results.="<tr class=\"$ret\"><td class=\"$ret\">".lmessage($aspect)."</td><td class=\"$ret\">".lmessage($hint)."</td></tr>\n"; |
181 | 181 | } |
182 | -$results .= '</table>'; |
|
182 | +$results.='</table>'; |
|
183 | 183 | if($conclusion===0) |
184 | 184 | $conclusion=lmessage('all passed'); |
185 | 185 | else if($conclusion===1) |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | else |
188 | 188 | $conclusion=lmessage('passed with warnings'); |
189 | 189 | |
190 | -$tokens = array( |
|
190 | +$tokens=array( |
|
191 | 191 | '%%Conclusion%%' => $conclusion, |
192 | 192 | '%%Details%%' => $results, |
193 | 193 | '%%Version%%' => $_SERVER['SERVER_SOFTWARE'].' <a href="https://github.com/pradosoft/prado">PRADO</a>/'.getPradoVersion(), |
194 | - '%%Time%%' => @strftime('%Y-%m-%d %H:%m',time()), |
|
194 | + '%%Time%%' => @strftime('%Y-%m-%d %H:%m', time()), |
|
195 | 195 | ); |
196 | 196 | |
197 | 197 | $lang=getPreferredLanguage(); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | die("Unable to open template file '$templateFile'."); |
203 | 203 | |
204 | 204 | header('Content-Type: text/html; charset=UTF-8'); |
205 | -echo strtr($content,$tokens); |
|
205 | +echo strtr($content, $tokens); |
|
206 | 206 | |
207 | 207 | /** |
208 | 208 | * Returns a localized message according to user preferred language. |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | static $messages=null; |
215 | 215 | if($messages===null) |
216 | 216 | { |
217 | - $lang = getPreferredLanguage(); |
|
217 | + $lang=getPreferredLanguage(); |
|
218 | 218 | $msgFile=dirname(__FILE__)."/messages-$lang.txt"; |
219 | 219 | if(!is_file($msgFile)) |
220 | 220 | $msgFile=dirname(__FILE__).'/messages.txt'; |
@@ -222,12 +222,12 @@ discard block |
||
222 | 222 | { |
223 | 223 | foreach($entries as $entry) |
224 | 224 | { |
225 | - @list($code,$message)=explode('=',$entry,2); |
|
225 | + @list($code, $message)=explode('=', $entry, 2); |
|
226 | 226 | $messages[trim($code)]=trim($message); |
227 | 227 | } |
228 | 228 | } |
229 | 229 | } |
230 | - return isset($messages[$token])?$messages[$token]:$token; |
|
230 | + return isset($messages[$token]) ? $messages[$token] : $token; |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | if($languages===null) |
244 | 244 | { |
245 | 245 | $languages=array(); |
246 | - foreach(explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']) as $language) |
|
246 | + foreach(explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $language) |
|
247 | 247 | { |
248 | - $array=explode(';q=',trim($language)); |
|
249 | - $languages[trim($array[0])]=isset($array[1])?(float)$array[1]:1.0; |
|
248 | + $array=explode(';q=', trim($language)); |
|
249 | + $languages[trim($array[0])]=isset($array[1]) ? (float) $array[1] : 1.0; |
|
250 | 250 | } |
251 | 251 | arsort($languages); |
252 | 252 | $languages=array_keys($languages); |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | if($language===null) |
267 | 267 | { |
268 | 268 | $langs=getUserLanguages(); |
269 | - $lang=explode('-',$langs[0]); |
|
269 | + $lang=explode('-', $langs[0]); |
|
270 | 270 | if(empty($lang[0]) || !function_exists('ctype_alpha') || !ctype_alpha($lang[0])) |
271 | 271 | $language='en'; |
272 | 272 | else |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | { |
286 | 286 | $contents=file_get_contents($coreFile); |
287 | 287 | $matches=array(); |
288 | - if(preg_match('/public static function getVersion.*?return \'(.*?)\'/ms',$contents,$matches)>0) |
|
288 | + if(preg_match('/public static function getVersion.*?return \'(.*?)\'/ms', $contents, $matches) > 0) |
|
289 | 289 | return $matches[1]; |
290 | 290 | } |
291 | 291 | return ''; |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * PRADO Requirements Checker script |
|
4 | - * |
|
5 | - * @author Qiang Xue <[email protected]> |
|
6 | - * @link https://github.com/pradosoft/prado |
|
7 | - * @copyright Copyright © 2005-2016 The PRADO Group |
|
8 | - * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
9 | - * @package prado |
|
10 | - */ |
|
3 | + * PRADO Requirements Checker script |
|
4 | + * |
|
5 | + * @author Qiang Xue <[email protected]> |
|
6 | + * @link https://github.com/pradosoft/prado |
|
7 | + * @copyright Copyright © 2005-2016 The PRADO Group |
|
8 | + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
9 | + * @package prado |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * PRADO Requirements Checker script |
@@ -62,31 +62,31 @@ discard block |
||
62 | 62 | class_exists("DOMDocument",false), |
63 | 63 | 'DOM extension check', |
64 | 64 | 'DOM extension required'), |
65 | - array( |
|
66 | - true, |
|
67 | - extension_loaded("SPL"), |
|
68 | - 'SPL extension check', |
|
69 | - 'SPL extension required'), |
|
70 | - array( |
|
71 | - true, |
|
72 | - extension_loaded("CType"), |
|
73 | - 'CType extension check', |
|
74 | - 'CType extension required'), |
|
75 | - array( |
|
76 | - true, |
|
77 | - extension_loaded("pcre"), |
|
78 | - 'PCRE extension check', |
|
79 | - 'PCRE extension required'), |
|
80 | - array( |
|
81 | - true, |
|
82 | - extension_loaded("json"), |
|
83 | - 'JSON extension check', |
|
84 | - 'JSON extension required'), |
|
85 | - array( |
|
86 | - false, |
|
87 | - class_exists("PDO",false), |
|
88 | - 'PDO extension check', |
|
89 | - 'PDO extension optional'), |
|
65 | + array( |
|
66 | + true, |
|
67 | + extension_loaded("SPL"), |
|
68 | + 'SPL extension check', |
|
69 | + 'SPL extension required'), |
|
70 | + array( |
|
71 | + true, |
|
72 | + extension_loaded("CType"), |
|
73 | + 'CType extension check', |
|
74 | + 'CType extension required'), |
|
75 | + array( |
|
76 | + true, |
|
77 | + extension_loaded("pcre"), |
|
78 | + 'PCRE extension check', |
|
79 | + 'PCRE extension required'), |
|
80 | + array( |
|
81 | + true, |
|
82 | + extension_loaded("json"), |
|
83 | + 'JSON extension check', |
|
84 | + 'JSON extension required'), |
|
85 | + array( |
|
86 | + false, |
|
87 | + class_exists("PDO",false), |
|
88 | + 'PDO extension check', |
|
89 | + 'PDO extension optional'), |
|
90 | 90 | array( |
91 | 91 | false, |
92 | 92 | function_exists("iconv"), |
@@ -66,6 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | /** |
68 | 68 | * @param TXmlElement parent element of this element |
69 | + * @param TXmlElement|null $parent |
|
69 | 70 | */ |
70 | 71 | public function setParent($parent) |
71 | 72 | { |
@@ -175,6 +176,7 @@ discard block |
||
175 | 176 | } |
176 | 177 | |
177 | 178 | /** |
179 | + * @param string $tagName |
|
178 | 180 | * @return TList list of all child elements that have the specified tag-name |
179 | 181 | */ |
180 | 182 | public function getElementsByTagName($tagName) |
@@ -334,6 +336,7 @@ discard block |
||
334 | 336 | |
335 | 337 | /** |
336 | 338 | * @param string version of this XML document |
339 | + * @param string $version |
|
337 | 340 | */ |
338 | 341 | public function setVersion($version) |
339 | 342 | { |
@@ -350,6 +353,7 @@ discard block |
||
350 | 353 | |
351 | 354 | /** |
352 | 355 | * @param string encoding of this XML document |
356 | + * @param string $encoding |
|
353 | 357 | */ |
354 | 358 | public function setEncoding($encoding) |
355 | 359 | { |
@@ -473,6 +477,7 @@ discard block |
||
473 | 477 | /** |
474 | 478 | * Recursively converts DOM XML nodes into TXmlElement |
475 | 479 | * @param DOMXmlNode the node to be converted |
480 | + * @param DOMElement $node |
|
476 | 481 | * @return TXmlElement the converted TXmlElement |
477 | 482 | */ |
478 | 483 | protected function buildElement($node) |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function getHasElement() |
111 | 111 | { |
112 | - return $this->_elements!==null && $this->_elements->getCount()>0; |
|
112 | + return $this->_elements!==null && $this->_elements->getCount() > 0; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getHasAttribute() |
119 | 119 | { |
120 | - return $this->_attributes!==null && $this->_attributes->getCount()>0; |
|
120 | + return $this->_attributes!==null && $this->_attributes->getCount() > 0; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | * @param string attribute name |
136 | 136 | * @param string attribute value |
137 | 137 | */ |
138 | - public function setAttribute($name,$value) |
|
138 | + public function setAttribute($name, $value) |
|
139 | 139 | { |
140 | - $this->getAttributes()->add($name,TPropertyValue::ensureString($value)); |
|
140 | + $this->getAttributes()->add($name, TPropertyValue::ensureString($value)); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -203,12 +203,12 @@ discard block |
||
203 | 203 | $attr.=" $name=\"$value\""; |
204 | 204 | } |
205 | 205 | } |
206 | - $prefix=str_repeat(' ',$indent*4); |
|
206 | + $prefix=str_repeat(' ', $indent * 4); |
|
207 | 207 | if($this->getHasElement()) |
208 | 208 | { |
209 | 209 | $str=$prefix."<{$this->_tagName}$attr>\n"; |
210 | 210 | foreach($this->getElements() as $element) |
211 | - $str.=$element->toString($indent+1)."\n"; |
|
211 | + $str.=$element->toString($indent + 1)."\n"; |
|
212 | 212 | $str.=$prefix."</{$this->_tagName}>"; |
213 | 213 | return $str; |
214 | 214 | } |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | |
242 | 242 | private function xmlEncode($str) |
243 | 243 | { |
244 | - return strtr($str,array( |
|
244 | + return strtr($str, array( |
|
245 | 245 | '>'=>'>', |
246 | 246 | '<'=>'<', |
247 | 247 | '&'=>'&', |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | * @param string version of this XML document |
318 | 318 | * @param string encoding of this XML document |
319 | 319 | */ |
320 | - public function __construct($version='1.0',$encoding='') |
|
320 | + public function __construct($version='1.0', $encoding='') |
|
321 | 321 | { |
322 | 322 | parent::__construct(''); |
323 | 323 | $this->setVersion($version); |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | if(($str=@file_get_contents($file))!==false) |
368 | 368 | return $this->loadFromString($str); |
369 | 369 | else |
370 | - throw new TIOException('xmldocument_file_read_failed',$file); |
|
370 | + throw new TIOException('xmldocument_file_read_failed', $file); |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | /** |
@@ -395,17 +395,17 @@ discard block |
||
395 | 395 | $attributes->clear(); |
396 | 396 | |
397 | 397 | static $bSimpleXml; |
398 | - if($bSimpleXml === null) |
|
399 | - $bSimpleXml = (boolean)function_exists('simplexml_load_string'); |
|
398 | + if($bSimpleXml===null) |
|
399 | + $bSimpleXml=(boolean) function_exists('simplexml_load_string'); |
|
400 | 400 | |
401 | 401 | if($bSimpleXml) |
402 | 402 | { |
403 | - $simpleDoc = simplexml_load_string($string); |
|
404 | - $docNamespaces = $simpleDoc->getDocNamespaces(false); |
|
405 | - $simpleDoc = null; |
|
403 | + $simpleDoc=simplexml_load_string($string); |
|
404 | + $docNamespaces=$simpleDoc->getDocNamespaces(false); |
|
405 | + $simpleDoc=null; |
|
406 | 406 | foreach($docNamespaces as $prefix => $uri) |
407 | 407 | { |
408 | - if($prefix === '') |
|
408 | + if($prefix==='') |
|
409 | 409 | $attributes->add('xmlns', $uri); |
410 | 410 | else |
411 | 411 | $attributes->add('xmlns:'.$prefix, $uri); |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | } |
414 | 414 | |
415 | 415 | foreach($element->attributes as $name=>$attr) |
416 | - $attributes->add(($attr->prefix === '' ? '' : $attr->prefix . ':') .$name,$attr->value); |
|
416 | + $attributes->add(($attr->prefix==='' ? '' : $attr->prefix.':').$name, $attr->value); |
|
417 | 417 | foreach($element->childNodes as $child) |
418 | 418 | { |
419 | 419 | if($child instanceof DOMElement) |
@@ -430,13 +430,13 @@ discard block |
||
430 | 430 | */ |
431 | 431 | public function saveToFile($file) |
432 | 432 | { |
433 | - if(($fw=fopen($file,'w'))!==false) |
|
433 | + if(($fw=fopen($file, 'w'))!==false) |
|
434 | 434 | { |
435 | - fwrite($fw,$this->saveToString()); |
|
435 | + fwrite($fw, $this->saveToString()); |
|
436 | 436 | fclose($fw); |
437 | 437 | } |
438 | 438 | else |
439 | - throw new TIOException('xmldocument_file_write_failed',$file); |
|
439 | + throw new TIOException('xmldocument_file_write_failed', $file); |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | /** |
@@ -445,8 +445,8 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public function saveToString() |
447 | 447 | { |
448 | - $version=empty($this->_version)?' version="1.0"':' version="'.$this->_version.'"'; |
|
449 | - $encoding=empty($this->_encoding)?'':' encoding="'.$this->_encoding.'"'; |
|
448 | + $version=empty($this->_version) ? ' version="1.0"' : ' version="'.$this->_version.'"'; |
|
449 | + $encoding=empty($this->_encoding) ? '' : ' encoding="'.$this->_encoding.'"'; |
|
450 | 450 | return "<?xml{$version}{$encoding}?>\n".$this->toString(0); |
451 | 451 | } |
452 | 452 | |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | $element=new TXmlElement($node->tagName); |
481 | 481 | $element->setValue($node->nodeValue); |
482 | 482 | foreach($node->attributes as $name=>$attr) |
483 | - $element->getAttributes()->add(($attr->prefix === '' ? '' : $attr->prefix . ':') . $name,$attr->value); |
|
483 | + $element->getAttributes()->add(($attr->prefix==='' ? '' : $attr->prefix.':').$name, $attr->value); |
|
484 | 484 | |
485 | 485 | foreach($node->childNodes as $child) |
486 | 486 | { |
@@ -534,11 +534,11 @@ discard block |
||
534 | 534 | * @param mixed new item |
535 | 535 | * @throws TInvalidDataTypeException if the item to be inserted is not a TXmlElement object. |
536 | 536 | */ |
537 | - public function insertAt($index,$item) |
|
537 | + public function insertAt($index, $item) |
|
538 | 538 | { |
539 | 539 | if($item instanceof TXmlElement) |
540 | 540 | { |
541 | - parent::insertAt($index,$item); |
|
541 | + parent::insertAt($index, $item); |
|
542 | 542 | if($item->getParent()!==null) |
543 | 543 | $item->getParent()->getElements()->remove($item); |
544 | 544 | $item->setParent($this->_o); |
@@ -211,13 +211,11 @@ discard block |
||
211 | 211 | $str.=$element->toString($indent+1)."\n"; |
212 | 212 | $str.=$prefix."</{$this->_tagName}>"; |
213 | 213 | return $str; |
214 | - } |
|
215 | - else if(($value=$this->getValue())!=='') |
|
214 | + } else if(($value=$this->getValue())!=='') |
|
216 | 215 | { |
217 | 216 | $value=$this->xmlEncode($value); |
218 | 217 | return $prefix."<{$this->_tagName}$attr>$value</{$this->_tagName}>"; |
219 | - } |
|
220 | - else |
|
218 | + } else |
|
221 | 219 | return $prefix."<{$this->_tagName}$attr />"; |
222 | 220 | } |
223 | 221 | |
@@ -434,8 +432,7 @@ discard block |
||
434 | 432 | { |
435 | 433 | fwrite($fw,$this->saveToString()); |
436 | 434 | fclose($fw); |
437 | - } |
|
438 | - else |
|
435 | + } else |
|
439 | 436 | throw new TIOException('xmldocument_file_write_failed',$file); |
440 | 437 | } |
441 | 438 | |
@@ -542,8 +539,7 @@ discard block |
||
542 | 539 | if($item->getParent()!==null) |
543 | 540 | $item->getParent()->getElements()->remove($item); |
544 | 541 | $item->setParent($this->_o); |
545 | - } |
|
546 | - else |
|
542 | + } else |
|
547 | 543 | throw new TInvalidDataTypeException('xmlelementlist_xmlelement_required'); |
548 | 544 | } |
549 | 545 |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | //$Id: packages.php 3319 2013-09-08 20:59:44Z ctrlaltca $ |
4 | 4 | |
5 | 5 | // To make future upgrades easier |
6 | -if (!defined('PROTOTYPE_DIR')) define ('PROTOTYPE_DIR', 'prototype-1.7'); |
|
7 | -if (!defined('JQUERY_DIR')) define ('JQUERY_DIR', 'jquery'); |
|
8 | -if (!defined('BOOTSTRAP_DIR')) define ('BOOTSTRAP_DIR', 'bootstrap3'); |
|
9 | -if (!defined('SCRIPTACULOUS_DIR')) define ('SCRIPTACULOUS_DIR', 'scriptaculous-1.9.0'); |
|
6 | +if(!defined('PROTOTYPE_DIR')) define('PROTOTYPE_DIR', 'prototype-1.7'); |
|
7 | +if(!defined('JQUERY_DIR')) define('JQUERY_DIR', 'jquery'); |
|
8 | +if(!defined('BOOTSTRAP_DIR')) define('BOOTSTRAP_DIR', 'bootstrap3'); |
|
9 | +if(!defined('SCRIPTACULOUS_DIR')) define('SCRIPTACULOUS_DIR', 'scriptaculous-1.9.0'); |
|
10 | 10 | |
11 | 11 | //package names and its contents (files relative to the current directory) |
12 | -$packages = array( |
|
12 | +$packages=array( |
|
13 | 13 | // base prado scripts |
14 | 14 | 'prado' => array( |
15 | 15 | 'prado/prado.js', |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | |
117 | 117 | //package names and their dependencies |
118 | -$dependencies = array( |
|
118 | +$dependencies=array( |
|
119 | 119 | 'jquery' => array('jquery'), |
120 | 120 | 'prado' => array('jquery', 'prado'), |
121 | 121 | 'bootstrap' => array('jquery', 'bootstrap'), |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | 'jqueryui' => array('jquery', 'jqueryui'), |
139 | 139 | 'prototype' => array('prototype'), |
140 | 140 | 'dragdrop' => array('prototype', 'jquery', 'prado', 'ajax', 'dragdrop'), |
141 | - 'dragdropextra' => array('prototype', 'jquery', 'prado', 'ajax', 'dragdrop','dragdropextra'), |
|
141 | + 'dragdropextra' => array('prototype', 'jquery', 'prado', 'ajax', 'dragdrop', 'dragdropextra'), |
|
142 | 142 | 'autocomplete' => array('prototype', 'jquery', 'prado', 'ajax', 'autocomplete'), |
143 | 143 | ); |
144 | 144 |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | * @return string URL |
65 | 65 | * @see parseUrl |
66 | 66 | */ |
67 | - public function constructUrl($serviceID,$serviceParam,$getItems,$encodeAmpersand,$encodeGetItems) |
|
67 | + public function constructUrl($serviceID, $serviceParam, $getItems, $encodeAmpersand, $encodeGetItems) |
|
68 | 68 | { |
69 | 69 | $url=$serviceID.'='.urlencode($serviceParam); |
70 | - $amp=$encodeAmpersand?'&':'&'; |
|
70 | + $amp=$encodeAmpersand ? '&' : '&'; |
|
71 | 71 | $request=$this->getRequest(); |
72 | 72 | if(is_array($getItems) || $getItems instanceof Traversable) |
73 | 73 | { |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | switch($request->getUrlFormat()) |
104 | 104 | { |
105 | 105 | case THttpRequestUrlFormat::Path: |
106 | - return $request->getApplicationUrl().'/'.strtr($url,array($amp=>'/','?'=>'/','='=>$request->getUrlParamSeparator())); |
|
106 | + return $request->getApplicationUrl().'/'.strtr($url, array($amp=>'/', '?'=>'/', '='=>$request->getUrlParamSeparator())); |
|
107 | 107 | case THttpRequestUrlFormat::HiddenPath: |
108 | - return rtrim(dirname($request->getApplicationUrl()), '/').'/'.strtr($url,array($amp=>'/','?'=>'/','='=>$request->getUrlParamSeparator())); |
|
108 | + return rtrim(dirname($request->getApplicationUrl()), '/').'/'.strtr($url, array($amp=>'/', '?'=>'/', '='=>$request->getUrlParamSeparator())); |
|
109 | 109 | default: |
110 | 110 | return $request->getApplicationUrl().'?'.$url; |
111 | 111 | } |
@@ -127,24 +127,24 @@ discard block |
||
127 | 127 | public function parseUrl() |
128 | 128 | { |
129 | 129 | $request=$this->getRequest(); |
130 | - $pathInfo=trim($request->getPathInfo(),'/'); |
|
130 | + $pathInfo=trim($request->getPathInfo(), '/'); |
|
131 | 131 | if(($request->getUrlFormat()===THttpRequestUrlFormat::Path || |
132 | 132 | $request->getUrlFormat()===THttpRequestUrlFormat::HiddenPath) && |
133 | 133 | $pathInfo!=='') |
134 | 134 | { |
135 | 135 | $separator=$request->getUrlParamSeparator(); |
136 | - $paths=explode('/',$pathInfo); |
|
136 | + $paths=explode('/', $pathInfo); |
|
137 | 137 | $getVariables=array(); |
138 | 138 | foreach($paths as $path) |
139 | 139 | { |
140 | 140 | if(($path=trim($path))!=='') |
141 | 141 | { |
142 | - if(($pos=strpos($path,$separator))!==false) |
|
142 | + if(($pos=strpos($path, $separator))!==false) |
|
143 | 143 | { |
144 | - $name=substr($path,0,$pos); |
|
145 | - $value=substr($path,$pos+1); |
|
146 | - if(($pos=strpos($name,'[]'))!==false) |
|
147 | - $getVariables[substr($name,0,$pos)][]=$value; |
|
144 | + $name=substr($path, 0, $pos); |
|
145 | + $value=substr($path, $pos + 1); |
|
146 | + if(($pos=strpos($name, '[]'))!==false) |
|
147 | + $getVariables[substr($name, 0, $pos)][]=$value; |
|
148 | 148 | else |
149 | 149 | $getVariables[$name]=$value; |
150 | 150 | } |
@@ -80,12 +80,10 @@ discard block |
||
80 | 80 | $name=urlencode($name.'[]'); |
81 | 81 | foreach($value as $v) |
82 | 82 | $url.=$amp.$name.'='.urlencode($v); |
83 | - } |
|
84 | - else |
|
83 | + } else |
|
85 | 84 | $url.=$amp.urlencode($name).'='.urlencode($value); |
86 | 85 | } |
87 | - } |
|
88 | - else |
|
86 | + } else |
|
89 | 87 | { |
90 | 88 | foreach($getItems as $name=>$value) |
91 | 89 | { |
@@ -93,8 +91,7 @@ discard block |
||
93 | 91 | { |
94 | 92 | foreach($value as $v) |
95 | 93 | $url.=$amp.$name.'[]='.$v; |
96 | - } |
|
97 | - else |
|
94 | + } else |
|
98 | 95 | $url.=$amp.$name.'='.$value; |
99 | 96 | } |
100 | 97 | } |
@@ -147,14 +144,12 @@ discard block |
||
147 | 144 | $getVariables[substr($name,0,$pos)][]=$value; |
148 | 145 | else |
149 | 146 | $getVariables[$name]=$value; |
150 | - } |
|
151 | - else |
|
147 | + } else |
|
152 | 148 | $getVariables[$path]=''; |
153 | 149 | } |
154 | 150 | } |
155 | 151 | return $getVariables; |
156 | - } |
|
157 | - else |
|
152 | + } else |
|
158 | 153 | return array(); |
159 | 154 | } |
160 | 155 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $this->loadConfig($dom); |
121 | 121 | } |
122 | 122 | else |
123 | - throw new TConfigurationException('soapservice_configfile_invalid',$this->_configFile); |
|
123 | + throw new TConfigurationException('soapservice_configfile_invalid', $this->_configFile); |
|
124 | 124 | } |
125 | 125 | $this->loadConfig($config); |
126 | 126 | |
@@ -137,16 +137,16 @@ discard block |
||
137 | 137 | protected function resolveRequest() |
138 | 138 | { |
139 | 139 | $serverID=$this->getRequest()->getServiceParameter(); |
140 | - if(($pos=strrpos($serverID,'.wsdl'))===strlen($serverID)-5) |
|
140 | + if(($pos=strrpos($serverID, '.wsdl'))===strlen($serverID) - 5) |
|
141 | 141 | { |
142 | - $serverID=substr($serverID,0,$pos); |
|
142 | + $serverID=substr($serverID, 0, $pos); |
|
143 | 143 | $this->_wsdlRequest=true; |
144 | 144 | } |
145 | 145 | else |
146 | 146 | $this->_wsdlRequest=false; |
147 | 147 | $this->_serverID=$serverID; |
148 | 148 | if(!isset($this->_servers[$serverID])) |
149 | - throw new THttpException(400,'soapservice_request_invalid',$serverID); |
|
149 | + throw new THttpException(400, 'soapservice_request_invalid', $serverID); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | { |
163 | 163 | foreach($config['soap'] as $id => $server) |
164 | 164 | { |
165 | - $properties = isset($server['properties'])?$server['properties']:array(); |
|
165 | + $properties=isset($server['properties']) ? $server['properties'] : array(); |
|
166 | 166 | if(isset($this->_servers[$id])) |
167 | - throw new TConfigurationException('soapservice_serverid_duplicated',$id); |
|
167 | + throw new TConfigurationException('soapservice_serverid_duplicated', $id); |
|
168 | 168 | $this->_servers[$id]=$properties; |
169 | 169 | } |
170 | 170 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | if(($id=$properties->remove('id'))===null) |
178 | 178 | throw new TConfigurationException('soapservice_serverid_required'); |
179 | 179 | if(isset($this->_servers[$id])) |
180 | - throw new TConfigurationException('soapservice_serverid_duplicated',$id); |
|
180 | + throw new TConfigurationException('soapservice_serverid_duplicated', $id); |
|
181 | 181 | $this->_servers[$id]=$properties; |
182 | 182 | } |
183 | 183 | } |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | */ |
199 | 199 | public function setConfigFile($value) |
200 | 200 | { |
201 | - if(($this->_configFile=Prado::getPathOfNamespace($value,Prado::getApplication()->getConfigurationFileExt()))===null) |
|
202 | - throw new TConfigurationException('soapservice_configfile_invalid',$value); |
|
201 | + if(($this->_configFile=Prado::getPathOfNamespace($value, Prado::getApplication()->getConfigurationFileExt()))===null) |
|
202 | + throw new TConfigurationException('soapservice_configfile_invalid', $value); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | /** |
@@ -210,9 +210,9 @@ discard block |
||
210 | 210 | * @param boolean whether to encode the GET parameters (their names and values), defaults to true. |
211 | 211 | * @return string URL for the page and GET parameters |
212 | 212 | */ |
213 | - public function constructUrl($serverID,$getParams=null,$encodeAmpersand=true,$encodeGetItems=true) |
|
213 | + public function constructUrl($serverID, $getParams=null, $encodeAmpersand=true, $encodeGetItems=true) |
|
214 | 214 | { |
215 | - return $this->getRequest()->constructUrl($this->getID(),$serverID,$getParams,$encodeAmpersand,$encodeGetItems); |
|
215 | + return $this->getRequest()->constructUrl($this->getID(), $serverID, $getParams, $encodeAmpersand, $encodeGetItems); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -248,13 +248,13 @@ discard block |
||
248 | 248 | if($serverClass===null) |
249 | 249 | $serverClass=self::DEFAULT_SOAP_SERVER; |
250 | 250 | Prado::using($serverClass); |
251 | - $className=($pos=strrpos($serverClass,'.'))!==false?substr($serverClass,$pos+1):$serverClass; |
|
252 | - if($className!==self::DEFAULT_SOAP_SERVER && !is_subclass_of($className,self::DEFAULT_SOAP_SERVER)) |
|
253 | - throw new TConfigurationException('soapservice_server_invalid',$serverClass); |
|
251 | + $className=($pos=strrpos($serverClass, '.'))!==false ? substr($serverClass, $pos + 1) : $serverClass; |
|
252 | + if($className!==self::DEFAULT_SOAP_SERVER && !is_subclass_of($className, self::DEFAULT_SOAP_SERVER)) |
|
253 | + throw new TConfigurationException('soapservice_server_invalid', $serverClass); |
|
254 | 254 | $server=new $className; |
255 | 255 | $server->setID($this->_serverID); |
256 | 256 | foreach($properties as $name=>$value) |
257 | - $server->setSubproperty($name,$value); |
|
257 | + $server->setSubproperty($name, $value); |
|
258 | 258 | return $server; |
259 | 259 | } |
260 | 260 | |
@@ -266,21 +266,21 @@ discard block |
||
266 | 266 | */ |
267 | 267 | public function run() |
268 | 268 | { |
269 | - Prado::trace("Running SOAP service",'System.Web.Services.TSoapService'); |
|
269 | + Prado::trace("Running SOAP service", 'System.Web.Services.TSoapService'); |
|
270 | 270 | $server=$this->createServer(); |
271 | 271 | $this->getResponse()->setContentType('text/xml'); |
272 | 272 | $this->getResponse()->setCharset($server->getEncoding()); |
273 | 273 | if($this->getIsWsdlRequest()) |
274 | 274 | { |
275 | 275 | // server WSDL file |
276 | - Prado::trace("Generating WSDL",'System.Web.Services.TSoapService'); |
|
276 | + Prado::trace("Generating WSDL", 'System.Web.Services.TSoapService'); |
|
277 | 277 | $this->getResponse()->clear(); |
278 | 278 | $this->getResponse()->write($server->getWsdl()); |
279 | 279 | } |
280 | 280 | else |
281 | 281 | { |
282 | 282 | // provide SOAP service |
283 | - Prado::trace("Handling SOAP request",'System.Web.Services.TSoapService'); |
|
283 | + Prado::trace("Handling SOAP request", 'System.Web.Services.TSoapService'); |
|
284 | 284 | $server->run(); |
285 | 285 | } |
286 | 286 | } |
@@ -331,8 +331,8 @@ discard block |
||
331 | 331 | */ |
332 | 332 | public function setID($id) |
333 | 333 | { |
334 | - if(strrpos($this->_id,'.wsdl')===strlen($this->_id)-5) |
|
335 | - throw new TInvalidDataValueException('soapserver_id_invalid',$id); |
|
334 | + if(strrpos($this->_id, '.wsdl')===strlen($this->_id) - 5) |
|
335 | + throw new TInvalidDataValueException('soapserver_id_invalid', $id); |
|
336 | 336 | $this->_id=$id; |
337 | 337 | } |
338 | 338 | |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | if(($provider=$this->getProvider())!==null) |
345 | 345 | { |
346 | 346 | Prado::using($provider); |
347 | - $providerClass=($pos=strrpos($provider,'.'))!==false?substr($provider,$pos+1):$provider; |
|
347 | + $providerClass=($pos=strrpos($provider, '.'))!==false ? substr($provider, $pos + 1) : $provider; |
|
348 | 348 | $this->guessMethodCallRequested($providerClass); |
349 | 349 | $server=$this->createServer(); |
350 | 350 | $server->setClass($providerClass, $this); |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | { |
358 | 358 | $server->handle(); |
359 | 359 | } |
360 | - catch (Exception $e) |
|
360 | + catch(Exception $e) |
|
361 | 361 | { |
362 | 362 | if($this->getApplication()->getMode()===TApplicationMode::Debug) |
363 | 363 | $this->fault($e->getMessage(), $e->__toString()); |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | */ |
377 | 377 | public function fault($title, $details='', $code='SERVER', $actor='', $name='') |
378 | 378 | { |
379 | - Prado::trace('SOAP-Fault '.$code. ' '.$title.' : '.$details, 'System.Web.Services.TSoapService'); |
|
379 | + Prado::trace('SOAP-Fault '.$code.' '.$title.' : '.$details, 'System.Web.Services.TSoapService'); |
|
380 | 380 | $this->_server->fault($code, $title, $actor, $details, $name); |
381 | 381 | } |
382 | 382 | |
@@ -387,14 +387,14 @@ discard block |
||
387 | 387 | */ |
388 | 388 | protected function guessMethodCallRequested($class) |
389 | 389 | { |
390 | - $namespace = $class.'wsdl'; |
|
391 | - $message = file_get_contents("php://input"); |
|
392 | - $matches= array(); |
|
390 | + $namespace=$class.'wsdl'; |
|
391 | + $message=file_get_contents("php://input"); |
|
392 | + $matches=array(); |
|
393 | 393 | if(preg_match('/xmlns:([^=]+)="urn:'.$namespace.'"/', $message, $matches)) |
394 | 394 | { |
395 | 395 | if(preg_match('/<'.$matches[1].':([a-zA-Z_]+[a-zA-Z0-9_]+)/', $message, $method)) |
396 | 396 | { |
397 | - $this->_requestedMethod = $method[1]; |
|
397 | + $this->_requestedMethod=$method[1]; |
|
398 | 398 | } |
399 | 399 | } |
400 | 400 | } |
@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | if($this->_server===null) |
418 | 418 | { |
419 | 419 | if($this->getApplication()->getMode()===TApplicationMode::Debug) |
420 | - ini_set("soap.wsdl_cache_enabled",0); |
|
421 | - $this->_server = new SoapServer($this->getWsdlUri(),$this->getOptions()); |
|
420 | + ini_set("soap.wsdl_cache_enabled", 0); |
|
421 | + $this->_server=new SoapServer($this->getWsdlUri(), $this->getOptions()); |
|
422 | 422 | } |
423 | 423 | return $this->_server; |
424 | 424 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | if($this->_wsdlUri==='') |
460 | 460 | { |
461 | 461 | $provider=$this->getProvider(); |
462 | - $providerClass=($pos=strrpos($provider,'.'))!==false?substr($provider,$pos+1):$provider; |
|
462 | + $providerClass=($pos=strrpos($provider, '.'))!==false ? substr($provider, $pos + 1) : $provider; |
|
463 | 463 | Prado::using($provider); |
464 | 464 | if($this->getApplication()->getMode()===TApplicationMode::Performance && ($cache=$this->getApplication()->getCache())!==null) |
465 | 465 | { |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | return $wsdl; |
469 | 469 | Prado::using('System.3rdParty.WsdlGen.WsdlGenerator'); |
470 | 470 | $wsdl=WsdlGenerator::generate($providerClass, $this->getUri(), $this->getEncoding()); |
471 | - $cache->set(self::WSDL_CACHE_PREFIX.$providerClass,$wsdl); |
|
471 | + $cache->set(self::WSDL_CACHE_PREFIX.$providerClass, $wsdl); |
|
472 | 472 | return $wsdl; |
473 | 473 | } |
474 | 474 | else |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | public function getWsdlUri() |
488 | 488 | { |
489 | 489 | if($this->_wsdlUri==='') |
490 | - return $this->getRequest()->getBaseUrl().$this->getService()->constructUrl($this->getID().'.wsdl',false); |
|
490 | + return $this->getRequest()->getBaseUrl().$this->getService()->constructUrl($this->getID().'.wsdl', false); |
|
491 | 491 | else |
492 | 492 | return $this->_wsdlUri; |
493 | 493 | } |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | public function getUri() |
507 | 507 | { |
508 | 508 | if($this->_uri==='') |
509 | - return $this->getRequest()->getBaseUrl().$this->getService()->constructUrl($this->getID(),false); |
|
509 | + return $this->getRequest()->getBaseUrl().$this->getService()->constructUrl($this->getID(), false); |
|
510 | 510 | else |
511 | 511 | return $this->_uri; |
512 | 512 | } |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | if($value==='1.1' || $value==='1.2' || $value==='') |
553 | 553 | $this->_version=$value; |
554 | 554 | else |
555 | - throw new TInvalidDataValueException('soapserver_version_invalid',$value); |
|
555 | + throw new TInvalidDataValueException('soapserver_version_invalid', $value); |
|
556 | 556 | } |
557 | 557 | |
558 | 558 | /** |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | */ |
617 | 617 | public function setClassMaps($classes) |
618 | 618 | { |
619 | - $this->_classMap = $classes; |
|
619 | + $this->_classMap=$classes; |
|
620 | 620 | } |
621 | 621 | } |
622 | 622 |
@@ -118,8 +118,7 @@ discard block |
||
118 | 118 | $dom=new TXmlDocument; |
119 | 119 | $dom->loadFromFile($this->_configFile); |
120 | 120 | $this->loadConfig($dom); |
121 | - } |
|
122 | - else |
|
121 | + } else |
|
123 | 122 | throw new TConfigurationException('soapservice_configfile_invalid',$this->_configFile); |
124 | 123 | } |
125 | 124 | $this->loadConfig($config); |
@@ -141,8 +140,7 @@ discard block |
||
141 | 140 | { |
142 | 141 | $serverID=substr($serverID,0,$pos); |
143 | 142 | $this->_wsdlRequest=true; |
144 | - } |
|
145 | - else |
|
143 | + } else |
|
146 | 144 | $this->_wsdlRequest=false; |
147 | 145 | $this->_serverID=$serverID; |
148 | 146 | if(!isset($this->_servers[$serverID])) |
@@ -168,8 +166,7 @@ discard block |
||
168 | 166 | $this->_servers[$id]=$properties; |
169 | 167 | } |
170 | 168 | } |
171 | - } |
|
172 | - else |
|
169 | + } else |
|
173 | 170 | { |
174 | 171 | foreach($config->getElementsByTagName('soap') as $serverXML) |
175 | 172 | { |
@@ -276,8 +273,7 @@ discard block |
||
276 | 273 | Prado::trace("Generating WSDL",'System.Web.Services.TSoapService'); |
277 | 274 | $this->getResponse()->clear(); |
278 | 275 | $this->getResponse()->write($server->getWsdl()); |
279 | - } |
|
280 | - else |
|
276 | + } else |
|
281 | 277 | { |
282 | 278 | // provide SOAP service |
283 | 279 | Prado::trace("Handling SOAP request",'System.Web.Services.TSoapService'); |
@@ -350,14 +346,12 @@ discard block |
||
350 | 346 | $server->setClass($providerClass, $this); |
351 | 347 | if($this->_persistent) |
352 | 348 | $server->setPersistence(SOAP_PERSISTENCE_SESSION); |
353 | - } |
|
354 | - else |
|
349 | + } else |
|
355 | 350 | $server=$this->createServer(); |
356 | 351 | try |
357 | 352 | { |
358 | 353 | $server->handle(); |
359 | - } |
|
360 | - catch (Exception $e) |
|
354 | + } catch (Exception $e) |
|
361 | 355 | { |
362 | 356 | if($this->getApplication()->getMode()===TApplicationMode::Debug) |
363 | 357 | $this->fault($e->getMessage(), $e->__toString()); |
@@ -470,14 +464,12 @@ discard block |
||
470 | 464 | $wsdl=WsdlGenerator::generate($providerClass, $this->getUri(), $this->getEncoding()); |
471 | 465 | $cache->set(self::WSDL_CACHE_PREFIX.$providerClass,$wsdl); |
472 | 466 | return $wsdl; |
473 | - } |
|
474 | - else |
|
467 | + } else |
|
475 | 468 | { |
476 | 469 | Prado::using('System.3rdParty.WsdlGen.WsdlGenerator'); |
477 | 470 | return WsdlGenerator::generate($providerClass, $this->getUri(), $this->getEncoding()); |
478 | 471 | } |
479 | - } |
|
480 | - else |
|
472 | + } else |
|
481 | 473 | return file_get_contents($this->_wsdlUri); |
482 | 474 | } |
483 | 475 |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function setDecayRate($value) |
81 | 81 | { |
82 | - $decay = TPropertyValue::ensureFloat($value); |
|
82 | + $decay=TPropertyValue::ensureFloat($value); |
|
83 | 83 | if($decay < 0) |
84 | 84 | throw new TConfigurationException('callback_decay_be_not_negative', $this->getID()); |
85 | 85 | $this->setViewState('Decay', $decay); |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function getTriggerOptions() |
92 | 92 | { |
93 | - $options = parent::getTriggerOptions(); |
|
94 | - $options['PropertyName'] = $this->getPropertyName(); |
|
95 | - $options['Interval'] = $this->getInterval(); |
|
96 | - $options['Decay'] = $this->getDecayRate(); |
|
93 | + $options=parent::getTriggerOptions(); |
|
94 | + $options['PropertyName']=$this->getPropertyName(); |
|
95 | + $options['Interval']=$this->getInterval(); |
|
96 | + $options['Decay']=$this->getDecayRate(); |
|
97 | 97 | return $options; |
98 | 98 | } |
99 | 99 |