{"id":18407539,"url":"https://github.com/simplecomplex/php-utils","last_synced_at":"2025-10-19T11:42:30.517Z","repository":{"id":57051277,"uuid":"92947439","full_name":"simplecomplex/php-utils","owner":"simplecomplex","description":null,"archived":false,"fork":false,"pushed_at":"2020-07-03T11:12:51.000Z","size":284,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T21:14:13.020Z","etag":null,"topics":["cli","dependency-injection-container","php","php7","psr"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simplecomplex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-31T13:18:39.000Z","updated_at":"2022-02-12T08:30:31.000Z","dependencies_parsed_at":"2022-08-24T03:41:02.048Z","dependency_job_id":null,"html_url":"https://github.com/simplecomplex/php-utils","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplecomplex%2Fphp-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplecomplex%2Fphp-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplecomplex%2Fphp-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplecomplex%2Fphp-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplecomplex","download_url":"https://codeload.github.com/simplecomplex/php-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631682,"owners_count":21136562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","dependency-injection-container","php","php7","psr"],"created_at":"2024-11-06T03:14:25.820Z","updated_at":"2025-10-19T11:42:25.483Z","avatar_url":"https://github.com/simplecomplex.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## (PHP) Utils ##\n\n### Main features ###\n\n#### Dependency injection container abstraction ####\n\nAs [Wikipedia](https://en.wikipedia.org/wiki/Dependency_injection#Disadvantages) sums it up:\n\u003e Ironically, dependency injection can encourage dependence on a dependency injection framework.\n\n**``` Dependency ```** is a simple tool for mitigating dependency of a particular injection container.  \nWraps a [PSR-11](https://github.com/container-interop/fig-standards/blob/container-configuration/proposed/container.md)\nor [Pimple](http://pimple.sensiolabs.org) container or creates it's own lightweight PSR-11 container.\n\n#### PHP CLI (command line/console) made easy ####\n\n**``` CliCommand ```** + **``` CliCommandInterface ```**  \nspecify a simple way of defining PHP CLI commands, and auto-generate --help output.\n\n**``` CliEnvironment ```** \n\n- resolves CLI input arguments and options\n- maps to a ``` CliCommand ``` and executes it\n- lists --help of all defined commands\n- finds document root\n\n##### Utils' own CLI commands #####\n\n```bash\n# List all commands in the system, and their providers.\nphp cli.php -h\n\n# One command's help.\nphp cli.php utils-xxx -h\n\n# (RISKY) Execute included PHP script.\nphp cli.php utils-execute include-file\n```\n\n#### Time ####\n\n**``` Time ```** extends the native DateTime class to fix shortcomings and defects,  \nand provide more, simpler and safer getters and setters.\n\nFeatures:\n * is stringable (sic!), to ISO-8601\n * JSON serializes to string ISO-8601 with timezone marker\n * freezable\n * enhanced timezone awareness\n * diff (diffConstant, that is) works correctly across differing timezones\n * simpler and safer getters and setters\n \nIt's inspired by Javascript's Date class, and secures better Javascript interoperability  \nby stresssing and facilitating timezone awareness,  and by JSON serializing to ISO-8601 timestamp string;  \n_not_ a phoney Javascript object representing a PHP DateTime's inner properties. \n\n#### Explorable ####\n\nThe abstract **``` Explorable ```** class provides simple means for making protected members of an object readable,  \nand optionally mutable via dedicated methods.\n\n#### Odds and ends ####\n\n**``` Unicode ```** abstracts mbstring.\n\n**``` Sanitize ```** delivers basic string sanitizers and converters.\n\n**``` PathList ```** hides the complexity of using FilesystemIterators.\n\n**``` Utils ```** parses ini strings/files, and delivers a range of other handy methods.\n\n**``` Bootstrap::prepareDependencies() ```** for easy dependency setup.  \n\u003csub\u003eNB: Bootstrap::prepareDependencies() requires packages not listed among composer requirements:  \n[Cache](https://github.com/simplecomplex/php-cache),\n[Config](https://github.com/simplecomplex/php-config),\n(optional) [JsonLog](https://github.com/simplecomplex/php-jsonlog),\n[Inspect](https://github.com/simplecomplex/inspect),\n[Locale](https://github.com/simplecomplex/php-locale),\n[Validate](https://github.com/simplecomplex/php-validate).\n\u003c/sub\u003e\n\n### Requirements ###\n\n- PHP \u003e=7.0\n- [PSR-11 Container](https://github.com/php-fig/container)\n- [PSR-3 Log](https://github.com/php-fig/log)\n\n#### Development requirements ####\n- [PHPUnit](https://github.com/sebastianbergmann/phpunit)\n\n#### Suggestions ####\n- PHP mbstring extension\u003c!-- - PHP intl extension --\u003e\n- [SimpleComplex Inspect](https://github.com/simplecomplex/inspect)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplecomplex%2Fphp-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplecomplex%2Fphp-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplecomplex%2Fphp-utils/lists"}