function checkplugins($p_path) { $t_path = rtrim($p_path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; $t_plugins = @scandir($t_path); if (false == $t_plugins) { print_error("plugin path {$t_path} not found or not accessible"); } else { foreach ($t_plugins as $t_plugin) { if ($t_plugin[0] == '.') { continue; } echo "<br />Checking language files for plugin {$t_plugin}:<br />"; checklangdir($t_path . $t_plugin); } } }
/** * Check plugin language files * @param string $p_path Plugin path. * @return void */ function checkplugins($p_path) { $t_path = rtrim($p_path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; $t_plugins = @scandir($t_path); if (false == $t_plugins) { print_error('plugin path ' . $t_path . ' not found or not accessible'); } else { foreach ($t_plugins as $t_plugin) { if ($t_plugin[0] == '.' || $t_plugin == 'Web.config') { continue; } echo '<br />Checking language files for plugin ' . $t_plugin . ':<br />'; checklangdir($t_path . $t_plugin); } } }
function checklangdir( $p_path, $p_subpath = '' ) { $p_path = $p_path . DIRECTORY_SEPARATOR . $p_subpath . DIRECTORY_SEPARATOR; if( $handle = opendir( $p_path ) ) { while( false !== ( $file = readdir( $handle ) ) ) { if ( $file[0] == '.' ) continue; if ( $p_subpath == '' ) { echo "Checking language files for plugin $file:<br />"; if (file_exists( $p_path . DIRECTORY_SEPARATOR . $p_subpath . DIRECTORY_SEPARATOR . $file . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR . 'strings_english.txt' ) ) { echo "Testing english language for plugin '$file' (phase 1)...<br />"; flush(); checkfile( $p_path . DIRECTORY_SEPARATOR . $p_subpath . DIRECTORY_SEPARATOR . $file . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, 'strings_english.txt' ); } } if( !is_dir( $p_path . DIRECTORY_SEPARATOR . $file ) && $p_subpath == 'lang' ) { checkfile( $p_path, $file ); } else { if ( is_dir( $p_path . DIRECTORY_SEPARATOR . $file ) ) checklangdir( $p_path, $file); } } closedir( $handle ); } }