@@ -262,7 +262,7 @@ public function getClassMaps(): array
262
262
*/
263
263
public function rebuild (): void
264
264
{
265
- $ this ->withTimeout (max (180 , max ( intval (ini_get ('max_execution_time ' )), 45 ) ));
265
+ $ this ->withTimeout (max (300 , intval (ini_get ('max_execution_time ' )) ));
266
266
$ this ->cacheLoaded = true ;
267
267
$ this ->classes = $ this ->missingClasses = $ this ->emptyFiles = [];
268
268
$ this ->refreshClasses ();
@@ -278,7 +278,7 @@ public function rebuild(): void
278
278
*/
279
279
public function refresh (): void
280
280
{
281
- $ this ->withTimeout (max (180 , max ( intval (ini_get ('max_execution_time ' )), 45 ) ));
281
+ $ this ->withTimeout (max (300 , intval (ini_get ('max_execution_time ' )) ));
282
282
$ this ->loadCache ();
283
283
if (!$ this ->refreshed ) {
284
284
$ this ->refreshClasses ();
@@ -303,13 +303,13 @@ protected function refreshClasses(): void
303
303
$ this ->classes = $ this ->emptyFiles = [];
304
304
305
305
foreach ($ this ->scanPaths as $ path ) {
306
- $ this ->withTimeout (max (180 , max ( intval (ini_get ('max_execution_time ' )), 45 ) ));
306
+ $ this ->withTimeout (max (300 , intval (ini_get ('max_execution_time ' )) ));
307
307
$ iterator = is_file ($ path )
308
308
? [new SplFileInfo ($ path )]
309
309
: $ this ->createFileIterator ($ path );
310
310
311
311
foreach ($ iterator as $ fileInfo ) {
312
- $ this ->withTimeout (max (180 , max ( intval (ini_get ('max_execution_time ' )), 45 ) ));
312
+ $ this ->withTimeout (max (300 , intval (ini_get ('max_execution_time ' )) ));
313
313
$ mtime = $ fileInfo ->getMTime ();
314
314
$ file = $ fileInfo ->getPathname ();
315
315
$ foundClasses = isset ($ files [$ file ]) && $ files [$ file ] === $ mtime
@@ -417,7 +417,7 @@ protected function createFileIterator(string $dir): \Nette\Utils\Finder
417
417
protected function updateFile (string $ file ): void
418
418
{
419
419
420
- $ this ->withTimeout ( max (180 , max ( intval (ini_get ('max_execution_time ' )), 45 )) );
420
+ $ this ->withTimeout (max (300 , intval (ini_get ('max_execution_time ' )) ) );
421
421
422
422
foreach ($ this ->classes as $ class => [$ prevFile ]) {
423
423
if ($ file === $ prevFile ) {
@@ -435,6 +435,7 @@ protected function updateFile(string $file): void
435
435
// $this->dubs[$hash][$file] = $foundClasses;
436
436
437
437
foreach ($ foundClasses as $ class ) {
438
+ $ this ->withTimeout (max (300 , intval (ini_get ('max_execution_time ' )) ));
438
439
[$ prevFile , $ prevMtime ] = $ this ->classes [$ class ] ?? null ;
439
440
440
441
if (isset ($ prevFile ) && @filemtime ($ prevFile ) !== $ prevMtime ) { // @ file may not exists
@@ -490,17 +491,14 @@ protected function scanPhp(string $file): array
490
491
if(\php_sapi_name()!=='cli'){
491
492
set_time_limit(180);
492
493
}
493
-
494
-
495
494
//(new \frdl\Lint\Php($cacheDirLint) ) ->lintString($codeWithStartTags)
496
-
497
495
if(true !== \frdl\Lint\Php::lintFileStatic($file,false) ){
498
496
trigger_error(sprintf('Parse error in %s', $file), \E_USER_WARNING);
499
497
return [];
500
498
}
501
499
*/
502
500
503
- $ this ->withTimeout (max (180 , max ( intval (ini_get ('max_execution_time ' )), 45 ) ));
501
+ $ this ->withTimeout (max (300 , intval (ini_get ('max_execution_time ' )) ));
504
502
505
503
$ code = file_get_contents ($ file );
506
504
$ expected = false ;
@@ -528,8 +526,7 @@ protected function scanPhp(string $file): array
528
526
529
527
foreach ($ tokens as $ token ) {
530
528
$ token =(object )$ token ;
531
- $ this ->withTimeout (max (180 , max (intval (ini_get ('max_execution_time ' )), 45 )));
532
-
529
+
533
530
534
531
switch ($ token ->id ) {
535
532
case \T_COMMENT :
@@ -653,6 +650,7 @@ protected function loadCache(): void
653
650
return ;
654
651
}
655
652
653
+ $ this ->withTimeout (max (300 , intval (ini_get ('max_execution_time ' )) ));
656
654
$ this ->classes = $ this ->missingClasses = $ this ->emptyFiles = [];
657
655
$ this ->refreshClasses ();
658
656
$ this ->saveCache ($ lock );
@@ -754,5 +752,3 @@ protected function getCacheKey(): array
754
752
755
753
}
756
754
757
-
758
-
0 commit comments