{"id":21056062,"url":"https://github.com/xp-framework/core","last_synced_at":"2025-05-15T23:32:53.602Z","repository":{"id":459877,"uuid":"14260565","full_name":"xp-framework/core","owner":"xp-framework","description":"The XP Framework is an all-purpose, object oriented PHP framework.","archived":false,"fork":false,"pushed_at":"2025-04-21T08:10:34.000Z","size":48465,"stargazers_count":19,"open_issues_count":3,"forks_count":6,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-21T09:24:50.493Z","etag":null,"topics":["annotations","date-time","enums","generics","io","php","php7","php8","php8-features","reflection","streams","type-system","unicode","xp-framework"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xp-framework.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2013-11-09T16:37:32.000Z","updated_at":"2025-04-21T08:10:37.000Z","dependencies_parsed_at":"2024-06-18T15:30:31.316Z","dependency_job_id":"1d2dd7dd-c60c-4466-b7cf-6237e6bdb655","html_url":"https://github.com/xp-framework/core","commit_stats":{"total_commits":20673,"total_committers":43,"mean_commits":480.7674418604651,"dds":0.439365355778068,"last_synced_commit":"6aa63786fe2563da73cc067816f68c981e194fab"},"previous_names":[],"tags_count":166,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-framework","download_url":"https://codeload.github.com/xp-framework/core/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442409,"owners_count":22071864,"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":["annotations","date-time","enums","generics","io","php","php7","php8","php8-features","reflection","streams","type-system","unicode","xp-framework"],"created_at":"2024-11-19T16:48:42.635Z","updated_at":"2025-05-15T23:32:53.566Z","avatar_url":"https://github.com/xp-framework.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"XP Framework Core\n=================\n[![Build status on GitHub](https://github.com/xp-framework/core/workflows/Tests/badge.svg)](https://github.com/xp-framework/core/actions)\n[![Build status on AppVeyor](https://ci.appveyor.com/api/projects/status/bb9gkkq1o7f6m2ns?svg=true)](https://ci.appveyor.com/project/thekid/core)\n[![BSD License](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENSE.md)\n[![Requires PHP 7.4+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_4plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-framework/core/version.svg)](https://packagist.org/packages/xp-framework/core)\n\nThis is the XP Framework's development checkout. \n\nInstallation\n------------\nIf you just want to use the XP Framework, grab a release using `composer require xp-framework/core`. If you wish to use this development checkout, clone this repository instead.\n\n### Runners\nThe entry point for software written in the XP Framework is not the PHP\ninterpreter's CLI / web server API but either a command line runner or\na specialized *web* entry point. These runners can be installed by using\nthe following one-liner:\n\n```sh\n$ cd ~/bin\n$ curl -sSL https://baltocdn.com/xp-framework/xp-runners/distribution/downloads/i/installer/setup-9.1.0.sh | sh\n```\n\n### Using it\nTo use the the XP Framework development checkout, put the following in your `~/bin/xp.ini` file:\n\n```ini\nuse=/path/to/xp/core\n```\n\nFinally, start `xp -v` to see it working:\n\n```sh\n$ xp -v\nXP 12.4.1-dev { PHP/8.4.6 \u0026 Zend/4.4.6 } @ Windows NT SURFACE 10.0 build 26100 (Windows 11) AMD64\nCopyright (c) 2001-2025 the XP group\nFileSystemCL\u003c./src/main/php\u003e\nFileSystemCL\u003c./src/test/php\u003e\nFileSystemCL\u003c./src/main/resources\u003e\nFileSystemCL\u003c./src/test/resources\u003e\nFileSystemCL\u003c.\u003e\n```\n\nBasic usage\n-----------\nThe XP Framework runs scripts or classes.\n\n### Hello World\nSave the following sourcecode to a file called `ageindays.script.php`:\n\n```php\n\u003c?php namespace examples;\n\nuse util\\{Date, Dates};\nuse util\\cmd\\Console;\n\n$span= Dates::diff(new Date($argv[1]), Date::now());\nConsole::writeLine('Hey, you are ', $span-\u003egetDays(), ' days old');\n```\n\nNow run it:\n\n```sh\n$ xp ageindays.script.php 1977-12-14\nHey, you are 16015 days old\n```\n\nAlternatively, you can put this code inside a class and give it a static *main* method. This way, you can use features like inheritance, trait inclusion etcetera. This time, save the code to a file called `AgeInDays.class.php`.\n\n```php\n\u003c?php\n\nuse util\\{Date, Dates};\nuse util\\cmd\\Console;\n\nclass AgeInDays {\n\n  public static function main(array $args): int {\n    $span= Dates::diff(new Date($args[0]), Date::now());\n    Console::writeLine('Hey, you are ', $span-\u003egetDays(), ' days old');\n    return 0;\n  }\n}\n```\n\n*Note the arguments have shifted by one: If you want the class' name, simply use `self::class`!*\n\n```sh\n$ xp AgeInDays 1977-12-14\nHey, you are 16015 days old\n```\n\nContributing\n------------\nTo contribute, use the GitHub way - fork, hack, and submit a pull request! :octocat:\n\n**Enjoy!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-framework%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-framework%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-framework%2Fcore/lists"}