FinchConfigs constructor

FinchConfigs({
  1. String version = '1.0.0',
  2. String? appPath,
  3. String? dbPath,
  4. String? backupPath,
  5. String? widgetsPath,
  6. String? languagePath,
  7. String pathMigrationMySQL = './migrations',
  8. String pathMigrationSQLite = './migrations_sqlite',
  9. int port = 8080,
  10. int portSocket = 8083,
  11. int portNginx = 80,
  12. String ip = '0.0.0.0',
  13. String dbName = "database_name",
  14. bool noStop = true,
  15. String serverName = "webserver",
  16. String pathFilemanager = '/upload/filemanager',
  17. LanguageSource languageSource = LanguageSource.json,
  18. Map<String, Map<String, String>> dartLanguages = const {},
  19. String? publicDir,
  20. String? domain,
  21. String? domainScheme,
  22. int? domainPort,
  23. FinchDBConfig? dbConfig,
  24. String widgetsType = 'html',
  25. int fakeDelay = 0,
  26. List<String>? languages,
  27. String mailDefault = "example@uproid.com",
  28. String mailHost = "smtp.zoho.eu",
  29. String blockStart = '{%',
  30. String blockEnd = "%}",
  31. String variableStart = "{{",
  32. String variableEnd = "}}",
  33. String commentStart = '{#',
  34. String commentEnd = '#}',
  35. String cookiePassword = "password",
  36. FinchMysqlConfig? mysqlConfig,
  37. FinchSqliteConfig? sqliteConfig,
  38. String poweredBy = "Dart Finch",
  39. bool enableLocalDebugger = false,
})

Creates an instance of FinchConfigs. Initializes configuration properties with values from environment variables or defaults provided in the parameters.

Implementation

FinchConfigs({
  this.version = '1.0.0',
  String? appPath,
  String? dbPath,
  String? backupPath,
  String? widgetsPath,
  String? languagePath,
  this.pathMigrationMySQL = './migrations',
  this.pathMigrationSQLite = './migrations_sqlite',
  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',
  this.languageSource = LanguageSource.json,
  this.dartLanguages = const {},
  String? publicDir,
  String? domain,
  String? domainScheme,
  int? domainPort,
  FinchDBConfig? 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",
  FinchMysqlConfig? mysqlConfig,
  FinchSqliteConfig? sqliteConfig,
  this.poweredBy = "Dart Finch",
  this.enableLocalDebugger = false,
}) {
  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 ?? FinchDBConfig();
  this.mysqlConfig = mysqlConfig ?? FinchMysqlConfig();
  this.sqliteConfig = sqliteConfig ?? FinchSqliteConfig();
  this.languages = languages ?? FinchDBConfig.defaultLanguages.keys.toList();
}