Req #61277 [Nab]: Feature request: Shared Keyword
Edit report at https://bugs.php.net/bug.php?id=61277&edit=1
ID: 61277
User updated by: thbley at gmail dot com
Reported by: thbley at gmail dot com
Summary: Feature request: Shared Keyword
Status: Not a bug
Type: Feature/Change Request
Package: *General Issues
Operating System: All
PHP Version: 5.5.0
Block user comment: N
Private report: N
New Comment:
Magic methods are nice but checking if the extension is available and enabled, maybe compile it
before, implement the whole interface, define some good error handling, include the library,
implement the fallback for non-apc, ... a lot of work than could be handled by a one-liner.
People love sth. like session_start(); $_SESSION["hello"] = "world"; without
knowing all the stuff behind it.
Previous Comments:
------------------------------------------------------------------------
[2012-03-05 05:53:56] rasmus@php.net
APC will eventually go in, but it is not going to be directly mapped to any sort
of special shared keywords. Like I said, there are plenty of ways to map this in
userspace via the various magic methods.
------------------------------------------------------------------------
[2012-03-05 05:44:17] thbley at gmail dot com
I think it shouldn't be a big issue to get a small portion of the apc or memcache code in the
core and make it stable. In the end of 2005, there was the decision to include apc in the core. So I
think it is not a bad idea to look at this again.
------------------------------------------------------------------------
[2012-03-05 03:55:12] rasmus@php.net
And APC is still not stable and portable enough to include in PHP, so saying to do
it like APC doesn't mean much. Doing it like APC means not putting it not the
core. And if you want something just like APC, just use APC. Most of the
frameworks already do and they include a slower fallback for servers without APC.
This is not going to be baked into the object syntax directly since we have all
the magic methods you need to hook it in yourself.
------------------------------------------------------------------------
[2012-03-05 02:26:09] thbley at gmail dot com
> It is a design decision in PHP not to have such global things in PHP itself.
All PHP frameworks are offering some kind of caching with shared disk or shared memory. And I
haven't seen a bigger project not using this stuff. It's time to rethink this decision.
> - correct locking can be hard
I think the way APC does this it, should do it.
> - such a feature makes scaling over multiple servers hard
It would be enough to have it on one server. For those who want more, can still send the data to
memcache.
Here is a new example: https://gist.github.com/1975954
------------------------------------------------------------------------
[2012-03-05 00:19:10] johannes@php.net
It is a design decision in PHP not to have such global things in PHP itself. Addon modules (you
mentioned apc) can add utilities for this, though.
Some reasons include:
- PHP can be embedded in any application which might add constrains
- correct locking can be hard
- such a feature makes scaling over multiple servers hard
- it messes with copy-on-write
- ...
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=61277
--
Edit this bug report at https://bugs.php.net/bug.php?id=61277&edit=1
Thread (9 messages)