{"id":14063334,"url":"https://github.com/sagebind/windows-registry","last_synced_at":"2025-07-29T15:32:36.742Z","repository":{"id":56955793,"uuid":"21629854","full_name":"sagebind/windows-registry","owner":"sagebind","description":"A small library for accessing and manipulating the Windows registry.","archived":true,"fork":false,"pushed_at":"2019-01-31T23:31:21.000Z","size":165,"stargazers_count":14,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-26T20:53:53.630Z","etag":null,"topics":["php","windows","windows-registry"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sagebind.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":"2014-07-08T21:18:05.000Z","updated_at":"2024-05-21T12:49:32.000Z","dependencies_parsed_at":"2022-08-21T08:50:38.194Z","dependency_job_id":null,"html_url":"https://github.com/sagebind/windows-registry","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagebind%2Fwindows-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagebind%2Fwindows-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagebind%2Fwindows-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagebind%2Fwindows-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sagebind","download_url":"https://codeload.github.com/sagebind/windows-registry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228028298,"owners_count":17858312,"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":["php","windows","windows-registry"],"created_at":"2024-08-13T07:03:16.842Z","updated_at":"2024-12-04T01:30:36.817Z","avatar_url":"https://github.com/sagebind.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Windows Registry Wrapper\n[![Build](https://img.shields.io/scrutinizer/build/g/coderstephen/windows-registry.svg)](https://scrutinizer-ci.com/g/coderstephen/windows-registry)\n[![Version](https://img.shields.io/packagist/v/coderstephen/windows-registry.svg)](https://packagist.org/packages/coderstephen/windows-registry)\n[![Code Quality](https://img.shields.io/scrutinizer/g/coderstephen/windows-registry.svg)](https://scrutinizer-ci.com/g/coderstephen/windows-registry)\n[![License](https://img.shields.io/packagist/l/coderstephen/windows-registry.svg)](https://packagist.org/packages/coderstephen/windows-registry)\n\nA small library for accessing and manipulating the Registry on Microsoft Windows systems. For that\none time that you need to access the Windows Registry in a PHP application.\n\nThis library can be (and has been) used in production code, but *please consider* reading the [disclaimer](#disclaimer) below before using.\n\n## Features\n- Read and write access to any hive, key, or value in the registry (that you have permissions to)\n- Automatic conversion between all registry value data types to PHP scalar types\n- Lazy-loaded iterators over lists of values and recursive iterators over keys and subkeys\n- Ability to connect to registries on remote computers using a remote WMI (Windows Management Instrumentation) connection (see Microsoft's docs on [how to connect to WMI remotely](https://msdn.microsoft.com/en-us/library/aa389290%28v=vs.85%29.aspx) for details)\n\n## Requirements\n- Microsoft Windows (Vista or newer) or Windows Server (Windows Server 2003 or\n  newer)\n- PHP [com_dotnet](http://php.net/manual/en/book.com.php) extension\n\n## Installation\nUse [Composer](http://getcomposer.org):\n\n```sh\n\u003e composer require coderstephen/windows-registry:~0.9\n```\n\n## Documentation\nFull API documentation is available online [here](http://coderstephen.github.io/windows-registry/api).\n\n## Examples\nBelow is an example of creating a new registry key with some values and then\ndeleting them.\n\n```php\nuse Windows\\Registry;\n\n$hklm = Registry\\Registry::connect()-\u003egetLocalMachine();\n$keyPath = 'Software\\\\MyKey\\\\MySubKey';\n\n// create a new key\ntry\n{\n    $mySubKey = $hklm-\u003ecreateSubKey($keyPath);\n}\ncatch (Registry\\Exception $e)\n{\n    print \"Key '{$keyPath}' not created\" . PHP_EOL;\n}\n\n// create a new value\n$mySubKey-\u003esetValue('Example DWORD Value', 250, Registry\\RegistryKey::TYPE_DWORD);\n\n// delete the new value\n$mySubKey-\u003edeleteValue('Example DWORD Value');\n\n// delete the new key\ntry\n{\n    $hklm-\u003edeleteSubKey($keyPath);\n}\ncatch (Registry\\Exception $e)\n{\n    print \"Key '{$keyPath}' not deleted\" . PHP_EOL;\n}\n```\n\nYou can also iterate over subkeys and values using built-in iterators:\n\n```php\nforeach ($key-\u003egetSubKeyIterator() as $name =\u003e $subKey)\n{\n    print $subKey-\u003egetQualifiedName() . PHP_EOL;\n}\n\nforeach ($key-\u003egetValueIterator() as $name =\u003e $value)\n{\n    printf(\"%s: %s\\r\\n\", $name, $value);\n}\n```\n\n## Disclaimer\nMessing with the Windows Registry can be dangerous; Microsoft has plenty of\nwarnings about how it can **destroy your installation**. Not only should you be\ncareful when accessing the Registry, this library is *not guaranteed* to be 100%\nsafe to use and free of bugs. Use discretion, and **test your code in a virtual\nmachine if possible**. I am not liable for *any* damages caused by this library.\nSee the [license](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagebind%2Fwindows-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagebind%2Fwindows-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagebind%2Fwindows-registry/lists"}