Skip to content

Commit 1b96460

Browse files
author
HugoFara
committed
chore: default branch is now main, no longer master
1 parent 790a400 commit 1b96460

File tree

102 files changed

+348
-277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+348
-277
lines changed

.github/workflows/docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build and push Docker images
22

33
on:
44
push:
5-
branches: [ 'master' ]
5+
branches: [ 'main' ]
66
release:
77
types: [ published ]
88

.github/workflows/php.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Composer CI
22

33
on:
44
push:
5-
branches: [ master, dev ]
5+
branches: [ main, dev ]
66
pull_request:
7-
branches: [ master, dev ]
7+
branches: [ main, dev ]
88

99
jobs:
1010
build:

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Migration files in `db/migrations/` with format `YYYYMMDD_HHMMSS_description.sql
243243

244244
Branches:
245245

246-
- `master` - Stable releases
246+
- `main` - Stable releases
247247
- `dev` - Development branch
248248

249249
Before committing:

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Learning with Texts
22

33
<p align="center">
4-
<img src="https://github.com/HugoFara/lwt/raw/master/img/lwt_icon_big.jpg" alt="LWT logo - an open book" width="200"/>
4+
<img src="https://github.com/HugoFara/lwt/raw/main/img/lwt_icon_big.jpg" alt="LWT logo - an open book" width="200"/>
55
</p>
66

77
<p align="center">
@@ -51,15 +51,15 @@ Then open <http://localhost:8010/lwt/> in your browser.
5151

5252
**1. Import a text** — Paste any content you want to read, or import from RSS feeds.
5353

54-
![Adding French text](https://github.com/HugoFara/lwt/raw/master/img/05.jpg)
54+
![Adding French text](https://github.com/HugoFara/lwt/raw/main/img/05.jpg)
5555

5656
**2. Read and learn** — Unknown words are highlighted. Click any word to see its translation and save it to your vocabulary.
5757

58-
![Learning French text](https://github.com/HugoFara/lwt/raw/master/img/06.jpg)
58+
![Learning French text](https://github.com/HugoFara/lwt/raw/main/img/06.jpg)
5959

6060
**3. Review with context** — Practice vocabulary with spaced repetition, always seeing words in their original context.
6161

62-
![Reviewing French word](https://github.com/HugoFara/lwt/raw/master/img/07.jpg)
62+
![Reviewing French word](https://github.com/HugoFara/lwt/raw/main/img/07.jpg)
6363

6464
Unlike flashcard apps like [Anki](https://apps.ankiweb.net/), LWT keeps words connected to the texts where you found them. We also include an Anki exporter if you want both.
6565

@@ -126,8 +126,8 @@ Access at <http://localhost:8010/lwt/>
126126

127127
```bash
128128
# Download and extract the latest release
129-
wget https://github.com/HugoFara/lwt/archive/refs/heads/master.zip
130-
unzip master.zip && cd lwt-master
129+
wget https://github.com/HugoFara/lwt/archive/refs/heads/main.zip
130+
unzip main.zip && cd lwt-main
131131

132132
# Run the installer
133133
chmod +x ./INSTALL.sh
@@ -202,7 +202,7 @@ npm run build:all # Production build
202202

203203
| Branch | Purpose |
204204
| --- | --- |
205-
| `master` | Stable releases |
205+
| `main` | Stable releases |
206206
| `dev` | Development and testing |
207207
| `official` | Tracks official LWT releases |
208208

docs-src/.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default defineConfig({
124124
},
125125

126126
editLink: {
127-
pattern: 'https://github.com/HugoFara/lwt/edit/master/docs-src/:path',
127+
pattern: 'https://github.com/HugoFara/lwt/edit/main/docs-src/:path',
128128
text: 'Edit this page on GitHub'
129129
}
130130
}

docs-src/changelog.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,60 @@ ones are marked like "v1.0.0-fork".
1515
### Added
1616

