HEX
Server: Apache/2.4.6 (CloudLinux) OpenSSL/1.0.2k-fips mod_fcgid/2.3.9 PHP/5.4.16
System: Linux s1.gigspace.ru 3.10.0-962.3.2.lve1.5.77.el7.x86_64 #1 SMP Mon Dec 12 07:06:14 EST 2022 x86_64
User: samok164 (6070)
PHP: 7.2.34
Disabled: NONE
Upload Files
File: /var/www/samok164/data/www2/townsusa.ru/rzgn/r4_download_links.php
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: ruzin
 * Date: 17.05.12
 * Time: 13:22
 * Скачивает файлы ссылок .rzg
 *
 * Параметры: $_GET['start'] (опциональный) - скачивает только файлы, измененные после этой даты
 */

error_reporting(0);

if (!isset($r4_cfg_root)) {
    $r4_cfg_root = dirname(__FILE__);
}

if (!empty($r4_cfg_root) && $r4_cfg_root != '/') {
    $r4_cfg_root .= '/';
}

include_once("{$r4_cfg_root}r4_vars.php");
include_once("{$r4_cfg_root}r4_libs.php");

if (isset($_GET['start'])) {
    $start = strtotime($_GET['start']);
}
else {
    $start = 0;
}

$len = strlen($r4_cfg_root);
$filenames = get_filenames($r4_cfg_root, '*.rzg');
foreach ($filenames as $filename) {
    $relative_filename = substr($filename, $len);
    $contents = file_get_contents($filename);
    $regs = array();
    if (preg_match("/#!r4\s+(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})/", $contents, $regs)) {
        $time = strtotime($regs[1]);
        if ($time > $start) {
            printf ("====== %s ======\n%s\n", $relative_filename, $contents);
        }
    }
}
?>