adjust config

This commit is contained in:
Km.Van
2025-08-11 21:45:53 +08:00
parent c12f7bea7d
commit 9e781cc314
27 changed files with 230 additions and 152 deletions

View File

@@ -14,7 +14,7 @@ final class ConfigGeneration
{
[
'phpConfigPath' => $this->phpConfigPath,
'configPath' => $this->configPath,
'configPath' => $this->configPath,
'configPathDev' => $this->configPathDev,
] = $args;
@@ -50,25 +50,7 @@ final class ConfigGeneration
return false;
}
[
'APP_VERSION' => $appVersion,
'APP_NAME' => $appName,
'APP_URL' => $appUrl,
'APP_CONFIG_URLS' => $appConfigUrls,
'APP_CONFIG_URL_DEV' => $appConfigUrlDev,
'APP_TEMPERATURE_SENSOR_URL' => $appTemperatureSensorUrl,
'APP_TEMPERATURE_SENSOR_PORTS' => $appTemperatureSensorPorts,
'AUTHOR_URL' => $authorUrl,
'UPDATE_PHP_URLS' => $updatePhpUrls,
'AUTHOR_NAME' => $authorName,
'LATEST_PHP_STABLE_VERSION' => $latestPhpStableVersion,
'LATEST_NGINX_STABLE_VERSION' => $latestNginxStableVersion,
] = $config;
$updatePhpUrls = implode("', '", $updatePhpUrls);
$appConfigUrls = implode("', '", $appConfigUrls);
$appTemperatureSensorPorts = implode(', ', $appTemperatureSensorPorts);
$config = var_export($config, true);
$configContent = <<<PHP
<?php
/**
@@ -79,18 +61,7 @@ namespace InnStudio\\Prober\\Components\\Config;
class ConfigApi
{
public static \$APP_VERSION = '{$appVersion}';
public static \$APP_NAME = '{$appName}';
public static \$APP_URL = '{$appUrl}';
public static \$APP_CONFIG_URLS = array('{$appConfigUrls}');
public static \$APP_CONFIG_URL_DEV = '{$appConfigUrlDev}';
public static \$APP_TEMPERATURE_SENSOR_URL = '{$appTemperatureSensorUrl}';
public static \$APP_TEMPERATURE_SENSOR_PORTS = array({$appTemperatureSensorPorts});
public static \$AUTHOR_URL = '{$authorUrl}';
public static \$UPDATE_PHP_URLS = array('{$updatePhpUrls}');
public static \$AUTHOR_NAME = '{$authorName}';
public static \$LATEST_PHP_STABLE_VERSION = '{$latestPhpStableVersion}';
public static \$LATEST_NGINX_STABLE_VERSION = '{$latestNginxStableVersion}';
public static \$config = {$config};
}
PHP;