WaConfigs constructor

WaConfigs({
  1. String version = '1.0.0',
  2. String? appPath,
  3. String? dbPath,
  4. String? backupPath,
  5. String? widgetsPath,
  6. String? languagePath,
  7. int port = 8080,
  8. int portSocket = 8083,
  9. int portNginx = 80,
  10. String ip = '0.0.0.0',
  11. String dbName = "database_name",
  12. bool noStop = true,
  13. String serverName = "webserver",
  14. String pathFilemanager = '/upload/filemanager',
  15. String? publicDir,
  16. String? domain,
  17. String? domainScheme,
  18. int? domainPort,
  19. WaDBConfig? dbConfig,
  20. String widgetsType = 'html',
  21. int fakeDelay = 0,
  22. List<String>? languages,
  23. String mailDefault = "example@uproid.com",
  24. String mailHost = "smtp.zoho.eu",
  25. String blockStart = '<?',
  26. String blockEnd = "?>",
  27. String variableStart = "<?=",
  28. String variableEnd = "?>",
  29. String commentStart = '<?#',
  30. String commentEnd = '?>',
  31. 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();
}