Skip to content

Latest commit

 

History

History
123 lines (94 loc) · 5.53 KB

CHANGELOG.md

File metadata and controls

123 lines (94 loc) · 5.53 KB

FastSitePHP Change Log

FastSitePHP uses Semantic Versioning. This change log includes Framework release history and new website features or major changes.

Website (March 27, 2020)

1.2.2 (February 26, 2020)

  • 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 single index.php file is used for routing.

1.2.1 (January 27, 2020)

1.2.0 (January 10, 2020)

  • The core Application object now handles route filter functions that return a Response object instead of a bool. 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 by Security::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]);
    }
}

1.1.3 (December 24, 2019)

  • Updated Application->rootUrl() and AppMin->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() . '/');
});

Website (December 24, 2019)

1.1.2 (December 16, 2019)

  • Updates for easier nginx suppport using a basic nginx install
    • Change affected Application->requestedPath() and AppMin->requestedPath() so handle empty string "" for PATH_INFO

Website (December 12, 2019)

  • 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

1.1.1 (December 12, 2019)

1.1.0 (December 10, 2019)

  • 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.

1.0.0 (November 14, 2019)

  • Initial public release