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