Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial import

  • Loading branch information...
commit b75e694427bb8bbb34d9ffbb7c801c73e0e318cf 0 parents
Ladislav Prskavec authored
67 .zfproject.xml
... ... @@ -0,0 +1,67 @@
  1 +<?xml version="1.0"?>
  2 +<projectProfile type="default" version="1.10">
  3 + <projectDirectory>
  4 + <projectProfileFile filesystemName=".zfproject.xml"/>
  5 + <applicationDirectory classNamePrefix="Application_">
  6 + <apisDirectory enabled="false"/>
  7 + <configsDirectory>
  8 + <applicationConfigFile type="ini"/>
  9 + </configsDirectory>
  10 + <controllersDirectory>
  11 + <controllerFile controllerName="Index">
  12 + <actionMethod actionName="index"/>
  13 + </controllerFile>
  14 + <controllerFile controllerName="Error"/>
  15 + </controllersDirectory>
  16 + <formsDirectory enabled="false"/>
  17 + <layoutsDirectory enabled="false"/>
  18 + <modelsDirectory/>
  19 + <modulesDirectory enabled="false"/>
  20 + <viewsDirectory>
  21 + <viewScriptsDirectory>
  22 + <viewControllerScriptsDirectory forControllerName="Index">
  23 + <viewScriptFile forActionName="index"/>
  24 + </viewControllerScriptsDirectory>
  25 + <viewControllerScriptsDirectory forControllerName="Error">
  26 + <viewScriptFile forActionName="error"/>
  27 + </viewControllerScriptsDirectory>
  28 + </viewScriptsDirectory>
  29 + <viewHelpersDirectory/>
  30 + <viewFiltersDirectory enabled="false"/>
  31 + </viewsDirectory>
  32 + <bootstrapFile filesystemName="Bootstrap.php"/>
  33 + </applicationDirectory>
  34 + <dataDirectory enabled="false">
  35 + <cacheDirectory enabled="false"/>
  36 + <searchIndexesDirectory enabled="false"/>
  37 + <localesDirectory enabled="false"/>
  38 + <logsDirectory enabled="false"/>
  39 + <sessionsDirectory enabled="false"/>
  40 + <uploadsDirectory enabled="false"/>
  41 + </dataDirectory>
  42 + <docsDirectory>
  43 + <file filesystemName="README.txt"/>
  44 + </docsDirectory>
  45 + <libraryDirectory>
  46 + <zfStandardLibraryDirectory enabled="false"/>
  47 + </libraryDirectory>
  48 + <publicDirectory>
  49 + <publicStylesheetsDirectory enabled="false"/>
  50 + <publicScriptsDirectory enabled="false"/>
  51 + <publicImagesDirectory enabled="false"/>
  52 + <publicIndexFile filesystemName="index.php"/>
  53 + <htaccessFile filesystemName=".htaccess"/>
  54 + </publicDirectory>
  55 + <projectProvidersDirectory enabled="false"/>
  56 + <temporaryDirectory enabled="false"/>
  57 + <testsDirectory>
  58 + <testPHPUnitConfigFile filesystemName="phpunit.xml"/>
  59 + <testApplicationDirectory>
  60 + <testApplicationBootstrapFile filesystemName="bootstrap.php"/>
  61 + </testApplicationDirectory>
  62 + <testLibraryDirectory>
  63 + <testLibraryBootstrapFile filesystemName="bootstrap.php"/>
  64 + </testLibraryDirectory>
  65 + </testsDirectory>
  66 + </projectDirectory>
  67 +</projectProfile>
8 application/Bootstrap.php
... ... @@ -0,0 +1,8 @@
  1 +<?php
  2 +
  3 +class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
  4 +{
  5 +
  6 +
  7 +}
  8 +
