Author: ralfbecker
New Revision: 55443
URL: http://svn.stylite.de/viewvc/egroupware?rev=55443&view=rev
Log:
replace create_function with performanter, because opcachable closure
Modified:
trunk/egroupware/api/src/Categories.php
trunk/egroupware/api/src/Db.php
trunk/egroupware/api/src/Db/Schema.php
trunk/egroupware/api/src/Etemplate/Widget/Link.php
trunk/egroupware/api/src/Vfs.php
trunk/egroupware/api/src/Vfs/StreamWrapper.php
— trunk/egroupware/api/src/Categories.php (original)
+++ trunk/egroupware/api/src/Categories.php Sun Mar 20 15:01:29 2016
@@ -811,7 +811,10 @@
($cat[‘appname’] != self::GLOBAL_APPNAME);
}
// sort heighest weight to the top
-
usort($cats, function($a, $b)
-
{
-
return $b['weight'] - $a['weight'];
-
});
}
return $cache[$cat['cat_name']] = (int) $cats[0]['id'];
}
— trunk/egroupware/api/src/Db.php (original)
+++ trunk/egroupware/api/src/Db.php Sun Mar 20 15:01:29 2016
@@ -2057,7 +2057,11 @@
{
$keys = array_keys($arr);
-
return array_walk($keys,create_function('&$v,$k,$strip','$v = str_replace($strip,\'\',$v);'),$strip) ?
-
return array_walk($keys, function(&$v, $k, $strip)
-
{
-
unset($k); // not used, but required by function signature
-
$v = str_replace($strip, '', $v);
-
}, $strip) ?
array_combine($keys,$arr) : $arr;
}
}
— trunk/egroupware/api/src/Db/Schema.php (original)
+++ trunk/egroupware/api/src/Db/Schema.php Sun Mar 20 15:01:29 2016
@@ -1369,7 +1369,10 @@
{
if($this->capabilities[‘name_case’] == ‘upper’)
{
@@ -1402,7 +1405,10 @@
}
if($this->capabilities[‘name_case’] == ‘upper’)
{
-
array_walk($index['columns'], function(&$s)
-
{
-
$s = strtolower($s);
-
});
}
if (count($definition['pk']) && (implode(':',$definition['pk']) == implode(':',$index['columns']) ||
$index['unique'] && count(array_intersect($definition['pk'],$index['columns'])) == count($definition['pk'])))
— trunk/egroupware/api/src/Etemplate/Widget/Link.php (original)
+++ trunk/egroupware/api/src/Etemplate/Widget/Link.php Sun Mar 20 15:01:29 2016
@@ -90,7 +90,8 @@
// ToDo: implement on client-side
if (!$attrs[‘help’]) self::setElementAttribute($form_name, ‘help’, ‘view this linked entry in its application’);
-
if($attrs['type'] == 'link-list')
-
{
$app = $value['to_app'];
$id = $value['to_id'];
$links = Api\Link::get_links($app,$id,'','link_lastmod DESC',true, $value['show_deleted']);
@@ -103,11 +104,18 @@
/**
* Find links that match the given parameters
*/
- public static function ajax_link_search($app, $type, $pattern, $options=array()) {
-
$linksc = array_combine(array_map(create_function('$k', 'return (string)" ".$k;'), array_keys($links)), $links);
-
-
$linksc = array_combine(array_map(function($k)
-
{
-
return (string)$k;
-
}, array_keys($links)), $links);
-
$response = Api\Json\Response::get();
$response->data($linksc);
}
— trunk/egroupware/api/src/Vfs.php (original)
+++ trunk/egroupware/api/src/Vfs.php Sun Mar 20 15:01:29 2016
@@ -360,7 +360,10 @@
}
self::$fstab[$path] = $url;
-
uksort(self::$fstab, function($a, $b)
-
{
-
return strlen($a) - strlen($b);
-
});
if ($persitent_mount)
{
— trunk/egroupware/api/src/Vfs/StreamWrapper.php (original)
+++ trunk/egroupware/api/src/Vfs/StreamWrapper.php Sun Mar 20 15:01:29 2016
@@ -1103,7 +1103,10 @@
self::$symlink_cache[$path] = $target;
// sort longest path first
-
uksort(self::$symlink_cache, function($b, $a)
-
{
-
return strlen($a) - strlen($b);
-
});
if (self::LOG_LEVEL > 1) error_log(__METHOD__."($path,$target) cache now ".array2string(self::$symlink_cache));
}
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs