elcobvg / laravel-opcache Goto Github PK
View Code? Open in Web Editor NEWCustom OPcache Cache Driver for Laravel. Faster than Redis, Memcache or APC.
License: MIT License
Custom OPcache Cache Driver for Laravel. Faster than Redis, Memcache or APC.
License: MIT License
I noticed that unlike the File cache, there is no folder structure created for the files. Does this mean there may be an IO overhead when caching millions of key/value pairs?
hi,
very excited to use this, but when i do this:
//use Illuminate\Database\Eloquent\Model;
use ElcoBvG\Opcache\Model;
i get:
Class 'ElcoBvG\Opcache\Model' not found
thanks
The instruction to register the service provider shows the wrong class name.
Hey guys,
I installed this package on ubuntu 18.04, PHP 7.4, and Laravel 8.1.
everything is ok except for one thing. when I want to run the PHP artisan opcache:compile
command line says
# php artisan opcache:compile
Compiling scripts...
Illuminate\Http\Client\RequestException
HTTP request returned status code 500:
<!doctype html>
<html class="theme-light">
<!--
ParseError: syntax error, unexpected 'private' (T_PRIVATE), expecting va (truncated...)
at vendor/laravel/framework/src/Illuminate/Http/Client/Response.php:288
284▕ */
285▕ public function toException()
286▕ {
287▕ if ($this->failed()) {
➜ 288▕ return new RequestException($this);
289▕ }
290▕ }
291▕
292▕ /**
+15 vendor frames
16 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
I checked the contained file and realized OMG this is the PHP 8.* syntax.
Hi @elcobvg!
The package is working like a charm, so we'll use it in our open source publishing softwares, I just found one issue:
Laravel is passing down seconds to the driver, but the package is currently interpreting the values as minutes.
ps: As you said you're currently with few time to deal with open-source, I'll submit a PR to address this issue and a small change to improve a bit the performance.
To enable caching of full Eloquent models, the base class needs to be extended with a __set_state method.
For retrievable storage of paged results, the Builder and Paginator need to be extended as well.
As of Laravel 5.8, str helper classes are deprecated.
The constructor still uses str_slug
.
$this->prefix = str_slug($prefix ?: config('app.name', 'opcache'), '-');
Can this please be updated to use Str::slug
instead?
In Store.php at line 229: only when old cache file present? Test....
I'm running my application with opcache, and give this error:
Type error: Argument 2 passed to ElcoBvg\Opcache\Store::writeFile() must be of the type integer, float given, called in \vendor\elcobvg\laravel-opcache\src\Store.php on line 104
The fix is just cast the $expiration before send, but I don't know what is the real problem, if it's mine...
What's the deal?
$model->delete() fails for some reason.
same exact code works fine with apc activated in .env and laravel-opcache still installed and without reverting
use ElcoBvg\Opcache\Model;
back to
use Illuminate\Database\Eloquent\Model;
. i thought cache flush wasn't working at first, but the row is not actually being deleted.
thanks
There's a way to show all keys stored in cache?
Uncaught BadMethodCallException: Call to undefined method App\Models\Page::__set_state() in /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:50
Stack trace: #0 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(36): Illuminate\Database\Eloquent\Model::throwBadMethodCallException('__set_state') #1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1614): Illuminate\Database\Eloquent\Model->forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), '__set_state', Array) #2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1626): Illuminate\Database\Eloquent\Model->__call('__set_state', Array) #3 /var/www/html/storage/framework/cache/data/unit3d-39b6f89872f56543cedea85d00a994d7150cbf29(6): Illuminate\Database\Eloquent\Model::__callStatic('__set_state', Array) #4 /var/www/html/vendor/elcobvg/laravel-opcache/src/Store.php(118): include('/var/www/html/s...') #5 /var/www/html/vend {"userId":3,"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 1): Uncaught BadMethodCallException: Call to undefined method App\\Models\\Page::__set_state() in /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:50 Stack trace: #0 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(36): Illuminate\\Database\\Eloquent\\Model::throwBadMethodCallException('__set_state') #1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1614): Illuminate\\Database\\Eloquent\\Model->forwardCallTo(Object(Illuminate\\Database\\Eloquent\\Builder), '__set_state', Array) #2 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1626): Illuminate\\Database\\Eloquent\\Model->__call('__set_state', Array) #3 /var/www/html/storage/framework/cache/data/unit3d-39b6f89872f56543cedea85d00a994d7150cbf29(6): Illuminate\\Database\\Eloquent\\Model::__callStatic('__set_state', Array) #4 /var/www/html/vendor/elcobvg/laravel-opcache/src/Store.php(118): include('/var/www/html/s...') #5 /var/www/html/vend at /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:50) [stacktrace] #0 {main} "}
Hi. Getting error Driver [opcache] not supported.
. All configs are correct and opcache is enabled in php on mac
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.