Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added poll schema

- Created poll schema, configuration, and initial DB
  • Loading branch information...
commit 70ca2a294a642dace4ffd39f158f79eb8ef887d6 1 parent 0fdac00
Matthew Weier O'Phinney authored
64 widgets-as-helpers/.vimproject
... ... @@ -0,0 +1,64 @@
  1 +widgets="/home/matthew/git/zf-examples/widgets-as-helpers" CD=. filter="*.php *.phtml *.css *.js *.sql TODO README ^.git" {
  2 + application=application {
  3 + Bootstrap.php
  4 + configs=configs {
  5 + }
  6 + controllers=controllers {
  7 + ErrorController.php
  8 + IndexController.php
  9 + }
  10 + models=models {
  11 + }
  12 + modules=modules {
  13 + poll=poll {
  14 + configs=configs {
  15 + poll.ini
  16 + }
  17 + controllers=controllers {
  18 + }
  19 + data=data {
  20 + }
  21 + models=models {
  22 + sql=sql {
  23 + poll.sql
  24 + }
  25 + }
  26 + views=views {
  27 + filters=filters {
  28 + }
  29 + helpers=helpers {
  30 + }
  31 + scripts=scripts {
  32 + }
  33 + }
  34 + }
  35 + }
  36 + views=views {
  37 + helpers=helpers {
  38 + }
  39 + scripts=scripts {
  40 + error=error {
  41 + error.phtml
  42 + }
  43 + index=index {
  44 + index.phtml
  45 + }
  46 + }
  47 + }
  48 + }
  49 + docs=docs {
  50 + }
  51 + library=library {
  52 + }
  53 + public=public {
  54 + index.php
  55 + }
  56 + tests=tests {
  57 + application=application {
  58 + bootstrap.php
  59 + }
  60 + library=library {
  61 + bootstrap.php
  62 + }
  63 + }
  64 +}
16 widgets-as-helpers/.zfproject.xml
@@ -16,7 +16,21 @@
16 16 <formsDirectory enabled="false"/>
17 17 <layoutsDirectory enabled="false"/>
18 18 <modelsDirectory/>
19   - <modulesDirectory enabled="false"/>
  19 + <modulesDirectory>
  20 + <moduleDirectory moduleName="poll">
  21 + <apisDirectory enabled="false"/>
  22 + <configsDirectory enabled="false"/>
  23 + <controllersDirectory/>
  24 + <formsDirectory enabled="false"/>
  25 + <layoutsDirectory enabled="false"/>
  26 + <modelsDirectory/>
  27 + <viewsDirectory>
  28 + <viewScriptsDirectory/>
  29 + <viewHelpersDirectory/>
  30 + <viewFiltersDirectory/>
  31 + </viewsDirectory>
  32 + </moduleDirectory>
  33 + </modulesDirectory>
20 34 <viewsDirectory>
21 35 <viewScriptsDirectory>
22 36 <viewControllerScriptsDirectory forControllerName="Index">
7 widgets-as-helpers/application/modules/poll/configs/poll.ini
... ... @@ -0,0 +1,7 @@
  1 +[production]
  2 +db.adapter = "pdo_sqlite"
  3 +db.params.dbname = APPLICATION_PATH "/modules/poll/data/polls.db"
  4 +
  5 +[testing : production]
  6 +
  7 +[development : production]
BIN  widgets-as-helpers/application/modules/poll/data/polls.db
Binary file not shown
24 widgets-as-helpers/application/modules/poll/models/sql/poll.sql
... ... @@ -0,0 +1,24 @@
  1 +CREATE TABLE IF NOT EXISTS polls (
  2 + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  3 + name VARCHAR(256) NOT NULL
  4 +);
  5 +
  6 +CREATE TABLE IF NOT EXISTS questions (
  7 + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  8 + poll_id INTEGER NOT NULL,
  9 + question TEXT NOT NULL
  10 +);
  11 +
  12 +CREATE TABLE IF NOT EXISTS answers (
  13 + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  14 + question_id INTEGER NOT NULL,
  15 + answer TEXT NOT NULL
  16 +);
  17 +
  18 +CREATE TABLE IF NOT EXISTS votes (
  19 + id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  20 + answer_id INTEGER NOT NULL,
  21 + ip_address INTEGER NOT NULL,
  22 + user_agent TEXT NOT NULL,
  23 + session_id TEXT NOT NULL
  24 +);

0 comments on commit 70ca2a2

Please sign in to comment.
Something went wrong with that request. Please try again.