- Implemented extensive PHPDOC with examples to
\spaf\simputils\basic(in progress) - Fixed ticket #116 (Weird bug of "tz" on DateTime)
- Fixed bug with incorrect interpretation of TZ parameter
in
\spaf\simputils\DT::normalize. Previouslyfalseandtrueparams for$tzwere returning incorrect values. - #144 | Added Renderer functionality
\spaf\simputils\traits\StaticRendererTrait- Trait for static helpers to enable rendering features on them\spaf\simputils\traits\BaseHtmlTrait- Minimal HTML related methods and renderers trait\spaf\simputils\Attrs- PHP Attributes related helper\spaf\simputils\Html- Minimal HTML helper that can be used as a base for custom HTML helper- You can try out a simple renderer:
use spaf\simputils\Html; use function spaf\simputils\basic\now; Html::render(now());
- Fixed issue with url "params" when the params with empty value are stripped out.
- Added models
\spaf\simputils\models\Passwordand\spaf\simputils\models\Secret. Documentation: Passwords and Secrets explained - Added some documentation and examples into README.md
- Improved composer scripts for the framework development and analysis/testing
- Fixed some minimal amount of mess (Cyclomatic Complexity)
- Added
\spaf\simputils\PHP::currentUrl()method - Added
\spaf\simputils\attributes\DebugHide::$default_placeholderfield for default placeholder instead of****- Usage on secrets and passwords will cooperate with those objects in a better way, displaying proper "placeholder"
- Added
\spaf\simputils\components\normalizers\VersionNormalizernormalizer - Added Canadian locale
CA - Files now can be accessed through
withfunctionality- Added
$in_memory_typeparameter forFileconstructor - Added integer support for
Fileconstructor to provide File Descriptor as integer instead of file path (limited to runtime)
- Added
- Added a file processor for:
\spaf\simputils\models\files\apps\PHPFileProcessor(basically prevent from displaying as text) - Improved
\spaf\simputils\models\files\apps\CsvProcessorand\spaf\simputils\models\files\apps\settings\CsvSettings - Improved
Box::join()/Box::impload()functionality- Added
apply()method "params":stretcher, value_wrap, key_wrap- Added
paramsAlike()(URL params) method - Added
htmlAttrAlike()(HTML attributes) method - Added
stretched()method
- Added
- Added
- Some improvements of Url Objects
- A bit more testing coverage is added
- Some more little stuff could be added or polished
- Fixed the ".env" autoload respect of the "working_dir" which was not working
- 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\Dateand\spaf\simputils\models\Timefrom the targetDateTimeobject \spaf\simputils\models\Dateand\spaf\simputils\models\Timeresult offor_systemnow 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 implementation of the class like$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')));
\spaf\simputils\components\execenvs\DummyExecEnvHandlerto handle your Exec-Env/stages implementation! More documentation and example will follow. - Additionally implemented
\spaf\simputils\components\execenvs\DummyExecEnvHandlerwhich 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
- Implemented
\spaf\simputils\basic\withfunctionality of a transactional style like pythonwithcommand. Really useful for DB and other connection types.
- Implemented
\spaf\simputils\components\normalizers\BoxNormalizerTo normalize simple arrays when assigned to Properties
- 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
- 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.
- Implemented
\spaf\simputils\System::localIp()that gets the local IP - Implemented shortcuts
url()for\spaf\simputils\models\UrlObjectmodel andip()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