{"id":18986169,"url":"https://github.com/brainbits/blocking","last_synced_at":"2025-04-19T20:36:29.859Z","repository":{"id":7396643,"uuid":"8726299","full_name":"brainbits/blocking","owner":"brainbits","description":"The Blocking Component provides methods to manage content based blocking.","archived":false,"fork":false,"pushed_at":"2025-03-27T17:02:43.000Z","size":146,"stargazers_count":0,"open_issues_count":2,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-27T18:22:22.866Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/brainbits.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-12T11:28:37.000Z","updated_at":"2025-03-18T10:48:48.000Z","dependencies_parsed_at":"2024-06-22T00:25:18.200Z","dependency_job_id":"0f328a24-19aa-4a30-abeb-1d987bdfa705","html_url":"https://github.com/brainbits/blocking","commit_stats":{"total_commits":51,"total_committers":7,"mean_commits":7.285714285714286,"dds":0.607843137254902,"last_synced_commit":"2cf7f09514d94d8d523716857f750df31020c3b7"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainbits%2Fblocking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainbits%2Fblocking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainbits%2Fblocking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainbits%2Fblocking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brainbits","download_url":"https://codeload.github.com/brainbits/blocking/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249250820,"owners_count":21237961,"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-08T16:30:05.884Z","updated_at":"2025-04-16T14:32:45.380Z","avatar_url":"https://github.com/brainbits.png","language":"PHP","readme":"Blocking Component\n==================\n\n[![Latest Version](https://img.shields.io/github/release/brainbits/blocking.svg?style=flat-square)](https://github.com/brainbits/blocking/releases)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n[![Total Downloads](https://img.shields.io/packagist/dt/brainbits/blocking.svg?style=flat-square)](https://packagist.org/packages/brainbits/blocking)\n[![Tests](https://github.com/brainbits/blocking/actions/workflows/test.yml/badge.svg)](https://github.com/brainbits/blocking/actions)\n\nThe Blocking Component provides methods to manage content based blocking.\n\n```php\n\u003c?php\n\nuse Brainbits\\Blocking\\Blocker;\nuse Brainbits\\Blocking\\Identity\\Identity;\nuse Brainbits\\Blocking\\Owner\\SymfonySessionOwnerFactory;\nuse Brainbits\\Blocking\\Storage\\FilesystemStorage;\nuse Brainbits\\Blocking\\Validator\\ExpiredValidator;\n\n$storage = new FilesystemStorage('/where/to/store/blocks' /* path to directory on filesystem */);\n$ownerFactory = new SymfonySessionOwnerFactory($session /* symfony session */);\n$validator = new ExpiredValidator(300 /* block will expire after 300 seconds */);\n\n$blocker = new Blocker($storage, $ownerFactory, $validator);\n\n$identity = new Identity('my_content_123');\n\n$block = $blocker-\u003eblock($identity);\n$result = $blocker-\u003eunblock($identity);\n$result = $blocker-\u003eisBlocked($identity);\n$block = $blocker-\u003egetBlock($identity);\n```\n\nBlocking Storage\n----------------\nThe blocking storage is used to store the block information.\n\nA file based blocking storage is provided.\nIt writes block-files to the filesystem, based on the blocking identifier.\n\nBlocking Identity\n-----------------\nThe blocking identity is used to identify the content that is being blocked.\n\nA general purpose blocking identify is provided, that uses a string as an identifier.\n\nBlocking Owner\n--------------\nThe blocking owner is used to identify the user that created the block.\n\nA symfony session based owner class is provided.\n\nBlocking Validator\n------------------\nThe blocking validator is used to test wether or not an existing block is still valid.\n\nA validator that checks a block via last modification time is provided.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainbits%2Fblocking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrainbits%2Fblocking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainbits%2Fblocking/lists"}