diff --git a/CHANGELOG.md b/CHANGELOG.md index 4300bc74b..60b8c6b03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#bugfix) * Fixed a fatal error if you have a collection with missing or invalid `@page: /route` + * Fixed gzip compression making it to work correctly with all servers and browsers # v1.0.0-rc.3 ## 10/29/2015 diff --git a/system/blueprints/config/system.yaml b/system/blueprints/config/system.yaml index e79da93e3..ce1169ea4 100644 --- a/system/blueprints/config/system.yaml +++ b/system/blueprints/config/system.yaml @@ -73,7 +73,7 @@ form: options: "F jS \\a\\t g:ia": Date1 "l jS \\of F g:i A": Date2 - "D, m M Y G:i:s": Date3 + "D, d M Y G:i:s": Date3 "d-m-y G:i": Date4 "jS M Y": Date5 @@ -86,7 +86,7 @@ form: options: "F jS \\a\\t g:ia": Date1 "l jS \\of F g:i A": Date2 - "D, m M Y G:i:s": Date3 + "D, d M Y G:i:s": Date3 "d-m-y G:i": Date4 "jS M Y": Date5 diff --git a/system/src/Grav/Common/Filesystem/Folder.php b/system/src/Grav/Common/Filesystem/Folder.php index 6026d8f04..af1b93352 100644 --- a/system/src/Grav/Common/Filesystem/Folder.php +++ b/system/src/Grav/Common/Filesystem/Folder.php @@ -64,8 +64,8 @@ abstract class Folder /** * Get relative path between target and base path. If path isn't relative, return full path. * - * @param string $path - * @param string $base + * @param string $path + * @param mixed|string $base * @return string */ public static function getRelativePath($path, $base = GRAV_ROOT) diff --git a/system/src/Grav/Common/GPM/Remote/Plugins.php b/system/src/Grav/Common/GPM/Remote/Plugins.php index ec6d64521..df8668491 100644 --- a/system/src/Grav/Common/GPM/Remote/Plugins.php +++ b/system/src/Grav/Common/GPM/Remote/Plugins.php @@ -16,6 +16,8 @@ class Plugins extends AbstractPackageCollection /** * Local Plugins Constructor + * @param bool $refresh + * @param callable $callback Either a function or callback in array notation */ public function __construct($refresh = false, $callback = null) { diff --git a/system/src/Grav/Common/GPM/Remote/Themes.php b/system/src/Grav/Common/GPM/Remote/Themes.php index 759b7e10a..0af055b03 100644 --- a/system/src/Grav/Common/GPM/Remote/Themes.php +++ b/system/src/Grav/Common/GPM/Remote/Themes.php @@ -16,6 +16,8 @@ class Themes extends AbstractPackageCollection /** * Local Themes Constructor + * @param bool $refresh + * @param callable $callback Either a function or callback in array notation */ public function __construct($refresh = false, $callback = null) { diff --git a/system/src/Grav/Common/GPM/Response.php b/system/src/Grav/Common/GPM/Response.php index 4f61e2b42..d2b446b3b 100644 --- a/system/src/Grav/Common/GPM/Response.php +++ b/system/src/Grav/Common/GPM/Response.php @@ -50,6 +50,7 @@ class Response /** * Sets the preferred method to use for making HTTP calls. * @param string $method Default is `auto` + * @return Response */ public static function setMethod($method = 'auto') { @@ -64,8 +65,9 @@ class Response /** * Makes a request to the URL by using the preferred method - * @param string $uri URL to call - * @param array $options An array of parameters for both `curl` and `fopen` + * @param string $uri URL to call + * @param array $options An array of parameters for both `curl` and `fopen` + * @param callable $callback Either a function or callback in array notation * @return string The response of the request */ public static function get($uri = '', $options = [], $callback = null) diff --git a/system/src/Grav/Common/Grav.php b/system/src/Grav/Common/Grav.php index da1ea4217..1335c4480 100644 --- a/system/src/Grav/Common/Grav.php +++ b/system/src/Grav/Common/Grav.php @@ -201,7 +201,10 @@ class Grav extends Container // Use output buffering to prevent headers from being sent too early. ob_start(); if ($this['config']->get('system.cache.gzip')) { - ob_start('ob_gzhandler'); + // Enable zip/deflate with a fallback in case of if browser does not support compressing. + if(!ob_start("ob_gzhandler")) { + ob_start(); + } } // Initialize the timezone @@ -416,22 +419,25 @@ class Grav extends Container public function shutdown() { if ($this['config']->get('system.debugger.shutdown.close_connection')) { - //stop user abort + // Prevent user abort. if (function_exists('ignore_user_abort')) { @ignore_user_abort(true); } - // close the session + // Close the session. if (isset($this['session'])) { $this['session']->close(); } - // flush buffer if gzip buffer was started if ($this['config']->get('system.cache.gzip')) { - ob_end_flush(); // gzhandler buffer + // Flush gzhandler buffer if gzip was enabled. + ob_end_flush(); + } else { + // Otherwise prevent server from compressing the output. + header('Content-Encoding: none'); } - // get lengh and close the connection + // Get length and close the connection. header('Content-Length: ' . ob_get_length()); header("Connection: close"); @@ -440,7 +446,7 @@ class Grav extends Container @ob_flush(); flush(); - // fix for fastcgi close connection issue + // Fix for fastcgi close connection issue. if (function_exists('fastcgi_finish_request')) { @fastcgi_finish_request(); } diff --git a/system/src/Grav/Console/Cli/InstallCommand.php b/system/src/Grav/Console/Cli/InstallCommand.php index 8b6e36eb9..31f011691 100644 --- a/system/src/Grav/Console/Cli/InstallCommand.php +++ b/system/src/Grav/Console/Cli/InstallCommand.php @@ -46,7 +46,6 @@ class InstallCommand extends ConsoleCommand 'destination', InputArgument::OPTIONAL, 'Where to install the required bits (default to current project)' - ) ->setDescription("Installs the dependencies needed by Grav. Optionally can create symbolic links") ->setHelp('The install command installs the dependencies needed by Grav. Optionally can create symbolic links');