Skip to content

Commit

Permalink
Setup namespace - requires dump of autoload
Browse files Browse the repository at this point in the history
  • Loading branch information
daanrijpkemacb committed Nov 25, 2023
1 parent 7b3fa87 commit 60aa2d5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
29 changes: 12 additions & 17 deletions bluem-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,21 @@
* Initialize a database table for the requests.
* @return void
*/
function bluem_db_create_requests_table(): void {
global $wpdb, $bluem_db_version;

$installed_ver = (float) get_option( "bluem_db_version" );

if ( empty( $installed_ver ) || $installed_ver < $bluem_db_version ) {
$charset_collate = $wpdb->get_charset_collate();

include_once ABSPATH . 'wp-admin/includes/upgrade.php';
function bluem_db_create_requests_table(): void
{
global $bluem_db_version;

$migrationRepository = new DatabaseMigrationRepository();
foreach($migrationRepository->getMigrations($installed_ver) as $migration) {
dbDelta($migration->sql);
}
include_once ABSPATH . 'wp-admin/includes/upgrade.php';

update_option(
"bluem_db_version",
$bluem_db_version
);
$repo = new DatabaseMigrationRepository();
foreach($repo->getMigrations() as $migration) {
dbDelta($migration->sql);
}

update_option(
"bluem_db_version",
$bluem_db_version
);
}

function bluem_db_check() {
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"yoast/phpunit-polyfills": "^1.0",
"vimeo/psalm": "^4.16"
},
"autoload": {
"psr-4": {
"Bluem\\WooCommerce\\": "src"
}
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": false
Expand Down

0 comments on commit 60aa2d5

Please sign in to comment.