This file contains 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
RewriteEngine On | |
RewriteRule !^manutencao.php$ /manutencao.php [R=302,L] |
This file contains 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
Options -Indexes | |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
This file contains 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
User-agent: * | |
Disallow: /wp-admin | |
Disallow: /wp-includes | |
Disallow: /wp-content/plugins | |
Disallow: /wp-content/cache | |
Disallow: /wp-content/themes | |
Disallow: /wp-includes/js | |
Disallow: /trackback | |
Disallow: /category/*/* | |
Disallow: */trackback |
This file contains 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 | |
require_once('recaptchalib.php'); | |
// Get a key from https://www.google.com/recaptcha/admin/create | |
$publickey = "6Ld6m-8SAAAAAGNrxIf7Dn6rt_6yfjcMO40Zxs_G"; | |
$privatekey = "6Ld6m-8SAAAAAOLkKK6T8j4K9YntpGA0f-xszASW"; | |
$token = 'VopcWwRNfnCzUhmgaXM7sbQBurqixY59yFvt1J8ZkjeD2AK4SH36TPLdEG'; | |
$referer = "http://www.verscontabilidade.com.br"; | |
$url_back = "http://www.verscontabilidade.com.br/obrigado"; |
This file contains 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
Exception handling in cakephp 2.0+ | |
Now, I discribe step by step how to handle error 400,403,404,405,501 in cakephp2.0+ | |
Step-1 : Update /app/Config/core.php | |
open /app/Config/core.php, and find the following: | |
Configure::write('Exception', array( | |
'handler' => 'ErrorHandler::handleException', | |
'renderer' => 'ExceptionRenderer', |
This file contains 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 CategoriesController extends GerenciadorAppController{ | |
public $components = array('Error'); | |
public function index(){ | |
$this->set('categories', $this->Category->find('all')); | |
} | |
public function add(){ | |
$this->set('label', 'Cadastrar categoria'); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Box Shadow</title> | |
<style> | |
.box { | |
height: 150px; | |
width: 300px; | |
margin: 20px; |
This file contains 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 | |
if (App::environment('production')) { | |
$url = parse_url(getenv("CLEARDB_DATABASE_URL")); | |
$_ENV['DATABASE_HOST'] = $url["host"]; | |
$_ENV['DATABASE_USERNAME'] = $url["user"]; | |
$_ENV['DATABASE_PASSWORD'] = $url["pass"]; | |
$_ENV['DATABASE_DATABASE'] = substr($url["path"], 1); | |
} |
This file contains 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 | |
# .... | |
$env = $app->detectEnvironment(array( | |
'local' => array('homestead'), | |
)); | |
#.... |
This file contains 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 | |
/** | |
* Application model for Cake. | |
* | |
* This file is application-wide model file. You can put all | |
* application-wide model-related methods here. | |
* | |
* PHP 5 | |
* | |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) |
OlderNewer