1717
* Official support for PHP 8.3 and 8.4.
18+
* **Multi-user support** ([#221](https://github.com/HugoFara/lwt/issues/221)):
19+
Users are now stored in a dedicated `users` table with proper foreign key
20+
relationships instead of using table prefixes. Includes user authentication,
21+
registration, and role-based access (user/admin).
22+
* **MVC Architecture** ([#212](https://github.com/HugoFara/lwt/issues/212),
23+
[#215](https://github.com/HugoFara/lwt/issues/215)): Complete restructure of
24+
the PHP codebase following the Model-View-Controller pattern:
25+
* Controllers in `src/backend/Controllers/` (17 controller classes)
26+
* Services in `src/backend/Services/` (35 service classes)
27+
* Views in `src/backend/Views/`
28+
* Router-based URL handling in `src/backend/Router/`
29+
* **Front Controller Pattern** ([#213](https://github.com/HugoFara/lwt/issues/213)):
30+
All requests now route through `index.php`. The root folder no longer contains
31+
dozens of PHP files - only `index.php` and `router.php` remain.
32+
* **Alpine.js Frontend Framework** ([#208](https://github.com/HugoFara/lwt/issues/208)):
33+
Adopted Alpine.js for reactive UI components, reducing reliance on PHP-rendered
34+
pages for user interactions.
35+
* **TypeScript Migration** ([#209](https://github.com/HugoFara/lwt/issues/209)):
36+
Frontend JavaScript converted to TypeScript with 90+ `.ts` files organized in
37+
`src/frontend/js/` with proper module structure (api/, core/, reading/, testing/,
38+
feeds/, languages/, etc.).
39+
* **jQuery Removal** ([#211](https://github.com/HugoFara/lwt/issues/211)):
40+
jQuery has been replaced with modern vanilla JavaScript and Alpine.js.
41+
* **Overlib Replacement** ([#214](https://github.com/HugoFara/lwt/issues/214)):
42+
The 20-year-old overlib library has been removed in favor of modern alternatives.
43+
* **HoverIntent Replacement** ([#210](https://github.com/HugoFara/lwt/issues/210)):
44+
The `briancherne/jquery-hoverintent` plugin has been replaced with a native
45+
TypeScript implementation.
46+
* **Iframe Replacement** ([#166](https://github.com/HugoFara/lwt/issues/166)):
47+
Legacy iframe-based dynamic content loading replaced with Alpine.js components
48+
and REST API calls. Only dictionary iframes remain for external dictionary display.
49+
50+
### Changed
51+
52+
* **Database Engine Migration** ([#220](https://github.com/HugoFara/lwt/issues/220)):
53+
All permanent tables converted from MyISAM to InnoDB engine. Benefits include:
54+
* ACID transaction support
55+
* Row-level locking for better concurrency
56+
* Foreign key constraints for data integrity
57+
* Improved crash recovery
58+
* **Inter-Table Foreign Keys** ([#220](https://github.com/HugoFara/lwt/issues/220)):
59+
Added 16 foreign key constraints for referential integrity between tables:
60+
* Language references: texts, words, sentences, archivedtexts, newsfeeds → languages (CASCADE)
61+
* Text references: sentences, textitems2, texttags → texts (CASCADE)
62+
* Other references: textitems2 → sentences (CASCADE), textitems2 → words (SET NULL),
63+
wordtags → words/tags, texttags → tags2, archtexttags → archivedtexts/tags2,
64+
feedlinks → newsfeeds (all CASCADE)
65+
* Migration: `20251221_120000_add_inter_table_foreign_keys.sql`
66+
* **Breaking change**: `textitems2.Ti2WoID` now uses NULL instead of 0 for unknown words
67+
* Database schema now includes foreign key constraints linking user-owned data
68+
(languages, texts, words, tags, feeds) to the `users` table with CASCADE delete.
69+
* **TTS Settings Storage** ([#186](https://github.com/HugoFara/lwt/issues/186)):
70+
Text-to-Speech language settings (voice, rate, pitch) now use browser localStorage
71+
instead of cookies. Includes automatic migration from old cookie format.
1872

1973
### Fixed
2074

@@ -30,6 +84,7 @@ ones are marked like "v1.0.0-fork".
3084

3185
### Security
3286

87+
* Adds session security cookie to protect against session hijacking.
3388
* Fixed SQL injection vulnerabilities in `validateLang()`, `validateText()`,
3489
`validateTag()`, and `validateArchTextTag()` functions. All validation
3590
functions now properly sanitize non-numeric input before executing SQL
@@ -44,6 +99,9 @@ ones are marked like "v1.0.0-fork".
4499
### Deprecated
45100

46101
* Removed testing for PHP 8.0.
102+
* Legacy table prefix system (`$tbpref`) is deprecated in favor of the new
103+
user-based multi-tenancy. Existing prefixed tables will be migrated to the
104+
new system automatically.
47105

48106
## 2.10.0-fork (April 1 2024)
49107

docs-src/developer/contributing.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,20 +215,32 @@ You can use it through `php tools/phpDocumentor` if installed with [Phive](https
215215
Code documentation for JavaScript is available at `docs/js/` is is generated thourgh [JSDoc](https://jsdoc.app/).
216216
The JSDoc configuration file is `jsdoc.json`.
217217

218-
## New version
218+
## New Version
219219

220220
LWT-fork follows a strict procedure for new versions.
221-
This section is mainly intended for the maintainers, but feel free to take a peak at it.
221+
This section is mainly intended for the maintainers, but feel free to take a peek at it.
222222

223-
The steps to publish a new version are:
223+
### Version Locations
224224

225-
1. In the [CHANGELOG](./CHANGELOG.md), add the latest release number and date.
226-
2. In `src/backend/Core/version.php`, update `LWT_APP_VERSION` and `LWT_RELEASE_DATE`.
225+
The version number must be updated in multiple places:
226+
227+
| File | Field/Constant |
228+
| --- | --- |
229+
| `src/backend/Core/ApplicationInfo.php` | `VERSION` and `RELEASE_DATE` constants |
230+
| `package.json` | `version` field |
231+
| `CHANGELOG.md` | New version section header |
232+
233+
The authoritative version is in `ApplicationInfo.php`. The `package.json` version should match (without the `-fork` suffix).
234+
235+
### Release Steps
236+
237+
1. Update the version in all locations listed above.
238+
2. In the [CHANGELOG](./CHANGELOG.md), move items from `[UNRELEASED]` to the new version section with the release date.
227239
3. Build frontend assets with `npm run build:all`.
228240
4. Regenerate documentation with `composer doc`.
229-
5. Commit your changes, `git commit -m "Regenerates documentation for release []."`
230-
6. Add a version tag with annotation `git tag -a [release number]` and push the changes.
231-
7. If all the GitHub actions are successful, write a new release on GitHub linking to the previously created tag.
241+
5. Commit your changes: `git commit -m "Release [version]"`
242+
6. Add a version tag with annotation: `git tag -a v[version] -m "Release [version]"` and push with `git push --tags`.
243+
7. If all GitHub Actions pass, create a new release on GitHub linking to the tag.
232244
8. The new version is live!
233245

234246
## Other Ways of Contribution

docs-src/guide/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To run LWT, you'll need:
2727
* [EasyPHP](http://www.easyphp.org/) or [XAMPP](https://www.apachefriends.org/download.html) (Windows), or
2828
* [MAMP](http://mamp.info/en/index.html) (macOS), or
2929
* a [LAMP (Linux-Apache-MariaDB-PHP) server](http://en.wikipedia.org/wiki/LAMP_%28software_bundle%29) (Linux).
30-
3. **The LWT Application**. The latest version _lwt\_v\_x\_y.zip_ can be downloaded at <https://github.com/HugoFara/lwt/archive/refs/heads/master.zip>. View the [installation guide](installation.md).
30+
3. **The LWT Application**. The latest version _lwt\_v\_x\_y.zip_ can be downloaded at <https://github.com/HugoFara/lwt/archive/refs/heads/main.zip>. View the [installation guide](installation.md).
3131

3232
## History
3333

docs-src/guide/installation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Two main softwares can be used to set up a local server on your computer: XAMPP
3030

3131
2. Get the [latest GitHub release](https://github.com/HugoFara/lwt/releases), unzip it.
3232

33-
You can also try to download the [latest stable version](https://github.com/HugoFara/lwt/archive/refs/heads/master.zip) if you want the cutting-edge updates (that may include some bugs)
33+
You can also try to download the [latest stable version](https://github.com/HugoFara/lwt/archive/refs/heads/main.zip) if you want the cutting-edge updates (that may include some bugs)
3434

3535
3. Now go into "C:\xampp\htdocs\lwt". Copy the file ".env.example" to ".env" and edit it with your database credentials (the defaults usually work for XAMPP).
3636

@@ -63,7 +63,7 @@ Now you must only do step 4.2 to start LWT.
6363

6464
3. Get the [latest GitHub release](https://github.com/HugoFara/lwt/releases), unzip it.
6565

66-
You can also try to download the [latest stable version](https://github.com/HugoFara/lwt/archive/refs/heads/master.zip) if you want the cutting-edge updates (that may include some bugs)
66+
You can also try to download the [latest stable version](https://github.com/HugoFara/lwt/archive/refs/heads/main.zip) if you want the cutting-edge updates (that may include some bugs)
6767

6868
4. Install everything
6969
1. Go to "C:\Program Files (x86)\EasyPHP-Devserver-17\eds-www\lwt".
@@ -93,7 +93,7 @@ Now you must only do step 5.2 to start LWT.
9393

9494
4. Get the [latest GitHub release](https://github.com/HugoFara/lwt/releases), unzip it.
9595

96-
You can also try to download the [latest stable version](https://github.com/HugoFara/lwt/archive/refs/heads/master.zip) if you want the cutting-edge updates (that may include some bugs)
96+
You can also try to download the [latest stable version](https://github.com/HugoFara/lwt/archive/refs/heads/main.zip) if you want the cutting-edge updates (that may include some bugs)
9797

9898
5. Go to ``/Applications/MAMP/htdocs/lwt``. Copy the file ``.env.example`` to ``.env``. Edit it and set ``DB_HOST=localhost:8889`` (MAMP uses port 8889 for MySQL).
9999

@@ -171,7 +171,7 @@ The following instruction were tested on Raspbian Stretch.
171171

172172
2. Get the [latest GitHub release](https://github.com/HugoFara/lwt/releases).
173173

174-
You can also try to download the [latest stable version](https://github.com/HugoFara/lwt/archive/refs/heads/master.zip) if you want the cutting-edge updates (that may include some bugs)
174+
You can also try to download the [latest stable version](https://github.com/HugoFara/lwt/archive/refs/heads/main.zip) if you want the cutting-edge updates (that may include some bugs)
175175

176176
3. Unzip it.
177177

@@ -233,7 +233,7 @@ The official repository is at <https://packagist.org/packages/hugofara/lwt>.
233233

234234
2. Get the [latest GitHub release](https://github.com/HugoFara/lwt/releases).
235235

236-
You can also try to download the [latest stable version](https://github.com/HugoFara/lwt/archive/refs/heads/master.zip) if you want the cutting-edge updates (that may include some bugs)
236+
You can also try to download the [latest stable version](https://github.com/HugoFara/lwt/archive/refs/heads/main.zip) if you want the cutting-edge updates (that may include some bugs)
237237

238238
3. Unzip it.
239239

docs-src/legal/links.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* [**Original Project Page** @ Sourceforge](http://sourceforge.net/projects/learning-with-texts/)
44
* **Download Page**:
55
* [Lastest release @ GitHub](https://github.com/HugoFara/lwt/releases/latest)
6-
* [Lastest pushed @ GitHub](https://github.com/HugoFara/lwt/archive/refs/heads/master.zip)
6+
* [Lastest pushed @ GitHub](https://github.com/HugoFara/lwt/archive/refs/heads/main.zip)
77
* [Official version @ Sourceforge](http://sourceforge.net/projects/learning-with-texts/files/)
88
* [**Community Maintained Version** @ GitHub](https://github.com/HugoFara/lwt)
99
* **Documentation**: try either the [local link](index.html) or the [absolute link](https://hugofara.github.io/lwt/index.html).

0 commit comments

Comments
 (0)