Download the PHP package radmen/lassy without Composer
On this page you can find all versions of the php package radmen/lassy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package lassy
About
Lassy is lazy static site generator. It means that every request (well not every.. check out Filters section) will generate a HTML file with its contents inside.
Every next request will be redirected to this file.
Installation
Add radmen/lassy
to composer.json
:
Then in app/config/app.php
add:
'Radmen\Lassy\LassyServiceProvider'
toproviders
'Lassy' => 'Radmen\Lassy\Facade'
toaliases
And publish config: php artisan config:publish radmen/lassy
Rewrites
Lassy only genereates HTML files. All requests must be rewrited to this files. Here are some example configs for such rewrites.
Note that _static
is only example dirname. It can be changed in config file.
Apache
Laravel
If you have problem with server rewrites (it happens to me all the time) you can serve static files through Laravel application.
In app/filters.php
add:
Filters
In some situations static file should not be generated. That's where filters come in action.
Filter is closure which returns boolean. If it's FALSE
Lassy will be disabled.
Lassy provides some basic filters:
Radmen\Lassy\Filter\AjaxRequest
checks if request is an AJAX call. IfTRUE
disable LassyRadmen\Lassy\Filter\GetRequest
enables Lassy only forGET
requestsRadmen\Lassy\Filter\HtmlResponse
enables Lassy only for valid (response code = 200
) HTML responsesRadmen\Lassy\Filter\QueriedRequest
disables Lassy when request has data in query
Filters can be specified in package config file.
Lassy can be enabled / disabled manually during the request. To do this run Lassy::enable()
, or Lassy::disable()
in your code.
Clearing files
If you want to delete generated files just run php artisan lassy:clear
in console.
License
The Lassy package is open-sourced software licensed under the MIT license.
All versions of lassy with dependencies
illuminate/support Version 4.1.x
illuminate/http Version 4.1.x
illuminate/filesystem Version 4.1.x
illuminate/console Version 4.1.x