Permalink
Browse files

Create database (createTables.sql)

Set connection to database (application.ini)
Setup Vhost
  • Loading branch information...
1 parent 3e6398d commit 744f124d3f62d694d8a8fb54f118d154d800d9f5 @abtris committed Mar 11, 2010
Showing with 59 additions and 0 deletions.
  1. +8 −0 application/configs/application.ini
  2. +40 −0 docs/createTables.sql
  3. +11 −0 docs/quickstart.vhost
@@ -9,6 +9,14 @@ resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
+resources.db.adapter = PDO_MYSQL
+resources.db.params.host = localhost
+resources.db.params.username = quickstart
+resources.db.params.password = quickstart
+resources.db.params.dbname = quickstart
+resources.db.isDefaultTableAdapter = true
+;resources.db.params.driver_options.1002 = "SET NAMES utf8"
+
[staging : production]
[testing : production]
View
@@ -0,0 +1,40 @@
+BEGIN;
+
+CREATE DATABASE quickstart;
+CREATE USER 'quickstart'@'localhost' IDENTIFIED BY 'quickstart';
+GRANT ALL ON quickstart.* TO 'quickstart'@'localhost';
+FLUSH PRIVILEGES;
+
+USE quickstart;
+
+CREATE TABLE posts (
+id int(11) NOT NULL auto_increment,
+title varchar(100) NOT NULL,
+content text NULL,
+PRIMARY KEY (id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
+
+insert into posts values(1, 'Test title', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer tempus lorem sed nisi gravida vel consequat turpis volutpat. Nullam euismod interdum odio, a sagittis est hendrerit in. Nullam ut condimentum eros. Duis a ante commodo urna laoreet dapibus. Morbi suscipit, nisi vitae condimentum adipiscing, velit erat posuere eros, sit amet pretium dolor leo in erat. Mauris euismod dapibus orci luctus dictum. Nam ut purus ut justo blandit hendrerit ut eu neque. Integer id justo turpis. Praesent accumsan eros lectus, non consequat ligula. Vivamus dignissim enim purus. Nunc hendrerit ipsum egestas mauris adipiscing ac lacinia sapien fermentum. Maecenas id ante mauris, in volutpat felis.');
+
+CREATE TABLE users (
+id int(11) NOT NULL auto_increment,
+email varchar(255) NOT NULL,
+password varchar(255) NOT NULL,
+PRIMARY KEY (id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
+
+
+insert into users values(1, 'test@test.com', SHA1('test'));
+
+CREATE TABLE comments (
+id int(11) NOT NULL auto_increment,
+post int(11) NOT NULL,
+parent int(11) NULL,
+comment text NULL,
+PRIMARY KEY (id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
+
+
+insert into comments values(1, 1, NULL, 'test comment');
+
+COMMIT;
View
@@ -0,0 +1,11 @@
+<VirtualHost *:80>
+ ServerName quickstart
+ DocumentRoot /home/prskavecl/src/my-zf-quickstart/public
+ <Directory /home/prskavecl/src/my-zf-quickstart/public/>
+ AllowOverride All
+ </Directory>
+ ErrorLog /var/log/apache2/quickstart-error.log
+
+ LogLevel warn
+ CustomLog /var/log/apache2/quickstart-access.log combined
+</VirtualHost>

0 comments on commit 744f124

Please sign in to comment.