{"id":16824874,"url":"https://github.com/tomnomnom/phpwol","last_synced_at":"2025-04-11T03:21:45.804Z","repository":{"id":6993883,"uuid":"8257756","full_name":"tomnomnom/phpwol","owner":"tomnomnom","description":"Wake On LAN for PHP","archived":false,"fork":false,"pushed_at":"2017-03-21T23:25:34.000Z","size":12,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T01:07:04.059Z","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/tomnomnom.png","metadata":{"files":{"readme":"README.mkd","changelog":"CHANGELOG.mkd","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":"2013-02-17T22:30:09.000Z","updated_at":"2025-02-18T19:33:09.000Z","dependencies_parsed_at":"2022-08-18T09:41:59.718Z","dependency_job_id":null,"html_url":"https://github.com/tomnomnom/phpwol","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fphpwol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fphpwol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fphpwol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fphpwol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomnomnom","download_url":"https://codeload.github.com/tomnomnom/phpwol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248334263,"owners_count":21086360,"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-10-13T11:12:16.337Z","updated_at":"2025-04-11T03:21:45.783Z","avatar_url":"https://github.com/tomnomnom.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phpwol\n\nSend Wake On LAN packets with PHP.\n\n## Contents\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [Testing](#testing)\n\n## Installation\n\nPhpwol is available on [Packagist](https://packagist.org/packages/tomnomnom/phpwol) so you can \ninstall it using [Composer](http://getcomposer.org/). Just specify it as a dependency in your \n`composer.json`:\n\n```json\n{\n    \"require\": {\n        \"tomnomnom/phpwol\": \"0.1.0\"\n    }\n}\n```\n\nThen run `composer install`:\n\n```\n▶ composer install\nLoading composer repositories with package information\nInstalling dependencies\n  - Installing tomnomnom/phpwol (0.1.0)\n    Downloading: 100%         \n\nWriting lock file\nGenerating autoload files\n```\n\nOnce installed you can use the Composer autoloader instead of the one provided in `./Phpwol/Init.php`:\n\n```php\n\u003c?php\nrequire __DIR__.'/vendor/autoload.php';\n\n$f = new \\Phpwol\\Factory();\n$m = $f-\u003emagicPacket();\n```\n\n## Usage\n\nA `\\Phpwol\\MagicPacket` object is used to send a WOL packet. Such an object is availble via the `\\Phpwol\\Factory::magicPacket()` method.\n\n\n```php\n\u003c?php\n// ./Examples/Basic.php\nrequire __DIR__.'/../Phpwol/Init.php';\n\n$f = new \\Phpwol\\Factory();\n$magicPacket = $f-\u003emagicPacket();\n\n$macAddress = '50:46:5C:53:94:25';\n$broadcastIP = '192.168.1.255';\n\n$result = $magicPacket-\u003esend($macAddress, $broadcastIP);\n\nif ($result){\n  echo \"Worked\\n\";\n} else {\n  echo \"Failed\\n\";\n}\n\n```\n\n```\n▶ php ./Examples/Basic.php\nWorked\n```\n\nIf you don't know what the broadcast IP is and don't know how to work it out, you can just specify the IP and subnet mask \nand everything will be worked out for you.\n\n```php\n\u003c?php\n// ./Examples/UnknownBroadcast.php\nrequire __DIR__.'/../Phpwol/Init.php';\n\n$f = new \\Phpwol\\Factory();\n$magicPacket = $f-\u003emagicPacket();\n\n$macAddress = '50:46:5C:53:94:25';\n$ip = '192.168.1.10';\n$subnet = '255.255.255.0';\n\n$result = $magicPacket-\u003esend($macAddress, $ip, $subnet);\n\nif ($result){\n  echo \"Worked\\n\";\n} else {\n  echo \"Failed\\n\";\n}\n\n```\n\n```\n▶ php ./Examples/UnknownBroadcast.php\nWorked\n```\n\n## Requirements\n\n* Linux of some description\n* PHP 5.3 or newer\n\n## Testing\n\nYou can run the tests by running:\n\n```\n▶ phpunit\n```\n\nThe repo is hooked up to Travis CI. You can see the state of the master branch and the \nbuild history on the [Phpwol Travis CI page](https://travis-ci.org/tomnomnom/phpwol).\nThe full test suite runs under PHP 5.3 and PHP 5.4.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomnomnom%2Fphpwol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomnomnom%2Fphpwol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomnomnom%2Fphpwol/lists"}