You appear to be a bot. Output may be restricted
Description
Load the library from fallback directoriesIf the library name is in the form vendor/package then we trim the vendor name to use this as the library and expect the fallback dirs to include all the possible repositories
Usage
$string = oik_require_lib_fallback( $library );
Parameters
- $library
- ( string ) required – the name of the shared library to load
Returns
string $library_file the file name of the loaded librarySource
File name: oik/libs/oik_boot.phpLines:
1 to 18 of 18
function oik_require_lib_fallback( $library ) { if ( false === strpos( $library, ".php" ) ) { $library .= ".php"; } $oik_lib_fallback = oik_lib_fallback( dirname( __FILE__ ) ); foreach ( $oik_lib_fallback as $library_dir ) { $library_file = "$library_dir/$library"; //echo "<b>trying: $library_file</b>" . PHP_EOL; if ( file_exists( $library_file ) ) { require_once( $library_file ); break; } else { $library_file = false; } } return( $library_file ); }View on GitHub View on Trac