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 @@ -257,20 +257,14 @@ public static function unguardWithSemaphore(false|\SysvSemaphore $semId): bool {
257257 */
258258 public static function getHardwareConcurrency (): int {
259259 static $ width ;
260+
260261 if (!isset ($ width )) {
261262 if (function_exists ('ini_get ' )) {
262263 $ openBasedir = ini_get ('open_basedir ' );
263- if ($ openBasedir == '' ) {
264+ if (empty ( $ openBasedir) || strpos ( $ openBasedir , ' /proc/cpuinfo ' ) !== false ) {
264265 $ width = is_readable ('/proc/cpuinfo ' ) ? substr_count (file_get_contents ('/proc/cpuinfo ' ), 'processor ' ) : 0 ;
265266 } else {
266- $ openBasedirPaths = explode (': ' , $ openBasedir );
267- foreach ($ openBasedirPaths as $ path ) {
268- if (strpos ($ path , '/proc ' ) === 0 || $ path === '/proc/cpuinfo ' ) {
269- $ width = is_readable ('/proc/cpuinfo ' ) ? substr_count (file_get_contents ('/proc/cpuinfo ' ), 'processor ' ) : 0 ;
270- } else {
271- $ width = 0 ;
272- }
273- }
267+ $ width = 0 ;
274268 }
275269 } else {
276270 $ width = 0 ;
You can’t perform that action at this time.
0 commit comments