[wp-hackers] Caching as part of the core
ryan at pixopoint.com
Mon Jul 23 12:13:20 UTC 2012
Perhaps a better solution may be to provide an API to allow regular
plugins to add drop-ins automatically? This can already be done via
the WordPress file API, but having something specific to dropins might
make some sense.
Or perhaps we should encourage existing drop-in plugin developers to
implement the WordPress file API directly, to copy their files across,
instead of requiring manual copying?
The API could also remove the drop-in when the plugin is deactivated.
This would remove the headaches some users have when they deactivate a
caching plugin and still have the advanced-caching.php file lingering
in their system even though the plugin is no longer in use.
> Date: Sun, 22 Jul 2012 15:54:33 -0400
> From: Mike Schinkel <mike at newclarity.net>
> Subject: Re: [wp-hackers] Caching as part of the core
> To: wp-hackers at lists.automattic.com
> Message-ID: <66806DEC-16A6-43A3-993C-BF9371932991 at newclarity.net>
> Content-Type: text/plain; charset=us-ascii
> On Jul 22, 2012, at 1:31 PM, Brian Layman wrote:
>> Drop in plugins are what they are because they must be loaded early on, or at least at very specific times in the initiation process, to do their job.
>> They are so specific in function, that the list of file names is hard coded into the core.
> But clearly the method $dropins use to find and load files could be improved, no?
> Consider this as a strawman proposal:
> 1.) Move the require() in /wp-settings.php for /wp-includes/plugin.php from line 78 to 31 so that it gets loaded before any drop-ins.
> 2.) On line 32 of /wp-settings.php call a function that looks for a '/wp-content/dropins/' directory; if it exists then include() all the .php files in the directory.
> 3.) Deprecate existing dropins and implement do_action() hooks to run in place of existing dropins.
> 4.) Document that any file in dropins directory is responsible to add the actions it needs to support its own drop-in functionality.
> Thoughts? If I don't get someone to explain an obvious reason this won't work I can add to Trac.
More information about the wp-hackers