diff options
Diffstat (limited to 'zend/documentation/manual/core/en/project-structure.project.html')
| -rw-r--r-- | zend/documentation/manual/core/en/project-structure.project.html | 302 |
1 files changed, 302 insertions, 0 deletions
diff --git a/zend/documentation/manual/core/en/project-structure.project.html b/zend/documentation/manual/core/en/project-structure.project.html new file mode 100644 index 0000000..0cb10ab --- /dev/null +++ b/zend/documentation/manual/core/en/project-structure.project.html @@ -0,0 +1,302 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> + <title>Recommended Project Directory Structure - Zend Framework Manual</title> + +</head> +<body> +<table width="100%"> + <tr valign="top"> + <td width="85%"> + <table width="100%"> + <tr> + <td width="25%" style="text-align: left;"> + <a href="project-structure.overview.html">Overview</a> + </td> + + <td width="50%" style="text-align: center;"> + <div class="up"><span class="up"><a href="project-structure.html">Recommended Project Structure for Zend Framework MVC Applications</a></span><br /> + <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div> + </td> + + <td width="25%" style="text-align: right;"> + <div class="next" style="text-align: right; float: right;"><a href="project-structure.filesystem.html">Module Structure</a></div> + </td> + </tr> + </table> +<hr /> +<div id="project-structure.project" class="section"><div class="info"><h1 class="title">Recommended Project Directory Structure</h1></div> + + + <div class="programlisting text"><div class="textcode"><div class="text" style="font-family: monospace;"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><project name>/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> application/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> configs/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> application.ini</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> controllers/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> helpers/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> forms/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> layouts/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> filters/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> helpers/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> scripts/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> models/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> modules/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> services/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> views/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> filters/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> helpers/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> scripts/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> Bootstrap.php</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> data/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> cache/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> indexes/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> locales/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> logs/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> sessions/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> uploads/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> docs/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> library/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> public/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> css/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> images/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> js/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> .htaccess</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> index.php</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> scripts/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> jobs/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> build/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> temp/</div></li> +<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> tests/</div></li></ol></div></div></div> + + + <p class="para"> + The following describes the use cases for each directory as listed. + </p> + + <ul class="itemizedlist"> + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">application/</var></em>: This directory contains + your application. It will house the <acronym class="acronym">MVC</acronym> system, as well as + configurations, services used, and your bootstrap file. + </p> + + <ul class="itemizedlist"> + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">configs/</var></em>: The + application-wide configuration directory. + </p> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">controllers/</var></em>, + <em class="emphasis"><var class="filename">models/</var></em>, and + <em class="emphasis"><var class="filename">views/</var></em>: These directories + serve as the default controller, model or view directories. Having + these three directories inside the application directory provides the + best layout for starting a simple project as well as starting a modular + project that has global <var class="filename">controllers/models/views</var>. + </p> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">controllers/helpers/</var></em>: These + directories will contain action helpers. Action helpers will be + namespaced either as "<span class="classname">Controller_Helper_</span>" for + the default module or "<Module>_Controller_Helper" in other + modules. + </p> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">layouts/</var></em>: This layout + directory is for <acronym class="acronym">MVC</acronym>-based layouts. Since + <span class="classname">Zend_Layout</span> is capable of + <acronym class="acronym">MVC</acronym>- and non-<acronym class="acronym">MVC</acronym>-based layouts, + the location of this directory reflects that layouts are not on a + 1-to-1 relationship with controllers and are independent of templates + within <var class="filename">views/</var>. + </p> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">modules/</var></em>: Modules allow a + developer to group a set of related controllers into a logically + organized group. The structure under the modules directory would + resemble the structure under the application directory. + </p> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">services/</var></em>: This directory is + for your application specific web-service files that are provided by + your application, or for implementing a <a href="http://www.martinfowler.com/eaaCatalog/serviceLayer.html" class="link external">» Service + Layer</a> for your models. + </p> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">Bootstrap.php</var></em>: This file is + the entry point for your application, and should implement + <span class="classname">Zend_Application_Bootstrap_Bootstrapper</span>. + The purpose for this file is to bootstrap the application and make + components available to the application by initializing them. + </p> + </li> + </ul> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">data/</var></em>: This directory provides a + place to store application data that is volatile and possibly temporary. The + disturbance of data in this directory might cause the application to fail. + Also, the information in this directory may or may not be committed to a + subversion repository. Examples of things in this directory are session files, + cache files, sqlite databases, logs and indexes. + </p> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">docs/</var></em>: This directory contains + documentation, either generated or directly authored. + </p> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">library/</var></em>: This directory is for + common libraries on which the application depends, and should be on the + <acronym class="acronym">PHP</acronym> <span class="property">include_path</span>. Developers should + place their application's library code under this directory in a unique + namespace, following the guidelines established in the <acronym class="acronym">PHP</acronym> + manual's <a href="http://www.php.net/manual/en/userlandnaming.php" class="link external">» Userland Naming + Guide</a>, as well as those established by Zend itself. This + directory may also include Zend Framework itself; if so, you would house it in + <var class="filename">library/Zend/</var>. + </p> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">public/</var></em>: This directory contains all + public files for your application. <var class="filename">index.php</var> sets up and + invokes <span class="classname">Zend_Application</span>, which in turn invokes the + <var class="filename">application/Bootstrap.php</var> file, resulting in dispatching + the front controller. The web root of your web server would typically be set to + this directory. + </p> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">scripts/</var></em>: This directory contains + maintenance and/or build scripts. Such scripts might include command line, + cron, or phing build scripts that are not executed at runtime but are part of + the correct functioning of the application. + </p> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">temp/</var></em>: The <var class="filename">temp/</var> + folder is set aside for transient application data. This information would not + typically be committed to the applications svn repository. If data under the + <var class="filename">temp/</var> directory were deleted, the application should be + able to continue running with a possible decrease in performance until data is + once again restored or recached. + </p> + </li> + + <li class="listitem"> + <p class="para"> + <em class="emphasis"><var class="filename">tests/</var></em>: This directory contains + application tests. These could be hand-written, PHPUnit tests, Selenium-RC + based tests or based on some other testing framework. By default, library code + can be tested by mimicing the directory structure of your + <var class="filename">library/</var> directory. Additionally, functional tests for + your application could be written mimicing the + <var class="filename">application/</var> directory structure (including the + application subdirectory). + </p> + </li> + </ul> + </div> + <hr /> + + <table width="100%"> + <tr> + <td width="25%" style="text-align: left;"> + <a href="project-structure.overview.html">Overview</a> + </td> + + <td width="50%" style="text-align: center;"> + <div class="up"><span class="up"><a href="project-structure.html">Recommended Project Structure for Zend Framework MVC Applications</a></span><br /> + <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div> + </td> + + <td width="25%" style="text-align: right;"> + <div class="next" style="text-align: right; float: right;"><a href="project-structure.filesystem.html">Module Structure</a></div> + </td> + </tr> + </table> +</td> + <td style="font-size: smaller;" width="15%"> <style type="text/css"> +#leftbar { + float: left; + width: 186px; + padding: 5px; + font-size: smaller; +} +ul.toc { + margin: 0px 5px 5px 5px; + padding: 0px; +} +ul.toc li { + font-size: 85%; + margin: 1px 0 1px 1px; + padding: 1px 0 1px 11px; + list-style-type: none; + background-repeat: no-repeat; + background-position: center left; +} +ul.toc li.header { + font-size: 115%; + padding: 5px 0px 5px 11px; + border-bottom: 1px solid #cccccc; + margin-bottom: 5px; +} +ul.toc li.active { + font-weight: bold; +} +ul.toc li a { + text-decoration: none; +} +ul.toc li a:hover { + text-decoration: underline; +} +</style> + <ul class="toc"> + <li class="header home"><a href="manual.html">Programmer's Reference Guide</a></li> + <li class="header up"><a href="manual.html">Programmer's Reference Guide</a></li> + <li class="header up"><a href="project-structure.html">Recommended Project Structure for Zend Framework MVC Applications</a></li> + <li><a href="project-structure.overview.html">Overview</a></li> + <li class="active"><a href="project-structure.project.html">Recommended Project Directory Structure</a></li> + <li><a href="project-structure.filesystem.html">Module Structure</a></li> + <li><a href="project-structure.rewrite.html">Rewrite Configuration Guide</a></li> + </ul> + </td> + </tr> +</table> +</body> +</html>
\ No newline at end of file |
