@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function raiseCallbackEvent($param) |
| 104 | 104 | { |
| 105 | - $parameter = new TActiveTableCellEventParameter($this->getResponse(), $param->getCallbackParameter(), $this->getCellIndex()); |
|
| 105 | + $parameter=new TActiveTableCellEventParameter($this->getResponse(), $param->getCallbackParameter(), $this->getCellIndex()); |
|
| 106 | 106 | $this->onCellSelected($parameter); |
| 107 | 107 | $this->raiseBubbleEvent($this, $parameter); |
| 108 | 108 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | { |
| 130 | 130 | parent::addAttributesToRender($writer); |
| 131 | 131 | $writer->addAttribute('id', $this->getClientID()); |
| 132 | - if ($this->hasEventHandler('OnCellSelected')) |
|
| 132 | + if($this->hasEventHandler('OnCellSelected')) |
|
| 133 | 133 | $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions()); |
| 134 | 134 | } |
| 135 | 135 | |
@@ -142,19 +142,19 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function render($writer) |
| 144 | 144 | { |
| 145 | - if ($this->getHasPreRendered()) |
|
| 145 | + if($this->getHasPreRendered()) |
|
| 146 | 146 | { |
| 147 | 147 | parent::render($writer); |
| 148 | - if ($this->getActiveControl()->canUpdateClientSide()) |
|
| 148 | + if($this->getActiveControl()->canUpdateClientSide()) |
|
| 149 | 149 | $this->getPage()->getCallbackClient()->replaceContent($this, $writer); |
| 150 | 150 | } |
| 151 | 151 | else { |
| 152 | 152 | $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
| 153 | 153 | // If we update a TActiveTableCell on callback, we shouldn't update all childs, |
| 154 | 154 | // because the whole content will be replaced by the parent. |
| 155 | - if ($this->getHasControls()) |
|
| 155 | + if($this->getHasControls()) |
|
| 156 | 156 | { |
| 157 | - foreach ($this->findControlsByType('Prado\Web\UI\ActiveControls\IActiveControl', false) as $control) |
|
| 157 | + foreach($this->findControlsByType('Prado\Web\UI\ActiveControls\IActiveControl', false) as $control) |
|
| 158 | 158 | $control->getActiveControl()->setEnableUpdate(false); |
| 159 | 159 | } |
| 160 | 160 | } |
@@ -167,8 +167,8 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | protected function getPostBackOptions() |
| 169 | 169 | { |
| 170 | - $options['ID'] = $this->getClientID(); |
|
| 171 | - $options['EventTarget'] = $this->getUniqueID(); |
|
| 170 | + $options['ID']=$this->getClientID(); |
|
| 171 | + $options['EventTarget']=$this->getUniqueID(); |
|
| 172 | 172 | return $options; |
| 173 | 173 | } |
| 174 | 174 | |
@@ -180,8 +180,8 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function getCellIndex() |
| 182 | 182 | { |
| 183 | - foreach ($this->getRow()->getCells() as $key => $row) |
|
| 184 | - if ($row == $this) return $key; |
|
| 183 | + foreach($this->getRow()->getCells() as $key => $row) |
|
| 184 | + if($row==$this) return $key; |
|
| 185 | 185 | throw new TConfigurationException('tactivetablecell_control_notincollection', get_class($this), $this->getUniqueID()); |
| 186 | 186 | } |
| 187 | 187 | |
@@ -192,14 +192,14 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | public function getRow() |
| 194 | 194 | { |
| 195 | - if ($this->_row === null) |
|
| 195 | + if($this->_row===null) |
|
| 196 | 196 | { |
| 197 | - $row = $this->getParent(); |
|
| 198 | - while (!($row instanceof TTableRow) && $row !== null) |
|
| 197 | + $row=$this->getParent(); |
|
| 198 | + while(!($row instanceof TTableRow) && $row!==null) |
|
| 199 | 199 | { |
| 200 | - $row = $row->getParent(); |
|
| 200 | + $row=$row->getParent(); |
|
| 201 | 201 | } |
| 202 | - if ($row instanceof TTableRow) $this->_row = $row; |
|
| 202 | + if($row instanceof TTableRow) $this->_row=$row; |
|
| 203 | 203 | else throw new TConfigurationException('tactivetablecell_control_outoftable', get_class($this), $this->getUniqueID()); |
| 204 | 204 | } |
| 205 | 205 | return $this->_row; |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function __construct($template) |
| 30 | 30 | { |
| 31 | - $this->_template = $template; |
|
| 31 | + $this->_template=$template; |
|
| 32 | 32 | } |
| 33 | 33 | /** |
| 34 | 34 | * Instantiates the template. |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function __construct($template) |
| 30 | 30 | { |
| 31 | - $this->_template = $template; |
|
| 31 | + $this->_template=$template; |
|
| 32 | 32 | } |
| 33 | 33 | /** |
| 34 | 34 | * Instantiates the template. |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function __construct($template) |
| 30 | 30 | { |
| 31 | - $this->_template = $template; |
|
| 31 | + $this->_template=$template; |
|
| 32 | 32 | } |
| 33 | 33 | /** |
| 34 | 34 | * Instantiates the template. |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | /** |
| 86 | 86 | * @var boolean if the module is initialized |
| 87 | 87 | */ |
| 88 | - private $_initialized = false; |
|
| 88 | + private $_initialized=false; |
|
| 89 | 89 | /** |
| 90 | 90 | * @var \Redis the Redis instance |
| 91 | 91 | */ |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | /** |
| 94 | 94 | * @var string host name of the redis cache server |
| 95 | 95 | */ |
| 96 | - private $_host = 'localhost'; |
|
| 96 | + private $_host='localhost'; |
|
| 97 | 97 | /** |
| 98 | 98 | * @var integer the port number of the redis cache server |
| 99 | 99 | */ |
| 100 | - private $_port = 6379; |
|
| 100 | + private $_port=6379; |
|
| 101 | 101 | /** |
| 102 | 102 | * @var string the unix socket of the redis cache server. |
| 103 | 103 | */ |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | /** |
| 106 | 106 | * @var integer the database index to use within the redis server. |
| 107 | 107 | */ |
| 108 | - private $_index = 0; |
|
| 108 | + private $_index=0; |
|
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | 111 | * Destructor. |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function __destruct() |
| 115 | 115 | { |
| 116 | - if ($this->_cache instanceof \Redis) |
|
| 116 | + if($this->_cache instanceof \Redis) |
|
| 117 | 117 | $this->_cache->close(); |
| 118 | 118 | } |
| 119 | 119 | |
@@ -126,17 +126,17 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function init($config) |
| 128 | 128 | { |
| 129 | - if (!extension_loaded('redis') || !class_exists('\Redis', false)) |
|
| 129 | + if(!extension_loaded('redis') || !class_exists('\Redis', false)) |
|
| 130 | 130 | throw new TConfigurationException('rediscache_extension_required'); |
| 131 | - $this->_cache = new \Redis(); |
|
| 132 | - if ($this->_socket !== null) |
|
| 131 | + $this->_cache=new \Redis(); |
|
| 132 | + if($this->_socket!==null) |
|
| 133 | 133 | $this->_cache->connect($this->_socket); |
| 134 | 134 | else |
| 135 | 135 | $this->_cache->connect($this->_host, $this->_port); |
| 136 | 136 | $this->_cache->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_PHP); |
| 137 | 137 | $this->_cache->select($this->_index); |
| 138 | 138 | parent::init($config); |
| 139 | - $this->_initialized = true; |
|
| 139 | + $this->_initialized=true; |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | public function valid($key) { |
@@ -157,10 +157,10 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function setHost($value) |
| 159 | 159 | { |
| 160 | - if ($this->_initialized) |
|
| 160 | + if($this->_initialized) |
|
| 161 | 161 | throw new TInvalidOperationException('rediscache_host_unchangeable'); |
| 162 | 162 | else |
| 163 | - $this->_host = $value; |
|
| 163 | + $this->_host=$value; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -177,10 +177,10 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | public function setPort($value) |
| 179 | 179 | { |
| 180 | - if ($this->_initialized) |
|
| 180 | + if($this->_initialized) |
|
| 181 | 181 | throw new TInvalidOperationException('rediscache_port_unchangeable'); |
| 182 | 182 | else |
| 183 | - $this->_port = TPropertyValue::ensureInteger($value); |
|
| 183 | + $this->_port=TPropertyValue::ensureInteger($value); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /** |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | if($this->_initialized) |
| 201 | 201 | throw new TInvalidOperationException('rediscache_socket_unchangeable'); |
| 202 | 202 | else |
| 203 | - $this->_socket = TPropertyValue::ensureString($value); |
|
| 203 | + $this->_socket=TPropertyValue::ensureString($value); |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /** |
@@ -217,10 +217,10 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | public function setIndex($value) |
| 219 | 219 | { |
| 220 | - if ($this->_initialized) |
|
| 220 | + if($this->_initialized) |
|
| 221 | 221 | throw new TInvalidOperationException('rediscache_index_unchangeable'); |
| 222 | 222 | else |
| 223 | - $this->_index = TPropertyValue::ensureInteger($value); |
|
| 223 | + $this->_index=TPropertyValue::ensureInteger($value); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | /** |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | */ |
| 246 | 246 | protected function setValue($key, $value, $expire) |
| 247 | 247 | { |
| 248 | - $options = $expire === 0 ? [] : ['ex' => $expire]; |
|
| 248 | + $options=$expire===0 ? [] : ['ex' => $expire]; |
|
| 249 | 249 | return $this->_cache->set($key, $value, $options); |
| 250 | 250 | } |
| 251 | 251 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | protected function addValue($key, $value, $expire) |
| 262 | 262 | { |
| 263 | - $options = $expire === 0 ? ['nx'] : ['nx', 'ex' => $expire]; |
|
| 263 | + $options=$expire===0 ? ['nx'] : ['nx', 'ex' => $expire]; |
|
| 264 | 264 | return $this->_cache->set($key, $value, $options); |
| 265 | 265 | } |
| 266 | 266 | |
@@ -60,10 +60,10 @@ |
||
| 60 | 60 | if(!extension_loaded('apc')) |
| 61 | 61 | throw new TConfigurationException('apccache_extension_required'); |
| 62 | 62 | |
| 63 | - if(ini_get('apc.enabled') == false) |
|
| 63 | + if(ini_get('apc.enabled')==false) |
|
| 64 | 64 | throw new TConfigurationException('apccache_extension_not_enabled'); |
| 65 | 65 | |
| 66 | - if(substr(php_sapi_name(), 0, 3) === 'cli' and ini_get('apc.enable_cli') == false) |
|
| 66 | + if(substr(php_sapi_name(), 0, 3)==='cli' and ini_get('apc.enable_cli')==false) |
|
| 67 | 67 | throw new TConfigurationException('apccache_extension_not_enabled_cli'); |
| 68 | 68 | |
| 69 | 69 | parent::init($config); |
@@ -69,8 +69,8 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | protected function getValue($key) |
| 71 | 71 | { |
| 72 | - $value = eaccelerator_get($key); |
|
| 73 | - return ($value === null) ? false : $value; |
|
| 72 | + $value=eaccelerator_get($key); |
|
| 73 | + return ($value===null) ? false : $value; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | protected function addValue($key, $value, $expire) |
| 100 | 100 | { |
| 101 | - return (null === eaccelerator_get($key)) ? $this->setValue($key, $value, $expire) : false; |
|
| 101 | + return (null===eaccelerator_get($key)) ? $this->setValue($key, $value, $expire) : false; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | // first, remove expired content from cache |
| 122 | 122 | eaccelerator_gc(); |
| 123 | 123 | // now, remove leftover cache-keys |
| 124 | - $keys = eaccelerator_list_keys(); |
|
| 124 | + $keys=eaccelerator_list_keys(); |
|
| 125 | 125 | foreach($keys as $key) |
| 126 | 126 | $this->deleteValue(substr($key['name'], 1)); |
| 127 | 127 | return true; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * @var array containing the mapping from RPC method names to the actual handlers |
| 28 | 28 | */ |
| 29 | - protected $rpcMethods = []; |
|
| 29 | + protected $rpcMethods=[]; |
|
| 30 | 30 | |
| 31 | 31 | // abstracts |
| 32 | 32 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function addMethod($methodName, $handlerDetails) |
| 76 | 76 | { |
| 77 | - $this->rpcMethods[$methodName] = $handlerDetails; |
|
| 77 | + $this->rpcMethods[$methodName]=$handlerDetails; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -86,13 +86,13 @@ discard block |
||
| 86 | 86 | public function callApiMethod($methodName, $parameters) |
| 87 | 87 | { |
| 88 | 88 | if(!isset($this->rpcMethods[$methodName])) |
| 89 | - throw new TRpcException('Method "' . $methodName . '" not found'); |
|
| 89 | + throw new TRpcException('Method "'.$methodName.'" not found'); |
|
| 90 | 90 | |
| 91 | - if($parameters === null) |
|
| 92 | - $parameters = []; |
|
| 91 | + if($parameters===null) |
|
| 92 | + $parameters=[]; |
|
| 93 | 93 | |
| 94 | 94 | if(!is_array($parameters)) |
| 95 | - $parameters = [$parameters]; |
|
| 95 | + $parameters=[$parameters]; |
|
| 96 | 96 | return call_user_func_array($this->rpcMethods[$methodName]['method'], $parameters); |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | \ No newline at end of file |
@@ -26,6 +26,6 @@ |
||
| 26 | 26 | { |
| 27 | 27 | public function toJavaScriptLiteral() |
| 28 | 28 | { |
| 29 | - return TJavaScript::jsonEncode((string)$this->_s, JSON_HEX_QUOT | JSON_HEX_APOS | JSON_HEX_TAG); |
|
| 29 | + return TJavaScript::jsonEncode((string) $this->_s, JSON_HEX_QUOT | JSON_HEX_APOS | JSON_HEX_TAG); |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | \ No newline at end of file |