20 application/configs/application.ini
... ... @@ -0,0 +1,20 @@
  1 +[production]
  2 +phpSettings.display_startup_errors = 0
  3 +phpSettings.display_errors = 0
  4 +includePaths.library = APPLICATION_PATH "/../library"
  5 +bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
  6 +bootstrap.class = "Bootstrap"
  7 +appnamespace = "Application"
  8 +resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
  9 +resources.frontController.params.displayExceptions = 0
  10 +
  11 +[staging : production]
  12 +
  13 +[testing : production]
  14 +phpSettings.display_startup_errors = 1
  15 +phpSettings.display_errors = 1
  16 +
  17 +[development : production]
  18 +phpSettings.display_startup_errors = 1
  19 +phpSettings.display_errors = 1
  20 +resources.frontController.params.displayExceptions = 1
51 application/controllers/ErrorController.php
... ... @@ -0,0 +1,51 @@
  1 +<?php
  2 +
  3 +class ErrorController extends Zend_Controller_Action
  4 +{
  5 +
  6 + public function errorAction()
  7 + {
  8 + $errors = $this->_getParam('error_handler');
  9 +
  10 + switch ($errors->type) {
  11 + case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
  12 + case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
  13 + case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
  14 +
  15 + // 404 error -- controller or action not found
  16 + $this->getResponse()->setHttpResponseCode(404);
  17 + $this->view->message = 'Page not found';
  18 + break;
  19 + default:
  20 + // application error
  21 + $this->getResponse()->setHttpResponseCode(500);
  22 + $this->view->message = 'Application error';
  23 + break;
  24 + }
  25 +
  26 + // Log exception, if logger available
  27 + if ($log = $this->getLog()) {
  28 + $log->crit($this->view->message, $errors->exception);
  29 + }
  30 +
  31 + // conditionally display exceptions
  32 + if ($this->getInvokeArg('displayExceptions') == true) {
  33 + $this->view->exception = $errors->exception;
  34 + }
  35 +
  36 + $this->view->request = $errors->request;
  37 + }
  38 +
  39 + public function getLog()
  40 + {
  41 + $bootstrap = $this->getInvokeArg('bootstrap');
  42 + if (!$bootstrap->hasPluginResource('Log')) {
  43 + return false;
  44 + }
  45 + $log = $bootstrap->getResource('Log');
  46 + return $log;
  47 + }
  48 +
  49 +
  50 +}
  51 +
18 application/controllers/IndexController.php
... ... @@ -0,0 +1,18 @@
  1 +<?php
  2 +
  3 +class IndexController extends Zend_Controller_Action
  4 +{
  5 +
  6 + public function init()
  7 + {
  8 + /* Initialize action controller here */
  9 + }
  10 +
  11 + public function indexAction()
  12 + {
  13 + // action body
  14 + }
  15 +
  16 +
  17 +}
  18 +
28 application/views/scripts/error/error.phtml
... ... @@ -0,0 +1,28 @@
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2 +<html xmlns="http://www.w3.org/1999/xhtml">
  3 +<head>
  4 + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5 + <title>Zend Framework Default Application</title>
  6 +</head>
  7 +<body>
  8 + <h1>An error occurred</h1>
  9 + <h2><?php echo $this->message ?></h2>
  10 +
  11 + <?php if (isset($this->exception)): ?>
  12 +
  13 + <h3>Exception information:</h3>
  14 + <p>
  15 + <b>Message:</b> <?php echo $this->exception->getMessage() ?>
  16 + </p>
  17 +
  18 + <h3>Stack trace:</h3>
  19 + <pre><?php echo $this->exception->getTraceAsString() ?>
  20 + </pre>
  21 +
  22 + <h3>Request Parameters:</h3>
  23 + <pre><?php echo var_export($this->request->getParams(), true) ?>
  24 + </pre>
  25 + <?php endif ?>
  26 +
  27 +</body>
  28 +</html>
