Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added example application to demonstrate file and class structure

  • Loading branch information...
commit 574360616de99016a44def33147bb614dd44b1ae 1 parent 27c05c1
@epixa authored
View
3  .gitmodules
@@ -0,0 +1,3 @@
+[submodule "example/vendor/Zend"]
+ path = example/vendor/Zend
+ url = http://github.com/epixa/Zend-Framework-v1-Mirror.git
View
17 example/application/Bootstrap.php
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Epixa - Example Application
+ */
+
+use Epixa\Application\Bootstrap as BaseBootstrap;
+
+/**
+ * Bootstrap the application
+ *
+ * @category Bootstrap
+ * @copyright 2010 epixa.com - Court Ewing
+ * @license http://github.com/epixa/Epixa/blob/master/LICENSE New BSD
+ * @author Court Ewing (court@epixa.com)
+ */
+class Bootstrap extends BaseBootstrap
+{}
View
32 example/application/Core/Controller/ErrorController.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Epixa - Example Application
+ */
+
+namespace Core\Controller;
+
+/**
+ * Error controller
+ *
+ * @category Module
+ * @package Core
+ * @subpackage Controller
+ * @copyright 2010 epixa.com - Court Ewing
+ * @license http://github.com/epixa/Epixa/blob/master/LICENSE New BSD
+ * @author Court Ewing (court@epixa.com)
+ */
+class ErrorController extends \Zend_Controller_Action
+{
+ /**
+ * Handle all application level exceptions
+ */
+ public function errorAction()
+ {
+ $error = $this->_getParam('error_handler', null);
+ if (null !== $error) {
+ var_dump($error->exception);
+ }
+
+ die('<p>Core\Controller\ErrorController::errorAction()</p>');
+ }
+}
View
24 example/application/Core/Controller/IndexController.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Epixa - Example Application
+ */
+
+namespace Core\Controller;
+
+/**
+ * Default controller
+ *
+ * @category Module
+ * @package Core
+ * @subpackage Controller
+ * @copyright 2010 epixa.com - Court Ewing
+ * @license http://github.com/epixa/Epixa/blob/master/LICENSE New BSD
+ * @author Court Ewing (court@epixa.com)
+ */
+class IndexController extends \Zend_Controller_Action
+{
+ public function indexAction()
+ {
+ die('<p>Core\Controller\IndexController::indexAction()</p>');
+ }
+}
View
24 example/application/User/Controller/IndexController.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Epixa - Example Application
+ */
+
+namespace User\Controller;
+
+/**
+ * Default controller
+ *
+ * @category Module
+ * @package User
+ * @subpackage Controller
+ * @copyright 2010 epixa.com - Court Ewing
+ * @license http://github.com/epixa/Epixa/blob/master/LICENSE New BSD
+ * @author Court Ewing (court@epixa.com)
+ */
+class IndexController extends \Zend_Controller_Action
+{
+ public function indexAction()
+ {
+ die('<p>User\Controller\IndexController::indexAction()</p>');
+ }
+}
View
48 example/application/User/Model/User.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Epixa - Example Application
+ */
+
+namespace User\Model;
+
+use Epixa\Model\AbstractModel;
+
+/**
+ * @category Module
+ * @package User
+ * @subpackage Model
+ * @copyright 2010 epixa.com - Court Ewing
+ * @license http://github.com/epixa/Epixa/blob/master/LICENSE New BSD
+ * @author Court Ewing (court@epixa.com)
+ *
+ * @Entity(table="user_user")
+ *
+ * @property integer $id
+ * @property string $email
+ * @property string $firstName
+ * @property string $lastName
+ */
+class User extends AbstractModel
+{
+ /**
+ * @Id
+ * @Column(type="integer", name="id")
+ * @GeneratedValue
+ */
+ protected $id;
+
+ /**
+ * @Column(type="string", name="email")
+ */
+ protected $email;
+
+ /**
+ * @Column(type="string", name="first_name")
+ */
+ protected $firstName;
+
+ /**
+ * @Column(type="string", name="last_name")
+ */
+ protected $lastName;
+}
View
10 example/config/settings/development.php
@@ -0,0 +1,10 @@
+<?php
+
+$config = require 'production.php';
+
+$config['phpSettings']['display_startup_errors'] = true;
+$config['phpSettings']['display_errors'] = true;
+
+$config['db']['dbname'] = 'epixaexampledb_development';
+
+return $config;
View
22 example/config/settings/production.php
@@ -0,0 +1,22 @@
+<?php
+
+return array(
+ 'phpSettings' => array(
+ 'display_startup_errors' => false,
+ 'display_errors' => false,
+ 'date' => array(
+ 'timezone' => 'America/New_York'
+ )
+ ),
+ 'bootstrap' => array(
+ 'path' => sprintf('%s/Bootstrap.php', APPLICATION_PATH)
+ ),
+ 'resources' => array(
+ 'frontController' => array(
+ 'moduleDirectory' => APPLICATION_PATH,
+ 'env' => APPLICATION_ENV
+ ),
+ 'modules' => array(),
+ 'view' => array()
+ )
+);
View
10 example/config/settings/staging.php
@@ -0,0 +1,10 @@
+<?php
+
+$config = require 'production.php';
+
+$config['phpSettings']['display_startup_errors'] = true;
+$config['phpSettings']['display_errors'] = true;
+
+$config['db']['dbname'] = 'epixaexampledb_staging';
+
+return $config;
View
10 example/config/settings/testing.php
@@ -0,0 +1,10 @@
+<?php
+
+$config = require 'production.php';
+
+$config['phpSettings']['display_startup_errors'] = true;
+$config['phpSettings']['display_errors'] = true;
+
+$config['db']['dbname'] = 'epixaexampledb_testing';
+
+return $config;
View
8 example/public/.htaccess
@@ -0,0 +1,8 @@
+SetEnv APPLICATION_ENV development
+
+RewriteEngine On
+RewriteCond %{REQUEST_FILENAME} -s [OR]
+RewriteCond %{REQUEST_FILENAME} -l [OR]
+RewriteCond %{REQUEST_FILENAME} -d
+RewriteRule ^.*$ - [NC,L]
+RewriteRule ^.*$ index.php [NC,L]
View
47 example/public/index.php
@@ -0,0 +1,47 @@
+<?php
+
+if (!defined('APPLICATION_ROOT')) {
+ define('APPLICATION_ROOT', realpath(implode(DIRECTORY_SEPARATOR, array(
+ dirname(__FILE__),
+ '..'
+ ))));
+}
+
+if (!defined('APPLICATION_PATH')) {
+ define('APPLICATION_PATH', realpath(implode(DIRECTORY_SEPARATOR, array(
+ APPLICATION_ROOT,
+ 'application'
+ ))));
+}
+
+if (!defined('APPLICATION_ENV')) {
+ if (!$env = getenv('APPLICATION_ENV')) {
+ $env = 'production';
+ }
+
+ define('APPLICATION_ENV', $env);
+}
+
+set_include_path(implode(PATH_SEPARATOR, array(
+ APPLICATION_PATH,
+ realpath(implode(DIRECTORY_SEPARATOR, array(
+ APPLICATION_ROOT,
+ '..',
+ 'library'
+ ))),
+ realpath(implode(DIRECTORY_SEPARATOR, array(
+ APPLICATION_ROOT,
+ 'vendor',
+ 'Zend',
+ 'library'
+ ))),
+ get_include_path()
+)));
+
+require_once 'Zend/Loader/Autoloader.php';
+Zend_Loader_Autoloader::getInstance()
+ ->registerNamespace('Epixa\\')
+ ->registerNamespace('Zend_');
+
+$application = new Epixa\Application(APPLICATION_ENV);
+$application->bootstrap()->run();
1  example/vendor/Zend
@@ -0,0 +1 @@
+Subproject commit c66314889739fae2a2f9f66cc023f9bc9639a10e
Please sign in to comment.
Something went wrong with that request. Please try again.