Commit graph

16 commits

Author SHA1 Message Date
d9726aff0e feat: add UUID v7 generator helper method (#17)
This PR adds a `UUID::v7()` method for generating version 7 UUIDs, which have several performace advantages over v4 when stored in database indecies.

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/17
2025-12-03 00:48:13 +01:00
be03b05191 fix: return passed value when setting db row value (#16)
Closes #14

From the example in the issue, this can now be fixed like this:
```php
final public DateTimeImmutable $date_created {
			get  => new DateTimeImmutable($this->get(Fields::DATE_CREATED->value));
			set (DateTimeImmutable $date_created) => new DateTimeImmutable(
			  $this->set(Fields::DATE_CREATED->value,
			  $date_created->format(Database::DATETIME_FORMAT)
			));
}
```

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/16
2025-12-01 13:56:42 +01:00
2f6e24b0a1 feat: add static helper class for license constants (#15)
This PR adds a new class for holding license constants, which is read by extensions like LibreJS to check that the site contains free JavaScript code.

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/15
2025-11-30 15:34:23 +01:00
9517203418 feat: add database Controller class for manipulating entity data (#13)
This PR adds a new database boilerplate for manipulating data stored in a database through an instanced database Model. The only method implemented by this class so far is `Controller()->update()`. It can be used to patch column values for a database row given an instanced `vlw\Database\Model`. An associative array of column keys and values are then passed to the update method.

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/13
2025-11-30 13:56:31 +01:00
d9fca6d4e1 fix(style): trim trailing whitespaces (#12)
Remove all trailing whitespaces from source files. Looks like it was only docblocks tho, that's nice!

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/12
2025-11-30 13:48:56 +01:00
4fa45083d0 feat: expose UUID helper as a class of static methods (#10)
Let's expose the uuid helpers as a class of static methods instead. I'm not sure if this approach is actually better but we're going to live with it for a while. I have done UUID helpers before this library as a class. So let's run with it again.

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/10
2025-11-02 09:50:03 +01:00
00337cd3aa refactor: replace the Model->isset property with a public instance method (#9)
This change is primarily to accommodate the new `Reflect::serialize()` method since we don't want to include the isset property when returning serialized objects.

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/9
2025-11-01 18:34:48 +01:00
feea36b190 feat: add UUID string length constant (#8)
Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/8
2025-11-01 16:48:38 +01:00
b1bdf628f2 refactor: replace for() with from() in database Model (#7)
This PR replaces the `vlw\MySQL->for()` with `vlw\MySQL->from()` since for() it's deprecated.

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/7
2025-11-01 16:37:26 +01:00
1940d89352 refactor: add class for crosstalk between Vegvisir and Reflect (#4)
Restores the class method approach for loading source files from #2, which undoes the changes introduced in #3. I can't figure out a way to make the function load before initialization of downstream classes.

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/4
2025-11-01 16:27:17 +01:00
3cc4984b14 docs: replace docs links with comments (#5)
Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/5
2025-11-01 16:27:01 +01:00
vlw
3c8c8561b2 docs: add note about documentation in README (#6)
Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/6
Co-authored-by: vlw <victor@vlw.se>
Co-committed-by: vlw <victor@vlw.se>
2025-11-01 16:26:41 +01:00
e1d3a09966 refactor: include Vegvisir source files from Reflect as a function (#3)
I know we just merged #2 and released verison 1.1.0 where the Vegvisir/Reflect crosstalk was supposed to be a class. But after using this briefly, I feel like it gets too verbose. This function will be called _a lot_ and therefore I think it should be pretty quick to type - just like the Vegvisir `VV` class.

Instead of typing
```php
use vlw\Scaffold\Scaffold;

Scaffold::include("some/file.php");
```
we can instead type
```php
use function vlw\Scaffold\load;

load("some/file.php");
```

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/3
2025-10-31 10:08:32 +01:00
dbdde9fcaf feat: add dedicated class for crosstalk between Vegvisir and Reflect (#2)
In this PR we move the Vegvisir `VV` class import into Reflect from the API class into its own `Scaffold` class. This new class will include everything that is required for crosstalk between Vegvisir and Reflect.

Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/2
2025-10-30 17:41:31 +01:00
3357416ad0 fix: namespace and relative source import paths (#1)
Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/1
2025-10-30 09:18:02 +01:00
e0cdfebc27
initial commit 2025-10-29 19:56:57 +01:00