WaConfigs constructor
WaConfigs({
- String version = '1.0.0',
- String? appPath,
- String? dbPath,
- String? backupPath,
- String? widgetsPath,
- String? languagePath,
- int port = 8080,
- int portSocket = 8083,
- int portNginx = 80,
- String ip = '0.0.0.0',
- String dbName = "database_name",
- bool noStop = true,
- String serverName = "webserver",
- String pathFilemanager = '/upload/filemanager',
- String? publicDir,
- String? domain,
- String? domainScheme,
- int? domainPort,
- WaDBConfig? dbConfig,
- String widgetsType = 'html',
- int fakeDelay = 0,
- List<
String> ? languages, - String mailDefault = "example@uproid.com",
- String mailHost = "smtp.zoho.eu",
- String blockStart = '<?',
- String blockEnd = "?>",
- String variableStart = "<?=",
- String variableEnd = "?>",
- String commentStart = '<?#',
- String commentEnd = '?>',
- String cookiePassword = "password",
Creates an instance of WaConfigs.
Initializes configuration properties with values from environment variables or defaults provided in the parameters.
Implementation
WaConfigs({
this.version = '1.0.0',
String? appPath,
String? dbPath,
String? backupPath,
String? widgetsPath,
String? languagePath,
this.port = 8080,
this.portSocket = 8083,
this.portNginx = 80,
this.ip = '0.0.0.0',
this.dbName = "database_name",
this.noStop = true,
this.serverName = "webserver",
this.pathFilemanager = '/upload/filemanager',
String? publicDir,
String? domain,
String? domainScheme,
int? domainPort,
WaDBConfig? dbConfig,
this.widgetsType = 'html',
this.fakeDelay = 0,
List<String>? languages,
this.mailDefault = "example@uproid.com",
this.mailHost = "smtp.zoho.eu",
this.blockStart = '<?',
this.blockEnd = "?>",
this.variableStart = "<?=",
this.variableEnd = "?>",
this.commentStart = '<?#',
this.commentEnd = '?>',
this.cookiePassword = "password",
}) {
this.appPath = appPath ?? pathApp;
this.dbPath = dbPath ?? pathTo("db");
this.backupPath = backupPath ?? pathTo("backup");
this.widgetsPath = widgetsPath ?? pathTo("bin/widgets");
this.languagePath = languagePath ?? pathTo("languages");
this.domain = domain ?? env['DOMAIN'] ?? 'localhost';
this.domainScheme = domainScheme ?? env['DOMAIN_SCHEME'] ?? "http";
this.domainPort = domainPort ?? int.parse(env['DOMAIN_PORT'] ?? "$port");
this.publicDir = publicDir ?? (env['PUBLIC_DIR'] ?? "public");
uri = Uri(
scheme: this.domainScheme,
host: this.domain,
port: this.domainPort,
);
this.dbConfig = dbConfig ?? WaDBConfig();
this.languages = languages ?? WaDBConfig.defaultLanguages.keys.toList();
}