Server IP : 192.158.238.246 / Your IP : 18.118.226.34 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/7779/task/7779/cwd/plugins/woocommerce/vendor/automattic/jetpack-status/src/ |
Upload File : |
<?php /** * A modules class for Jetpack. * * @package automattic/jetpack-status */ namespace Automattic\Jetpack; /** * Class Automattic\Jetpack\Files * * Used to retrieve information about files. */ class Files { /** * Returns an array of all PHP files in the specified absolute path. * Equivalent to glob( "$absolute_path/*.php" ). * * @param string $absolute_path The absolute path of the directory to search. * @return array Array of absolute paths to the PHP files. */ public function glob_php( $absolute_path ) { if ( function_exists( 'glob' ) ) { return glob( "$absolute_path/*.php" ); } $absolute_path = untrailingslashit( $absolute_path ); $files = array(); $dir = @opendir( $absolute_path ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged if ( ! $dir ) { return $files; } // phpcs:ignore Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition while ( false !== $file = readdir( $dir ) ) { if ( str_starts_with( $file, '.' ) || ! str_ends_with( $file, '.php' ) ) { continue; } $file = "$absolute_path/$file"; if ( ! is_file( $file ) ) { continue; } $files[] = $file; } closedir( $dir ); return $files; } }