You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You need a webserver (e.g. MAMP/WAMP/XAMPP) able to run PHP (tested with 7.3) and a database.
109
-
Both MySQL and local SQLite are supported.
108
+
Both MySQL and local SQLite are supported. SQLite requires the `pdo_sqlite` PHP extension (enabled by default in most installations).
110
109
111
110
1. Install `composer` (the PHP dependency management system - `brew install composer` for MacOS if you have brew) and run `composer install`
112
111
@@ -124,20 +123,57 @@ You can choose `MYSQL` or `SQLITE (LOCAL FILE)` on the setup screen.
124
123
125
124
### Manual setup
126
125
127
-
1. If you are using MySQL, import `includes/install/DB.sql` to the database you have created.
128
-
129
-
2. Rename `includes/database_info.php.template` to `includes/database_info.php` and update the details within accordingly:
130
-
131
-
- MySQL mode: set `$db['driver'] = 'mysql'` and fill host/user/password/name/port
132
-
- SQLite mode: set `$db['driver'] = 'sqlite'` and set `$db['sqlite_path']` (for example `includes/local.sqlite`)
133
-
134
-
3. The game should be up and running. Go and create and account manually.
135
-
136
-
4. Go to the `user_credentials` table and update the entry for your user, setting the column `group_id` to be `1`. This will make your account a full administrator. Log out and log back in.
126
+
1. Rename `includes/database_info.php.template` to `includes/database_info.php` and configure it:
127
+
128
+
**MySQL mode:**
129
+
```php
130
+
$db['driver'] = 'mysql';
131
+
$db['server_name'] = 'localhost';
132
+
$db['username'] = 'root';
133
+
$db['password'] = '';
134
+
$db['name'] = 'your_database';
135
+
$db['port'] = 3306;
136
+
```
137
+
Then import the schema: `mysql -u root your_database < includes/install/DB.sql`
138
+
139
+
**SQLite mode:**
140
+
```php
141
+
$db['driver'] = 'sqlite';
142
+
$db['sqlite_path'] = 'includes/local.sqlite';
143
+
```
144
+
The SQLite schema is imported automatically on first run via the setup page. For manual import, use the PHP helper:
2. The game should be up and running. Go and create an account manually.
154
+
155
+
3. Go to the `user_credentials` table and update the entry for your user, setting the column `group_id` to be `1`. This will make your account a full administrator. Log out and log back in.
156
+
157
+
### SQLite details
158
+
159
+
SQLite support requires no external database server. The database is stored as a single file (default: `includes/local.sqlite`). The path can be relative to the project root or absolute.
160
+
161
+
**How it works:**
162
+
-`SqliteSchemaConverter` automatically converts the MySQL schema (`DB.sql`) to SQLite-compatible SQL at setup time, handling type mappings, escape sequences, primary keys and auto-increment columns.
163
+
-`SqliteDb` is a lightweight PDO-based adapter that mirrors the `Mysqlidb` API (query builder, `where()`, `join()`, `get()`, `insert()`, `update()`, `delete()`, `rawQuery()`, etc.) so the game code works with either driver.
164
+
- MySQL-specific SQL like `RAND()` is translated to `RANDOM()` at runtime, and `UPDATE/DELETE ... LIMIT` is rewritten using subqueries.
165
+
166
+
**Requirements:**
167
+
- PHP `pdo_sqlite` extension (included by default in most PHP installations)
168
+
- Write permission on the directory where the `.sqlite` file will be created
169
+
170
+
**Limitations:**
171
+
- SQLite is best for development and small deployments. For production with many concurrent users, MySQL is recommended.
172
+
- Foreign key constraints from the MySQL schema are partially supported (inline constraints work; ALTER TABLE constraints are skipped as SQLite has limited ALTER TABLE support).
137
173
138
174
### Useful tips
139
175
140
-
You may need to manually execute the following SQL if you see a GROUP BY related error on the missions page:
176
+
You may need to manually execute the following SQL if you see a GROUP BY related error on the missions page (MySQL only):
141
177
142
178
```
143
179
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
You need a webserver (e.g. MAMP/WAMP/XAMPP) able to run PHP (tested with 7.3) and an MySQL database (LAMP stack).
87
+
You need a webserver (e.g. MAMP/WAMP/XAMPP) able to run PHP (tested with 7.3) and a database.
88
+
Both MySQL and local SQLite are supported.
88
89
89
90
1. Install `composer` (the PHP dependency management system - `brew install composer` for MacOS if you have brew) and run `composer install`
90
91
91
-
2. Create an empty Database in MySQL. For MAMP, you would go to `http://localhost:8888/phpMyAdmin5`
92
+
2. Pick one database mode:
93
+
94
+
- MySQL: create an empty database (for MAMP you can use `http://localhost:8888/phpMyAdmin5`)
95
+
- SQLite (local): no external DB server needed; setup creates a local `.sqlite` file
92
96
93
97
## Semi-manual setup
94
98
95
99
96
-
Visit `http://localhost/public_html/setup` - this may be different if you are using another port or directory structure, e.g. `http://localhost:8888/sr/public_html/setup` and follow the setup process
100
+
Visit `http://localhost/public_html/setup` - this may be different if you are using another port or directory structure, e.g. `http://localhost:8888/sr/public_html/setup` and follow the setup process.
101
+
You can choose `MYSQL` or `SQLITE (LOCAL FILE)` on the setup screen.
97
102
98
103
## Manual setup
99
104
100
-
1. Import `includes/install/DB.sql` to the database you have created.
105
+
1. If you are using MySQL, import `includes/install/DB.sql` to the database you have created.
106
+
107
+
2. Rename `includes/database_info.php.template` to `includes/database_info.php` and update the details within accordingly:
101
108
102
-
2. Rename `includes/database_info.php.template` to `includes/database_info.php` and update the details within accordingly.
109
+
- MySQL mode: set `$db['driver'] = 'mysql'` and fill host/user/password/name/port
110
+
- SQLite mode: set `$db['driver'] = 'sqlite'` and set `$db['sqlite_path']` (for example `includes/local.sqlite`)
103
111
104
112
3. The game should be up and running. Go and create and account manually.
0 commit comments