Skip to content

Instantly share code, notes, and snippets.

View eminetto's full-sized avatar
:octocat:
always learning

Elton Minetto eminetto

:octocat:
always learning
View GitHub Profile
LoadModule rewrite_module modules/mod_rewrite.so
AddModule mod_rewrite.c
AllowOverride all
LoadModule rewrite_module modules/mod_rewrite.so
AddModule mod_rewrite.c
AllowOverride all
@eminetto
eminetto / gist:987325
Created May 23, 2011 19:16
Create tables
CREATE DATABASE blog;
GRANT ALL privileges ON blog.* TO zend@localhost IDENTIFIED BY 'zend';
USE blog;
CREATE  TABLE IF NOT EXISTS `users` (
  `id` INT NOT NULL AUTO_INCREMENT ,
  `username` VARCHAR(200) NOT NULL ,
  `password` VARCHAR(250) NOT NULL ,
RewriteEngine On
RewriteRule !\.(js|ico|gif|jpg|png|css|htm|html)$ index.php
@eminetto
eminetto / gist:987332
Created May 23, 2011 19:18
Virtual host
<VirtualHost *:80>
DocumentRoot "/Applications/MAMP/htdocs/blog"
ServerName blog.local
SetEnv APPLICATION_ENV "development"
<Directory "/Applications/MAMP/htdocs/blog">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
@eminetto
eminetto / index.php
Created May 23, 2011 19:19
Bootstrap
<?php
/**
 * Arquivo Principal da Aplicacao, responsavel pelo processamento
 * de todas as requisicoes, todos os caminhos para os arquivos
 * serao contruidos aqui para serem utilizados ao longo da requisicao
 * E responsavel tambem por carregar o front-controller da aplicacao
 * E por consequencia tambem carrega o controller requisitado
 * @author    Andre Gustavo Espeiorin <xorna@coderockr.com>
 * @author    Elton Luís Minetto <eminetto@coderockr.com>
 * @version    1.0
@eminetto
eminetto / gist:987340
Created May 23, 2011 19:20
Config.ini
;ambiente de desenvolvimento
[production]
;database
db.adapter = Pdo_Mysql
db.host = localhost
db.username = userName
db.password = password
db.dbname = dataBase
;translate
<?php
class IndexController extends Zend_Controller_Action {
   
    public function showAction() {
       
    }
}
<?php
class Admin_IndexController extends Zend_Controller_Action {
   
    public function showAction() {
       
    }
}
$postRoute = new Zend_Controller_Router_Route(
    'post/:id',
    array(
        'module' => 'dafault',
        'controller' => 'post',
        'action' => 'view'
    )
);
$router = $frontController->getRouter();
$router->addRoute('post', $postRoute);