You appear to be a bot. Output may be restricted
Description
Compare the library files in two directories
This solution is a temporary solution until a better one is found using
- Git submodules
- or Composer packages.
The oik-libs /libs directory is supposed to contain the master The plugin's /libs directory should either be updated from the master OR, if it's newer than the master then we update the master When packaging a plugin we need to ensure that we've got the latest version of the shared library files that we use. For each file in the plugin's directory we compare it with the master
plugin time vs master time | processing |
---|---|
earlier | Copy to plugins dir from master |
same | OK |
later | Copy to master dir from plugins dir |
Note: We may need to loop through all the plugins a couple of times
master
Usage
oik_libs_compare_libs( $master_dir, $plugins_dir );
Parameters
- $master_dir
- ( string ) required – the master directory
- $plugins_dir
- ( string ) required – the plugins directory
Returns
void
Source
File name: oik-libs/libs/oik-libs.php
Lines:
1 to 17 of 17
function oik_libs_compare_libs( $master_dir, $plugins_dir ) { oik_require( "admin/oik-apis.php", "oik-shortcodes" ); $files = _oiksc_get_php_files( $plugins_dir, null ); bw_trace2( $files, "files", true ); foreach ( $files as $key => $file ) { if ( substr( $file, -1 ) !== "." ) { //echo "$key $file" . PHP_EOL; $master_file = oik_libs_get_file( $file, $master_dir ); $plugin_file = oik_libs_get_file( $file, $plugins_dir ); oik_libs_compare_file( $plugin_file, $master_file ); } } }