{"id":18879723,"url":"https://github.com/loilo/native-open","last_synced_at":"2026-02-20T04:30:19.207Z","repository":{"id":62518838,"uuid":"203133001","full_name":"loilo/native-open","owner":"loilo","description":"Open a file/URL/app from inside PHP, cross-platform","archived":false,"fork":false,"pushed_at":"2021-01-09T11:50:19.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T10:17:03.525Z","etag":null,"topics":[],"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/loilo.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":"2019-08-19T08:40:45.000Z","updated_at":"2022-10-02T02:23:05.000Z","dependencies_parsed_at":"2022-11-02T13:18:17.292Z","dependency_job_id":null,"html_url":"https://github.com/loilo/native-open","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loilo%2Fnative-open","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loilo%2Fnative-open/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loilo%2Fnative-open/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loilo%2Fnative-open/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loilo","download_url":"https://codeload.github.com/loilo/native-open/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239841742,"owners_count":19705981,"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":[],"created_at":"2024-11-08T06:39:04.251Z","updated_at":"2026-02-20T04:30:19.136Z","avatar_url":"https://github.com/loilo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg alt=\"native-open logo: A mouse pointer, presented as a hand with extended index finger, floating above a colored circle representing an interactive area.\" src=\"native-open.svg\" width=\"200\" height=\"200\"\u003e\n\u003c/div\u003e\n\n# Native Open\n\u003c!-- [![Test status on Travis](https://badgen.net/travis/loilo/native-open?label=tests\u0026icon=travis)](https://travis-ci.org/loilo/native-open) --\u003e\n\u003c!-- [![Version on packagist.org](https://badgen.net/packagist/v/loilo/native-open)](https://packagist.org/packages/loilo/native-open) --\u003e\n\nThis package enables you to open a file/URL/app from inside PHP, cross-platform.\n\nNote that it opens the app on *the machine running the PHP code*, so you can *not* use it to open apps on behalf of your website's users.\n\n\u003e Most of the credit for this package goes to [Sindre Sorhus](https://sindresorhus.com) as this is mostly a port of his [`open`](https://www.npmjs.com/package/open) package for Node.js.\n\n## Installation\n```bash\ncomposer require loilo/native-open\n```\n\n## Usage\n```php\nuse Loilo\\NativeOpen\\NativeOpen;\n\n// Opens the image in the default image viewer\nNativeOpen::open('picture.jpg'); \n\n// Opens the URL in the default browser\nNativeOpen::open('https://github.com/loilo');\n\n// Opens the URL in a specified browser\nNativeOpen::open('https://github.com/loilo', 'firefox');\n\n// Specify app arguments\nNativeOpen::open('https://github.com/loilo', 'google chrome', ['--incognito']);\n```\n\nThis package uses the `open` command on macOS, `start` on Windows and `xdg-open` on other platforms. Note that, if you define a specific app to open a target in, the app name is platform dependent. Don't hard code it in reusable modules. For example, Chrome is `google chrome` on macOS, `google-chrome` on Linux and `chrome` on Windows.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floilo%2Fnative-open","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floilo%2Fnative-open","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floilo%2Fnative-open/lists"}