{"id":37006656,"url":"https://github.com/fuko-php/source","last_synced_at":"2026-01-14T00:45:46.721Z","repository":{"id":62507881,"uuid":"374905151","full_name":"fuko-php/source","owner":"fuko-php","description":"Extracts chunks of source code identified by code references, e.g. filename + line","archived":false,"fork":false,"pushed_at":"2021-06-08T09:10:40.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-16T19:04:11.249Z","etag":null,"topics":["fuko","fuko-php","source","source-code"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/fuko-php/source","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/fuko-php.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":"2021-06-08T06:27:55.000Z","updated_at":"2021-06-08T09:14:05.000Z","dependencies_parsed_at":"2022-11-02T12:46:00.459Z","dependency_job_id":null,"html_url":"https://github.com/fuko-php/source","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fuko-php/source","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuko-php%2Fsource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuko-php%2Fsource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuko-php%2Fsource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuko-php%2Fsource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuko-php","download_url":"https://codeload.github.com/fuko-php/source/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuko-php%2Fsource/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["fuko","fuko-php","source","source-code"],"created_at":"2026-01-14T00:45:46.091Z","updated_at":"2026-01-14T00:45:46.716Z","avatar_url":"https://github.com/fuko-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fuko\\\\Source [![GitHub license](https://img.shields.io/github/license/fuko-php/source.svg)](https://github.com/fuko-php/source/blob/master/LICENSE) [![Latest Version](http://img.shields.io/packagist/v/fuko-php/source.svg)](https://packagist.org/packages/fuko-php/source)\n\n**Fuko\\\\Source** is a small PHP library that helps you to extracts chunks of\nsource code identified by code references, e.g. filename + line.\n\nIt is really simple to use. Imagine you want to extract a piece of code, and\nyou know what source code line exactly you want to reference: for example\n`/var/www/html/index.php` at line 17. You must first create a new `\\Fuko\\Source\\Code`\nobject, and then call the `getLinesAt()` method:\n\n```php\ninclude __DIR__ . '/vendor/autoload.php';\n\n$source = new \\Fuko\\Source\\Code('/var/www/html/index.php');\nprint_r($source-\u003egetLinesAt(17));\n/*\nArray\n(\n    [14] =\u003e Illuminate\\Support\\ClassLoader::register();\n    [15] =\u003e Illuminate\\Support\\ClassLoader::addDirectories(array(CLASS_DIR,CONTROLLERS,CONTROLLERS.'Middleware/', MODELS, CONTROLLERS.'Admin/'));\n    [16] =\u003e\n    [17] =\u003e $FileLoader = new FileLoader(new Filesystem,  RESOURCES.'lang');\n    [18] =\u003e $translator = new Translator($FileLoader, 'en');\n    [19] =\u003e $Container = new Container();\n    [20] =\u003e $validation = new Factory($translator, $Container);\n)\n*/\n\n```\n\nBy default there are 7 lines of code (LOCs) returned, but you can specify a\ndifferent number in the range of 1 to 20 (as defined in `\\Fuko\\Source\\Code::LOC_MAX`):\n```php\ninclude __DIR__ . '/vendor/autoload.php';\n\n$source = new \\Fuko\\Source\\Code('/var/www/html/index.php');\nprint_r($source-\u003egetLinesAt(17, 1));\n/*\nArray\n(\n    [17] =\u003e $FileLoader = new FileLoader(new Filesystem,  RESOURCES.'lang');\n)\n*/\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuko-php%2Fsource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuko-php%2Fsource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuko-php%2Fsource/lists"}