BladeOne.php
2 years ago
CSV.php
9 months ago
Calculations.php
2 years ago
Currency.php
8 months ago
Device.php
1 year ago
Device_Cache.php
2 years ago
Dir.php
5 months ago
Format.php
5 months ago
Link_Validator.php
6 months ago
Number_Formatter.php
5 months ago
Obj.php
6 months ago
Request.php
11 months ago
Salt.php
1 year ago
Security.php
1 year ago
Server.php
2 years ago
Singleton.php
2 years ago
String_Util.php
2 years ago
Timezone.php
5 months ago
URL.php
6 months ago
WP_Async_Request.php
1 year ago
Server.php
29 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\Utils; |
| 4 | |
| 5 | /** @internal */ |
| 6 | class Server |
| 7 | { |
| 8 | public static function increase_max_execution_time() : void |
| 9 | { |
| 10 | if (self::is_function_enabled('ignore_user_abort')) { |
| 11 | @\ignore_user_abort(\true); |
| 12 | } |
| 13 | if (self::is_function_enabled('set_time_limit')) { |
| 14 | @\set_time_limit(16000); |
| 15 | } |
| 16 | if (self::is_function_enabled('ini_set')) { |
| 17 | @\ini_set('max_execution_time', '259200'); |
| 18 | @\ini_set('max_input_time', '259200'); |
| 19 | @\ini_set('session.gc_maxlifetime', '1200'); |
| 20 | } |
| 21 | } |
| 22 | private static function is_function_enabled(string $the_function) : bool |
| 23 | { |
| 24 | $disabled_functions = \explode(',', \ini_get('disable_functions')); |
| 25 | $isDisabled = \in_array($the_function, $disabled_functions); |
| 26 | return !$isDisabled && \function_exists($the_function); |
| 27 | } |
| 28 | } |
| 29 |