Comments (6)
I still use an older version or Yourls, and of PHP, so I won't be able to test this until I have time to upgrade everything. But it looks as if you will need to change this line in yapchache/plugin.php
$ydb->infos[$keyword] = apc_fetch(yapc_get_keyword_key($keyword));
to
$ydb->set_infos($keyword, apc_fetch(yapc_get_keyword_key($keyword)));
I don't think this will solve all your problems though. At the least, you'll have to look at similar issues around lines 95 and 96
$ydb->option = apc_fetch($key);
$ydb->installed = apc_fetch(YAPC_YOURLS_INSTALLED);
They'll need changing to use $ydb->set_option() and $ydb->set_installed() instead.
from yapcache.
Mmm, actually, the $ydb->option bit is going to be more complicated, as we're trying to set an entire array here. Probably need to cycle through it.
from yapcache.
Thanks for taking a look at this Chris. I'm happy to test anything further that might help!
from yapcache.
OK. I built YAPCache against 1.7.1. It necessarily needs quite low level access to the database and there have been some important changes to the all powerful $ydb object since 1.7.1. Several properties that YAPCache accesses directly are now protected and must be accessed via methods. Methods that didn't exist in 1.7.1, so I can't actually make the changes until I can upgrade. But if you fancy poking about in the code I think what you'll have to do is this (get the latest commit from GitHub first):
Around line 138 change
$ydb->infos[$keyword] = apc_fetch(yapc_get_keyword_key($keyword));
to
$ydb->set_infos($keyword, apc_fetch(yapc_get_keyword_key($keyword)));
Around line 95 change
$ydb->option = apc_fetch($key);
$ydb->installed = apc_fetch(YAPC_YOURLS_INSTALLED);
to
$options = apc_fetch($key);
foreach ($options as $name => $value) {
$this->ydb->set_option($name, $value);
}
$ydb->set_installed(apc_fetch(YAPC_YOURLS_INSTALLED));
Let me know how you get on. And if you can't face hacking the code, at least the notes are here for me when I get around to it :)
from yapcache.
And as a 'note to self'... I need to look at all the $ydb->query()
calls and change them. There are specific methods for beginTransaction() and commit(), and perform() or fetchAffected() should work elsewhere.
from yapcache.
Thanks, Chris. Those changes allowed me to use the plugin and edit and delete URLs properly. I do notice that the speed increase from using the cache is not as great as it was before, fwiw.
Thanks again,
--Chris
from yapcache.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yapcache.