This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import web | |
from controllers import blog | |
urls = ( | |
'/blog', blog.app | |
) | |
app = web.application(urls, locals()) | |
if __name__ == "__main__": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__PACKAGE__->log->levels( qw/info warn error fatal/ ) unless __PACKAGE__->debug; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Plugin Cache> | |
<backend> | |
class Cache::Memcached | |
servers [127.0.0.1:11211] | |
</backend> | |
</Plugin> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$this->load->helper('recaptcha'); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function recaptcha_check($response) | |
{ | |
// check to see if the recaptcha is correct | |
$resp = recaptcha_check_answer ( | |
$this->_recaptcha_private_key, | |
$this->input->ip_address(), | |
$this->input->post('recaptcha_challenge_field'), | |
$this->input->post('recaptcha_response_field')); | |
if(!$resp->is_valid) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function someAction() | |
{ | |
$this->load->library('form_validation'); | |
// set validation rule for the recaptcha response | |
$this->form_validation->set_rules('recaptcha_response_field', 'reCaptcha', 'required|callback_recaptcha_check'); | |
if ($this->form_validation->run() === FALSE) | |
{ | |
// store the recaptcha html code for the view | |
$data['recaptcha'] = recaptcha_get_html($this->_recaptcha_public_key); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// store your private/public key | |
private $_recaptcha_private_key = 'YOUR PRIVATE KEY GOES HERE'; | |
private $_recaptcha_public_key = 'YOUR PUBLIC KEY GOES HERE'; | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Test extends Controller | |
{ | |
// store your private/public key | |
private $_recaptcha_private_key = 'YOUR PRIVATE KEY GOES HERE'; | |
private $_recaptcha_public_key = 'YOUR PUBLIC KEY GOES HERE'; | |
function __construct() | |
{ | |
parent::__construct(); |
NewerOlder