• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

XOOPS Cube Legacy base repository


Commit MetaInfo

Révision3057f07453c6dcaff1587f203c8c3a220294de62 (tree)
l'heure2011-11-16 22:15:09
Auteurnbuy <nbuy@704c...>
Commiternbuy

Message de Log

revise for speedup

git-svn-id: https://xoopscube.svn.sourceforge.net/svnroot/xoopscube/Package_Legacy/trunk@1055 704cf05f-ae62-4b0e-a484-234ee0250e75

Change Summary

Modification

--- a/html/modules/legacy/kernel/Legacy_Controller.class.php
+++ b/html/modules/legacy/kernel/Legacy_Controller.class.php
@@ -264,7 +264,7 @@ class Legacy_Controller extends XCube_Controller
264264 $arr = localtime($iTime);
265265 $arr[5] += 1900;
266266 $arr[4]++;
267- $iTztime = gmmktime($arr[2], $arr[1], $arr[0], $arr[4], $arr[3], $arr[5], $arr[8]);
267+ $iTztime = gmmktime($arr[2], $arr[1], $arr[0], $arr[4], $arr[3], $arr[5]);
268268 $offset = doubleval(($iTztime-$iTime)/(60*60));
269269 $zonelist =
270270 array
@@ -775,17 +775,15 @@ class Legacy_Controller extends XCube_Controller
775775 $dir = XOOPS_ROOT_PATH . '/modules/' . $mod_dir . $dirname . '/';
776776 if(is_dir($dir)) {
777777 $files = glob($dir.'*.class.php');
778- if (is_array($files)) {
778+ if ($files) {
779779 foreach($files as $file) {
780780 require_once $file;
781- if (preg_match("/(\w+)\.class\.php/", $file, $matches)) {
782- $className = ucfirst($mod_dir) . "_" . $matches[1];
781+ $className = ucfirst($mod_dir) . "_" . basename($file, '.class.php');
783782
784783 if (XC_CLASS_EXISTS($className) && !isset($this->_mLoadedFilterNames[$className])) {
785784 $this->_mLoadedFilterNames[$className] = true;
786785 $this->addActionFilter(new $className($this));
787786 }
788- }
789787 }
790788 }
791789 }
--- a/html/modules/legacy/kernel/object.php
+++ b/html/modules/legacy/kernel/object.php
@@ -61,7 +61,7 @@ class XoopsSimpleObject extends AbstractXoopsObject
6161 'data_type' => $dataType,
6262 'value' => null,
6363 'required' => $required ? true : false,
64- 'maxlength' => $size ? intval($size) : null
64+ 'maxlength' => $size ? (int)$size : null
6565 );
6666
6767 $this->assignVar($key, $value);
@@ -75,28 +75,23 @@ class XoopsSimpleObject extends AbstractXoopsObject
7575 switch ($vars['data_type']) {
7676 case XOBJ_DTYPE_BOOL:
7777 $vars['value'] = $value ? 1 : 0;
78- break;
78+ return;
7979
8080 case XOBJ_DTYPE_INT:
81- $vars['value'] = $value !== null ? intval($value) : null;
82- break;
81+ $vars['value'] = $value !== null ? (int)$value : null;
82+ return;
8383
8484 case XOBJ_DTYPE_FLOAT:
85- $vars['value'] = $value !== null ? floatval($value) : null;
86- break;
85+ $vars['value'] = $value !== null ? (float)$value : null;
86+ return;
8787
8888 case XOBJ_DTYPE_STRING:
89- if ($vars['maxlength'] !== null && strlen($value) > $vars['maxlength']) {
90- $vars['value'] = xoops_substr($value, 0, $vars['maxlength'], null);
91- }
92- else {
93- $vars['value'] = $value;
94- }
95- break;
89+ $vars['value'] = ($vars['maxlength'] !== null && strlen($value) > $vars['maxlength']) ? xoops_substr($value, 0, $vars['maxlength'], null) : $value;
90+ return;
9691
9792 case XOBJ_DTYPE_TEXT:
9893 $vars['value'] = $value;
99- break;
94+ return;
10095 }
10196 }
10297
@@ -157,20 +152,17 @@ class XoopsSimpleObject extends AbstractXoopsObject
157152 case XOBJ_DTYPE_BOOL:
158153 case XOBJ_DTYPE_INT:
159154 case XOBJ_DTYPE_FLOAT:
160- $value = $vars['value'];
161- break;
155+ return $vars['value'];
162156
163157 case XOBJ_DTYPE_STRING:
164158 $root =& XCube_Root::getSingleton();
165159 $textFilter =& $root->getTextFilter();
166- $value = $textFilter->toShow($vars['value']);
167- break;
160+ return $textFilter->toShow($vars['value']);
168161
169162 case XOBJ_DTYPE_TEXT:
170163 $root =& XCube_Root::getSingleton();
171164 $textFilter =& $root->getTextFilter();
172- $value = $textFilter->toShowTarea($vars['value'], 0, 1, 1, 1, 1);
173- break;
165+ return $textFilter->toShowTarea($vars['value'], 0, 1, 1, 1, 1);
174166 }
175167
176168 return $value;