Steve Boyd
fc78763d20
Merge pull request #10497 from creative-commoners/pulls/5/rescue-master-template-enhancements
...
Rescue master branch PRs: Template enhancements
2022-09-15 16:55:18 +12:00
Steve Boyd
71dca0118d
Merge pull request #10484 from creative-commoners/pulls/5/rescue-master-orm-generators
...
API rescue master-branch PR: Use Generators for ORM
2022-09-15 16:51:29 +12:00
Guy Sartorelli
e140c3786c
FIX Ensure consistent behaviour with repeat iterations
2022-09-15 16:22:48 +12:00
Guy Sartorelli
62ee63706f
FIX PHP 8.1 compatability for iterators.
...
Setting a proper return type for these will be done in a separate PR
2022-09-15 13:29:41 +12:00
Guy Sartorelli
d9be52579d
MNT Fix test
2022-09-15 13:29:29 +12:00
Guy Sartorelli
a76fa32a39
API Remove unnecessary getGenerator()
method.
...
`getIterator()` now returns a generator by default.
2022-09-15 13:29:29 +12:00
Guy Sartorelli
bf331072df
FIX Don't try to call count() on an iterator
2022-09-15 13:29:29 +12:00
Sam Minnee
81beddc161
Add deprecated method to make CMS tests work
2022-09-15 13:29:29 +12:00
Sam Minnee
9eb9e13071
FIX: Re-set finalisedQuery to allow recreation of iterator.
2022-09-15 13:29:29 +12:00
Sam Minnee
9c7ecb1f79
Further work on Loz’ solution
2022-09-15 13:29:29 +12:00
Loz Calver
850482138b
Proposed solution for caching template generator counts
2022-09-15 13:29:29 +12:00
Loz Calver
8e0e797b40
Fix code style
2022-09-15 13:29:27 +12:00
Loz Calver
749405170c
Update MySQLDatabaseTest to work with new query iterators
2022-09-15 13:29:10 +12:00
Sam Minnee
6ef5785fc5
FIX: pre-cache loop content within SSViewer.
...
SSViewer iterates on Iterators that it receives twice: first to get the
total number of items, then to actually render each item.
This necessitates a rewind. In order to make more use of generators,
which are not rewindable, I’d like to remove the need for a rewind.
I’ve done this by caching the content of the iterator as an array
within SSViewer_Scope.
Although this means a bit of memory usage, there are no cases in which
code will get to this point without iterating on all items, which would
use the memory anyway. It would only create onerous impacts in cases
where you are iterating on very long iterators, which would mean you’re
rendering a very large page anyway, and probably have other performance
issues.
2022-09-15 13:29:00 +12:00
Loz Calver
1b8f601023
NEW: Make DataList::getIterator a generator
2022-09-15 13:29:00 +12:00
Sam Minnee
77c7552c3f
NEW: ORM’ Query is a generator-based IteratorAggregate
...
API: Query no longer has iterator methods current(), first(), rewind(), next()
Using generators reduces the amount of boilerplate needed for this
code.
Turning it into an IteratorAggregate means that the iterator can be
re-created for each subsequent foreach call. This means that the
rewind() and seek() functionality can be discarded.
2022-09-15 13:28:56 +12:00
Sam Minnee
d8735633a7
FIX: Don’t call PaginatedList::getIterator() directly.
...
It’s best for foreach() to call this for us.
2022-09-15 13:28:20 +12:00
Sam Minnee
1efe2b46ff
FIX: Fix PaginatedList::toArray()
...
It wasn’t respecting pagination.
2022-09-15 13:28:20 +12:00
Sam Minnee
6c136c9cf2
NEW: Iterate ArrayList via a generator
...
Using a generator here means that we don’t need to prepare a duplicate
array in-memory before iterating.
2022-09-15 13:28:20 +12:00
Sam Minnee
2ead3746d6
Replace Map_Iterator with a generator.
...
Generators (PHP 5.5+) make this kind of code structure much easier to
build.
2022-09-15 13:28:20 +12:00
Guy Sartorelli
03b929dd33
API Remove support for PDO ( #10499 )
2022-09-15 13:13:48 +12:00
Guy Sartorelli
5da5555ce3
Merge pull request #10506 from creative-commoners/pulls/5/symfony-cache-fix
...
FIX Pass PSR6 caches to ChainAdapter
2022-09-13 17:28:39 +12:00
Steve Boyd
a2028a2817
FIX Pass PSR6 caches to ChainAdapter
2022-09-13 16:44:07 +12:00
Guy Sartorelli
a605093656
Merge branch '4' into 5
2022-09-09 16:48:20 +12:00
Guy Sartorelli
c4eadcd074
Merge branch '4.11' into 4
2022-09-09 16:47:49 +12:00
Guy Sartorelli
1385712ffd
MNT Make sure to test strings of boolean/null values
2022-09-09 13:42:06 +12:00
Guy Sartorelli
5b2820e8ac
MNT Fix unit tests
2022-09-09 13:38:55 +12:00
Loz Calver
47337782a2
API: <% loop %> and <% with %> only ever create one new scope level
2022-09-09 11:23:38 +12:00
Loz Calver
3a6c48cddb
FIX: template parser erroring on strings partially matching true/false/null
2022-09-09 11:16:58 +12:00
Loz Calver
d6e8229352
FIX: Fix type preservation in <% include %> arguments
2022-09-09 11:16:55 +12:00
Loz Calver
4339e4d02c
NEW: Add support for native nulls as template lookup arguments
2022-09-09 11:15:09 +12:00
Loz Calver
4cda967eae
API: Preserve variable types in template lookup args
2022-09-09 11:11:30 +12:00
Guy Sartorelli
7e9ced0824
Merge pull request #10470 from creative-commoners/pulls/4.11/case-insensitive-casting
...
FIX Normalise casing before casting fields
2022-09-08 12:45:09 +12:00
Guy Sartorelli
a6a07a7ef2
Merge pull request #10491 from creative-commoners/pulls/5/symfony6-translation-2
...
API Update translation to use symfony 6
2022-09-08 12:29:43 +12:00
Steve Boyd
a87a657367
API Update translation to use symfony 6
2022-09-08 11:52:34 +12:00
Guy Sartorelli
8fe2a786dc
Merge pull request #10478 from creative-commoners/pulls/5/symfony6-cache
...
API Update caching to use symfony 6
2022-09-07 16:27:59 +12:00
Steve Boyd
c9bc01473c
API Update caching to use symfony 6
2022-09-07 16:08:54 +12:00
Guy Sartorelli
06b13e0fa6
Revert "Merge pull request #10450 from creative-commoners/pulls/5/rescue-master-generators" ( #10483 )
...
This reverts commit 9edf3a5ca6
, reversing
changes made to 934fafd29d
.
2022-09-02 10:58:37 +12:00
Guy Sartorelli
1bf86cf39f
API Revert shorten auto-generated table names ( #10482 )
...
* Revert "BUG Fix table name test"
This reverts commit b36a01a8fd
.
* Revert "ENH shorten auto-generated table names"
This reverts commit 156f63bce3
.
2022-09-02 10:55:45 +12:00
Guy Sartorelli
e6fb9634b5
DEP Revert change to dependency that was made during a merge-up ( #10479 )
2022-09-01 14:48:18 +12:00
Steve Boyd
37ff4ee46a
Merge pull request #10454 from creative-commoners/pulls/5/rescue-master-table-name
...
API rescue master-branch PR: Shorten auto-generated table names #7621
2022-09-01 09:12:11 +12:00
Maxime Rainville
9f32b4b284
Merge pull request #10477 from creative-commoners/pulls/5/remove-accidental-deprecation-warnings
...
FIX Remove accidental deprecation warnings.
2022-08-31 14:02:51 +12:00
Guy Sartorelli
89a0f59ef1
FIX Remove accidental deprecation warnings.
...
These were erroneously added via a merge-up from 4 to 5.
2022-08-31 13:50:33 +12:00
Guy Sartorelli
f0a20ed400
MNT Fix merge-up error.
2022-08-31 13:38:18 +12:00
Guy Sartorelli
715415d5c8
Merge branch '4' into 5
2022-08-31 13:37:25 +12:00
Steve Boyd
250a75b233
Merge pull request #10457 from creative-commoners/pulls/5/rescue-master-extensions-expose-public
...
API Rescue Master Branch PR: Only expose public extension methods
2022-08-29 19:09:00 +12:00
Steve Boyd
9edf3a5ca6
Merge pull request #10450 from creative-commoners/pulls/5/rescue-master-generators
...
API rescue master-branch PR: Use Generators for ORM
2022-08-29 19:03:47 +12:00
Guy Sartorelli
6d885ab894
FIX Normalise casing before casting fields
2022-08-25 17:36:06 +12:00
Steve Boyd
934fafd29d
Merge pull request #10459 from creative-commoners/pulls/5/rescue-master-no-dual-support
...
ENH Rescue Master Branch Commits: CSV BOM stripping is now handled internally by league/csv
2022-08-25 10:01:50 +12:00
Steve Boyd
f14c60ceb2
Merge pull request #10463 from creative-commoners/pulls/4/rescue-master-static-analysis
...
Rescue Master Branch PR: ENH Various changes via static analysis tooling
2022-08-25 09:50:13 +12:00