Some checks failed
CI / Coding Standards (push) Failing after 2m31s
CI / PHPStan (push) Failing after 50s
CI / Tests (PHP 8.1) (push) Successful in 50s
CI / Tests (PHP 8.2) (push) Successful in 48s
CI / Tests (PHP 8.3) (push) Successful in 40s
CI / No Debug Code (push) Successful in 2s
- Custom DB tables for availability slots and lesson bookings - Instructor (wp-admin) and student (front-end) roles with custom capabilities - REST API under us-scheduler/v1 for availability CRUD and booking - [us_booking] and [us_student_login] shortcodes for student front end - PHPUnit + Brain\Monkey unit test suite (29 tests) - Gitea Actions CI: lint, PHPStan, tests on PHP 8.1/8.2/8.3, no-debug check - Feature docs under docs/features/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
681 B
PHP
31 lines
681 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Unsupervised\Schedular;
|
|
|
|
use Unsupervised\Schedular\Data\Schema;
|
|
use Unsupervised\Schedular\Roles\RoleManager;
|
|
|
|
class Installer
|
|
{
|
|
public function run(): void
|
|
{
|
|
$this->createTables();
|
|
(new RoleManager())->createRoles();
|
|
flush_rewrite_rules();
|
|
update_option('us_schedular_version', USC_VERSION);
|
|
}
|
|
|
|
private function createTables(): void
|
|
{
|
|
global $wpdb;
|
|
$charset = $wpdb->get_charset_collate();
|
|
|
|
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
|
|
|
foreach (Schema::tables($wpdb->prefix, $charset) as $sql) {
|
|
dbDelta($sql);
|
|
}
|
|
}
|
|
}
|