{"id":19533636,"url":"https://github.com/oliwierptak/phuxtil-chmod","last_synced_at":"2025-04-26T13:33:50.880Z","repository":{"id":57041232,"uuid":"191435856","full_name":"oliwierptak/phuxtil-chmod","owner":"oliwierptak","description":"Library to validate symbolic and octal modes used by unix chmod program","archived":false,"fork":false,"pushed_at":"2021-05-18T16:12:18.000Z","size":29,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-15T14:50:28.514Z","etag":null,"topics":["chmod","octal","permissions","php","symbolic","unix"],"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/oliwierptak.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-06-11T19:20:39.000Z","updated_at":"2023-01-20T14:20:12.000Z","dependencies_parsed_at":"2022-08-24T01:10:43.429Z","dependency_job_id":null,"html_url":"https://github.com/oliwierptak/phuxtil-chmod","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/oliwierptak%2Fphuxtil-chmod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliwierptak%2Fphuxtil-chmod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliwierptak%2Fphuxtil-chmod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliwierptak%2Fphuxtil-chmod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliwierptak","download_url":"https://codeload.github.com/oliwierptak/phuxtil-chmod/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250993632,"owners_count":21519701,"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":["chmod","octal","permissions","php","symbolic","unix"],"created_at":"2024-11-11T02:08:59.709Z","updated_at":"2025-04-26T13:33:50.596Z","avatar_url":"https://github.com/oliwierptak.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phuxtil-chmod\n\n\nEasy way to validate symbolic and octal modes used by unix `chmod` program.\n\n\u003e In Unix and Unix-like operating systems, chmod is the command and system call which is used to change the access permissions of file system objects. It is also used to change special mode flags.\n\n### Installation\n\n```\ncomposer require phuxtil/chmod\n```\n\n_Note_: Use v1.x for compatibility with PHP v7.0+\n_Note_: Use v2.x for compatibility with PHP v7.2+\n\n### Usage\n\n#### Facade\n\nCreate new instance:\n\n```php\n$facade = new ChmodFacade();\n```\n\n\n##### isReadable(...)\n\n```php\n$facade-\u003eisReadable('0755');     # true\n$facade-\u003eisReadable('0334');     # true\n$facade-\u003eisReadable('0333');     # false\n```\n\n##### isWritable(...)\n\n```php\n$facade-\u003eisWritable('0644');     # true\n$facade-\u003eisWritable('0222');     # true\n$facade-\u003eisWritable('0111');     # false\n```\n\n##### isExecutable(...)\n\n```php\n$facade-\u003eisExecutable('0755');     # true\n$facade-\u003eisExecutable('0644');     # false\n$facade-\u003eisExecutable('0222');     # false\n```\n\n\n##### validateByOctal(...)\n```php\n$facade-\u003evalidateByOctal('0755', 'u', 'r');     # true\n$facade-\u003evalidateByOctal('0755', 'u', 'x');     # true\n$facade-\u003evalidateByOctal('0755', 'o', 'w');     # false\n```\n\n##### validateBySymbol(...)\n```php\n$facade-\u003evalidateBySymbol('-rw-r--r--', 'u', 'r');     # true\n$facade-\u003evalidateBySymbol('-rw-r--r--', 'u', 'x');     # false\n$facade-\u003evalidateBySymbol('-rw-r--r--', 'o', 'r');     # true\n```\n\n##### applyUid(...)\n```php\n$facade-\u003eapplyUid('0644');          # 4644\n```\n\n##### applyGid(...)\n```php\n$facade-\u003eapplyGid('0644');          # 2644\n```\n\n##### applyUidAndGid(...)\n```php\n$facade-\u003eapplyUidAndGid('0644');    # 6644\n```\n\n##### toArray()\n```php\nprint_r($facade-\u003etoArray('0775'));\n```\n\n```php\n[\n    'u' =\u003e [\n        'r' =\u003e 'r',\n        'w' =\u003e 'w',\n        'x' =\u003e 'x',\n    ],\n    'g' =\u003e [\n        'r' =\u003e 'r',\n        'w' =\u003e 'w',\n        'x' =\u003e 'x',\n    ],\n    'o' =\u003e [\n        'r' =\u003e 'r',\n        'w' =\u003e '-',\n        'x' =\u003e 'x',\n    ]\n]\n```\n\n\nSee [`tests`](https://github.com/oliwierptak/phuxtil-chmod/blob/master/tests/Functional/Chmod/ChmodFacadeTest.php) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliwierptak%2Fphuxtil-chmod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliwierptak%2Fphuxtil-chmod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliwierptak%2Fphuxtil-chmod/lists"}