Installation Guide

Requirements

  • PHP 8.1 or higher
  • ext-pdo extension
  • MySQL 5.7+ or MariaDB 10.3+
  • Web server (Apache/Nginx)

Installation Methods

Method 1: Single File (Recommended)

Download the single-file distribution for the easiest setup.

# Download the single-file distribution
wget https://schoolkit.skhoolar.com/schoolkit-0.1.zip
unzip schoolkit-0.1.zip

# This will extract schoolkit.php into your directory.
# You can also download it directly from the home page.

Then include it in your project:

<?php
require_once 'schoolkit.php';

// Example configuration
$config = [
    'db' => [
        'dsn' => 'mysql:host=localhost;dbname=schoolkit;charset=utf8mb4',
        'user' => 'your_username',
        'pass' => 'your_password'
    ],
    'storage_path' => __DIR__ . '/storage'
];

// For local development
/*
$config = [
    'db' => [
        'dsn' => 'mysql:host=localhost;dbname=schoolkit_dev;charset=utf8mb4',
        'user' => 'your_username',
        'pass' => 'your_password'
    ],
    'storage_path' => __DIR__ . '/storage'
];
*/

$schoolKit = SchoolKit::start($config);
?>

Method 2: Composer (Development)

For development and custom builds, you can use Composer:

composer require skhooler/schoolkit

Database Setup

Create your MySQL database and configure the connection:

CREATE DATABASE schoolkit CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'schoolkit'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON schoolkit.* TO 'schoolkit'@'localhost';

Verification

Test your installation with a simple script:

<?php
require_once 'schoolkit.php';

try {
    $config = [
        'db' => [
            'dsn' => 'mysql:host=127.0.0.1;dbname=schoolkit;charset=utf8mb4',
            'user' => 'schoolkit',
            'pass' => 'secure_password'
        ],
        'storage_path' => __DIR__ . '/storage'
    ];
    
    $schoolKit = SchoolKit::start($config);
    echo "✅ SchoolKit initialized successfully!\n";
    
    // Test database connection
    $stmt = $schoolKit->db()->query("SELECT 'Hello SchoolKit!' as message");
    $result = $stmt->fetch();
    echo "✅ Database connection successful! Message: " . $result['message'] . "\n";
    
} catch (Exception $e) {
    echo "❌ Error: " . $e->getMessage() . "\n";
}
?>