43 application/views/scripts/index/index.phtml
... ... @@ -0,0 +1,43 @@
  1 +<style>
  2 + a:link,
  3 + a:visited
  4 + {
  5 + color: #0398CA;
  6 + }
  7 +
  8 + span#zf-name
  9 + {
  10 + color: #91BE3F;
  11 + }
  12 +
  13 + div#welcome
  14 + {
  15 + color: #FFFFFF;
  16 + background-image: url(http://framework.zend.com/images/bkg_header.jpg);
  17 + width: 600px;
  18 + height: 400px;
  19 + border: 2px solid #444444;
  20 + overflow: hidden;
  21 + text-align: center;
  22 + }
  23 +
  24 + div#more-information
  25 + {
  26 + background-image: url(http://framework.zend.com/images/bkg_body-bottom.gif);
  27 + height: 100%;
  28 + }
  29 +</style>
  30 +<div id="welcome">
  31 + <h1>Welcome to the <span id="zf-name">Zend Framework!</span></h1>
  32 +
  33 + <h3>This is your project's main page</h3>
  34 +
  35 + <div id="more-information">
  36 + <p><img src="http://framework.zend.com/images/PoweredBy_ZF_4LightBG.png" /></p>
  37 + <p>
  38 + Helpful Links: <br />
  39 + <a href="http://framework.zend.com/">Zend Framework Website</a> |
  40 + <a href="http://framework.zend.com/manual/en/">Zend Framework Manual</a>
  41 + </p>
  42 + </div>
  43 +</div>
30 docs/README.txt
... ... @@ -0,0 +1,30 @@
  1 +README
  2 +======
  3 +
  4 +This directory should be used to place project specfic documentation including
  5 +but not limited to project notes, generated API/phpdoc documentation, or
  6 +manual files generated or hand written. Ideally, this directory would remain
  7 +in your development environment only and should not be deployed with your
  8 +application to it's final production location.
  9 +
  10 +
  11 +Setting Up Your VHOST
  12 +=====================
  13 +
  14 +The following is a sample VHOST you might want to consider for your project.
  15 +
  16 +<VirtualHost *:80>
  17 + DocumentRoot "/home/prskavecl/src/zffirebug/public"
  18 + ServerName zffirebug.local
  19 +
  20 + # This should be omitted in the production environment
  21 + SetEnv APPLICATION_ENV development
  22 +
  23 + <Directory "/home/prskavecl/src/zffirebug/public">
  24 + Options Indexes MultiViews FollowSymLinks
  25 + AllowOverride All
  26 + Order allow,deny
  27 + Allow from all
  28 + </Directory>
  29 +
  30 +</VirtualHost>
7 public/.htaccess
... ... @@ -0,0 +1,7 @@
  1 +
  2 +RewriteEngine On
  3 +RewriteCond %{REQUEST_FILENAME} -s [OR]
  4 +RewriteCond %{REQUEST_FILENAME} -l [OR]
  5 +RewriteCond %{REQUEST_FILENAME} -d
  6 +RewriteRule ^.*$ - [NC,L]
  7 +RewriteRule ^.*$ index.php [NC,L]
26 public/index.php
... ... @@ -0,0 +1,26 @@
  1 +<?php
  2 +
  3 +// Define path to application directory
  4 +defined('APPLICATION_PATH')
  5 + || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
  6 +
  7 +// Define application environment
  8 +defined('APPLICATION_ENV')
  9 + || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
  10 +
  11 +// Ensure library/ is on include_path
  12 +set_include_path(implode(PATH_SEPARATOR, array(
  13 + realpath(APPLICATION_PATH . '/../library'),
  14 + get_include_path(),
  15 +)));
  16 +
  17 +/** Zend_Application */
  18 +require_once 'Zend/Application.php';
  19 +
  20 +// Create application, bootstrap, and run
  21 +$application = new Zend_Application(
  22 + APPLICATION_ENV,
  23 + APPLICATION_PATH . '/configs/application.ini'
  24 +);
  25 +$application->bootstrap()
  26 + ->run();
0  tests/application/bootstrap.php
No changes.
0  tests/library/bootstrap.php
No changes.
0  tests/phpunit.xml
No changes.

0 comments on commit b75e694

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