Skip to content

Commit bb1ec9e

Browse files
authored
set_time_limit (#60)
1 parent 0872f6c commit bb1ec9e

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/File.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,10 @@ public static function move($src, $dest, $path = '', $useStreams = false)
218218
*/
219219
public static function write($file, &$buffer, $useStreams = false, $appendToFile = false)
220220
{
221-
@set_time_limit(ini_get('max_execution_time'));
221+
if (\function_exists('set_time_limit'))
222+
{
223+
set_time_limit(ini_get('max_execution_time'));
224+
}
222225

223226
// If the destination directory doesn't exist we need to create it
224227
if (!file_exists(\dirname($file)))

src/Folder.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ abstract class Folder
3333
*/
3434
public static function copy($src, $dest, $path = '', $force = false, $useStreams = false)
3535
{
36-
@set_time_limit(ini_get('max_execution_time'));
36+
if (\function_exists('set_time_limit'))
37+
{
38+
set_time_limit(ini_get('max_execution_time'));
39+
}
3740

3841
if ($path)
3942
{
@@ -235,7 +238,10 @@ public static function create($path = '', $mode = 0755)
235238
*/
236239
public static function delete($path)
237240
{
238-
@set_time_limit(ini_get('max_execution_time'));
241+
if (\function_exists('set_time_limit'))
242+
{
243+
set_time_limit(ini_get('max_execution_time'));
244+
}
239245

240246
// Sanity check
241247
if (!$path)
@@ -469,7 +475,10 @@ public static function folders($path, $filter = '.', $recurse = false, $full = f
469475
*/
470476
protected static function _items($path, $filter, $recurse, $full, $exclude, $excludeFilterString, $findfiles)
471477
{
472-
@set_time_limit(ini_get('max_execution_time'));
478+
if (\function_exists('set_time_limit'))
479+
{
480+
set_time_limit(ini_get('max_execution_time'));
481+
}
473482

474483
$arr = [];
475484

0 commit comments

Comments
 (0)