Lines:
1 to 98 of 98
<?php // (C) Copyright Bobbing Wide 2015, 2018 if ( !defined( 'OIK_LIB_INCLUDED' ) ) { define( 'OIK_LIB_INCLUDED', "0.1.1" ); /** * oik library management functions * * Library: oik-lib * Provides: oik-lib * Depends: oik_boot, bwtrace * Shareable: No - since it expects to be part of the oik-lib plugin. See oik_require() below * Conflicts: oik:<=3.0.0 * * Notes: If we wanted to make oik-lib a shareable shared library then we might want to make * the plugin `oik-lib` and the shared library package `oik_lib` ... the difference being the underscore for the library * To do this it would also be better to locate it in /vendor/bobbingwide/oik_lib * * * These are the functions that implement shared library logic that enable * plugins and themes to define their dependencies on other plugins and/or library functions. * These functions are loaded as WordPress starts up. * * Plugins should expect the base APIs to be available from "muplugins_loaded" - when this is also implemented in a Must-Use plugin * OR "plugins_loaded" otherwise. * * They don't have to wait for "init" BUT they should actually wait for the appropriate "oik_lib_loaded" action message * If they need a library then they should invoke oik_require_lib( $lib, $version ) and test the result. * If they need a library function then they should invoke oik_require_func( $func, $lib, $version ) and test the result * If they need a library file then they should invoke oik_require_file( $file, $lib ) and test the result * These functions may also support parameters passed as $args arrays * * This logic is intended to be run as part of a must-use plugin ( __oik-lib-mu.php ) * but may also be invoked as a normal plugin * * Libraries implemented: * * Library | Functionality * ---------- | ------------- * oik_boot |Bootstrap functions equivalent to oik's oik_boot.php * bwtrace | Trace functions equivalent to oik's bwtrace.php * * * Plugins that use/share these functions or provide other libraries are * summarised in the oik-libs master repository. * * Plugin | Functionality * ------ | --------------- * oik | oik_boot * oik | bobbforms * oik | bobbfunc * oik | oik-admin * * @TODO Correct this list to reflect actual libraries * oik | lib-fields * oik | lib-shortcodes * oik | oik-depends * oik | lib-update * etcetera... * * Note: These "libraries" are more modular than the PHP libraries listed in * {@link https://github.com/ziadoz/awesome-php#dependency-management-extras} * You may want to consider them as modules, similar to Drupal modules or those implemented by Jetpack. * The difference between a library and a plugin is that the library simply provides some functionality, the plugin implements it. * * The difference between a library and an include file is that the library is dynamically fetched when required; * it's not just loaded at startup in the vain assumption that it's going to be needed. * * The difference between a library and a package has yet to be defined. */ /* function oik_libs() – Return the singular instance of the OIK_libs class */ /* function oik_register_lib() – Register a library */ if ( !function_exists( "oik_require_lib" ) ) { /* function oik_require_lib() – Require a library */ } /* function oik_lib_determine_lib() – Determine the library file to load */ /* function oik_require_func() – Require a library function */ /* function oik_lib_register_default_libs() – Register the default libraries */ /* function oik_lib_check_libs() – Check the existence of the available libraries for the given plugin */ /* function oik_lib_boot() – Satisfy pre-requisites for oik-lib shared library processing */ } /* end !defined */View on GitHub
Called by
Invoked by
Calls
Call hooks
API Letters: