Merge branch '1.7' into feature/clockwork-twig

This commit is contained in:
Andy Miller
2019-05-29 09:48:32 +02:00
6 changed files with 1433 additions and 1417 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -125,6 +125,7 @@ log:
debugger:
enabled: false # Enable Grav debugger and following settings
provider: debugbar # Debugger provider
shutdown:
close_connection: true # Close the connection before calling onShutdown(). false for debugging

View File

@@ -8,8 +8,8 @@
// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.6.9');
define('GRAV_TESTING', false);
define('GRAV_VERSION', '1.7.0-dev');
define('GRAV_TESTING', true);
define('DS', '/');
if (!defined('GRAV_PHP_MIN')) {

View File

@@ -118,11 +118,15 @@ class Debugger
if ($this->enabled) {
$this->initialized = true;
// Clockwork initialization.
$this->clockwork = $clockwork = new Clockwork();
$clockwork = $debugbar = null;
// Debugbar initialization.
$this->debugbar = $debugbar = new DebugBar();
switch ($this->config->get('system.debugger.provider', 'debugbar')) {
case 'clockwork':
$this->clockwork = $clockwork = new Clockwork();
break;
default:
$this->debugbar = $debugbar = new DebugBar();
}
$plugins_config = (array)$this->config->get('plugins');
ksort($plugins_config);
@@ -169,7 +173,7 @@ class Debugger
$debugbar['time']->addMeasure('Site Setup', $this->currentTime, microtime(true));
}
$this->addMessage('Grav v' . GRAV_VERSION);
$this->addMessage('Grav v' . GRAV_VERSION . ' - PHP ' . PHP_VERSION);
$this->config->debug();
if ($clockwork) {

View File

@@ -300,16 +300,17 @@ class Uri
* Get URI parameter.
*
* @param string $id
* @param bool $default
*
* @return bool|string
*/
public function param($id)
public function param($id, $default = false)
{
if (isset($this->params[$id])) {
return html_entity_decode(rawurldecode($this->params[$id]));
}
return false;
return $default;
}
/**

View File

@@ -1260,7 +1260,7 @@ abstract class Utils
*/
public static function sortArrayByArray(array $array, array $orderArray)
{
$ordered = array();
$ordered = [];
foreach ($orderArray as $key) {
if (array_key_exists($key, $array)) {
$ordered[$key] = $array[$key];