Created
April 10, 2016 07:29
-
-
Save kenjis/e4418878c235c884b4bf32f4afc9cdd2 to your computer and use it in GitHub Desktop.
git diff 1.7/master 1.8/master
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/.travis.yml b/.travis.yml | |
index 7ea66ae..dc1f64c 100644 | |
--- a/.travis.yml | |
+++ b/.travis.yml | |
@@ -3,6 +3,7 @@ php: | |
- 5.3 | |
- 5.4 | |
- 5.5 | |
+ - 7.0 | |
before_script: | |
- curl -s http://getcomposer.org/installer | php | |
diff --git a/CHANGELOG.md b/CHANGELOG.md | |
index a210417..f5153d4 100644 | |
--- a/CHANGELOG.md | |
+++ b/CHANGELOG.md | |
@@ -1,5 +1,99 @@ | |
# Changelog | |
+## v1.8.0 | |
+ | |
+### Important fixes, changes, notes. Read them carefully. | |
+ | |
+This version provides full compatibility with PHP 7. To achieve this, the \Fuel\Error class had to be renamed to \Fuel\Errorhandler. The new error handler has full support for PHP 7's new Error exceptions. If your application calls the Error class directly, or has extended the Error class, make sure you make the appropriate changes after you have upgraded! | |
+ | |
+The oil installer has been updated to use composer to install Fuel, and to provide better support for MacOS. | |
+ | |
+### Backward compatibility notes | |
+ | |
+* The included PHPSecLib version has been swapped by the composer package. If your application creates instances of PHPSecLib classes, check your code for compatibility issues, for example with the use of namespaces. | |
+ | |
+### Removed code (because it was deprecated in v1.7.3 or earlier) | |
+ | |
+* The old "mysql" DB driver has been removed because of removal in recent PHP versions. You can keep using `mysqli` if for some reason you don't want to use PDO. A new "mysql" driver has been introduced that uses PDO underneath. This should be transparent for most applications. | |
+ | |
+### Security related | |
+ | |
+* Because of the swap to the composer PHPSecLib package, the `pbkdf2()` method that was added to the code by the Fuel team is no longer available. Fuel itself now uses the PHP `hash_pbkdf2()` function. If you are using a PHP version < 5.5.0, this function is emulated in base.php. | |
+* When using file based session, an additional check has been added to make sure the session file is loaded from the configured path. | |
+* The `Security::clean_input()` now has support for `ArrayAccess` and `Traversable` classes, and now fully recurses into these classes and arrays for a full deep clean. | |
+* `Security::generate_token()` now uses `random_bytes()`, `openssl_random_pseudo_bytes()` if available, and uses `hash_algos()` with SHA to generate the token hash. | |
+ | |
+### System changes | |
+ | |
+* The database classes have been refactored. `Database_Query` is now properly extendable, and `DBUtil` schema manipulations have been abstracted in order to support multiple DB platforms. | |
+* New drivers have been added for "dblib" (MS-SQL/Sybase), "sqlsrv" (MS-SQL on Windows) and "SQLite". | |
+* The framework now supports generic HTTP status 400 messages through the new `HttpBadRequestException` exception. | |
+* When a database migration is run, and the database schema is ahead of the migration configuration file, the status is synced before any migrations are run. This makes sure migrations don't run twice, which may happen when you update multiple application instances using a shared clustered database. | |
+* You can now correctly use "hybrid" controller (like "\Controller\Something_Class") names as documented. | |
+* new function `get_composer()` allows direct access to the Composer Autoloader instance. | |
+* The core's "base.php" code has been optimized for PHP 5.6+. | |
+* A new route keyword ":everything" has been added, which complements ":any" by also matching with "nothing". | |
+ | |
+### Specific classes | |
+ | |
+* The Agent class now supports the definition of an HTTP proxy for downloading the browscap file. | |
+* An issue in the Agent class is fixed where loading the browscap file could fail if it was defined as type "local". | |
+* `Arr::key_exists()` now has support for classes implementing `ArrayAccess`. | |
+* Asset now has a new method `add_type()` to define new types besides "js", "css" and "img". You need to pass a closure that is used to render the HTML for the given type. | |
+* Asset is now more compatible with Windows platforms when it comes to generating paths and URL's (correct use of slash vs backslash). | |
+* The Cache file driver has been improved to solve some locking race conditions. | |
+* Config class no longer caches the result of config keys defined as a closure. Closures are now evaluated at runtime instead of at load time. | |
+* Fixed a bug in `Controller_Rest` that would cause the HTTP status code to be overwritten when detecting an incorrect return format in production mode. | |
+* `Controller_Rest` now returns HTTP status 200 by default. | |
+* When calling the `Database` method `count_last_query()`, any ORDER BY is now stripped from the COUNT query to improve performance. | |
+* Return type detection has been improved for `DB::query()` calls, for SQL statements like "DESCRIBE", "EXECUTE", "EXPLAIN" and "SHOW". | |
+* `Date::range_to_array()` could return unexpected values when using more complex intervals. This has been fixed. | |
+* Added support for "runtime-created functions" in Debug detailed output. | |
+* Fixed a bug in `File::create_dir()` that causes directory creation to fail if the directory had the same name as its parent. | |
+* `Form::open()` can now automatically add a CSRF key field when the config key "security.csrf_auto_token" is set. | |
+* Lang now has a new method `set_lang()`, which allows you to switch the active language, optionally reloading all already loaded language files in this new language. | |
+* Migrate can now detect circular dependencies (two migrations depending on each other), and will now bail out with a loop detection error message. | |
+* Migration tasks can now define `before()` and `after()` methods. If either returns false, the migration is skipped. In case of `after()`, that implies the migration is reverted. | |
+* Mongo_Db has a new `dump()` method to allow dumping a collection or collections for backup purposes. | |
+* The `Response` class now has a new `set_headers()` method to set multiple headers in one go. | |
+* `Request_Curl` now returns the complete "raw" response in the response variable "response", which can be accessed in case of a returned http status >= 400. | |
+* `Request_Curl` now allows you to use fully qualified option names to be set (those starting with "CURLOPT_"). | |
+* The Router now also returns the path of the controller on a found route match. | |
+* The Security class can now throw an `HttpBadRequestException` instead of a generic `Security Exception` when CSRF validation fails. | |
+* The Session file driver has been improved to solve some locking race conditions, and an additional validation of the session payload on session load. | |
+* The "randomness" of generated session ID's has been improved by using `Security::generate_token()` to generate them. | |
+* The Str class now checks if mbstring functions are available before using them. | |
+* Theme is now more compatible with Windows platforms when it comes to generating paths and URL's (correct use of slash vs backslash). | |
+* Validation `valid_date` rule can now handle incomplete date/time formats properly by using defaults for missing values. | |
+* You can now control the behaviour of the View class on closures assigned to a View variable through the config key "filter_closures". | |
+* For View variables supporting the `Sanitation` interface, sanitation is disabled after rendering the view to return the object in its original state. | |
+ | |
+### Packages | |
+ | |
+* Auth: login drivers now uses the internal PHP function `hash_pbkdf2()` function to hash passwords. | |
+* Auth: the Opauth driver will now pass a "group_id" back in the result if the login provider supplies this value in its response. | |
+* Auth: the Opauth driver now has a `get_instance()` method to return the current Opauth instance. | |
+* Auth: migrations now use the configured "db_connection" from the simpleauth/ormauth config, if defined. | |
+* Auth: `auth_check()` now also accepts the name of the login driver (as a string), besides the login driver instance. | |
+* Auth: updated the Auth classes to support the PHPSecLib composer package. | |
+* Email: Fixed bug in text wrapping where spaces could be stripped from HTML tags. | |
+* Email: Added a check on the availability of mbstring extensions before its functions are used. | |
+* Oil: migrate now has a new "--installed" option, which only runs migrations for packages and modules defined in the "always_load" section of the config. You can use it in conjunction with "--modules" and "--packages" to include some manually loaded modules or packages. | |
+* Oil: new "--with-test" option to scaffolding will generate corresponding test classes for each class generated. | |
+* Oil: "fromdb" task has a new "migration" command that allows you to generate migrations from an existing database. NOTE: these need to be checked as not all details can be retrieved from an existing table! | |
+* Orm: Fixed SQL generation error when `DB::expression()` was used at the left-hand side of a query statement. | |
+* Orm: Fixed a decimal point positioning issue in the Typing observer. | |
+* Orm: Fixed a problem in the Temporal model where the incorrect primary key values where used when generating a WHERE clause. | |
+* Orm: Added the option to `dump_tree()` to include a path URI, mainly useful when working with nested sets. | |
+* Orm: The typing observer can now handle floats in all locales (the decimal point is comma problem). | |
+* Orm: Implemented a workaround for slow access of large array entries by reference (see https://bugs.php.net/bug.php?id=68624) | |
+* Orm: A bug that caused related data in a many-many relation to be incorrectly hydrated has been fixed. | |
+* Parser: It is now possible to load Mustache partials. If none are defined, the UTF-8 partial is loaded by default. | |
+* Parser: for View variables supporting the `Sanitation` interface, sanitation is disabled after rendering the view to return the object in its original state. | |
+* Parser: for jade templates, now the Talesoft Jade renderer is supported too, besides the already supported Everzet renderer. | |
+* Parser: fixed a bug that caused loading template files with multiple dots to fail. | |
+* Parser: Twig templates now have access to the `Auth::get()` method through "auth_get". | |
+ | |
## v1.7.3 | |
### Important fixes, changes, notes. Read them carefully. | |
@@ -16,6 +110,10 @@ The final version will be v1.8, which will be released at the same time the firs | |
* When Fuel is run is CLI mode, output buffering is now disabled. Note that it might still buffer, for example because you have enabled buffering globally in your php.ini. | |
* The `match_collection` validation rule now always returns `true` if no collection was passed to match against. | |
+### Removed code (because it was deprecated in v1.6 or earlier) | |
+ | |
+n/a | |
+ | |
### Security related | |
* PHPSecLib has been updated to a more recent version. | |
@@ -28,7 +126,7 @@ The final version will be v1.8, which will be released at the same time the firs | |
* The finder caching system has been updated to avoid incorrect cache hits when loading files from modules or packages. | |
* Module and package paths are now forced to be lowercase to comply with the standards. | |
* You can now configure additional paths to be cleaned, to avoid giving away FQFN in error messages. | |
-* When running migrations, your `up()` or `down()` method can return false to signal it can't execute the method at that point in time. Migrations that use this method are now automatically re-tried in a second migration run. This helps with dependencies, to make sure migrations run in the correct sequence (for example if an app migration requires a package migration to run first because it needs access to its tables). | |
+* When running migrations, your `up()` or `down()` method can return false to signal it can't execute the method at that point in time. Migrations that use this method are now automatically re-tried in a second migration run. This helps with dependencies, to make sure migrations run in the correct sequence (for example if an app migration requires a package migration to run first because it needs access to its tables). | |
### Specific classes | |
@@ -42,7 +140,8 @@ The final version will be v1.8, which will be released at the same time the firs | |
* __Error__: the log level used for errors is now configurable. | |
* __Form__: the `label()` method now has support for the "for" attribute. | |
* __Format__: new parameter for `to_xml()` allows you to specify how booleans must be represented (0/1 vs false/true). | |
-* __Inflector__: the inflector ruleset has been moved to a lang file, so it can easily be amended, and provide support for introducting non-english language rulesets. | |
+* __Inflector__: the inflector ruleset has been moved to a lang file, so it can easily be | |
+amended, and provide support for introducting non-english language rulesets. | |
* __Input__: new `query_string()` method to return the main requests query string. | |
* __Input__: a header value lookup is now done in a case-insensitive manner. | |
* __Lang__: now allows you to load the same lang filename for different languages concurrently. | |
@@ -57,7 +156,7 @@ The final version will be v1.8, which will be released at the same time the firs | |
* __Session__: the `rotation_time` configuration key can now be set to false to completely disable automatic session id rotation. Use with care! | |
* __Theme__: you can now specify the other in which partials must be rendered for output. This allows you to render content before headers and footers, needed to dynamically add assets. | |
* __Theme__: the `presenter()` method now allows you to pass a custom view name (like `Presenter::forge()` that is theme aware. | |
-* __Validation__: the `match_collection` rule can now be run in `strict` mode, which meanly helps when validating booleans. | |
+__Validation__: the `match_collection` rule can now be run in `strict` mode, which meanly helps when validating booleans. | |
* __Validation__: new rule `specials` allows matching against non-latin characters considered alphabetic in unicode. | |
* __View__: `get()` and `set()` now supports dot-notation for getting values from stored arrays. | |
@@ -85,7 +184,7 @@ The final version will be v1.8, which will be released at the same time the firs | |
* __Orm__: `where()` now accepts a single DB::expr() object as argument. | |
* __Orm__: `set()` now allows you to pass an array structure that can recursively set relations (currently "has_one" and "belong_to" only). | |
* __Parser__: now also handles view files with a ".php" extension correctly. | |
-* __Parser__: you can now use `Debug::dump()` in a twig template. | |
+* __Parser__: you can now use `Debug::dump()` in a twig template. | |
* __Parser__: in Twig templates you can now access the current Asset instance to load css, js or image files. | |
## v1.7.2 | |
@@ -172,7 +271,7 @@ Error messages are now escaped, to prevent a possible XSS through the generated | |
* __Asset__: Has a new config option "always_resolve", which will do local asset resolving even for absolute URL's. | |
* __Cache__: A check is added to avoid possible deadlocks with using files for caching. | |
* __Cache__: Now has a driver for Xcache (http://xcache.lighttpd.net). | |
-* __Cli__: Backtrace output has been rewritten to make it more readable on the commandline. | |
+* __Cli__: Backtrace output has been rewritten to make it more readable on the commandline. | |
* __Cli__: Now has the option to disable output colouring. | |
* __Cli__: New methods `stdout` and `stderr` allow you to redirect them to file. | |
* __Config__: When saving a config file, the configured permission mask is now applied. | |
@@ -520,7 +619,7 @@ __Orm__: calling `find()` with no parameters or with a single parameter that is | |
* __Orm__: No longer signals an insert failure if you don't use auto-increment PK's. | |
* __Orm__: Observer_Slug now works correctly with Model_Temporal. | |
* __Orm__: Added `count()`, `min()` and `max()` support to Model_Soft and Model_Temporal. | |
-* __Orm__: Complex `find_this_and_that_or_other()` calls now work correctly. | |
+* __Orm__: Complex `find_this_and_that_or_other()` calls now work correctly. | |
* __Parser__: You can now call `Markdown::parse()` from within a Twig template. | |
* __Parser__: You can now call `Session::get_flash()` and `Session::set_flash()` from within a Twig template. | |
diff --git a/LICENSE.md b/LICENSE.md | |
index 27b95c3..0375af8 100644 | |
--- a/LICENSE.md | |
+++ b/LICENSE.md | |
@@ -1,4 +1,4 @@ | |
-Copyright (c) 2010-2014 Fuel Development Team | |
+Copyright (c) 2010-2016 Fuel Development Team | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
diff --git a/README.md b/README.md | |
index 19f5c05..df7d96b 100644 | |
--- a/README.md | |
+++ b/README.md | |
@@ -1,6 +1,6 @@ | |
#FuelPHP | |
-* Version: 1.7.2 | |
+* Version: 1.8 | |
* [Website](http://fuelphp.com/) | |
* [Release Documentation](http://docs.fuelphp.com) | |
* [Release API browser](http://api.fuelphp.com) | |
@@ -10,7 +10,9 @@ | |
## Description | |
-FuelPHP is a fast, lightweight PHP 5.3 framework. In an age where frameworks are a dime a dozen, We believe that FuelPHP will stand out in the crowd. It will do this by combining all the things you love about the great frameworks out there, while getting rid of the bad. | |
+FuelPHP is a fast, lightweight PHP 5.3+ framework. In an age where frameworks are a dime a dozen, We believe that FuelPHP will stand out in the crowd. It will do this by combining all the things you love about the great frameworks out there, while getting rid of the bad. | |
+ | |
+FuelPHP is fully PHP 7 compatible. | |
## More information | |
@@ -19,8 +21,8 @@ For more detailed information, see the [development wiki](https://github.com/fue | |
##Development Team | |
* Harro Verton - Project Manager, Developer ([http://wanwizard.eu/](http://wanwizard.eu/)) | |
-* Frank de Jonge - Developer ([http://frenky.net/](http://frenky.net/)) | |
-* Steve West - Developer | |
+* Steve West - Core Developer, ORM | |
+* Márk Sági-Kazár - Developer | |
### Want to join? | |
@@ -34,6 +36,7 @@ are up to scratch, we will notice you, and will ask you to become a team member. | |
### Alumni | |
+* Frank de Jonge - Developer ([http://frenky.net/](http://frenky.net/)) | |
* Jelmer Schreuder - Developer ([http://jelmerschreuder.nl/](http://jelmerschreuder.nl/)) | |
* Phil Sturgeon - Developer ([http://philsturgeon.co.uk](http://philsturgeon.co.uk)) | |
* Dan Horrigan - Founder, Developer ([http://dhorrigan.com](http://dhorrigan.com)) | |
diff --git a/composer.json b/composer.json | |
index 3fa09b0..f632585 100644 | |
--- a/composer.json | |
+++ b/composer.json | |
@@ -1,8 +1,8 @@ | |
{ | |
"name": "fuel/fuel", | |
"type": "project", | |
- "description" : "FuelPHP is a simple, flexible, community driven PHP 5.3+ framework, based on the best ideas of other frameworks, with a fresh start!", | |
- "keywords": ["application", "website", "development", "framework", "PHP"], | |
+ "description" : "FuelPHP is a simple, flexible, community driven PHP 5.3.3+ framework, based on the best ideas of other frameworks, with a fresh start!", | |
+ "keywords": ["application", "website", "development", "framework", "PHP", "PHP7"], | |
"license": "MIT", | |
"repositories": [ | |
{ "type": "vcs", "url": "https://github.com/fuel/docs" }, | |
@@ -16,17 +16,20 @@ | |
"require": { | |
"php": ">=5.3.3", | |
"composer/installers": "~1.0", | |
- "fuel/docs": "dev-1.7/master", | |
- "fuel/core": "dev-1.7/master", | |
- "fuel/auth": "dev-1.7/master", | |
- "fuel/email": "dev-1.7/master", | |
- "fuel/oil": "dev-1.7/master", | |
- "fuel/orm": "dev-1.7/master", | |
- "fuel/parser": "dev-1.7/master", | |
- "fuelphp/upload": "2.0.2", | |
+ "fuel/core": "dev-1.8/master", | |
+ "fuel/auth": "dev-1.8/master", | |
+ "fuel/email": "dev-1.8/master", | |
+ "fuel/oil": "dev-1.8/master", | |
+ "fuel/orm": "dev-1.8/master", | |
+ "fuel/parser": "dev-1.8/master", | |
+ "fuelphp/upload": "2.0.6", | |
"monolog/monolog": "1.5.*", | |
+ "phpseclib/phpseclib": "2.0.0", | |
"michelf/php-markdown": "1.4.0" | |
}, | |
+ "require-dev": { | |
+ "fuel/docs": "dev-1.8/master" | |
+ }, | |
"suggest": { | |
"dwoo/dwoo" : "Allow Dwoo templating with the Parser package", | |
"mustache/mustache": "Allow Mustache templating with the Parser package", | |
diff --git a/composer.phar b/composer.phar | |
index 68565db..7e548b6 100755 | |
Binary files a/composer.phar and b/composer.phar differ | |
diff --git a/fuel/app/bootstrap.php b/fuel/app/bootstrap.php | |
index 589bcab..bca6385 100644 | |
--- a/fuel/app/bootstrap.php | |
+++ b/fuel/app/bootstrap.php | |
@@ -18,7 +18,7 @@ require COREPATH.'bootstrap.php'; | |
* Fuel::STAGING | |
* Fuel::PRODUCTION | |
*/ | |
-\Fuel::$env = (isset($_SERVER['FUEL_ENV']) ? $_SERVER['FUEL_ENV'] : \Fuel::DEVELOPMENT); | |
+\Fuel::$env = \Arr::get($_SERVER, 'FUEL_ENV', \Arr::get($_ENV, 'FUEL_ENV', \Fuel::DEVELOPMENT)); | |
// Initialize the framework with the config file. | |
\Fuel::init('config.php'); | |
diff --git a/fuel/app/classes/controller/welcome.php b/fuel/app/classes/controller/welcome.php | |
index ae28255..edff7e1 100644 | |
--- a/fuel/app/classes/controller/welcome.php | |
+++ b/fuel/app/classes/controller/welcome.php | |
@@ -3,10 +3,10 @@ | |
* Fuel is a fast, lightweight, community driven PHP5 framework. | |
* | |
* @package Fuel | |
- * @version 1.7 | |
+ * @version 1.8 | |
* @author Fuel Development Team | |
* @license MIT License | |
- * @copyright 2010 - 2015 Fuel Development Team | |
+ * @copyright 2010 - 2016 Fuel Development Team | |
* @link http://fuelphp.com | |
*/ | |
diff --git a/fuel/app/config/config.php b/fuel/app/config/config.php | |
index 34f4b37..3d2df13 100644 | |
--- a/fuel/app/config/config.php | |
+++ b/fuel/app/config/config.php | |
@@ -3,10 +3,10 @@ | |
* Part of the Fuel framework. | |
* | |
* @package Fuel | |
- * @version 1.7 | |
+ * @version 1.8 | |
* @author Fuel Development Team | |
* @license MIT License | |
- * @copyright 2010 - 2015 Fuel Development Team | |
+ * @copyright 2010 - 2016 Fuel Development Team | |
* @link http://fuelphp.com | |
*/ | |
@@ -113,9 +113,12 @@ return array( | |
* Security settings | |
*/ | |
'security' => array( | |
- // 'csrf_autoload' => false, | |
- // 'csrf_token_key' => 'fuel_csrf_token', | |
- // 'csrf_expiration' => 0, | |
+ // 'csrf_autoload' => false, | |
+ // 'csrf_autoload_methods' => array('post', 'put', 'delete'), | |
+ // 'csrf_bad_request_on_fail' => false, | |
+ // 'csrf_auto_token' => false, | |
+ // 'csrf_token_key' => 'fuel_csrf_token', | |
+ // 'csrf_expiration' => 0, | |
/** | |
* A salt to make sure the generated security tokens are not predictable | |
@@ -160,7 +163,7 @@ return array( | |
// 'htmlentities_flags' => ENT_QUOTES, | |
/** | |
- * Wether to encode HTML entities as well | |
+ * Whether to encode HTML entities as well | |
*/ | |
// 'htmlentities_double_encode' => false, | |
@@ -203,7 +206,7 @@ return array( | |
*/ | |
// 'validation' => array( | |
/** | |
- * Wether to fallback to global when a value is not found in the input array. | |
+ * Whether to fallback to global when a value is not found in the input array. | |
*/ | |
// 'global_input_fallback' => true, | |
// ), | |
@@ -223,7 +226,7 @@ return array( | |
// 'case_sensitive' => true, | |
/** | |
- * Wether to strip the extension | |
+ * Whether to strip the extension | |
*/ | |
// 'strip_extension' => true, | |
// ), | |
diff --git a/fuel/app/tasks/robots.php b/fuel/app/tasks/robots.php | |
index 8fb54f8..28402ba 100644 | |
--- a/fuel/app/tasks/robots.php | |
+++ b/fuel/app/tasks/robots.php | |
@@ -3,10 +3,10 @@ | |
* Fuel is a fast, lightweight, community driven PHP5 framework. | |
* | |
* @package Fuel | |
- * @version 1.7 | |
+ * @version 1.8 | |
* @author Fuel Development Team | |
* @license MIT License | |
- * @copyright 2010 - 2015 Fuel Development Team | |
+ * @copyright 2010 - 2016 Fuel Development Team | |
* @link http://fuelphp.com | |
*/ | |
diff --git a/fuel/app/tests/presenter/.gitkeep b/fuel/app/tests/presenter/.gitkeep | |
new file mode 100644 | |
index 0000000..e69de29 | |
diff --git a/oil b/oil | |
index dd9575b..61f4d04 100644 | |
--- a/oil | |
+++ b/oil | |
@@ -3,10 +3,10 @@ | |
* Fuel is a fast, lightweight, community driven PHP5 framework. | |
* | |
* @package Fuel | |
- * @version 1.7 | |
+ * @version 1.8 | |
* @author Fuel Development Team | |
* @license MIT License | |
- * @copyright 2010 - 2014 Fuel Development Team | |
+ * @copyright 2010 - 2016 Fuel Development Team | |
* @link http://fuelphp.com | |
*/ | |
diff --git a/public/.htaccess b/public/.htaccess | |
index 3ced731..c24fede 100644 | |
--- a/public/.htaccess | |
+++ b/public/.htaccess | |
@@ -31,7 +31,7 @@ | |
#RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC] | |
#RewriteRule ^index\.php(.*)$ $1 [R=301,NS,L] | |
- # make HTTP Basic Authentication work on php5-fcgi installs | |
+ # make HTTP Basic Authentication work on php-fcgi installs | |
<IfModule mod_fcgid.c> | |
RewriteCond %{HTTP:Authorization} . | |
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
@@ -41,21 +41,31 @@ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
- # deal with php5-cgi first | |
+ # deal with php-fcgi first | |
<IfModule mod_fcgid.c> | |
RewriteRule ^(.*)$ index.php?/$1 [QSA,L] | |
</IfModule> | |
+ # no php-fcgi, check for sapi and fpm | |
<IfModule !mod_fcgid.c> | |
- # for normal Apache installations | |
+ # for PHP5 sapi installations | |
<IfModule mod_php5.c> | |
RewriteRule ^(.*)$ index.php/$1 [L] | |
</IfModule> | |
- # for Apache FGCI installations | |
<IfModule !mod_php5.c> | |
- RewriteRule ^(.*)$ index.php?/$1 [QSA,L] | |
+ | |
+ # for PHP7 sapi installations | |
+ <IfModule mod_php7.c> | |
+ RewriteRule ^(.*)$ index.php/$1 [L] | |
+ </IfModule> | |
+ | |
+ # for fpm installations | |
+ <IfModule !mod_php7.c> | |
+ RewriteRule ^(.*)$ index.php?/$1 [QSA,L] | |
+ </IfModule> | |
+ | |
</IfModule> | |
</IfModule> | |
diff --git a/public/index.php b/public/index.php | |
index 88f694b..3dc3887 100644 | |
--- a/public/index.php | |
+++ b/public/index.php | |
@@ -3,10 +3,10 @@ | |
* Fuel is a fast, lightweight, community driven PHP5 framework. | |
* | |
* @package Fuel | |
- * @version 1.7 | |
+ * @version 1.8 | |
* @author Fuel Development Team | |
* @license MIT License | |
- * @copyright 2010 - 2014 Fuel Development Team | |
+ * @copyright 2010 - 2016 Fuel Development Team | |
* @link http://fuelphp.com | |
*/ | |
@@ -91,6 +91,10 @@ try | |
// ... and execute the main request | |
$response = $routerequest(); | |
} | |
+catch (HttpBadRequestException $e) | |
+{ | |
+ $response = $routerequest('_400_', $e); | |
+} | |
catch (HttpNoAccessException $e) | |
{ | |
$response = $routerequest('_403_', $e); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment