예제 #1
0
 static function InitClass()
 {
     wpfb_loadclass("Admin", "GetID3", "FileUtils", "Misc");
     require_once ABSPATH . 'wp-admin/includes/file.php';
     @ini_set('max_execution_time', '0');
     @set_time_limit(0);
     if (!empty($_GET['output']) || !empty($_GET['debug'])) {
         @ini_set('display_errors', 1);
         @error_reporting(E_ERROR | E_WARNING | E_PARSE);
         set_error_handler(array(__CLASS__, 'CaptureError'));
         set_exception_handler(array(__CLASS__, 'CaptureException'));
         register_shutdown_function(array(__CLASS__, 'CaptureShutdown'));
     }
     self::$error_log_file = WPFB_Core::UploadDir() . '/_wpfb_sync_errors_' . md5(WPFB_Core::UploadDir()) . '.log';
     if (is_file(self::$error_log_file) && is_writable(self::$error_log_file)) {
         // don't append to big files (4MiB)
         @file_put_contents(self::$error_log_file, "\n" . str_repeat('=', 20) . "\nINIT SYNC\n", filesize(self::$error_log_file) > 4194304 ? 0 : FILE_APPEND);
     }
     @ini_set("error_log", self::$error_log_file);
     if (!empty($_GET['output']) || !empty($_GET['debug'])) {
         @ini_set('display_errors', 1);
         @error_reporting(E_ERROR | E_WARNING | E_PARSE);
         set_error_handler(array(__CLASS__, 'CaptureError'));
         set_exception_handler(array(__CLASS__, 'CaptureException'));
         register_shutdown_function(array(__CLASS__, 'CaptureShutdown'));
     }
     // raise memory limit if needed
     if (WPFB_Misc::ParseIniFileSize(ini_get('memory_limit')) < 64000000) {
         @ini_set('memory_limit', '128M');
         @ini_set('memory_limit', '256M');
         @ini_set('memory_limit', '512M');
     }
 }
예제 #2
0
파일: Sync.php 프로젝트: noxian/WP-Filebase
 static function InitClass()
 {
     wpfb_loadclass("Admin", "GetID3", "FileUtils", "Misc");
     require_once ABSPATH . 'wp-admin/includes/file.php';
     @ini_set('max_execution_time', '0');
     @set_time_limit(0);
     self::$error_log_file = WPFB_Core::GetLogFile('sync');
     @ini_set("error_log", self::$error_log_file);
     set_error_handler(array(__CLASS__, 'CaptureError'));
     set_exception_handler(array(__CLASS__, 'CaptureException'));
     register_shutdown_function(array(__CLASS__, 'CaptureShutdown'));
     if (self::$debug_output = !empty($_GET['output']) || !empty($_GET['debug'])) {
         @ini_set('display_errors', 1);
         @error_reporting(E_ALL);
     }
     // raise memory limit if needed
     if (WPFB_Misc::ParseIniFileSize(ini_get('memory_limit')) < 64000000) {
         @ini_set('memory_limit', '128M');
         @ini_set('memory_limit', '256M');
         @ini_set('memory_limit', '512M');
     }
 }