function buildjs() { $t = $_GET["t"]; $time = time(); $MEPOST = 0; header("content-type: application/x-javascript"); $tpl = new templates(); $page = CurrentPageName(); $array = unserialize(@file_get_contents($GLOBALS["CACHEFILE"])); $prc = intval($array["POURC"]); $title = $tpl->javascript_parse_text($array["TEXT"]); $suffix = suffix(); $md5file = trim(md5_file($GLOBALS["LOGSFILES"])); echo "// CACHE FILE: {$GLOBALS["CACHEFILE"]} {$prc}%\n"; echo "// LOGS FILE: {$GLOBALS["LOGSFILES"]} - {$md5file} " . strlen($md5file) . "\n"; if ($prc == 0) { if (strlen($md5file) < 32) { echo "\n\t// PRC = {$prc} ; md5file={$md5file}\n\tfunction Start{$time}(){\n\t\t\tif(!RTMMailOpen()){return;}\n\t\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}{$suffix}');\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);"; return; } } if ($md5file != $_GET["md5file"]) { echo "\n\tvar xStart{$time}= function (obj) {\n\t\tif(!document.getElementById('text-{$t}')){return;}\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){\n\t\t\tdocument.getElementById('text-{$t}').value=res;\n\t\t}\t\t\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$md5file}{$suffix}');\n\t}\t\t\n\t\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('Filllogs', 'yes');\n\t\tXHR.appendData('t', '{$t}');\n\t\tXHR.setLockOff();\n\t\tXHR.sendAndLoad('{$page}', 'POST',xStart{$time},false); \n\t}\n\tsetTimeout(\"Start{$time}()\",1000);"; return; } if ($prc > 100) { echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\tdocument.getElementById('title-{$t}').style.border='1px solid #C60000';\n\t\tdocument.getElementById('title-{$t}').style.color='#C60000';\n\t\t\$('#progress-{$t}').progressbar({ value: 100 });\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t"; return; } if ($prc == 100) { echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tLayersTabsAllAfter();\n\t\tRTMMailHide();\n\t\tif(document.getElementById('SQUID_URGENCY_FORM_ADM')){ YahooWin3Hide(); }\n\t\tif(document.getElementById('main_adker_tabs')){ RefreshTab('main_adker_tabs'); }\n\t\tif(document.getElementById('sequence-proxy')){LoadAjaxSilent('sequence-proxy','admin.dashboard.proxy.php?sequence-proxy=yes&nofw=yes&sequence=yes'); }\n\t\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t"; return; } echo "\t\nfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}{$suffix}');\n\t}\n\tsetTimeout(\"Start{$time}()\",1500);\n"; }
private function newPath($filePath) { $fileEx = explode("/", $filePath); $this->file = $fileEx[count($fileEx) - 1]; $this->thumbPath = substr($filePath, 0, strlen($filePath) - strlen($this->file)) . $this->dirName; $this->thumbPath = suffix($this->thumbPath); $this->thumbPath = str_replace(baseUrl(), "", $this->thumbPath); }
public function file($file = '') { if (is_string($file)) { $this->manipulation['filename'] = STYLES_DIR . suffix($file, '.css'); $this->manipulation['file'] = File::contents($this->manipulation['filename']); } return $this; }
public function do(string $file) : string { $file = suffix($file, '.xml'); if (File::exists($file)) { return File::read($file); } else { throw new FileNotFoundException('Exception', 'fileNotFound', $file); } }
function section_events() { $suffix = suffix(); $page = CurrentPageName(); $tpl = new templates(); $t = time(); $boot = new boostrap_form(); $form = $boot->SearchFormGen("subject", "events-search", $suffix); echo $form; }
function js() { header("content-type: application/x-javascript"); $tpl = new templates(); $page = CurrentPageName(); $t = time(); $tpl = new templates(); $suffix = suffix(); $title = title(); echo "\n\tfunction Start{$t}(){\t\n\t\t{$warn}\n\t\tYahooWinHide();\n\t\tRTMMail('800','{$page}?popup=yes{$suffix}','{$title}');\n\t}\n\tStart{$t}();"; }
private static function _config($file) { global $config; $path = CONFIG_DIR . suffix($file, ".php"); if (!is_file($path)) { return false; } if (!isImport($path)) { require_once restorationPath($path); self::$config = $config; } }
function js() { header("content-type: application/x-javascript"); $tpl = new templates(); $page = CurrentPageName(); $t = time(); $tpl = new templates(); $suffix = suffix(); $title = title(); $warn = $tpl->javascript_parse_text("{uninstall} {APP_SEALION_AGENT} ?"); echo "\n\tfunction Start{$t}(){\t\n\t\tif(!confirm('{$warn}')){return;}\n\t\tYahooWinHide();\n\t\tRTMMail('800','{$page}?popup=yes{$suffix}','{$title}');\n\t}\n\tStart{$t}();"; }
public static function class(string $class) { $namespace = NULL; if (defined('static::namespace')) { $namespace = suffix(static::namespace, '\\'); } else { $calledClass = get_called_class(); $namespace = str_ireplace(divide($calledClass, '\\', -1), NULL, $calledClass); } $class = $namespace . $class; return uselib($class); }
function js() { header("content-type: application/x-javascript"); $tpl = new templates(); $page = CurrentPageName(); $t = time(); $tpl = new templates(); $compile_squid_ask = $tpl->javascript_parse_text("{build_webfiltering_rules} ?"); $suffix = suffix(); $title = title(); echo "\n\tfunction Start{$t}(){\t\n\t\t//if(!confirm('{$compile_squid_ask}')){return;}\n\t\tYahooWinHide();\n\t\tRTMMail('800','{$page}?popup=yes{$suffix}','{$title}');\n\t}\n\tStart{$t}();"; }
function js() { header("content-type: application/x-javascript"); $tpl = new templates(); $page = CurrentPageName(); $t = time(); $tpl = new templates(); $suffix = suffix(); $title = title(); $ask = "if(!confirm('" . $tpl->javascript_parse_text("{enable_ask_firewall}") . "')){return;}"; echo "\n\tfunction Start{$t}(){\t\n\t\t{$ask}\n\t\tYahooWinHide();\n\t\tRTMMail('800','{$page}?popup=yes{$suffix}','{$title}');\n\t}\n\tStart{$t}();"; }
function js() { header("content-type: application/x-javascript"); $tpl = new templates(); $page = CurrentPageName(); $t = time(); $tpl = new templates(); $export_password = $tpl->javascript_parse_text("{export_password}"); $suffix = suffix(); $title = title(); $tt = time(); echo "\nvar xSave{$t}=function (obj) {\n\tvar results=obj.responseText;\n\tif (results.length>3){alert(results);return;}\n\tRTMMail('800','{$page}?popup=yes{$suffix}','{$title}');\n\t\n}\nfunction Start{$t}(){\n\tvar XHR = new XHRConnection();\n\tvar pp=prompt('{$export_password}');\n\tif(!pp){return;}\n\tXHR.appendData('save-exportpass',pp);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\t\nStart{$t}();"; }
function js() { header("content-type: application/x-javascript"); $tpl = new templates(); $page = CurrentPageName(); $t = time(); $tpl = new templates(); $compile_squid_ask = $tpl->javascript_parse_text("{confirm_dnsg_compile_db}"); $warn = "if(!confirm('{$compile_squid_ask}')){return;}"; $suffix = suffix(); $title = title(); echo "\n\tfunction Start{$t}(){\t\n\t\t{$warn}\n\t\tRTMMail('800','{$page}?popup=yes{$suffix}','{$title}');\n\t}\n\tStart{$t}();"; }
function popup() { $tpl = new templates(); $page = CurrentPageName(); $sock = new sockets(); $suffix = suffix(); $sock->getFrameWork("cmd.php?fdisk-build-big-partitions=yes&{$suffix}"); $t = $_GET["t"]; if (!is_numeric($t)) { $t = time(); } $text = $tpl->_ENGINE_parse_body("{please_wait_preparing_settings}..."); $html = "\n<center id='title-{$t}' style='font-size:18px;margin-bottom:20px'>{$text}</center>\n<div id='progress-{$t}' style='height:50px'></div>\n<p> </p>\n<textarea style='margin-top:5px;font-family:Courier New;\nfont-weight:bold;width:99%;height:446px;border:5px solid #8E8E8E;\noverflow:auto;font-size:11px' id='text-{$t}'></textarea>\n\t\n<script>\nfunction Step1{$t}(){\n\t\$('#progress-{$t}').progressbar({ value: 1 });\n\tLoadjs('{$page}?build-js=yes&t={$t}&md5file=0&{$suffix}');\n}\n\$('#progress-{$t}').progressbar({ value: 1 });\nsetTimeout(\"Step1{$t}()\",1000);\n\n</script>\n"; echo $html; }
function basePath(string $uri = '', int $index = 0) : string { $newBaseDir = substr(BASE_DIR, 1); if (BASE_DIR !== "/") { if ($index < 0) { $baseDir = substr(BASE_DIR, 1, -1); $baseDir = explode("/", $baseDir); $newBaseDir = ''; for ($i = 0; $i < count($baseDir) + $index; $i++) { $newBaseDir .= suffix($baseDir[$i]); } } } return internalCleanInjection($newBaseDir . $uri); }
public function use(string $randomPageVariable, array $randomDataVariable = NULL, bool $randomObGetContentsVariable = false) { if (!empty(Properties::$parameters['usable'])) { $randomObGetContentsVariable = Properties::$parameters['usable']; } if (!empty(Properties::$parameters['data'])) { $randomDataVariable = Properties::$parameters['data']; } Properties::$parameters = []; $eol = EOL; $randomPageVariableExtension = extension($randomPageVariable); $randomPageVariableBaseUrl = baseUrl($randomPageVariable); $return = ''; if (!is_file($randomPageVariable)) { throw new InvalidArgumentException('Error', 'fileParameter', '1.($randomPageVariable)'); } if ($randomPageVariableExtension === 'js') { $return = '<script type="text/javascript" src="' . $randomPageVariableBaseUrl . '"></script>' . $eol; } elseif ($randomPageVariableExtension === 'css') { $return = '<link href="' . $randomPageVariableBaseUrl . '" rel="stylesheet" type="text/css" />' . $eol; } elseif (stristr('svg|woff|otf|ttf|' . implode('|', Config::get('ViewObjects', 'font')['differentFontExtensions']), $randomPageVariableExtension)) { $return = '<style type="text/css">@font-face{font-family:"' . divide(removeExtension($randomPageVariable), "/", -1) . '"; src:url("' . $randomPageVariableBaseUrl . '") format("truetype")}</style>' . $eol; } elseif ($randomPageVariableExtension === 'eot') { $return = '<style type="text/css"><!--[if IE]>@font-face{font-family:"' . divide(removeExtension($randomPageVariable), "/", -1) . '"; src:url("' . $randomPageVariableBaseUrl . '") format("truetype")}<![endif]--></style>' . $eol; } else { $randomPageVariable = suffix($randomPageVariable, '.php'); if (is_file($randomPageVariable)) { if (is_array($randomDataVariable)) { extract($randomDataVariable, EXTR_OVERWRITE, 'zn'); } if ($randomObGetContentsVariable === false) { require $randomPageVariable; } else { ob_start(); require $randomPageVariable; $randomSomethingFileContent = ob_get_contents(); ob_end_clean(); return $randomSomethingFileContent; } } } if ($randomObGetContentsVariable === false) { echo $return; } else { return $return; } }
public function use(...$args) { if (!empty($args)) { foreach ($args as $file) { $suffix = suffix($file, '.php'); $commonFile = EXTERNAL_HANDLOAD_DIR . $suffix; $file = HANDLOAD_DIR . $suffix; if (is_file($file)) { require_once $file; // Local File } elseif (is_file($commonFile)) { require_once $commonFile; // Common File } } } }
function popup() { $tpl = new templates(); $page = CurrentPageName(); $zdate = $tpl->javascript_parse_text("{time}"); $ipaddr = $tpl->javascript_parse_text("{ipaddr}"); $mac = $tpl->javascript_parse_text("{MAC}"); $familysite = $tpl->javascript_parse_text("{sitename}"); $uid = $tpl->javascript_parse_text("{{$_GET["field"]}}"); $size = $tpl->javascript_parse_text("{size}"); // ipaddr | familysite | servername | uid | MAC | size $t = time(); $title = $tpl->javascript_parse_text("{this_hour}:{$_GET["field"]} {$_GET["value"]}"); $suffix = suffix(); $html = "\n\t<table class='flexRT{$t}' style='display:none' id='flexRT{$t}'></table>\n\t<script>\n\tfunction StartLogsSquidTable{$t}(){\n\n\t\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?list=yes{$suffix}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$zdate}', name : 'xtime', width : 159, sortable : true, align: 'left'},\n\t{display: '{$uid}', name : '{$_GET["field"]}', width :142, sortable : true, align: 'left'},\n\t{display: '{$familysite}', name : 'sitename', width : 169, sortable : true, align: 'left'},\n\t{display: '{$size}', name : 'size', width : 142, sortable : true, align: 'right'},\n\t],\n\n\tsearchitems : [\n\t{display: '{$uid}', name : '{$_GET["field"]}'},\n\t{display: '{$familysite}', name : 'sitename'},\n\t],\n\tsortname: 'xtime',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span style=font-size:18px>{$title}</span>',\n\tuseRp: true,\n\trp: 100,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 450,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200,500,1000,1500]\n\n});\n\n}\n\nStartLogsSquidTable{$t}();\n</script>\n"; echo $html; }
public function do(array $data, string $file = 'excel.xls') { $file = suffix($file, '.xls'); header("Content-Disposition: attachment; filename=\"{$file}\""); header("Content-Type: application/vnd.ms-excel;"); header("Pragma: no-cache"); header("Expires: 0"); if (!empty($this->rows)) { $data = $this->rows; $this->rows = NULL; } $output = fopen("php://output", 'w'); foreach ($data as $column) { fputcsv($output, $column, "\t"); } fclose($output); }
function js() { header("content-type: application/x-javascript"); $tpl = new templates(); $page = CurrentPageName(); $t = time(); $tpl = new templates(); $compile_squid_ask = $tpl->javascript_parse_text("{WARN_RESTART_HOTSPOT}"); $warn = "if(!confirm('{$compile_squid_ask}')){return;}"; if (isset($_GET["CheckCaches"])) { $warn = $tpl->javascript_parse_text("{check_caches_warning}"); $warn = "if(!confirm('{$warn}')){return;}"; } $suffix = suffix(); $title = title(); echo "\n\tfunction Start{$t}(){\t\n\t\t{$warn}\n\t\tRTMMail('800','{$page}?popup=yes{$suffix}','{$title}');\n\t}\n\tStart{$t}();"; }
public function settings(array $config = []) : InternalPagination { $configs = VIEWOBJECTS_PAGINATION_CONFIG; // --------------------------------------------------------------------------------------- // Sayfalama Ayarlarını İçeren Değişkenler // --------------------------------------------------------------------------------------- if (isset($config['totalRows'])) { $this->totalRows = $config['totalRows']; } if (isset($config['start'])) { $this->start = $config['start']; } if (isset($config['limit'])) { $this->limit = $config['limit']; } if (isset($config['countLinks'])) { $this->countLinks = $config['countLinks']; } if (isset($config['prevName'])) { $this->prevTag = $config['prevName']; } if (isset($config['nextName'])) { $this->nextTag = $config['nextName']; } if (isset($config['firstName'])) { $this->firstTag = $config['firstName']; } if (isset($config['lastName'])) { $this->lastTag = $config['lastName']; } if (isset($config['type'])) { $this->type = $config['type']; } $this->class = array_merge($configs['class'], isset($config['class']) ? $config['class'] : []); $this->style = array_merge($configs['style'], isset($config['style']) ? $config['style'] : []); if (isset($config['url']) && $this->type !== 'ajax') { $this->url = suffix(siteUrl($config['url'])); } elseif ($this->type === 'ajax') { $this->url = '#prow='; } else { $this->url = suffix(CURRENT_CFURL); } // --------------------------------------------------------------------------------------- return $this; }
function js() { header("content-type: application/x-javascript"); $tpl = new templates(); $page = CurrentPageName(); $t = time(); $tpl = new templates(); $sock = new sockets(); $compile_squid_ask = $tpl->javascript_parse_text("{compile_squid_ask}"); $warn = $tpl->javascript_parse_text("{warn_change_mysql_dir}"); $ArticaProxyStatisticsBackupFolder = $sock->GET_INFO("ArticaProxyStatisticsBackupFolder"); if ($ArticaProxyStatisticsBackupFolder == null) { $ArticaProxyStatisticsBackupFolder = "/home/artica/squid/backup-statistics"; } $suffix = suffix(); $title = title(); echo "\n\tfunction Start{$t}(){\t\n\t\tRTMMail('800','{$page}?popup=yes{$suffix}','{$title}');\n\t}\n\t\n\t\n\tStart{$t}();"; }
function popup() { $tpl = new templates(); $page = CurrentPageName(); $q = new mysql_meta(); $zdate = $tpl->javascript_parse_text("{time}"); $ipaddr = $tpl->javascript_parse_text("{ipaddr}"); $mac = $tpl->javascript_parse_text("{MAC}"); $familysite = $tpl->javascript_parse_text("{sitename}"); $uid = $tpl->javascript_parse_text("{members}"); $size = $tpl->javascript_parse_text("{size}"); $hits = $tpl->javascript_parse_text("{hits}"); $t = time(); $title = $tpl->javascript_parse_text("{this_hour}:" . $q->uuid_to_host($_GET["uuid"])); $suffix = suffix(); $html = "\n\t<table class='flexRT{$t}' style='display:none' id='flexRT{$t}'></table>\n\t<script>\n\tfunction StartLogsSquidTable{$t}(){\n\n\t\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?list=yes{$suffix}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$zdate}', name : 'zDate', width : 61, sortable : true, align: 'left'},\n\t{display: '{$uid}', name : 'uid', width :112, sortable : true, align: 'left'},\n\t{display: '{$mac}', name : 'mac', width :142, sortable : true, align: 'left'},\n\t{display: '{$ipaddr}', name : 'ipaddr', width :142, sortable : true, align: 'left'},\n\t{display: '{$familysite}', name : 'sitename', width : 169, sortable : true, align: 'left'},\n\t{display: '{$hits}', name : 'hits', width : 66, sortable : true, align: 'right'},\n\t{display: '{$size}', name : 'size', width : 142, sortable : true, align: 'right'},\n\t],\n\n\tsearchitems : [\n\t{display: '{$uid}', name : 'uid'},\n\t{display: '{$mac}', name : 'mac'},\n\t{display: '{$ipaddr}', name : 'ipaddr'},\n\t{display: '{$familysite}', name : 'sitename'},\n\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span style=font-size:18px>{$title}</span>',\n\tuseRp: true,\n\trp: 100,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 450,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200,500,1000,1500]\n\n});\n\n}\n\nStartLogsSquidTable{$t}();\n</script>\n"; echo $html; }
public function __construct(string $driver = NULL) { parent::__construct(); if (!defined('static::driver')) { throw new UndefinedConstException('[const driver] is required to use the [Driver Ability]!'); } nullCoalesce($driver, $this->config['driver'] ?? NULL); $this->selectedDriverName = $driver; Support::driver(static::driver['options'], $driver); if (!isset(static::driver['namespace'])) { $this->driver = uselib($driver); } else { $this->driver = uselib(suffix(static::driver['namespace'], '\\') . $driver . 'Driver'); } if (isset(static::driver['construct'])) { $construct = static::driver['construct']; $this->{$construct}(); } }
private static function _config($file) { if (empty(self::$config[$file])) { $externalPath = EXTERNAL_CONFIG_DIR . suffix($file, ".php"); $projectPath = CONFIG_DIR . suffix($file, ".php"); $internalPath = INTERNAL_CONFIG_DIR . suffix($file, ".php"); $allConfig = []; if (is_file($externalPath)) { $allConfig = array_merge($allConfig, (array) (require_once $externalPath)); } if (is_file($projectPath)) { $allConfig = array_merge($allConfig, (array) (require_once $projectPath)); } if (is_file($internalPath)) { $allConfig = array_merge($allConfig, (array) (require_once $internalPath)); } self::$config[$file] = $allConfig; } }
public function do(string $file) : array { $file = suffix($file, '.csv'); if (!is_file($file)) { throw new FileNotFoundException($file); } $row = 1; $rows = []; if (($resource = fopen($file, "r")) !== false) { while (($data = fgetcsv($resource, 1000, ",")) !== false) { $num = count($data); $row++; for ($c = 0; $c < $num; $c++) { $rows[] = explode(';', $data[$c]); } } fclose($resource); } return $rows; }
function js(){ header("content-type: application/x-javascript"); $tpl=new templates(); $page=CurrentPageName(); $t=time(); $tpl=new templates(); $suffix=suffix(); $title=title(); echo " function Start$t(){ RTMMail('800','$page?popup=yes$suffix','$title'); } Start$t();"; }
function lang(string $file, string $str = NULL, $changed = NULL) { global $lang; $file = (Config::get('Language', 'shortCodes')[getLang()] ?? 'English') . '/' . suffix($file, '.php'); $langDir = LANGUAGES_DIR . $file; $sysLangDir = INTERNAL_LANGUAGES_DIR . $file; $commonLangDir = EXTERNAL_LANGUAGES_DIR . $file; if (is_file($langDir) && !isImport($langDir)) { $lang[$file] = (require_once $langDir); } elseif (is_file($sysLangDir) && !isImport($sysLangDir)) { $lang[$file] = (require_once $sysLangDir); } elseif (is_file($commonLangDir) && !isImport($commonLangDir)) { $lang[$file] = (require_once $commonLangDir); } if (empty($str) && isset($lang[$file])) { return $lang[$file]; } elseif (!empty($lang[$file][$str])) { $langstr = $lang[$file][$str]; } else { return false; } if (!is_array($changed)) { if (strstr($langstr, "%") && !empty($changed)) { return str_replace("%", $changed, $langstr); } else { return $langstr; } } else { if (!empty($changed)) { $values = []; foreach ($changed as $key => $value) { $keys[] = $key; $values[] = $value; } return str_replace($keys, $values, $langstr); } else { return $langstr; } } }
public function fileInfo(string $dir, string $extension = NULL) : array { $dir = File::rpath($dir); if (is_dir($dir)) { $files = Factory::class('FileList')->files($dir, $extension); $dir = suffix($dir); $filesInfo = []; foreach ($files as $file) { $filesInfo[$file]['basename'] = pathInfos($dir . $file, 'basename'); $filesInfo[$file]['size'] = filesize($dir . $file); $filesInfo[$file]['date'] = filemtime($dir . $file); $filesInfo[$file]['readable'] = is_readable($dir . $file); $filesInfo[$file]['writable'] = is_writable($dir . $file); $filesInfo[$file]['executable'] = is_executable($dir . $file); $filesInfo[$file]['permission'] = fileperms($dir . $file); } return $filesInfo; } elseif (is_file($dir)) { return (array) File::info($dir); } else { throw new FolderNotFoundException($dir); } }
public function extract($source, $target, $password) { $rarFile = rar_open(suffix($source, '.rar'), $password); $list = rar_list($rarFile); if (!empty($list)) { foreach ($list as $file) { $entry = rar_entry_get($rarFile, $file); $entry->extract($target); } } else { throw new InvalidArgumentException('Error', 'emptyVariable', '$list'); } rar_close($rarFile); }