File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -295,20 +295,14 @@ public static function unguardWithSemaphore($semId): bool {
295295 */
296296 public static function getHardwareConcurrency (): int {
297297 static $ width ;
298+
298299 if (!isset ($ width )) {
299300 if (function_exists ('ini_get ' )) {
300301 $ openBasedir = ini_get ('open_basedir ' );
301- if ($ openBasedir == '' ) {
302+ if (empty ( $ openBasedir) || strpos ( $ openBasedir , ' /proc/cpuinfo ' ) !== false ) {
302303 $ width = is_readable ('/proc/cpuinfo ' ) ? substr_count (file_get_contents ('/proc/cpuinfo ' ), 'processor ' ) : 0 ;
303304 } else {
304- $ openBasedirPaths = explode (': ' , $ openBasedir );
305- foreach ($ openBasedirPaths as $ path ) {
306- if (strpos ($ path , '/proc ' ) === 0 || $ path === '/proc/cpuinfo ' ) {
307- $ width = is_readable ('/proc/cpuinfo ' ) ? substr_count (file_get_contents ('/proc/cpuinfo ' ), 'processor ' ) : 0 ;
308- } else {
309- $ width = 0 ;
310- }
311- }
305+ $ width = 0 ;
312306 }
313307 } else {
314308 $ width = 0 ;
You can’t perform that action at this time.
0 commit comments