maartenstaa / laravel-41-route-caching Goto Github PK
View Code? Open in Web Editor NEWThis package allows you to cache your routes definitions, thereby speeding up each request.
License: Other
This package allows you to cache your routes definitions, thereby speeding up each request.
License: Other
Now that I went through all 4.1.x versions, I should do the same for 4.0.x to find out what it would take to add compatibility for that.
I think there's only one statement left to be covered.
Seems that disabling the routes cache solves this, both by //comment
and by TTL=0
.
output of php artisan routes
is identical.
It would be nice to know:
$router->controller
and $router->resource
Hi,
Thanks for the great library. It is very useful in projects with laravel 4.2
This is more a request, not a bug.
Is it possible for you to create a public function in the Router.php to clean the cache?
Sometimes we don't change the Routes.php but if we add a method in a controller that is defined by Route::Controller it will give 404. This happens when routes are cached and it didn't had that method before.
If I had that method (could be called though the Facade like Route::cleanCache() ) I could make a command that calls it.
Thanks,
Pedro
PS. sorry about the bad english
The version requirement for Laravel should be defined differently, at least for now.
@MaartenStaa since 4.1.0 compatibility and code coverage are all set, any plans to tag a release according to http://semver.org/ so users on packagist can use tagged version instead of dev-master?
As pointed our by @yuripave in pull request #2, integration tests with Laravel < 4.1.19 fail. I should check each individual version and figure out if I can make it work without getting too hacky.
Otherwise, may need to restrict Laravel version number (as updating from 4.1.x where x < 19 to 4.1.y with y >= 19 shouldn't be a problem in almost all cases).
<?php
Route::cache(__FILE__, function() {
// do stuff
}, 0);
I added the package and also included the service provider but it throws the following error.
Call to undefined method Illuminate\Routing\Router::cache()
Am I doing anything wrong or Any idea on why this is occurring ?
My route.php is quite long and it contains several Route::group. If the Route::cache(FILE, function() {}); function support multiple call then it would great.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.