{"id":25363471,"url":"https://github.com/vitexsoftware/php-ease-core","last_synced_at":"2025-10-30T01:31:51.560Z","repository":{"id":42383445,"uuid":"165311512","full_name":"VitexSoftware/php-ease-core","owner":"VitexSoftware","description":"EasePHP Core Library","archived":false,"fork":false,"pushed_at":"2025-02-10T17:44:15.000Z","size":1415,"stargazers_count":5,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-10T18:34:21.995Z","etag":null,"topics":["ease","php-framework","php-library"],"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/VitexSoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":"VitexSoftware","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-01-11T21:21:04.000Z","updated_at":"2025-02-10T17:44:19.000Z","dependencies_parsed_at":"2023-09-23T15:05:36.488Z","dependency_job_id":"6e97de1f-3dcf-4b89-be18-57792bd00406","html_url":"https://github.com/VitexSoftware/php-ease-core","commit_stats":{"total_commits":388,"total_committers":6,"mean_commits":64.66666666666667,"dds":0.05670103092783507,"last_synced_commit":"7b0b2ab62da5943fd618318e61963559cef42d25"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VitexSoftware%2Fphp-ease-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VitexSoftware%2Fphp-ease-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VitexSoftware%2Fphp-ease-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VitexSoftware%2Fphp-ease-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VitexSoftware","download_url":"https://codeload.github.com/VitexSoftware/php-ease-core/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238920710,"owners_count":19552672,"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":["ease","php-framework","php-library"],"created_at":"2025-02-14T22:32:49.167Z","updated_at":"2025-10-30T01:31:51.555Z","avatar_url":"https://github.com/VitexSoftware.png","language":"PHP","readme":"![EasePHP Framework Logo](ease-core-social-preview.png?raw=true \"Project Logo\")\n\nEasePHP Framework Core\n======================\n\nObject oriented PHP Framework for easy\u0026fast writing small/middle sized apps.\n\n[![Latest Version](https://img.shields.io/github/release/VitexSoftware/ease-core.svg?style=flat-square)](https://github.com/VitexSoftware/ease-core/releases)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/VitexSoftware/ease-core/blob/master/LICENSE)\n[![Code Coverage](https://scrutinizer-ci.com/g/VitexSoftware/ease-core/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/VitexSoftware/ease-core/?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/VitexSoftware/ease-core/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/VitexSoftware/ease-core/?branch=master)\n[![Build Status](https://scrutinizer-ci.com/g/VitexSoftware/ease-core/badges/build.png?b=master)](https://scrutinizer-ci.com/g/VitexSoftware/ease-core/build-status/master)\n[![Code Intelligence Status](https://scrutinizer-ci.com/g/VitexSoftware/ease-core/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/code-intelligence)\n[![Total Downloads](https://img.shields.io/packagist/dt/vitexsoftware/ease-core.svg?style=flat-square)](https://packagist.org/packages/vitexsoftware/ease-core)\n[![Latest stable](https://img.shields.io/packagist/v/vitexsoftware/ease-core.svg?style=flat-square)](https://packagist.org/packages/vitexsoftware/ease-core)\n\n![PHPUnit](https://github.com/VitexSoftware/php-ease-core/workflows/PHPUnit/badge.svg)\n![Ubuntu Packaging](https://github.com/VitexSoftware/php-ease-core/workflows/Ubuntu%20Packaging/badge.svg)\n\n[![Latest Stable Version](https://poser.pugx.org/vitexsoftware/ease-core/v/stable)](https://packagist.org/packages/vitexsoftware/ease-core)\n[![Total Downloads](https://poser.pugx.org/vitexsoftware/ease-core/downloads)](https://packagist.org/packages/vitexsoftware/ease-core)\n[![Latest Unstable Version](https://poser.pugx.org/vitexsoftware/ease-core/v/unstable)](https://packagist.org/packages/vitexsoftware/ease-core)\n[![License](https://poser.pugx.org/vitexsoftware/ease-core/license)](https://packagist.org/packages/vitexsoftware/ease-core)\n[![Monthly Downloads](https://poser.pugx.org/vitexsoftware/ease-core/d/monthly)](https://packagist.org/packages/vitexsoftware/ease-core)\n[![Daily Downloads](https://poser.pugx.org/vitexsoftware/ease-core/d/daily)](https://packagist.org/packages/vitexsoftware/ease-core)\n\n\n---\n\nOverview\n--------\n\nEasePHP Framework Core is a small, dependency-light runtime library for building CLI and web applications in PHP. It provides:\n- a set of base classes for your domain objects (Atom ➝ Molecule ➝ Sand ➝ Brick),\n- a flexible, multi-sink logging pipeline (memory, console, file, syslog, std, eventlog),\n- a simple but powerful configuration layer (constants/ENV/.env/.json) via Ease\\\\Shared,\n- gettext-based internationalization helpers (Ease\\\\Locale),\n- user abstractions (Ease\\\\Anonym, Ease\\\\User), and\n- pragmatic utilities (Ease\\\\Functions) and a Mailer built on PEAR Mail/Mail_mime.\n\nWorks standalone or as the core of the broader EasePHP ecosystem. Autoloading follows PSR-4:\n- \"Ease\\\\\" ➝ src/Ease\n- \"Ease\\\\Logger\\\\\" ➝ src/Ease/Logger\n\nKey features\n------------\n- Base object model\n  - Atom: minimal base with object naming and draw().\n  - Molecule: property setup helpers from options/ENV/constants.\n  - Sand: data holder with typed helpers; integrates logging via trait.\n  - Brick: adds record identity (id/name/array/reuse) through recordkey trait.\n- Logging\n  - Regent aggregator dispatches to memory/console/file/syslog/std/eventlog; configure via EASE_LOGGER (pipe-separated).\n  - Console logger features internationalized date formatting with graceful fallback for maximum reliability.\n  - Comprehensive error handling ensures logging never crashes your application.\n- Internationalization (i18n)\n  - Gettext domain binding, locale selection (request/session/browser/ENV), and helper APIs.\n- Configuration\n  - Shared::cfg reads constants then ENV; loadConfig supports .json and .env.\n- Users and identity\n  - Anonymous and User implementations with login/password helpers and Gravatar.\n- Utilities\n  - URL helpers, transliteration, AES-256-CBC encrypt/decrypt, randoms, human-readable sizes, UUIDv4, JSON/serialization checks, namespace class loader, etc.\n\nRequirements\n------------\n- PHP \u003e= 7.0 (tested up to PHP 8.4)\n- ext-intl (optional but recommended for internationalized date formatting)\n- PEAR packages: pear/mail, pear/mail_mime (Mailer)\n\n**Note:** The framework gracefully handles missing or misconfigured internationalization extensions.\n\nQuick start\n-----------\n```php\n\u003c?php\nrequire __DIR__.'/vendor/autoload.php';\n\n// Minimal config\ndefine('EASE_APPNAME', 'MyApp');\n// Send logs to console and syslog (combine with \"|\")\ndefine('EASE_LOGGER', 'console|syslog');\n\n$logger = new \\Ease\\Sand();\n$logger-\u003eaddStatusMessage('MyApp started', 'info');\n\n// i18n (optional): bind domain in ./i18n or /usr/share/locale\nnew \\Ease\\Locale('en_US', './i18n', 'php-vitexsoftware-ease-core');\n$logger-\u003eaddStatusMessage(_('Ready to work'), 'success');\n\n// Mail (optional): configure sender via constants or ENV\n// define('EASE_FROM', 'no-reply@example.com');\n// define('EASE_SMTP', json_encode([\n//     'host' =\u003e 'smtp.example.com', 'auth' =\u003e true, 'username' =\u003e '...','password' =\u003e '...'\n// ]));\n// $mailer = new \\Ease\\Mailer('user@example.com', 'Hello', 'Message body');\n// $mailer-\u003esend();\n```\n\nConfiguration\n-------------\nCommon ways to configure EaseCore:\n\n- PHP constants (highest precedence)\n\n  ```php\n  \u003c?php\n  define('EASE_APPNAME', 'MyApp');\n  define('EASE_LOGGER', 'console|syslog');\n  define('EASE_FROM', 'no-reply@example.com');\n  define('EASE_SMTP', json_encode([\n      'host' =\u003e 'smtp.example.com',\n      'auth' =\u003e true,\n      'username' =\u003e 'smtp-user',\n      'password' =\u003e 'secret',\n  ]));\n  ```\n\n- Environment variables\n\n  ```bash\n  export EASE_APPNAME=MyApp\n  export EASE_LOGGER=console|syslog\n  export EASE_FROM=no-reply@example.com\n  export EASE_SMTP='{\"host\":\"smtp.example.com\",\"auth\":true,\"username\":\"smtp-user\",\"password\":\"secret\"}'\n  ```\n\n- .env or JSON file\n\n  ```php\n  \u003c?php\n  // Load .env and define UPPERCASE constants from it:\n  \\Ease\\Shared::singleton()-\u003eloadConfig(__DIR__.'/.env', true);\n  // Or load JSON without defining constants (values accessible via Shared::cfg()):\n  \\Ease\\Shared::singleton()-\u003eloadConfig(__DIR__.'/config.json', false);\n  ```\n\nFrequently used keys: EASE_APPNAME, EASE_LOGGER, EASE_FROM, EASE_SMTP, LOG_DIRECTORY, LOG_FLAG, LOG_FACILITY.\n\nInstallation\n============\n\n\nComposer:\n---------\n    composer require vitexsoftware/ease-core\n\n\nDocker:\n-------\n\nThis repository includes a minimal Docker build primarily for packaging/distribution (it places the library under /usr/share/php/Ease*). For application development, prefer installing via Composer.\n\n- Build image locally:\n\n    make dimage\n\n- Note: The image is not intended as a full runtime base; it contains the library files for packaging purposes.\n\n\nFramework Constants\n===================\n\n  * EASE_APPNAME  - common name of application. Mainly used in logs. (APP_NAME is also recoginsed)\n  * EASE_LOGGER   - one of memory,console,file,syslog,email,std,eventlog or combination eg. \"console|syslog\"\n  * EASE_EMAILTO  - recipient email address for Ease/Logger/ToMail\n  * EASE_SMTP     - Custom [SMTP Settings](https://pear.php.net/manual/en/package.mail.mail.factory.php) (JSON Encoded) \n  * EASE_FROM     - Sent mail sender address\n  * LOG_DIRECTORY - destination for ToFile logger\n  * LOG_OPTION    - syslog option argument\n  * LOG_FACILITY  - syslog facility argument\n\n\n\nLogging\n-------\n\n You can use any combination of this logging modules:\n\n  - memory     - log to array in memory\n  - console    - log to ansi sequence capable console with internationalized timestamps\n  - file       - log to specified file\n  - syslog     - log to linux syslog service\n  - email      - send all messages to constant('EASE_EMAILTO') at end\n  - std        - write messages to stdout/stderr\n  - eventlog   - log to Windows eventlog\n\n**Reliability Features:**\n- Console logger automatically falls back to standard PHP date formatting if IntlDateFormatter fails\n- Comprehensive error handling prevents logging failures from crashing your application\n- All loggers are extensively tested with edge cases and error scenarios \n\n  ```php\n    define('EASE_LOGGER', 'console|syslog');\n    $logger = new \\Ease\\Sand();\n    $logger-\u003eaddStatusMessage('Error Message', 'error');\n  ```\n\n\nTesting\n-------\n\nRun the PHPUnit test suite locally:\n\n```\ncomposer install\nmake phpunit\n```\n\nWhen installed from the Debian dev package, tests (including i18n assets) can be executed with:\n\n```\nphpunit --bootstrap /usr/share/php/EaseCore/Test/Bootstrap.php \\\n  --configuration /usr/share/php/EaseCore/Test/phpunit.xml\n```\n\nBuilding\n--------\n\nSimply run **make deb**\n\nRecent Updates\n==============\n\n### Version 1.49.1 (October 2025)\n\n**Logger Reliability Improvements:**\n- **Fixed IntlDateFormatter Fatal Error**: Resolved `\"Found unconstructed IntlDateFormatter\"` crashes in console logger\n- **Graceful Fallback**: Console logger now automatically falls back to standard PHP date formatting when internationalization fails\n- **Enhanced Error Handling**: Added comprehensive exception handling for `ValueError` and `Error` cases\n- **Improved Type Safety**: Full PHPStan level 8 compliance with proper type annotations\n- **Extended Test Coverage**: Added tests for edge cases including invalid locales, null values, and error scenarios\n\n**Documentation Updates:**\n- Updated PHPDoc comments from Czech to English\n- Added detailed method and property documentation\n- Enhanced code examples and usage patterns\n\nLinks\n=====\n\nHomepage: https://www.vitexsoftware.cz/ease.php\n\nGitHub: https://github.com/VitexSoftware/ease-core\n\nphpDocumentor: http://vitexsoftware.cz/php-ease-core/\n\n","funding_links":["https://patreon.com/VitexSoftware"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitexsoftware%2Fphp-ease-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitexsoftware%2Fphp-ease-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitexsoftware%2Fphp-ease-core/lists"}