Flextype v0.9.12 Release Notes
Release Date: 2020-12-07 // over 3 years ago-
๐ Features
core: Added Atomastic Components instead of Flextype Components (#478)
Added:
- atomastic/session
- atomastic/arrays
- atomastic/filesystem
- atomastic/registry
- atomastic/strings
entries: Entries API return Arrays Object instead of plain array on fetch. (#485)
From no we have ability to work with entries singles and collections as with smart objects for further data manipulations with help of Atomastic Arrays Component.
Example:
// Fetch random 10 posts created by Awilum and sort them by published_at field. $posts = flextype('entries') ->fetchCollection('blog') ->where('author.name', 'eq', 'Awilum') ->sortBy('published_at') ->limit(10) ->random();
entries: Standardize Entries API fetch. (#486)
entries: Standardize Media Files API fetch. (#487)
entries: Standardize Media Folders API fetch. (#488)
entries: Added ability to extend Core class with Macros. (#489)
cache: Added new cache engine - PHPFastCache instead of Doctrine Cache (#457)
New config for PhpFastCache
https://github.com/flextype/flextype/blob/dev/src/flextype/settings.yaml#L127-L241
New methods from PhpFastCache
We are start using PhpFastCache PSR16 adapter
https://github.com/PHPSocialNetwork/phpfastcachecore: Unit Test powered by PestPHP.
media: Added new
move()
method instead ofrename()
entries: Added new
move()
method instead ofrename()
core: Added new
PATH['tmp']
constant (#470)Now we have:
PATH['tmp']
constant instead ofPATH['cache']
andPATH['logs']
markdown: Added markdown basic settings (#471)
markdown: auto_line_breaks: false auto_url_links: false escape_markup: false
markdown: Added ability to access markdown parser instance (#468)
Usage:
$markdown = flextype('markdown')->getInstance();
entries: Added new Flextype Entries Memory Storage (Flextype EMS). New private property
$storage
for storing current requested entry(or entries) data and all Entries CRUD operations data in memory with ability to change them dynamically on fly. New public methodsgetStorage()
setStorage()
(#467)Structure (Flextype EMS):
$storage = [ 'fetch' => [ 'id' => '', 'data' => '', ], 'create' => [ 'id' => '', 'data' => '', ], 'Updated' => [ 'id' => '', 'data' => '', ], 'delete' => [ 'id' => '', ], 'copy' => [ 'id' => '', 'new_id' => '', ], 'move' => [ 'id' => '', 'new_id' => '', ], 'has' => [ 'id' => '', ], ];
Accessing storage example:
flextype('emitter')->AddedListener('onEntryAfterInitialized', static function () : void { flextype('entries')->setStorage('fetch.data.title', 'New title'); }); $entry = flextype('entries')->fetchSingle('about'); echo $entry['title'];
entries: Added new events:
onEntryHas
,onEntryInitialized
,onEntriesInitialized
(#467)helpers Added new support helper
find()
for files and directories searching instead offind_filter()
helpers Added new support helper
filter()
for data collection filtering instead ofarrays_filter()
๐ Bug Fixes
entries: Fixed issue with
delete()
method (#465)media: Fixed issue with
exif_read_data()
on files upload.
๐จ Refactoring
- entries: Removed App from all core namespaces (#469)
๐ฅ BREAKING CHANGES
entries: removed properties from Entries API (#467)
$entry_id $entry $entry_create_data $entry_update_data $entries_id $entries
Use public methods
getStorage()
setStorage()
instead.Example:
// old flextype('entries')->entry['title'] = 'New title'; // new flextype('entries')->setStorage('fetch.data.title', 'New title'); // old $title = flextype('entries')->entry['title']; // new $title = flextype('entries')->getStorage('fetch.data.title'); $title = flextype('entries')->getStorage('fetch.data')['title'];
core: Removed App from all core namespaces (#469)
We should have
use Flextype\Foundation\Entries\Entries;
instead of
use Flextype\App\Foundation\Entries\Entries;
core: use new
PATH['tmp']
constant instead ofPATH['cache']
andPATH['logs']
(#470)cache: old cache config removed, use new config for PhpFastCache (#457)
cache: use methods
has()
set()
get()
instead ofcontains()
save()
fetch()
(#457)core: Removed flextype-components/session (#473)
core: Removed flextype-components/cookie (#473)
core: Removed flextype-components/number (#474)
core: Removed flextype-components/filesystem (#474)
core: Removed flextype-components/arrays (#474)