diff options
author | Thedro Neely <thedroneely@gmail.com> | 2022-11-18 17:04:50 -0500 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2022-11-18 17:53:31 -0500 |
commit | de6f5e2be5dfbd2c55dd689439f46363649ae747 (patch) | |
tree | 7d76e309a3f27c850a178107cb92b0e978ae6ed7 | |
parent | 6aa5d8a6b09b60ac819ca90059e07e4e9cb7844d (diff) | |
download | edwinmattiacci.com-de6f5e2be5dfbd2c55dd689439f46363649ae747.tar.gz edwinmattiacci.com-de6f5e2be5dfbd2c55dd689439f46363649ae747.tar.bz2 edwinmattiacci.com-de6f5e2be5dfbd2c55dd689439f46363649ae747.zip |
bootstrap/database/Connection: Swap to sqlite
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | bootstrap/database/Connection.php | 8 | ||||
-rw-r--r-- | config.php | 9 |
4 files changed, 14 insertions, 14 deletions
@@ -1,10 +1,10 @@ .hugo_build.lock /bootstrap/comments/comments +/database +/generators/hugo/public +/production /public/posts +/staging /vendor config.php -database -generators/hugo/public google[a-z0-9]*.html -production -staging @@ -32,8 +32,9 @@ deploy: ln --symbolic --force '$(path)/public' '$(prelaunch)' make minify make cache - cd '$(deployment)' && make site && make migration + cd '$(deployment)' && make site make permissions + cd '$(deployment)' && make migration mv --force --no-target-directory '$(prelaunch)' '$(public)' find '$(target)' -maxdepth 1 ! -path '$(target)' -type d -printf '%T@\t%p\n' \ | sort --reverse --general-numeric-sort --field-separator $$'\t' \ diff --git a/bootstrap/database/Connection.php b/bootstrap/database/Connection.php index deec2c6..3093d85 100644 --- a/bootstrap/database/Connection.php +++ b/bootstrap/database/Connection.php @@ -2,17 +2,17 @@ class Connection { - public static function make($config) + public static function make(array $config) { try { return new PDO( - $config['connection'].';dbname='.$config['name'], + $config['dsn'], $config['username'], $config['password'], $config['options'] ); - } catch (PDOException $e) { - error_log($e->getMessage()); + } catch (PDOException $error) { + error_log($error->getMessage()); } } } @@ -2,10 +2,9 @@ return [ 'database' => [ - 'name' => 'pgsql_database', - 'username' => 'pgsql_username', - 'password' => 'pgsql_password', - 'connection' => 'pgsql:', + 'dsn' => 'sql:;dbname=sql_database', + 'username' => 'sql_username', + 'password' => 'sql_password', 'options' => [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ] @@ -17,5 +16,5 @@ return [ 'name' => 'email_name', 'username' => 'email_username', 'password' => 'email_password', - ] + ], ]; |