| Server IP : 74.208.250.37 / Your IP : 216.73.216.114 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ubuntu 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 User : miferval ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/brainwavemx/app/FileData/ |
Upload File : |
<?php
declare(strict_types=1);
namespace App\DataFile;
use App\Controller\Api\ApiController;
use App\Model\DataFileModel;
class Data
{
public function getTimestamp(string $filename): int
{
$env = $this->env();
date_default_timezone_set($env['TIMEZONE']);
if (file_exists($filename)) {
return filemtime($filename);
}
return 0;
}
public function getStatus(string $sourcePath, string $filename): bool
{
new ApiController();
$dataFileModel = new DataFileModel();
$file = $dataFileModel->getFile($filename);
isset($file->row['date_current']) ?
$fileDate = strtotime($file->row['date_current']) :
$fileDate = 0;
if ($this->getTimestamp($sourcePath) > $fileDate) {
return true;
}
return false;
}
public function getCsvPath(): string
{
$env = $this->env();
return $env['CSV_PATH'];
}
public function getLogPath(): string
{
$env = $this->env();
return $env['LOG_PATH'];
}
public function env(): array
{
return parse_ini_file('.env');
}
}