{"id":45138941,"url":"https://github.com/hhpack/package","last_synced_at":"2026-02-20T00:30:26.592Z","repository":{"id":56984206,"uuid":"43628024","full_name":"hhpack/package","owner":"hhpack","description":"Package utility library for vendor","archived":false,"fork":false,"pushed_at":"2019-08-20T03:12:23.000Z","size":154,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-07T01:58:17.428Z","etag":null,"topics":["hacklang","hhvm","loader","selector","stream"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/hhpack.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-10-04T07:02:07.000Z","updated_at":"2019-08-20T03:09:52.000Z","dependencies_parsed_at":"2022-08-21T12:50:45.751Z","dependency_job_id":null,"html_url":"https://github.com/hhpack/package","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/hhpack/package","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhpack%2Fpackage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhpack%2Fpackage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhpack%2Fpackage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhpack%2Fpackage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hhpack","download_url":"https://codeload.github.com/hhpack/package/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hhpack%2Fpackage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29637407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T22:32:43.237Z","status":"ssl_error","status_checked_at":"2026-02-19T22:32:38.330Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["hacklang","hhvm","loader","selector","stream"],"created_at":"2026-02-20T00:30:25.952Z","updated_at":"2026-02-20T00:30:26.587Z","avatar_url":"https://github.com/hhpack.png","language":"Shell","readme":"package\n==============================\n\nPackage utility library for vendor.  \nEasily and quickly, and you can find a class or interface.\n\n[![Latest Stable Version](https://poser.pugx.org/hhpack/package/v/stable)](https://packagist.org/packages/hhpack/package)\n[![CircleCI](https://circleci.com/gh/hhpack/package/tree/master.svg?style=svg)](https://circleci.com/gh/hhpack/package/tree/master)\n[![Dependency Status](https://www.versioneye.com/user/projects/5610e428a193340015000009/badge.svg?style=flat)](https://www.versioneye.com/user/projects/5610e428a193340015000009)\n[![License](https://poser.pugx.org/hhpack/package/license)](https://packagist.org/packages/hhpack/package)\n\nBasic usage\n------------------------------\n\nFind the source file from the package.\n\n```hack\nuse HHPack\\Package\\VendorPackage;\n\n$sources = VendorPackage::fromItems([\n    Pair { 'package\\\\examples\\\\classes\\\\', realpath(__DIR__ . '/src') }\n])-\u003esources();\n\nforeach ($sources as $source) {\n\tvar_dump($source-\u003ename()); // /path/to/example.hh\n\tvar_dump($source-\u003edirectory()); // /path/to\n}\n```\n\nSelection of elements\n------------------------------\n\nYou can select the elements in the following function.\n\n* HHPack\\Package\\implementsInterface\n* HHPack\\Package\\subclassOf\n* HHPack\\Package\\classes\n* HHPack\\Package\\abstractClasses\n* HHPack\\Package\\traits\n* HHPack\\Package\\interfaces\n* HHPack\\Package\\instantiable\n* HHPack\\Package\\startsWith\n* HHPack\\Package\\endsWith\n\nIn the following we are looking for a interface and traits.\n\n```hack\nuse HHPack\\Package as package;\nuse HHPack\\Package\\VendorPackage;\n\n$interfaces = VendorPackage::fromItems([\n    Pair { 'Package\\\\Examples\\\\Classes\\\\', realpath(__DIR__ . '/src') }\n])-\u003eclasses(package\\interfaces());\n\nforeach ($interfaces as $interface) {\n    var_dump($interface-\u003ename()); // interface\n}\n\n$traits = VendorPackage::fromItems([\n    Pair { 'Package\\\\Examples\\\\Classes\\\\', realpath(__DIR__ . '/src') }\n])-\u003eclasses(package\\traits());\n\nforeach ($traits as $trait) {\n    var_dump($trait-\u003egetName()); // trait\n}\n```\n\nInstantiation of class\n------------------------------\n\nGet an instance from the source files\n\n```hack\nuse HHPack\\Package\\VendorPackage;\n\n$instances = VendorPackage::fromItems([\n    Pair { 'Package\\\\Examples\\\\Classes\\\\', realpath(__DIR__ . '/src') }\n])-\u003eclasses()-\u003emap(($class) ==\u003e $class-\u003einstantiate());\n\nforeach ($instances as $instance) {\n    var_dump($instance);\n}\n```\n\nPipeline of stream\n------------------------------\n\nYou can build a pipeline.  \nYou can achieve when implement the interface **Middleware** and **Stream**.  \n\nPlease look at the **example/pipeline.hh** for details.\n\n```hack\nuse HHPack\\Package\\VendorPackage;\nuse HHPack\\Package\\Examples\\Classes\\FileStatTransformer;\nuse HHPack\\Package\\Examples\\Classes\\FileStatOutput;\n\n$package = VendorPackage::fromItems([\n    Pair { 'Package\\\\Examples\\\\Classes\\\\', realpath(__DIR__ . '/src') }\n]);\n\n$package-\u003esources()\n    -\u003epipeTo(new FileStatTransformer())\n    -\u003epipeTo(new FileStatOutput());\n```\n\nRun the test\n------------------------------\n\n\tcomposer install\n\tcomposer test\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhhpack%2Fpackage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhhpack%2Fpackage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhhpack%2Fpackage/lists"}