{"id":17142466,"url":"https://github.com/dozoisch/cachedbuzzbundle","last_synced_at":"2026-05-16T17:04:45.026Z","repository":{"id":56971645,"uuid":"10302486","full_name":"dozoisch/CachedBuzzBundle","owner":"dozoisch","description":"A way to cache HTTP requests built over the light weight client Buzz","archived":false,"fork":false,"pushed_at":"2013-09-27T16:59:03.000Z","size":267,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T14:35:37.713Z","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/dozoisch.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":"2013-05-26T19:28:55.000Z","updated_at":"2013-10-07T08:24:33.000Z","dependencies_parsed_at":"2022-08-21T11:20:14.448Z","dependency_job_id":null,"html_url":"https://github.com/dozoisch/CachedBuzzBundle","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/dozoisch%2FCachedBuzzBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dozoisch%2FCachedBuzzBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dozoisch%2FCachedBuzzBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dozoisch%2FCachedBuzzBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dozoisch","download_url":"https://codeload.github.com/dozoisch/CachedBuzzBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245240926,"owners_count":20583102,"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-14T20:31:21.205Z","updated_at":"2025-10-08T04:48:14.358Z","avatar_url":"https://github.com/dozoisch.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"CachedBuzzBundle\n================\n\nThis bundle is meant to provide a way to cache request made with the [buzz bundle][buzzlnk]. This bundle can be used exactly like [buzz][buzzlnk], the cache is integrated directly. The bundle is under the [MIT license][mitlnk]. For more information see the file called [LICENSE][liclnk] in the root of the path.\n\nInstallation\n------------\n\n1.  Add this to the `composer.json`:\n\n    ```json\n    {\n        \"require\": {\n            \"dozoisch/cachedbuzz\": \"dev-master\"\n        }\n    }\n    ```\n\n2.  Enable the bundle in `app/AppKernel.php`:\n\n    ```php\n    public function registerBundles()\n    {\n        $bundles = array(\n            // ...\n            new Dozoisch\\CachedBuzzBundle\\DozoischCachedBuzzBundle(),\n        );\n    }\n    ```\n\nConfiguration\n------------\n\n**No setting is mandatory** as every thing fallback to a default setting or a default implementation provided by the bundle. The default `cache` uses [APC][apclnk]. If the module is not available on your web server, the module initialization will fail.\n\n\nHere is the full configuration *(in yaml)* possible, with the defaults value :\n\n```yaml\ndozoisch_cached_buzz:\n    http_client:\n        timeout: 10\n        verify_peer: true\n        max_redirects: 5\n        ignore_errors: true\n    cache: null #takes a string\n    validator: null #takes a string\n```\n\nIn the `http_client` is used to configure the buzz client. The `cache` setting takes a string that should be a class or a service. Same thing for the `validator`.\n\nThe `cache` has to implement the class `Dozoisch\\CachedBuzzBundle\\Cache\\CacheInterface`.  \nThe `validator` has to implement the class `Dozoisch\\CachedBuzzBundle\\Cache\\CacheValidatorInterface`.\n\nRunning as a Service\n--------------------\n\nTo run the Cached Buzz Bundle as a service, insert this into your services.yml file:\n\n```yaml\nparameters:\n  dozoisch.bundle.name: Dozoisch\\CachedBuzzBundle\n\nservices:\n  # The actual service\n  dozoisch.buzz.browser:\n    class: '%dozoisch.bundle.name%\\Browser'\n    arguments: ['@dozoisch.buzz.cacher', '@dozoisch.buzz.client.curl']\n    \n  # Parametring.\n  dozoisch.buzz.client.curl:\n    class:  'Buzz\\Client\\Curl'\n    public: false\n    calls:\n      - [setVerifyPeer, [false]] # this is optional\n      - [setTimeout, [100]] # this is optional\n\n  dozoisch.buzz.cacheinterface:\n    class: '%dozoisch.bundle.name%\\Cache\\APCCache'\n\n  dozoisch.buzz.cachevalidator:\n    class: '%dozoisch.bundle.name%\\Cache\\CacheValidator'\n\n  dozoisch.buzz.cacher:\n    class: '%dozoisch.bundle.name%\\Cacher'\n    arguments: ['@dozoisch.buzz.cacheinterface', '@dozoisch.buzz.cachevalidator']\n\n```\n\n*When using it like that it overrides some of the normal bundles setting and thus, the cacher and client parameters for the browser are no longer optional.*\n\nHow to use it\n--------------------\n\nYou can now call the browser just as you would with any other service.\n\n###Container aware class\n\nIf you wish to call it from a container aware class, a controller for example, just do `$this-\u003eget('dozoisch.buzz.browser');`.\n\n###Non-container aware class\n\nTo call it from a service which is not container aware, first add this to your services.yml\n\n```yaml\n\nservices:\n  my.super.service:\n    class: xclass.class\n    arguments: ['@dozoisch.buzz.browser']\n```\n\nAnd make sure to have the appropriate constructor in your class :\n\n```php\n/** @var Buzz\\Browser */\nprotected $browser;\n\npublic function __construct(\\Buzz\\Browser $browser) {\n    $this-\u003ebrowser = $browser;\n}\n\n```\n\n###Actually using it\n\nAfter retrieving the browser, you can use it as you would with the normal buzz browser. This bundles is meant to be used seamlessly over the normal buzz instance.\n\n```php\n$response = $this-\u003ebrowser-\u003eget(\"http://example.com\");\n$content = $response-\u003egetContent();\n```\nThe available functions are post, head, patch, put, delete.\n\n[buzzlnk]:https://github.com/kriswallsmith/Buzz\n[apclnk]:http://www.php.net/manual/en/book.apc.php\n[mitlnk]:http://en.wikipedia.org/wiki/MIT_License\n[liclnk]:./LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdozoisch%2Fcachedbuzzbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdozoisch%2Fcachedbuzzbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdozoisch%2Fcachedbuzzbundle/lists"}