/** * Load the OIK_Autoload logic * * You might think that the fact that you invoke oik_require_lib( "oik_autoload" ); * would be enough to tell the autoload library that you'll be using autoloading for your classes. * But I think it's better to implicitely invoke either oik_require_class() or oik_autoload() to instantiate the * autoloading logic when you know that OO code will be used. * * Notice we use oik_require_file() to load a class file manually */ function oik_autoload() { if (!class_exists("OIK_Autoload")) { //echo "Loading OIK_Autoload" ; oik_require_file("class-oik-autoload.php", "oik-autoload"); } if (class_exists("OIK_Autoload")) { $oik_autoload = OIK_Autoload::instance(); } else { bw_trace2("Class OIK_Autoload does not exist"); die; } return $oik_autoload; }
/** * Add admin when 'oik' OR 'oik-lib' is active * * What if it's been done already? * oik-fum is dependent upon its own library ( oik_fum ) and the * shared libraries that the oik base plugin used. * If oik-lib is active then we can simply request "oik_fum" * If not, we have to request them one by one. * * @TODO We can tell oik-lib is active by ??? * */ function oikf_admin_setup() { oik_lib_fallback(__DIR__ . "/vendor/bobbingwide/oik_fum"); $bobbfunc = oik_require_lib("bobbfunc"); //c( $bobbfunc ); $bobbforms = oik_require_lib("bobbforms"); //c( $bobbforms ); $oik_admin = oik_require_lib("oik-admin"); //c( $oik_admin ); $oik_fum = oik_require_lib("oik_fum"); //c( $oik_fum ); bw_trace2($oik_fum, "oik_fum library?", false, BW_TRACE_DEBUG); if ($oik_fum && !is_wp_error($oik_fum)) { $oik_fum_admin = oik_require_file('admin/oik-fum.php', "oik_fum"); bw_trace2($oik_fum_admin, "oik_fum_admin?", false, BW_TRACE_DEBUG); //c( $oik_fum_admin ); //echo $oik_fum_admin; if ($oik_fum_admin) { oik_fum_add_page(); } } }