/home/techb158/exp.abdallabala.com/application/autoload
NameSizeModeActions
Ib/-0755rm
IBilling/-0755rm
Models/-0755rm
Notify/-0755rm
Admin.php16260644editdlrm
App.php870644editdlrm
Arr.php4160644editdlrm
Asset.php18220644editdlrm
Auth.php12460644editdlrm
Backup.php116500644editdlrm
Cache.php840644editdlrm
Ccavenue.php84580644editdlrm
class.smtp.php394380644editdlrm
Companies.php25640644editdlrm
Contacts.php66070644editdlrm
Countries.php311520644editdlrm
Currency.php232370644editdlrm
Dashboard.php206250644editdlrm
DB.php620644editdlrm
Demo.php248440644editdlrm
Dev.php16660644editdlrm
Ed.php17580644editdlrm
Event.php4490644editdlrm
ExtendedZip.php13810644editdlrm
Finance.php58740644editdlrm
Fsubmit.php44890644editdlrm
Gravatar.php27210644editdlrm
Image.php693950644editdlrm
index.html1120644editdlrm
Invoice.php155570644editdlrm
Make.php9660644editdlrm
Misc.php13850644editdlrm
Model.php237280644editdlrm
ORM.php840360644editdlrm
Paginator.php61220644editdlrm
parseCSV.php390090644editdlrm
Parsedown.php381370644editdlrm
Password.php21360644editdlrm
PHPMailer.php1114110644editdlrm
Plugins.php29730644editdlrm
Quote.php80900644editdlrm
Reorder.php20170644editdlrm
Repeating.php57710644editdlrm
Schema.php48990644editdlrm
Sms.php10470644editdlrm
Syscpanel.php60580644editdlrm
Syscurl.php10750644editdlrm
Sysfile.php5790644editdlrm
Tags.php8310644editdlrm
Template.php5400644editdlrm
Timezone.php11710644editdlrm
Transaction.php10730644editdlrm
Uploader.php33690644editdlrm
User.php3740644editdlrm
Util.php97600644editdlrm
Validator.php86340644editdlrm
View.php21700644editdlrm
Edit: /home/techb158/exp.abdallabala.com/application/autoload/Util.php (9760B)
0) { $max_size = $post_max_size; } // If upload_max_size is less, then reduce. Except if upload_max_size is // zero, which indicates no limit. $upload_max = self::parse_size(ini_get('upload_max_filesize')); if ($upload_max > 0 && $upload_max < $max_size) { $max_size = $upload_max; } } return $max_size; } /** * @return array */ public static function systemInfo() { global $config; if (class_exists('ZipArchive')) { $zip_info = '✅'; } else { $zip_info = '❌ php ZipArchive class does not exist, backup and automatic updates will not work'; } if (is_writable('./')) { $writable = '✅'; } else { $writable = '❌ System can not write file in the disk.'; } if (extension_loaded('mbstring')) { $mbstring = '✅'; } else { $mbstring = '❌ mbstring is not enabled, PDF will not work.'; } if (extension_loaded('gd')) { $gd = '✅'; } else { $gd = '❌ mbstring is not enabled, PDF will not work.'; } if (function_exists('curl_version')) { $curl = '✅'; } else { $curl = '❌ curl is not enabled. api based service will not work.'; } return [ 'app_name' => $config['CompanyName'], 'app_build' => $config['build'], 'php_version' => phpversion(), 'os' => PHP_OS, 'modules' => [ 'zip' => $zip_info, 'mbstring' => $mbstring, 'gd' => $gd, 'curl' => $curl, ], 'write_permission' => $writable, ]; } /** * @param $taskId * @return array */ public static function backupFiles($taskId) { $logger = false; try { $backup_path = 'tmp/' . $taskId; if (!file_exists($backup_path)) { mkdir($backup_path); $info = 'Backup folder created: ' . $taskId; } else { $info = 'Existing backup folder found: ' . $taskId; } $logger = new Logger('clx'); $logger->pushHandler( new StreamHandler($backup_path . '/task.log', Logger::DEBUG) ); $logger->info($info); $logger->info('storage folder...'); ExtendedZip::zipTree( 'storage', $backup_path . '/storage.zip', ZipArchive::CREATE ); $logger->info('system folder...'); ExtendedZip::zipTree( 'system', $backup_path . '/system.zip', ZipArchive::CREATE ); $logger->info('ui folder...'); ExtendedZip::zipTree( 'ui', $backup_path . '/ui.zip', ZipArchive::CREATE ); $logger->info('=============== Done !'); return [ 'success' => true, 'message' => 'Files backup completed', ]; } catch (Exception $e) { if ($logger) { $logger->error($e->getMessage()); } return [ 'success' => false, 'errors' => [ 'message' => $e->getMessage(), ], ]; } } /** * @param $taskId * @return array */ public static function backupDatabase($taskId) { $logger = false; try { $backup_path = 'tmp/' . $taskId; if (!file_exists($backup_path)) { mkdir($backup_path); $info = 'Backup folder created: ' . $taskId; } else { $info = 'Existing backup folder found: ' . $taskId; } $logger = new Logger('clx'); $logger->pushHandler( new StreamHandler($backup_path . '/task.log', Logger::DEBUG) ); $logger->info($info); $backup = new Backup(); $sql_file = $backup_path . '/db.sql'; $backupDB = $backup->backupDB($sql_file); if ($backupDB['success']) { $logger->info('=============== Done !'); } else { $logger->warning($backupDB['message']); $logger->warning( '!!! Standard backup failed, trying with alternative methods...' ); $b = $backup->backupDatabaseMySqli($backup_path, 'db'); if ($b) { $logger->info( '=============== alternative backup successful !' ); $logger->info('=============== Done !'); return [ 'success' => true, 'message' => 'Database backup successful', ]; } else { $logger->info('Database backup failed!'); return [ 'success' => false, 'message' => 'An error occurred while backing up database.', ]; } } return $backupDB; } catch (Exception $e) { if ($logger) { $logger->error($e->getMessage()); } return [ 'success' => false, 'errors' => [ 'message' => $e->getMessage(), ], ]; } } /** * @param $taskId * @return array */ public static function getTaskLog($taskId) { $log_path = 'tmp/' . $taskId . '/task.log'; if (file_exists($log_path)) { return [ 'success' => true, 'contents' => file_get_contents($log_path), ]; } else { return [ 'success' => false, ]; } } /** * @return array */ public static function fileUpload() { $uploader = new Uploader(); $uploader->setDir('./'); $uploader->sameName(true); $uploader->setExtensions(['zip']); //allowed extensions list// if ($uploader->uploadFile('file')) { //txtFile is the filebrowse element name // $uploaded = $uploader->getUploadName(); //get uploaded file name, renames on upload// return [ 'success' => true, 'uploaded' => $uploaded, ]; } else { //upload failed return [ 'success' => false, 'errors' => [ 'file' => $uploader->getMessage(), ], ]; } } public static function extractFile($name, $deleteAfterUpload = true) { $msg = ''; if (class_exists('ZipArchive')) { $zip = new ZipArchive(); $res = $zip->open('./' . $name); if ($res === true) { $zip->extractTo('./'); if ($deleteAfterUpload) { if ($zip->close()) { unlink('./' . $name); } } // } else { $msg .= $name . ' - Invalid archive Or An error occured while unzipping the file!
'; } } else { $msg .= 'PHP ZipArchive Class is not Available!
'; } if ($msg != '') { return [ 'success' => false, 'errors' => [ 'zip' => $msg, ], ]; } else { return [ 'success' => true, ]; } } public static function downloadFile($file_url, $file_name) { if (function_exists('ini_set')) { ini_set('memory_limit', '512M'); ini_set('max_execution_time', 300); } $h = new IBilling_Http(); try { $r = $h ->open($file_url) ->setFileName($file_name) ->then('download'); return [ 'success' => true, 'message' => 'File copied from remote! - ' . $file_name, ]; } catch (Exception $e) { return [ 'success' => false, 'message' => $e->getMessage(), ]; } } }