{"id":17272817,"url":"https://github.com/marcioalmada/xray","last_synced_at":"2025-09-09T14:46:22.116Z","repository":{"id":62523704,"uuid":"68958225","full_name":"marcioAlmada/xray","owner":"marcioAlmada","description":"X-Ray - PHP Engine compiler hook API (new)","archived":false,"fork":false,"pushed_at":"2018-07-01T20:03:56.000Z","size":11,"stargazers_count":20,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T08:21:45.761Z","etag":null,"topics":["php-extension","preprocessor"],"latest_commit_sha":null,"homepage":"https://github.com/marcioAlmada/xray","language":"C","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/marcioAlmada.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":"2016-09-22T20:08:43.000Z","updated_at":"2023-05-26T11:05:32.000Z","dependencies_parsed_at":"2022-11-02T14:46:26.909Z","dependency_job_id":null,"html_url":"https://github.com/marcioAlmada/xray","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marcioAlmada/xray","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcioAlmada%2Fxray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcioAlmada%2Fxray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcioAlmada%2Fxray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcioAlmada%2Fxray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcioAlmada","download_url":"https://codeload.github.com/marcioAlmada/xray/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcioAlmada%2Fxray/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274314613,"owners_count":25262694,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["php-extension","preprocessor"],"created_at":"2024-10-15T08:49:34.223Z","updated_at":"2025-09-09T14:46:22.063Z","avatar_url":"https://github.com/marcioAlmada.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"X-Ray\n=====\n[![Build Status](https://travis-ci.org/marcioAlmada/xray.svg?branch=master)](https://travis-ci.org/marcioAlmada/xray)\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/marcioAlmada/xray.svg)](http://isitmaintained.com/project/marcioAlmada/xray \"Percentage of issues still open\")\n[![License](https://poser.pugx.org/yay/yay/license.png)](https://github.com/marcioAlmada/xray)\n\n**X-Ray** allows declaration of *Zend Engine* `include()`, `require()` and `eval()` hooks.:\n\n## How to use:\n\n```php\n// adding a compiler hook:\nxray\\set_compiler_hook(function(string $source, string $filename = null) : string {\n    if ($filename === null)  {\n        // here we intercept source included through eval()\n        // do transformations on $source and return the new $source to be included        \n    }\n    else {\n        // here we intercept source included from a *.php file\n        // do transformations on $source and return the new $source to be included\n    }\n});\n\n// removing the compiler hook:\n$hook = xray\\restore_compiler_hook();\n\n```\n\n## How to install:\n\n```\ngit clone https://github.com/marcioAlmada/xray\ncd xray\nphpize\n./configure\nmake\nsudo make install\n```\nFinally add `extension=xray.so` to your `/etc/php.ini`\n\n## Windows Support\n\nPull requests welcome. Anyone?\n\n## Why?\n\nA compiler hook API was needed in order to have a decent infrastructure for [YAY](https://github.com/marcioAlmada/yay).\nBut this ended up as a more general purpose internal framework so [others projects](https://github.com/phplang/phack) can benefit too.\n\n## Copyright\n\nCopyright (c) 2015-* Márcio Almada. Distributed under the terms of an MIT-style license.\nSee LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcioalmada%2Fxray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcioalmada%2Fxray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcioalmada%2Fxray/lists"}