Closed daithi-coombes closed 11 years ago
N.B. when working on this check that if loading the index.php from api-con will add action and filter callbacks twice, thus running calls to the api twice.
Nice solution here: http://stackoverflow.com/questions/2397004/php-check-if-a-file-is-loaded-directly-instead-of-including
if!(in_array(__FILE__, get_included_files()):
/* BOOTSRAPPING */
...
/* END BOOTSTRAPPING */
endif;
or condition could be:
if(!is_defined("API_Con_Mngr_Loaded")):
define("API_Con_Mngr_Loaded", 1);
...
endif;
Hooking in to modify the db wouldn't be the best solution, as the first time the blog is run - ie before the first re-organisation of the plugins, then plugins that require the api-con would throw errors.
Unfortunately the only solution here is to force plugin writers to require
the index.php file for the api-con suite.
@ryanholder @mrdavidlaing to put on the list...
issue
currently plugin developers are going to have to link to the api connection managers index.php file. The reason for this is there is no mechanism built at the moment to make sure the api-con plugin gets loaded first, therefore if the plugin dev's loads first it won't find the api-con class without including the file.
solution
Wordpress calls the order of plugins from a serialized array, adding a hook to re-organise the serialized db entry would enforce the api-con to be first plugin loaded. We could hook into a query being executed so there wouldn't be extra load and run it on every page load, a hook thats before the loading of plugins.