aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2022-11-18 17:04:50 -0500
committerThedro Neely <thedroneely@gmail.com>2022-11-18 17:53:31 -0500
commitde6f5e2be5dfbd2c55dd689439f46363649ae747 (patch)
tree7d76e309a3f27c850a178107cb92b0e978ae6ed7
parent6aa5d8a6b09b60ac819ca90059e07e4e9cb7844d (diff)
downloadedwinmattiacci.com-de6f5e2be5dfbd2c55dd689439f46363649ae747.tar.gz
edwinmattiacci.com-de6f5e2be5dfbd2c55dd689439f46363649ae747.tar.bz2
edwinmattiacci.com-de6f5e2be5dfbd2c55dd689439f46363649ae747.zip
bootstrap/database/Connection: Swap to sqlite
-rw-r--r--.gitignore8
-rw-r--r--Makefile3
-rw-r--r--bootstrap/database/Connection.php8
-rw-r--r--config.php9
4 files changed, 14 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore
index 05ddf83..9029cc3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/Makefile b/Makefile
index 761bd96..f64cbd6 100644
--- a/Makefile
+++ b/Makefile
@@ -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());
}
}
}
diff --git a/config.php b/config.php
index 0e83ebe..5df7b42 100644
--- a/config.php
+++ b/config.php
@@ -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',
- ]
+ ],
];