Releases: PandaHugMonster/php-simputils
Releases · PandaHugMonster/php-simputils
1.1.6
1.1.5
Lots of changes including almost a year of development. My apologies for the delay.
1.1.4
- Fixed the ".env" autoload respect of the "working_dir" which was not working
1.1.3
- Implemented method
\spaf\simputils\models\Box::batch()that allows to easily export items
of specified keys to the local variable scope - Implemented methods
setFromData()and meta-magic methods___serialize()and
___deserialize()to fix PHP native serialization/deserialization for the
following classes:\spaf\simputils\models\Version\spaf\simputils\models\UrlObject\spaf\simputils\models\Time\spaf\simputils\models\L10n\spaf\simputils\models\IPv4Range\spaf\simputils\models\IPv4\spaf\simputils\models\File\spaf\simputils\models\Dir\spaf\simputils\models\DateTimeZone\spaf\simputils\models\DateTime\spaf\simputils\models\DatePeriod\spaf\simputils\models\DateInterval\spaf\simputils\models\Date\spaf\simputils\models\DataUnit\spaf\simputils\models\BigNumber
- Code Sniffer is removed from the project (got really annoyed, and it does not work correctly)
\spaf\simputils\models\Timeand\spaf\simputils\models\Datehave been refactored a bit.
The caching mechanics has been fixed.- Additionally have been added the properties for
\spaf\simputils\models\Date
and\spaf\simputils\models\Timefrom the targetDateTimeobject \spaf\simputils\models\Dateand\spaf\simputils\models\Timeresult offor_system
now returns the whole DateTime string value of UTC, not only the date or time component.
- Additionally have been added the properties for
- Implemented
\spaf\simputils\generic\BasicExecEnvHandlerExecution-Environment (aka stages),
besides that implemented\spaf\simputils\generic\BasicInitConfig::@$eeproperty that
automatically will be assigned duringPHP::init(), the object or params could be
adjusted in the incoming config, example:For now not much of documentation is provided, but you always can define your own$ic = PHP::init([ 'l10n' => 'AT', // 'ee' => new DummyExecEnvHandler(false, ee_name: 'TOO'), 'ee' => [ 'ee' => 'test3-local', 'is_hierarchical' => true, 'permitted_values' => [ 'test1', 'test2', 'test3', 'test4', ] ] ]); pd("{$ic->ee}", Boolean::to($ic->ee->is('test4-local')));
implementation of the class like\spaf\simputils\components\execenvs\DummyExecEnvHandler
to handle your Exec-Env/stages implementation! More documentation and example will follow. - Additionally implemented
\spaf\simputils\components\execenvs\DummyExecEnvHandler
which is a dummy handler that just returns the predefined value. Should not be used
on production. - Implemented
\spaf\simputils\exceptions\ExecEnvExceptionexception for Exec-Env cases - Implemented
\spaf\simputils\models\Box::popFromStart()and
\spaf\simputils\models\Box::popFromEnd()methods to get value from the box, return
and remove it from the box. - Implemented tests for:
- Exec-Env
- Box batch functionality
1.1.2
- Implemented
\spaf\simputils\basic\withfunctionality of a transactional style like
pythonwithcommand. Really useful for DB and other connection types.
1.1.1
- Implemented
\spaf\simputils\components\normalizers\BoxNormalizerTo normalize simple
arrays when assigned to Properties
1.1.0
Change-log 1.1.0
- Implemented
FS::require(),FS::include()andFS::data() - Implemented
PHP::listOfExecPhpFileExtensions(),PHP::listOfExecPhpMimeTypes() - Now array/box argument for
Fileconstructor is allowed (like forFS::locate()) - Added support of
FS::locate()alike array/box of path components forfl(),
FS::file()andFile. So nowfl(['part1', 'part2', 'file.txt'])will make a file
object with path: "{working-dir}/part1/part2/file.txt" - In
BasicInitConfigintroduced component-aware$allowed_data_dirsfor specifying
allowed data-dirs - Introduced new exceptions:
DataDirectoryIsNotAllowed,IPParsingException - Implemented the shortcut for the "InitConfig". Now instead of
$config = PHP::getInitConfig()you can use a shortcut$config = ic() - Fixed some of the logic related to "l10n" and "default_tz" more you can find here:
Nuances of l10n and default_tz - Implemented list of days of the week:
\spaf\simputils\DT::getListOfDaysOfWeek() - Implemented list of months:
\spaf\simputils\DT::getListOfMonths() - Incorporated all the previous minor-version patches
- To set the timezone for "DateTime" object now can be done by "strings" instead of
creation of "DateTimeZone" object every single time - Other minimal changes
- To set the timezone for "DateTime" object now can be done by "strings" instead of
- Implemented trait
\spaf\simputils\traits\ComparablesTraitwhich enables to implement
common set of comparing functionality (equalsTo,greaterThan,lessThan,
greaterThanEqual,lessThanEqual) and their shortcuts (e,gt,lt,
gte,lte). Currently used inVersionandIPv4models - Implemented
\spaf\simputils\models\IPv4and\spaf\simputils\models\IPv4Rangemodels
with minimal but nice functionality - Implemented
\spaf\simputils\models\UrlObjectmodel
and\spaf\simputils\models\urls\processors\HttpProtocolProcessor- The most of the stuff should work out of the box except lack
of "to punycode" conversion. Cyrillic and other non-latin domains are
not converted to punycode.
- The most of the stuff should work out of the box except lack
- Implemented
\spaf\simputils\System::localIp()that gets the local IP - Implemented shortcuts
url()for\spaf\simputils\models\UrlObjectmodel and
ip()for\spaf\simputils\models\IPv4 - Added
\spaf\simputils\components\normalizers\IPNormalizerproperty normalizer - Implementation of
\spaf\simputils\PHP::bro()method (\spaf\simputils\models\BoxRO)
which is basically "immutable Box" - Implemented shortcuts for getting
POSTandGETdata as bros (BoxRO). Please keep
in mind that they are immutable due to best-practices:\spaf\simputils\PHP::POST()\spaf\simputils\PHP::GET()
- Implemented
\spaf\simputils\PHP::objToNaiveString()method to generate simple/naive
object representation - Implemented some relevant tests
- Important: Functionality of the Box is slightly extended. Now you can re-define static
\spaf\simputils\models\Box::$default_separatorvariable value to string that should be used
during\spaf\simputils\models\Box::join()and\spaf\simputils\models\Box::implode()as
a separator by default (initially default is ", " as it was before).
Additionally you can specify\spaf\simputils\models\Box::$separatoron per object basis
that will be used in the object in case of "join" or "implode" without the first argument.
That functionality allows to create "path-ready" Box-arrays, that can by default
be automatically converted into a "unix" path.
\spaf\simputils\models\Box::$joined_to_strper object variable allows to define that
this Box-object needs to be converted in__toString()method
through\spaf\simputils\models\Box::join()method, which is really useful for "path-ready"
Box-arrays. See example here: Path-alike Box-array - For convenience create method-shortcut
to set Box as "Path-alike":\spaf\simputils\models\Box::pathAlike() - Added missing data-blocks for different locales
1.0.5
Tiny fix for "null" in normalizers/validators issue
1.0.4
Patch 1.0.4
Somehow the setTimezone update was not
`setTimezone()`` as well is chainable.
```php
$t = ts('previous monday 23:00', true)
->setTimezone('America/Los_Angeles');
```
1.0.3
Patch 1.0.3
Somehow the setTimezone update was not
`setTimezone()`` as well is chainable.
```php
$t = ts('previous monday 23:00', true)
->setTimezone('America/Los_Angeles');
```