On 03/27/2013 11:01 AM, Johannes Schlüter wrote:
On Tue, 2013-03-26 at 11:32 +0000, Joe Watkins wrote:
Hi chaps,
As some of you know, I have recently stripped APC of opcode caching
abilities. Revised it's C API and locking and am preparing to create a
PECL release.
http://github.com/krakjoe/apcu
Any objections ?
Seems to be a good idea. An request: IS there a chance to make APIs like
apc_cache_store() exported, stable (PHP|APC_)API function which could be
used by other extension to check/preload/... the cache?
johannes
Morning Johannes,
Every part of the APCu API is exposed, and installed.
From an external extension, you can do anything, from manipulate the
APC cache, to creating caches and even shared memory allocators of your
own !
An example of using this new superpower, (I think it's fair to call it
a superpower):
https://github.com/krakjoe/apcu/blob/simplify/apcue
Another example that allows the user, at runtime, to create and
configure multiple caches:
https://github.com/krakjoe/apcup
Both of these examples use a separate allocator to APC (apc_sma), to
properly demonstrate how this is done. You can of course interact with
apc_sma from an external extension too. Both examples are not examples
of polished code, but extensions thrown together to test the
functionality of the API and explore some of the possibilities.
I have agressively commented and organized the source code of APCu,
also updated the TECHNOTES/INSTALL for correctness. It should all make
quite a good read, if you're into that sort of thing.
The headers you want to read in particular: *_api.h
I do hope this gives rise to some pretty cool extensions ...
Enjoy :)
Joe
--
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php