{"id":18000922,"url":"https://github.com/cgsmith/zf1-recaptcha-2","last_synced_at":"2025-03-26T07:32:18.951Z","repository":{"id":29617566,"uuid":"33158114","full_name":"cgsmith/zf1-recaptcha-2","owner":"cgsmith","description":"Zend Framework 1 integration for Google reCAPTCHA version 2.0","archived":false,"fork":false,"pushed_at":"2018-03-22T17:32:44.000Z","size":29,"stargazers_count":9,"open_issues_count":6,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-19T21:55:54.876Z","etag":null,"topics":["google-recaptcha","php","zend-framework","zf1-recaptcha2"],"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/cgsmith.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":"2015-03-31T01:36:41.000Z","updated_at":"2023-04-18T21:19:06.000Z","dependencies_parsed_at":"2022-09-20T22:31:42.981Z","dependency_job_id":null,"html_url":"https://github.com/cgsmith/zf1-recaptcha-2","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/cgsmith%2Fzf1-recaptcha-2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgsmith%2Fzf1-recaptcha-2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgsmith%2Fzf1-recaptcha-2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgsmith%2Fzf1-recaptcha-2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgsmith","download_url":"https://codeload.github.com/cgsmith/zf1-recaptcha-2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245604524,"owners_count":20643006,"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":["google-recaptcha","php","zend-framework","zf1-recaptcha2"],"created_at":"2024-10-29T23:15:26.727Z","updated_at":"2025-03-26T07:32:18.572Z","avatar_url":"https://github.com/cgsmith.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"ZF1 reCAPTCHA2 - Google reCAPTCHA integration\n==============================\n\nZF1 ships with Google reCAPTCHA version 1.  Now that version 2 is available\nyou will probably want to use an up-to-date element for your Zend Framework installations.\n\nInstallation\n-----\n\n#### Composer Install\n\n    \"require\": {\n        \"cgsmith/zf1-recaptcha-2\": \"~1.0\"\n    }\n\n\nUsage\n-----\n\nInstall the latest version (1.0.1) and setup your plugins and form abstract with the following information:\n\n* On your application.ini or where you want\n\n```ini\nrecaptcha.sitekey = \"YOUR SITE KEY GIVEN BY GOOGLE\"\nrecaptcha.secretkey = \"YOUR SECRET KEY GIVEN BY GOOGLE\"\n```\n\n* In your bootstrap:\n\n```php\npublic function _initView()\n{\n    $view = new Zend_View();\n\n    $view-\u003eaddHelperPath(\n        APPLICATION_PATH . '/../vendor/cgsmith/zf1-recaptcha-2/src/Cgsmith/View/Helper',\n        'Cgsmith\\\\View\\\\Helper\\\\'\n    );\n\n    Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_ViewRenderer($view));\n\n    return $view;\n}\n\npublic function _initRecaptcha()\n{\n    $config = \\Zend_Registry::get('application');\n    $params = $config-\u003erecaptcha-\u003etoArray();\n\n    $params['messageTemplates'] = [\n        \\Cgsmith\\Validate\\Recaptcha::INVALID_CAPTCHA =\u003e 'The captcha was invalid', // set custom/translated message\n        \\Cgsmith\\Validate\\Recaptcha::CAPTCHA_EMPTY =\u003e 'The captcha must be completed'\n    ];\n\n    \\Zend_Registry::set('recaptcha', $params);\n}\n```\n\n\n* Below is what you would setup in your form.\n\n```php\n\u003c?php\n\n// create your element\n$this-\u003eaddElement(new \\Cgsmith\\Form\\Element\\Recaptcha());\n\n```\n\n* On your controller, after \"validate the post data\"\n\n```php\nif($form-\u003eisValid($_POST)) {\n\t$values = $form-\u003egetValues();\n\tunset($values['g-recaptcha-response']);\n\t// Your business logic must be here\n}\n```\n\nAbout\n=====\n\nRequirements\n------------\n\n- ZF1 reCAPTCHA2 works with PHP 5.5 or above.\n\nSubmitting bugs and feature requests\n------------------------------------\n\nBugs and feature request are tracked on [GitHub](https://github.com/cgsmith/zf1-recaptcha-2/issues)\n\nAuthor\n------\n\nChris Smith - \u003cchris@cgsmith.net\u003e - \u003chttp://twitter.com/cgsmith105\u003e\n\nLicense\n-------\n\nZF1 reCAPTCHA2 is licensed under the MIT License - see the `LICENSE` file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgsmith%2Fzf1-recaptcha-2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgsmith%2Fzf1-recaptcha-2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgsmith%2Fzf1-recaptcha-2/lists"}