FastSitePHP uses Semantic Versioning. This change log includes Framework release history and new website features or major changes.
- Thanks Li Jun Hui for helping with Chinese translations! https://github.com/lijunhuippl
- Update
I18N::langFile()
for a minor edge case bug related to 404 redirect on missing language. It was found to affect local development with the PHP built-in server when a singleindex.php
file is used for routing.
-
Improved Framework support with FreeBSD
FileEncryption
Class now has improved support for large file encryption (2+ GB) on a basic FreeBSD Server Setup- Additional documentation on FreeBSD Server Setup: https://www.fastsitephp.com/en/documents/install-php-on-linux
-
Fixed a bug with
FastSitePHP\Encoding\Json::encode()
that prevented it from working when using PHP5.3
. This did not affect any other version of PHP. -
Thanks Nicolas CARPi for opening the issue related to the following items https://github.com/NicolasCARPi
-
Adding support for PHP linting with https://github.com/phpstan/phpstan
- For info on how to run
phpstan
see comments in file: https://github.com/fastsitephp/fastsitephp/blob/master/phpstan.neon
- For info on how to run
-
Updated
README.md
file with warning about using older versions of PHP. Currently FastSitePHP supports older versions of PHP that are widely used by not considered secure. -
Updated
README.md
with a brief description of how Unit Testing works.
- The core
Application
object now handles routefilter
functions that return aResponse
object instead of abool
. This allows for easier unit testing of custom middleware. See code example below. - Added function
Request->bearerToken()
- Added function
I18N::hasLang($lang)
- Updated function
I18N::getUserDefaultLang()
to validate the language from malicious user attempts to attack a site from the 'Accept-Language' request header. This is simply an additional safety check as the key validation is handled bySecurity::dirContainsFile
in the function.
// Example route
$app->get('/:lang/auth-demo', 'AuthDemo')->filter('Auth.hasAccess');
// Prior to this change an Auth Middleware Object would have likely called [exit()]
class Auth
{
public function hasAccess(Application $app)
{
$res = new Response($app)
$res
->statusCode(401)
->header('WWW-Authenticate', 'Bearer')
->json(['success' => false, 'authRequired' => true])
->send();
exit();
}
}
// Now the Middleware Object can return a Response Object.
// This allows for easier CLI testing of an Apps Middleware.
class Auth
{
public function hasAccess(Application $app)
{
return (new Response($app))
->statusCode(401)
->header('WWW-Authenticate', 'Bearer')
->json(['success' => false, 'authRequired' => true]);
}
}
- Updated
Application->rootUrl()
andAppMin->rootUrl()
for edge case error when using built-in PHP Server- Error did not affect Apache, nginx, IIS, or most PHP built-in server setups
- When PHP built-in server with fallback 'php -S localhost:3000 website/public/index.php' and code similar to the example below the a site would redirect with 2 forward slashes (example:
http://localhost:3000//en/
). - The previous work-around was to use
$app->redirect('/' . I18N::getUserDefaultLang() . '/');
- The below code now works correctly in all tested environments
$app->get('/', function() use ($app) {
$app->redirect($app->rootUrl() . I18N::getUserDefaultLang() . '/');
});
- Spanish
es
translations complete for all JSON files on the main site- https://fastsitephp.com/es/
- Thanks Tibaldo Pirela Reyes for helping with translations! https://github.com/tpirelar
- Updates for easier nginx suppport using a basic nginx install
- Change affected
Application->requestedPath()
andAppMin->requestedPath()
so handle empty string "" for PATH_INFO
- Change affected
- Created a script that allows easy web server setup with Apache, PHP, and the FastSitePHP Starter Site
wget https://www.fastsitephp.com/downloads/create-fast-site.sh
sudo bash create-fast-site.sh
- Brazilian Portuguese
pt-BR
language support added forL10N
- formatting dates, times, and numbers- https://www.fastsitephp.com/en/api/Lang_L10N
- Previously
pt-BR
would have fallen back topt
- Thanks Marcelo dos Santos Mafra for finding and providing this! https://github.com/msmafra
- Class
Lang\L10N
- https://www.fastsitephp.com/en/api/Lang_L10N
- Fixed bug with
Lang\L10N
class so that a 404 page is correctly sent by default - Thanks eGirlAsm for finding the bug! https://github.com/eGirlAsm
- Added link updates for unicode-cldr in the header docs
- Changed default 404 page title message from 'Page Not Found' to '404 - Page Not Found' for clarity - Property [$app->not_found_page_title]
- New Class
FastSitePHP\FileSystem\Sync
- Class
FastSitePHP\Lang\I18N
- Added new static function:
I18N::getUserDefaultLang()
- Fixed edge case error when multple calls are made to
I18N::langFile()
and a file is missing after the first call.
- Added new static function:
- Initial public release