Completed
Push — autoload ( 4808d1...dcd67f )
by Fabio
60:18 queued 50:52
created
framework/I18N/TNumberFormat.php 2 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 */
78 78
 	public function getPattern()
79 79
 	{
80
-		return $this->getViewState('Pattern','');
80
+		return $this->getViewState('Pattern', '');
81 81
 	}
82 82
 
83 83
 	/**
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function setPattern($pattern)
88 88
 	{
89
-		$this->setViewState('Pattern',$pattern,'');
89
+		$this->setViewState('Pattern', $pattern, '');
90 90
 	}
91 91
 
92 92
 	/**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function getValue()
97 97
 	{
98
-		return $this->getViewState('Value','');
98
+		return $this->getViewState('Value', '');
99 99
 	}
100 100
 
101 101
 	/**
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	 */
105 105
 	public function setValue($value)
106 106
 	{
107
-		$this->setViewState('Value',$value,'');
107
+		$this->setViewState('Value', $value, '');
108 108
 	}
109 109
 
110 110
 	/**
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	public function getDefaultText()
115 115
 	{
116
-		return $this->getViewState('DefaultText','');
116
+		return $this->getViewState('DefaultText', '');
117 117
 	}
118 118
 
119 119
 	/**
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	public function setDefaultText($value)
124 124
 	{
125
-		$this->setViewState('DefaultText',$value,'');
125
+		$this->setViewState('DefaultText', $value, '');
126 126
 	}
127 127
 
128 128
 	/**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	public function getType()
159 159
 	{
160
-		return $this->getViewState('Type','d');
160
+		return $this->getViewState('Type', 'd');
161 161
 	}
162 162
 
163 163
 	/**
@@ -168,20 +168,20 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	public function setType($type)
170 170
 	{
171
-		$type = strtolower($type);
171
+		$type=strtolower($type);
172 172
 
173 173
 		switch($type)
174 174
 		{
175 175
 			case 'decimal':
176
-				$this->setViewState('Type','d',''); break;
176
+				$this->setViewState('Type', 'd', ''); break;
177 177
 			case 'currency':
178
-				$this->setViewState('Type','c',''); break;
178
+				$this->setViewState('Type', 'c', ''); break;
179 179
 			case 'percentage':
180
-				$this->setViewState('Type','p',''); break;
180
+				$this->setViewState('Type', 'p', ''); break;
181 181
 			case 'scientific':
182
-				$this->setViewState('Type','e',''); break;
182
+				$this->setViewState('Type', 'e', ''); break;
183 183
 			default:
184
-				throw new TInvalidDataValueException('numberformat_type_invalid',$type);
184
+				throw new TInvalidDataValueException('numberformat_type_invalid', $type);
185 185
 		}
186 186
 
187 187
 	}
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	 */
192 192
 	public function getCurrency()
193 193
 	{
194
-		return $this->getViewState('Currency','USD');
194
+		return $this->getViewState('Currency', 'USD');
195 195
 	}
196 196
 
197 197
 	/**
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 */
202 202
 	public function setCurrency($currency)
203 203
 	{
204
-		$this->setViewState('Currency', $currency,'');
204
+		$this->setViewState('Currency', $currency, '');
205 205
 	}
206 206
 
207 207
 	/**
@@ -212,31 +212,31 @@  discard block
 block discarded – undo
212 212
 	 */
213 213
 	protected function getFormattedValue()
214 214
 	{
215
-		$value = $this->getValue();
216
-		$defaultText = $this->getDefaultText();
215
+		$value=$this->getValue();
216
+		$defaultText=$this->getDefaultText();
217 217
 		if(empty($value) && !empty($defaultText))
218 218
 			return $this->getDefaultText();
219 219
 
220
-		$app = $this->getApplication()->getGlobalization();
220
+		$app=$this->getApplication()->getGlobalization();
221 221
 		//initialized the default class wide formatter
222 222
 		if(self::$formatter===null)
223
-			self::$formatter = new NumberFormat($app->getCulture());
223
+			self::$formatter=new NumberFormat($app->getCulture());
224 224
 
225
-		$pattern = strlen($this->getPattern()) > 0
225
+		$pattern=strlen($this->getPattern()) > 0
226 226
 						? $this->getPattern() : $this->getType();
227 227
 
228
-		$culture = $this->getCulture();
228
+		$culture=$this->getCulture();
229 229
 		//return the specific cultural formatted number
230
-		if(!empty($culture) && $app->getCulture() != $culture)
230
+		if(!empty($culture) && $app->getCulture()!=$culture)
231 231
 		{
232
-			$formatter = new NumberFormat($culture);
233
-			return $formatter->format($this->getValue(),$pattern,
232
+			$formatter=new NumberFormat($culture);
233
+			return $formatter->format($this->getValue(), $pattern,
234 234
 									  $this->getCurrency(),
235 235
 									  $this->getCharset());
236 236
 		}
237 237
 
238 238
 		//return the application wide culture formatted number.
239
-		return self::$formatter->format($this->getValue(),$pattern,
239
+		return self::$formatter->format($this->getValue(), $pattern,
240 240
 										$this->getCurrency(),
241 241
 										$this->getCharset());
242 242
 	}
Please login to merge, or discard this patch.
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TNumberFromat component.
4
- *
5
- * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
6
- * @link https://github.com/pradosoft/prado
7
- * @copyright Copyright &copy; 2005-2016 The PRADO Group
8
- * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
- * @package System.I18N
10
- */
3
+	 * TNumberFromat component.
4
+	 *
5
+	 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
6
+	 * @link https://github.com/pradosoft/prado
7
+	 * @copyright Copyright &copy; 2005-2016 The PRADO Group
8
+	 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
+	 * @package System.I18N
10
+	 */
11 11
 
12 12
 /**
13 13
  * Get the NumberFormat class.
@@ -20,49 +20,49 @@  discard block
 block discarded – undo
20 20
 Prado::using('System.I18N.TI18NControl');
21 21
 
22 22
 /**
23
-  * To format numbers in locale sensitive manner use
24
-  * <code>
25
-  * <com:TNumberFormat Pattern="0.##" value="2.0" />
26
-  * </code>
27
-  *
28
-  * Numbers can be formatted as currency, percentage, decimal or scientific
29
-  * numbers by specifying the Type attribute. The known types are
30
-  * "currency", "percentage", "decimal" and "scientific".
31
-  *
32
-  * If someone from US want to see sales figures from a store in
33
-  * Germany (say using the EURO currency), formatted using the german
34
-  * currency, you would need to use the attribute Culture="de_DE" to get
35
-  * the currency right, e.g. 100,00. The decimal and grouping separator is
36
-  * then also from the de_DE locale. This may lead to some confusion because
37
-  * people from US know the "," as thousand separator. Therefore a "Currency"
38
-  * attribute is available, so that the output from the following example
39
-  * results in 100.00.
40
-  * <code>
41
-  * <com:TNumberFormat Type="currency" Culture="en_US" Currency="EUR" Value="100" />
42
-  * </code>
43
-  *
44
-  * Namespace: System.I18N
45
-  *
46
-  * Properties
47
-  * - <b>Value</b>, number,
48
-  *   <br>Gets or sets the number to format. The tag content is used as Value
49
-  *   if the Value property is not specified.
50
-  * - <b>Type</b>, string,
51
-  *   <br>Gets or sets the formatting type. The valid types are
52
-  *    'decimal', 'currency', 'percentage' and 'scientific'.
53
-  * - <b>Currency</b>, string,
54
-  *   <br>Gets or sets the currency symbol for the currency format.
55
-  *   The default is 'USD' if the Currency property is not specified.
56
-  * - <b>Pattern</b>, string,
57
-  *   <br>Gets or sets the custom number formatting pattern.
58
-  * - <b>DefaultText</b>, string,
59
-  * <br>Gets or sets the default text. If Value is not set, DefaultText will be
60
-  * shown instead of the default currency Value/Pattern.
61
-  *
62
-  * @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
63
-  * @version v1.0, last update on Sat Dec 11 17:49:56 EST 2004
64
-  * @package System.I18N
65
-  */
23
+ * To format numbers in locale sensitive manner use
24
+ * <code>
25
+ * <com:TNumberFormat Pattern="0.##" value="2.0" />
26
+ * </code>
27
+ *
28
+ * Numbers can be formatted as currency, percentage, decimal or scientific
29
+ * numbers by specifying the Type attribute. The known types are
30
+ * "currency", "percentage", "decimal" and "scientific".
31
+ *
32
+ * If someone from US want to see sales figures from a store in
33
+ * Germany (say using the EURO currency), formatted using the german
34
+ * currency, you would need to use the attribute Culture="de_DE" to get
35
+ * the currency right, e.g. 100,00. The decimal and grouping separator is
36
+ * then also from the de_DE locale. This may lead to some confusion because
37
+ * people from US know the "," as thousand separator. Therefore a "Currency"
38
+ * attribute is available, so that the output from the following example
39
+ * results in 100.00.
40
+ * <code>
41
+ * <com:TNumberFormat Type="currency" Culture="en_US" Currency="EUR" Value="100" />
42
+ * </code>
43
+ *
44
+ * Namespace: System.I18N
45
+ *
46
+ * Properties
47
+ * - <b>Value</b>, number,
48
+ *   <br>Gets or sets the number to format. The tag content is used as Value
49
+ *   if the Value property is not specified.
50
+ * - <b>Type</b>, string,
51
+ *   <br>Gets or sets the formatting type. The valid types are
52
+ *    'decimal', 'currency', 'percentage' and 'scientific'.
53
+ * - <b>Currency</b>, string,
54
+ *   <br>Gets or sets the currency symbol for the currency format.
55
+ *   The default is 'USD' if the Currency property is not specified.
56
+ * - <b>Pattern</b>, string,
57
+ *   <br>Gets or sets the custom number formatting pattern.
58
+ * - <b>DefaultText</b>, string,
59
+ * <br>Gets or sets the default text. If Value is not set, DefaultText will be
60
+ * shown instead of the default currency Value/Pattern.
61
+ *
62
+ * @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
63
+ * @version v1.0, last update on Sat Dec 11 17:49:56 EST 2004
64
+ * @package System.I18N
65
+ */
66 66
 class TNumberFormat extends TI18NControl implements IDataRenderer
67 67
 {
68 68
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveHyperLink.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public function setText($value)
52 52
 	{
53
-		if(parent::getText() === $value)
53
+		if(parent::getText()===$value)
54 54
 			return;
55 55
 
56 56
 		parent::setText($value);
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	public function setImageUrl($value)
66 66
 	{
67
-		if(parent::getImageUrl() === $value)
67
+		if(parent::getImageUrl()===$value)
68 68
 			return;
69 69
 
70 70
 		parent::setImageUrl($value);
71
-		if($this->getActiveControl()->canUpdateClientSide() && $value !== '')
71
+		if($this->getActiveControl()->canUpdateClientSide() && $value!=='')
72 72
 		{
73
-			$textWriter = new TTextWriter;
74
-			$renderer = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $textWriter);
73
+			$textWriter=new TTextWriter;
74
+			$renderer=Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $textWriter);
75 75
 			$this->createImage($value)->renderControl($renderer);
76 76
 			$this->getPage()->getCallbackClient()->update($this, $textWriter->flush());
77 77
 		}
@@ -83,14 +83,14 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function setNavigateUrl($value)
85 85
 	{
86
-		if(parent::getNavigateUrl() === $value)
86
+		if(parent::getNavigateUrl()===$value)
87 87
 			return;
88 88
 
89 89
 		parent::setNavigateUrl($value);
90 90
 		if($this->getActiveControl()->canUpdateClientSide())
91 91
 		{
92 92
 			//replace &amp; with & and urldecode the url (setting the href using javascript is literal)
93
-			$url = urldecode(str_replace('&amp;', '&', $value));
93
+			$url=urldecode(str_replace('&amp;', '&', $value));
94 94
 			$this->getPage()->getCallbackClient()->setAttribute($this, 'href', $url);
95 95
 		}
96 96
 	}
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 */
102 102
 	public function setTarget($value)
103 103
 	{
104
-		if(parent::getTarget() === $value)
104
+		if(parent::getTarget()===$value)
105 105
 			return;
106 106
 
107 107
 		parent::setTarget($value);
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TActiveHyperLink class file.
4
- *
5
- * @author Wei Zhuo <weizhuo[at]gamil[dot]com>
6
- * @link https://github.com/pradosoft/prado
7
- * @copyright Copyright &copy; 2005-2016 The PRADO Group
8
- * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
- * @package System.Web.UI.ActiveControls
10
- */
3
+   * TActiveHyperLink class file.
4
+   *
5
+   * @author Wei Zhuo <weizhuo[at]gamil[dot]com>
6
+   * @link https://github.com/pradosoft/prado
7
+   * @copyright Copyright &copy; 2005-2016 The PRADO Group
8
+   * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
+   * @package System.Web.UI.ActiveControls
10
+   */
11 11
 
12 12
 /**
13 13
  * TActiveHyperLink class.
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function setInterval($value)
45 45
 	{
46
-		$interval = TPropertyValue::ensureFloat($value);
46
+		$interval=TPropertyValue::ensureFloat($value);
47 47
 		if($interval <= 0)
48 48
 			throw new TConfigurationException('callback_interval_be_positive', $this->getID());
49 49
 
50
-		if($this->getInterval() === $value)
50
+		if($this->getInterval()===$value)
51 51
 			return;
52 52
 
53 53
 		$this->setViewState('Interval', $interval, 1);
54
-		if ($this->getActiveControl()->canUpdateClientSide()){
55
-			$client = $this->getPage()->getCallbackClient();
54
+		if($this->getActiveControl()->canUpdateClientSide()) {
55
+			$client=$this->getPage()->getCallbackClient();
56 56
 			$client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.setTimerInterval', array($this, $interval));
57 57
 		}
58 58
 	}
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 */
63 63
 	public function startTimer()
64 64
 	{
65
-		$client = $this->getPage()->getCallbackClient();
65
+		$client=$this->getPage()->getCallbackClient();
66 66
 		$client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.start', array($this));
67 67
 	}
68 68
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	public function stopTimer()
73 73
 	{
74
-		$client = $this->getPage()->getCallbackClient();
74
+		$client=$this->getPage()->getCallbackClient();
75 75
 		$client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.stop', array($this));
76 76
 	}
77 77
 
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	protected function getTriggerOptions()
99 99
 	{
100
-		$options['ID'] = $this->getClientID();
101
-		$options['EventTarget']= $this->getUniqueID();
102
-		$options['Interval'] = $this->getInterval();
100
+		$options['ID']=$this->getClientID();
101
+		$options['EventTarget']=$this->getUniqueID();
102
+		$options['Interval']=$this->getInterval();
103 103
 		return $options;
104 104
 	}
105 105
 
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
 		parent::render($writer);
113 113
 		$this->getActiveControl()->registerCallbackClientScript(
114 114
 			$this->getClientClassName(), $this->getTriggerOptions());
115
-		if($this->getStartTimerOnLoad()){
116
-			$id = $this->getClientID();
117
-			$code = "Prado.WebUI.TTimeTriggeredCallback.start('{$id}');";
118
-			$cs = $this->getPage()->getClientScript();
115
+		if($this->getStartTimerOnLoad()) {
116
+			$id=$this->getClientID();
117
+			$code="Prado.WebUI.TTimeTriggeredCallback.start('{$id}');";
118
+			$cs=$this->getPage()->getClientScript();
119 119
 			$cs->registerEndScript("{$id}:start", $code);
120 120
 		}
121 121
 	}
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TTimeTriggeredCallback class file.
4
- *
5
- * @author Wei Zhuo <weizhuo[at]gamil[dot]com>
6
- * @link https://github.com/pradosoft/prado
7
- * @copyright Copyright &copy; 2005-2016 The PRADO Group
8
- * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
- * @package System.Web.UI.ActiveControls
10
- */
3
+	 * TTimeTriggeredCallback class file.
4
+	 *
5
+	 * @author Wei Zhuo <weizhuo[at]gamil[dot]com>
6
+	 * @link https://github.com/pradosoft/prado
7
+	 * @copyright Copyright &copy; 2005-2016 The PRADO Group
8
+	 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
+	 * @package System.Web.UI.ActiveControls
10
+	 */
11 11
 
12 12
 /**
13 13
  * Load active callback control.
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveButton.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function setText($value)
96 96
 	{
97
-		if(parent::getText() === $value)
97
+		if(parent::getText()===$value)
98 98
 			return;
99 99
 
100 100
 		parent::setText($value);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	protected function addAttributesToRender($writer)
118 118
 	{
119 119
 		parent::addAttributesToRender($writer);
120
-		$writer->addAttribute('id',$this->getClientID());
120
+		$writer->addAttribute('id', $this->getClientID());
121 121
 		$this->getActiveControl()->registerCallbackClientScript(
122 122
 			$this->getClientClassName(), $this->getPostBackOptions());
123 123
 	}
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveImage.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	public function setAlternateText($value)
50 50
 	{
51
-		if(parent::getAlternateText() === $value)
51
+		if(parent::getAlternateText()===$value)
52 52
 			return;
53 53
 
54 54
 		parent::setAlternateText($value);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 */
66 66
 	public function setImageAlign($value)
67 67
 	{
68
-		if(parent::getImageAlign() === $value)
68
+		if(parent::getImageAlign()===$value)
69 69
 			return;
70 70
 
71 71
 		parent::setImageAlign($value);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	 */
79 79
 	public function setImageUrl($value)
80 80
 	{
81
-		if(parent::getImageUrl() === $value)
81
+		if(parent::getImageUrl()===$value)
82 82
 			return;
83 83
 
84 84
 		parent::setImageUrl($value);
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function setDescriptionUrl($value)
93 93
 	{
94
-		if(parent::getDescriptionUrl() === $value)
94
+		if(parent::getDescriptionUrl()===$value)
95 95
 			return;
96 96
 
97 97
 		parent::setDescriptionUrl($value);
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveLinkButton.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function setText($value)
97 97
 	{
98
-		if(parent::getText() === $value)
98
+		if(parent::getText()===$value)
99 99
 			return;
100 100
 
101 101
 		parent::setText($value);
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	protected function addAttributesToRender($writer)
119 119
 	{
120 120
 		parent::addAttributesToRender($writer);
121
-		$writer->addAttribute('id',$this->getClientID());
121
+		$writer->addAttribute('id', $this->getClientID());
122 122
 
123 123
 		if($this->getEnabled(true))
124 124
 		{
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	 */
135 135
 	public function setEnabled($value)
136 136
 	{
137
-		if(parent::getEnabled() === $value)
137
+		if(parent::getEnabled()===$value)
138 138
 			return;
139 139
 
140 140
 		parent::setEnabled($value);
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		{
143 143
 			if($this->getEnabled(true))
144 144
 			{
145
-				$nop = "javascript:;//".$this->getClientID();
145
+				$nop="javascript:;//".$this->getClientID();
146 146
 				$this->getPage()->getCallbackClient()->setAttribute($this, 'href', $nop);
147 147
 
148 148
 				$this->getActiveControl()->registerCallbackClientScript(
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveCheckBox.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function setText($value)
90 90
 	{
91
-		if(parent::getText() === $value)
91
+		if(parent::getText()===$value)
92 92
 			return;
93 93
 
94 94
 		parent::setText($value);
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 	 */
106 106
 	public function setChecked($value)
107 107
 	{
108
-		$value = TPropertyValue::ensureBoolean($value);
109
-		if(parent::getChecked() === $value)
108
+		$value=TPropertyValue::ensureBoolean($value);
109
+		if(parent::getChecked()===$value)
110 110
 			return;
111 111
 
112 112
 		parent::setChecked($value);
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
 	 * @param string checkbox id
133 133
 	 * @param string onclick js
134 134
 	 */
135
-	protected function renderInputTag($writer,$clientID,$onclick)
135
+	protected function renderInputTag($writer, $clientID, $onclick)
136 136
 	{
137
-		parent::renderInputTag($writer,$clientID,$onclick);
138
-		if ($this->getAutoPostBack())
137
+		parent::renderInputTag($writer, $clientID, $onclick);
138
+		if($this->getAutoPostBack())
139 139
 			$this->getActiveControl()->registerCallbackClientScript(
140 140
 				$this->getClientClassName(), $this->getPostBackOptions());
141 141
 	}
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
 	 */
155 155
 	public function getLabelAttributes()
156 156
 	{
157
-		$attributes = parent::getLabelAttributes();
158
-		$attributes['id'] = $this->getDefaultLabelID();
157
+		$attributes=parent::getLabelAttributes();
158
+		$attributes['id']=$this->getDefaultLabelID();
159 159
 		return $attributes;
160 160
 	}
161 161
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 	 * @param string checkbox id
166 166
 	 * @param string label text
167 167
 	 */
168
-	protected function renderLabel($writer,$clientID,$text)
168
+	protected function renderLabel($writer, $clientID, $text)
169 169
 	{
170 170
 		$writer->addAttribute('id', $this->getDefaultLabelID());
171 171
 		parent::renderLabel($writer, $clientID, $text);
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	 */
177 177
 	protected function getDefaultLabelID()
178 178
 	{
179
-		if($attributes=$this->getViewState('LabelAttributes',null))
179
+		if($attributes=$this->getViewState('LabelAttributes', null))
180 180
 			return TCheckBox::getLabelAttributes()->itemAt('id');
181 181
 		else
182 182
 			return $this->getClientID().'_label';
Please login to merge, or discard this patch.
framework/TShellApplication.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TShellApplication class file
4
- *
5
- * @author Qiang Xue <[email protected]>
6
- * @link https://github.com/pradosoft/prado
7
- * @copyright Copyright &copy; 2005-2016 The PRADO Group
8
- * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
- * @package System
10
- */
3
+	 * TShellApplication class file
4
+	 *
5
+	 * @author Qiang Xue <[email protected]>
6
+	 * @link https://github.com/pradosoft/prado
7
+	 * @copyright Copyright &copy; 2005-2016 The PRADO Group
8
+	 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
+	 * @package System
10
+	 */
11 11
 
12 12
 /**
13 13
  * TShellApplication class.
Please login to merge, or discard this patch.
framework/Caching/TEACache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php
/**
 * TEACache class file
 *
 * @author Dario rigolin <[email protected]>
 * @link https://github.com/pradosoft/prado
 * @copyright Copyright &copy; 2005-2016 The PRADO Group
 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
 * @package System.Caching
 */

/**
 * TEACache class
 *
 * TEACache implements a cache application module based on {@link http://eaccelerator.net/ eAccelerator}.
 *
 * By definition, cache does not ensure the existence of a value
 * even if it never expires. Cache is not meant to be an persistent storage.
 *
 * To use this module, the eAccelerator PHP extension must be loaded and enabled
 *
 * Please note that as of v0.9.6, eAccelerator no longer supports data caching.
 * This means if you still want to use this component, your eAccelerator should be of 0.9.5.x or lower version.
 *
 * Some usage examples of TEACache are as follows,
 * <code>
 * $cache=new TEACache;  // TEACache may also be loaded as a Prado application module
 * $cache->init(null);
 * $cache->add('object',$object);
 * $object2=$cache->get('object');
 * </code>
 *
 * If loaded, TEACache will register itself with {@link TApplication} as the
 * cache module. It can be accessed via {@link TApplication::getCache()}.
 *
 * TEACache may be configured in application configuration file as follows
 * <code>
 * <module id="cache" class="System.Caching.TEACache" />
 * </code>
 *
 * @author Dario Rigolin <[email protected]>
 * @package System.Caching
 * @since 3.2.2
 */
class TEACache extends TCache
{
   /**
    * Initializes this module.
    * This method is required by the IModule interface.
    * @param TXmlElement configuration for this module, can be null
    * @throws TConfigurationException if eaccelerator extension is not installed or not started, check your php.ini
    */
	public function init($config)
	{
		if(!function_exists('eaccelerator_get'))
			throw new TConfigurationException('eacceleratorcache_extension_required');
		parent::init($config);
	}

	/**
	 * Retrieves a value from cache with a specified key.
	 * This is the implementation of the method declared in the parent class.
	 * @param string a unique key identifying the cached value
	 * @return string the value stored in cache, false if the value is not in the cache or expired.
	 */
	protected function getValue($key)
	{
		$value = eaccelerator_get($key);
		return ($value === null) ? false : $value;
	}

	/**
	 * Stores a value identified by a key in cache.
	 * This is the implementation of the method declared in the parent class.
	 *
	 * @param string the key identifying the value to be cached
	 * @param string the value to be cached
	 * @param integer the number of seconds in which the cached value will expire. 0 means never expire.
	 * @return boolean true if the value is successfully stored into cache, false otherwise
	 */
	protected function setValue($key,$value,$expire)
	{
		return eaccelerator_put($key,$value,$expire);
	}

	/**
	 * Stores a value identified by a key into cache if the cache does not contain this key.
	 * This is the implementation of the method declared in the parent class.
	 *
	 * @param string the key identifying the value to be cached
	 * @param string the value to be cached
	 * @param integer the number of seconds in which the cached value will expire. 0 means never expire.
	 * @return boolean true if the value is successfully stored into cache, false otherwise
	 */
	protected function addValue($key,$value,$expire)
	{
		return (null === eaccelerator_get($key)) ? $this->setValue($key,$value,$expire) : false;
	}

	/**
	 * Deletes a value with the specified key from cache
	 * This is the implementation of the method declared in the parent class.
	 * @param string the key of the value to be deleted
	 * @return boolean if no error happens during deletion
	 */
	protected function deleteValue($key)
	{
		return eaccelerator_rm($key);
	}

	/**
	 * Deletes all values from cache.
	 * Be careful of performing this operation if the cache is shared by multiple applications.
	 */
	public function flush()
	{
		// first, remove expired content from cache
		eaccelerator_gc();
		// now, remove leftover cache-keys
		$keys = eaccelerator_list_keys();
		foreach($keys as $key)
			$this->deleteValue(substr($key['name'], 1));
		return true;
	}
}
2 1
\ No newline at end of file
2
+<?php
/**
 * TEACache class file
 *
 * @author Dario rigolin <[email protected]>
 * @link https://github.com/pradosoft/prado
 * @copyright Copyright &copy; 2005-2016 The PRADO Group
 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
 * @package System.Caching
 */

/**
 * TEACache class
 *
 * TEACache implements a cache application module based on {@link http://eaccelerator.net/ eAccelerator}.
 *
 * By definition, cache does not ensure the existence of a value
 * even if it never expires. Cache is not meant to be an persistent storage.
 *
 * To use this module, the eAccelerator PHP extension must be loaded and enabled
 *
 * Please note that as of v0.9.6, eAccelerator no longer supports data caching.
 * This means if you still want to use this component, your eAccelerator should be of 0.9.5.x or lower version.
 *
 * Some usage examples of TEACache are as follows,
 * <code>
 * $cache=new TEACache;  // TEACache may also be loaded as a Prado application module
 * $cache->init(null);
 * $cache->add('object',$object);
 * $object2=$cache->get('object');
 * </code>
 *
 * If loaded, TEACache will register itself with {@link TApplication} as the
 * cache module. It can be accessed via {@link TApplication::getCache()}.
 *
 * TEACache may be configured in application configuration file as follows
 * <code>
 * <module id="cache" class="System.Caching.TEACache" />
 * </code>
 *
 * @author Dario Rigolin <[email protected]>
 * @package System.Caching
 * @since 3.2.2
 */
class TEACache extends TCache {
   /**
    * Initializes this module.
    * This method is required by the IModule interface.
    * @param TXmlElement configuration for this module, can be null
    * @throws TConfigurationException if eaccelerator extension is not installed or not started, check your php.ini
    */
	public function init($config) {
		if(!function_exists('eaccelerator_get'))
			throw new TConfigurationException('eacceleratorcache_extension_required'); parent::init($config); }

	/**
	 * Retrieves a value from cache with a specified key.
	 * This is the implementation of the method declared in the parent class.
	 * @param string a unique key identifying the cached value
	 * @return string the value stored in cache, false if the value is not in the cache or expired.
	 */
	protected function getValue($key) {
		$value=eaccelerator_get($key); return ($value===null) ? false : $value; }

	/**
	 * Stores a value identified by a key in cache.
	 * This is the implementation of the method declared in the parent class.
	 *
	 * @param string the key identifying the value to be cached
	 * @param string the value to be cached
	 * @param integer the number of seconds in which the cached value will expire. 0 means never expire.
	 * @return boolean true if the value is successfully stored into cache, false otherwise
	 */
	protected function setValue($key, $value, $expire) {
		return eaccelerator_put($key, $value, $expire); }

	/**
	 * Stores a value identified by a key into cache if the cache does not contain this key.
	 * This is the implementation of the method declared in the parent class.
	 *
	 * @param string the key identifying the value to be cached
	 * @param string the value to be cached
	 * @param integer the number of seconds in which the cached value will expire. 0 means never expire.
	 * @return boolean true if the value is successfully stored into cache, false otherwise
	 */
	protected function addValue($key, $value, $expire) {
		return (null===eaccelerator_get($key)) ? $this->setValue($key, $value, $expire) : false; }

	/**
	 * Deletes a value with the specified key from cache
	 * This is the implementation of the method declared in the parent class.
	 * @param string the key of the value to be deleted
	 * @return boolean if no error happens during deletion
	 */
	protected function deleteValue($key) {
		return eaccelerator_rm($key); }

	/**
	 * Deletes all values from cache.
	 * Be careful of performing this operation if the cache is shared by multiple applications.
	 */
	public function flush() {
		// first, remove expired content from cache
		eaccelerator_gc(); // now, remove leftover cache-keys
		$keys=eaccelerator_list_keys(); foreach($keys as $key)
			$this->deleteValue(substr($key['name'], 1)); return true; }
}
3 3
\ No newline at end of file
Please login to merge, or discard this patch.