Skip to content

Commit

Permalink
Dev: Fixes for PHP7
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Feb 19, 2018
1 parent 6f903c7 commit af776ea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions framework/logging/CProfileLogRoute.php
Expand Up @@ -179,8 +179,7 @@ protected function displaySummary($logs)
}

$entries=array_values($results);
$func=create_function('$a,$b','return $a[4]<$b[4]?1:0;');
usort($entries,$func);
usort($entries, function($a,$b){return $a[4]<$b[4]?1:0;});

$this->render('profile-summary',$entries);
}
Expand All @@ -202,4 +201,4 @@ protected function aggregateResult($result,$delta)
$total+=$delta;
return array($token,$calls,$min,$max,$total);
}
}
}
6 changes: 3 additions & 3 deletions framework/vendors/markdown/markdown.php
Expand Up @@ -1455,9 +1455,9 @@ public function _initDetab() {
# regular expression.
#
if (function_exists($this->utf8_strlen)) return;
$this->utf8_strlen = create_function('$text', 'return preg_match_all(
"/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/",
$text, $m);');
$this->utf8_strlen = function($text){
return preg_match_all( "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/", $text, $m);
};
}


Expand Down
2 changes: 1 addition & 1 deletion framework/web/CHttpRequest.php
Expand Up @@ -1051,7 +1051,7 @@ public function getPreferredLanguages()
$languages[]=array((float)$q,$matches[1][$i]);
}

usort($languages,create_function('$a,$b','if($a[0]==$b[0]) {return 0;} return ($a[0]<$b[0]) ? 1 : -1;'));
usort($languages,function($a,$b) {if($a[0]==$b[0]) {return 0;} return ($a[0]<$b[0]) ? 1 : -1;});
foreach($languages as $language)
$sortedLanguages[]=$language[1];
}
Expand Down
4 changes: 2 additions & 2 deletions framework/yiilite.php
Expand Up @@ -2799,7 +2799,7 @@ public function getPreferredLanguages()
if($q)
$languages[]=array((float)$q,$matches[1][$i]);
}
usort($languages,create_function('$a,$b','if($a[0]==$b[0]) {return 0;} return ($a[0]<$b[0]) ? 1 : -1;'));
usort($languages,function($a,$b) {if($a[0]==$b[0]) {return 0;} return ($a[0]<$b[0]) ? 1 : -1;});
foreach($languages as $language)
$sortedLanguages[]=$language[1];
}
Expand Down Expand Up @@ -10661,4 +10661,4 @@ interface ILogFilter
{
public function filter(&$logs);
}
?>
?>

1 comment on commit af776ea

@LouisGac
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, don't hack the framework files.
create some Core files to extend them.

Please sign in to comment.