Desacople e inyeccion de dependencias

This commit is contained in:
imnavajas
2025-07-22 16:01:34 +02:00
parent a1aaa095d4
commit 9ed397e9ad
9 changed files with 391 additions and 154 deletions

View File

@ -6,21 +6,22 @@ use CodeIgniter\Config\BaseConfig;
class PresupuestoSFTP extends BaseConfig
{
public string $host;
public int $port;
public string $username;
public string $password;
public string $base_dir; # FTP server directory
public string $base_dir;
public int $id_offset;
public function __construct() {
public function __construct()
{
parent::__construct();
$this->host = env("HIDRIVE_FILES_HOST","sftp.hidrive.ionos.com");
$this->port = env("HIDRIVE_FILES_PORT",22);
$this->host = env("HIDRIVE_FILES_HOST", "sftp.hidrive.ionos.com");
$this->port = (int) env("HIDRIVE_FILES_PORT", 22);
$this->username = env("HIDRIVE_FILES_USER");
$this->password = env("HIDRIVE_FILES_PASS");
$this->base_dir = env("HIDRIVE_FILES_PATH_ROOT"); # FTP server directory
$this->id_offset = env("BUDGET_FILES_OFFSET_ID",1000000);
$this->id_offset = (int) env("BUDGET_FILES_OFFSET_ID", 1000000);
$domain = parse_url(env("app.baseURL"), PHP_URL_HOST);
$this->base_dir = "/users/{$this->username}/{$domain}";
}
}