@@ -991,9 +991,43 @@ func (e *Engine) Run(ctx context.Context, ch chan<- domain.Event, actions <-chan
991991 }
992992
993993 e .maybeRunExtras (ctx , emit , actions , workDir )
994+ e .cleanupExtrasRuntimeArtifacts (emit , workDir )
994995 }()
995996}
996997
998+ func (e * Engine ) cleanupExtrasRuntimeArtifacts (emit func (domain.Event ) bool , workDir string ) {
999+ cacheDir := filepath .Join (absDir (workDir ), extrasRuntimeCacheDir )
1000+ if _ , err := os .Stat (cacheDir ); err != nil {
1001+ return
1002+ }
1003+ if err := os .RemoveAll (cacheDir ); err != nil {
1004+ if emit != nil {
1005+ _ = emit (domain.Event {
1006+ Type : domain .EventWarning ,
1007+ StepID : extrasStepID ,
1008+ Source : "extras" ,
1009+ Severity : domain .SeverityWarn ,
1010+ Payload : domain.LogPayload {
1011+ Message : "Failed to remove installer extras runtime cache." ,
1012+ Fields : map [string ]string {"error" : err .Error ()},
1013+ },
1014+ })
1015+ }
1016+ return
1017+ }
1018+ if emit != nil {
1019+ _ = emit (domain.Event {
1020+ Type : domain .EventLog ,
1021+ StepID : extrasStepID ,
1022+ Source : "extras" ,
1023+ Severity : domain .SeverityInfo ,
1024+ Payload : domain.LogPayload {
1025+ Message : "Removed installer extras runtime cache." ,
1026+ },
1027+ })
1028+ }
1029+ }
1030+
9971031type phpNewOptions struct {
9981032 DBType string
9991033 DBHost string
@@ -1796,9 +1830,9 @@ func dbDriverQuestionOptions(status domain.SystemStatus) []domain.QuestionOption
17961830 // If we don't have system status yet, don't block the user.
17971831 if len (status .Items ) == 0 {
17981832 return []domain.QuestionOption {
1833+ {ID : "sqlite" , Label : "SQLite" , Enabled : true },
17991834 {ID : "mysql" , Label : "MySQL or MariaDB" , Enabled : true },
18001835 {ID : "pgsql" , Label : "PostgreSQL" , Enabled : true },
1801- {ID : "sqlite" , Label : "SQLite" , Enabled : true },
18021836 {ID : "sqlsrv" , Label : "SQL Server" , Enabled : true },
18031837 }
18041838 }
@@ -1807,9 +1841,9 @@ func dbDriverQuestionOptions(status domain.SystemStatus) []domain.QuestionOption
18071841 pdoOK := ok && pdoLevel == domain .StatusOK
18081842
18091843 return []domain.QuestionOption {
1844+ dbDriverOption (status , pdoOK , "sqlite" , "SQLite" , "pdo_sqlite" ),
18101845 dbDriverOption (status , pdoOK , "mysql" , "MySQL or MariaDB" , "pdo_mysql" ),
18111846 dbDriverOption (status , pdoOK , "pgsql" , "PostgreSQL" , "pdo_pgsql" ),
1812- dbDriverOption (status , pdoOK , "sqlite" , "SQLite" , "pdo_sqlite" ),
18131847 dbDriverOption (status , pdoOK , "sqlsrv" , "SQL Server" , "pdo_sqlsrv" ),
18141848 }
18151849}
@@ -1858,6 +1892,15 @@ try {
18581892 if ($name !== ":memory:" && !str_starts_with($name, "file:") && !preg_match('/^(\/|[A-Za-z]:[\\\\\\/])/', $name)) {
18591893 $name = "core/database/" . basename(str_replace("\\", "/", $name));
18601894 }
1895+ if ($name !== ":memory:" && !str_starts_with($name, "file:")) {
1896+ $dir = dirname($name);
1897+ if ($dir !== "" && $dir !== "." && !is_dir($dir)) {
1898+ @mkdir($dir, 0755, true);
1899+ }
1900+ if (!file_exists($name)) {
1901+ @touch($name);
1902+ }
1903+ }
18611904 new \PDO("sqlite:".$name, null, null, $timeout);
18621905 echo json_encode(["ok"=>true]); exit(0);
18631906 }
0 commit comments