PageRenderTime 67ms CodeModel.GetById 39ms RepoModel.GetById 0ms app.codeStats 0ms

/version/1.1.2/manual/website/appendix-standards.system

https://bitbucket.org/solarphp/docs
Unknown | 248 lines | 248 code | 0 blank | 0 comment | 0 complexity | a7c37ba265122e49923e6af8fbfa518b MD5 | raw file
Possible License(s): IPL-1.0, LGPL-2.0, Apache-2.0, 0BSD
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6. <title>A.6. Project System</title>
  7. <link rel="stylesheet" href="style.css" type="text/css" />
  8. <meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2" />
  9. <link rel="home" href="index" title="The Solar Framework for PHP" />
  10. <link rel="up" href="appendix-standards" title="Appendix A. Project Standards" />
  11. <link rel="prev" href="appendix-standards.config" title="A.5. Universal Configuration" />
  12. <link rel="next" href="appendix-naming" title="Appendix B. Naming Conventions" />
  13. <link rel="part" href="pt01" title="Part I. Getting Started" />
  14. <link rel="chapter" href="blog-demo" title="Chapter 1. Quick-Start Blog Demo" />
  15. <link rel="chapter" href="dispatch-cycle" title="Chapter 2. Dynamic Dispatch Cycle" />
  16. <link rel="chapter" href="model" title="Chapter 3. Working With Models" />
  17. <link rel="chapter" href="related" title="Chapter 4. Working With Related Models" />
  18. <link rel="chapter" href="views" title="Chapter 5. Views and Layouts" />
  19. <link rel="chapter" href="form" title="Chapter 6. Models and Forms" />
  20. <link rel="chapter" href="user" title="Chapter 7. User Authentication, Roles, and Access Control" />
  21. <link rel="chapter" href="commands" title="Chapter 8. Command-Line Tools" />
  22. <link rel="chapter" href="mail" title="Chapter 9. Mail" />
  23. <link rel="part" href="pt02" title="Part II. Appendices" />
  24. <link rel="appendix" href="appendix-standards" title="Appendix A. Project Standards" />
  25. <link rel="appendix" href="appendix-naming" title="Appendix B. Naming Conventions" />
  26. <link rel="subsection" href="appendix-standards.system#appendix-standards.system.source" title="A.6.1. The source/ Directory" />
  27. <link rel="subsection" href="appendix-standards.system#appendix-standards.system.include" title="A.6.2. The include/ Directory" />
  28. <link rel="subsection" href="appendix-standards.system#appendix-standards.system.config" title="A.6.3. The config/ Directory" />
  29. <link rel="subsection" href="appendix-standards.system#appendix-standards.system.docroot" title="A.6.4. The docroot/ Directory" />
  30. </head>
  31. <body>
  32. <div class="navheader">
  33. <table width="100%" summary="Navigation header">
  34. <tr>
  35. <th colspan="3" align="center">A.6. Project System</th>
  36. </tr>
  37. <tr>
  38. <td width="20%" align="left"><a accesskey="p" href="appendix-standards.config">Prev</a> </td>
  39. <th width="60%" align="center">Appendix A. Project Standards</th>
  40. <td width="20%" align="right"> <a accesskey="n" href="appendix-naming">Next</a></td>
  41. </tr>
  42. </table>
  43. </div>
  44. <div class="sect1" title="A.6. Project System">
  45. <div class="titlepage">
  46. <div>
  47. <div>
  48. <h2 class="title" style="clear: both"><a id="appendix-standards.system"></a>A.6. Project System</h2>
  49. </div>
  50. </div>
  51. </div>
  52. <p>
  53. The library organization for Solar and your Vendor files is good for
  54. the core of the application, but usually you will need to deploy those
  55. libraries, as well as libraries from other Vendors, to a web server or
  56. other target machine. That means we need a common level of
  57. organization for the various support files and SVN externals; we call
  58. this a Solar "system" for your project.
  59. </p>
  60. <p>
  61. These are the main files and directories in a Solar system:
  62. </p>
  63. <pre class="screen"><em class="replaceable"><code>SYSTEM/</code></em>
  64. index.php # quick-start (insecure) bootstrap
  65. config.php # main config file
  66. config/ # other config files
  67. docroot/ # web server document root
  68. .htaccess # mod-rewrite rules
  69. index.php # real bootstrap file
  70. public/ # public assets
  71. Solar/ # Solar assets
  72. include/ # used as the php include_path
  73. script/ # command-line scripts
  74. solar # the solar command-line tool
  75. source/ # source packages, libraries, etc
  76. sqlite/ # sqlite files
  77. tmp/ # temp files
  78. cache/ # private cache
  79. log/ # log files
  80. mail/ # test emails
  81. session/ # session files</pre>
  82. <p>
  83. The "big four" directories here are <code class="filename">source/</code>,
  84. <code class="filename">include/</code>, <code class="filename">config/</code>, and
  85. <code class="filename">docroot/</code>. The others are mostly self-explanatory.
  86. </p>
  87. <div class="sect2" title="A.6.1. The source/ Directory">
  88. <div class="titlepage">
  89. <div>
  90. <div>
  91. <h3 class="title"><a id="appendix-standards.system.source"></a>A.6.1. The <code class="literal">source/</code> Directory</h3>
  92. </div>
  93. </div>
  94. </div>
  95. <p>
  96. The <code class="filename">source/</code> directory is where all your source
  97. files are placed, including the files from
  98. <span class="command"><strong>make-vendor</strong></span>. This is *not* used as the
  99. include-path; it is a holding location to keep all your source code in
  100. one place. (We will get to the include-path shortly.)
  101. </p>
  102. <p>
  103. The <code class="filename">source/</code> directory doesn't care what kind of
  104. code or pacakges you keep there. You can download and extract
  105. PEAR-style packages, keep downloads of third-party libraries, or use
  106. svn externals or git clones. You could even keep multiple versions of
  107. the same libraries here, so long as each gets its own subdirectory.
  108. </p>
  109. <p>
  110. The <code class="filename">source/</code> directory is organized like this:
  111. </p>
  112. <pre class="screen">source/
  113. acme/ # libraries from the `make-vendor Acme` CLI call
  114. Acme.php
  115. Acme/
  116. config/
  117. script/
  118. docs/
  119. tests/
  120. example/ # svn:externals http://svn.example.com/trunk
  121. ...
  122. solar/ # core Solar libraries
  123. Solar.php
  124. Solar/
  125. config/
  126. script/
  127. docs/
  128. tests/
  129. third-party/ # copied or downloaded from a third party
  130. ...</pre>
  131. </div>
  132. <div class="sect2" title="A.6.2. The include/ Directory">
  133. <div class="titlepage">
  134. <div>
  135. <div>
  136. <h3 class="title"><a id="appendix-standards.system.include"></a>A.6.2. The <code class="filename">include/</code> Directory</h3>
  137. </div>
  138. </div>
  139. </div>
  140. <p>
  141. The <code class="filename">include/</code> directory is used as the
  142. include-path for your Solar system code. In general, the
  143. <code class="filename">include/</code> directory contains only symlinks to the
  144. <code class="filename">source/</code> directory. This means you can have any
  145. files at all in the <code class="filename">source/</code> directory and not
  146. pollute your include-path. It also means you can swap between sources
  147. at will by pointing the symlink to whatever you want.
  148. </p>
  149. <p>
  150. The <code class="filename">include/</code> directory is organized like
  151. this:
  152. </p>
  153. <pre class="screen">include/
  154. Acme.php # ln -s ../source/acme/Acme.php
  155. Acme/ # ln -s ../source/acme/Acme
  156. Example/ # ln -s ../source/Example
  157. Solar.php # ln -s ../source/solar/Solar.php
  158. Solar/ # ln -s ../source/solar/Solar
  159. thirdparty.php # ln -s ../source/third-party/some_file.php</pre>
  160. <p>
  161. If you use <span class="command"><strong>make-vendor</strong></span>, these links will be created
  162. for you automatically (both Windows Vista and Unix style symlinks are
  163. supported). If you bring in your own sources from Solar-style vendors,
  164. you can use <span class="command"><strong>link-vendor</strong></span> to create them for you. For
  165. non-Solar-style vendors, you will need to create the links yourself.
  166. </p>
  167. </div>
  168. <div class="sect2" title="A.6.3. The config/ Directory">
  169. <div class="titlepage">
  170. <div>
  171. <div>
  172. <h3 class="title"><a id="appendix-standards.system.config"></a>A.6.3. The <code class="filename">config/</code> Directory</h3>
  173. </div>
  174. </div>
  175. </div>
  176. <p>
  177. Next, we have the <code class="filename">config/</code> directory. This one
  178. holds all configuration files for the system.
  179. </p>
  180. <pre class="screen">config.php
  181. config/
  182. access.txt # an example ACL file
  183. htpasswd.conf # an example password file
  184. thirdparty.ini # a .ini file for a third-party library</pre>
  185. </div>
  186. <div class="sect2" title="A.6.4. The docroot/ Directory">
  187. <div class="titlepage">
  188. <div>
  189. <div>
  190. <h3 class="title"><a id="appendix-standards.system.docroot"></a>A.6.4. The <code class="filename">docroot/</code> Directory</h3>
  191. </div>
  192. </div>
  193. </div>
  194. <p>
  195. The last of the "big four" directories is the
  196. <code class="filename">docroot/</code>. This is the web server document root for
  197. the system; your virtual host configurations should point to this
  198. directory, not to the
  199. <code class="filename"><em class="replaceable"><code>SYSTEM</code></em></code> root.
  200. </p>
  201. <p>
  202. The <code class="filename">public/</code> subdirectory contains public assets
  203. such as Javascript files, stylesheets, images, etc. In a Solar-style
  204. vendor, the ending directories are actually symlinks back to a
  205. <code class="filename">Public/</code> directory for a particular class. This
  206. lets you distribute public assets along with the class package without
  207. having to copy those assets every time you change them.
  208. </p>
  209. <p>
  210. The <code class="filename">public/</code> subdirectory is organized as
  211. follows:
  212. </p>
  213. <pre class="screen">docroot/
  214. index.php # bootstrap file
  215. public/ # public assets
  216. Solar/ #
  217. View/ #
  218. Helper/ #
  219. Pager/ # ln -s <code class="filename"><em class="replaceable"><code>SYSTEM</code></em>/source/Solar/View/Helper/Pager/Public</code></pre>
  220. <p>
  221. If you create class with a <code class="filename">Public/</code> subdirectory
  222. for public assets, you can use the <span class="command"><strong>link-public</strong></span>
  223. command to automatically create these symlinks (both Windows Vista
  224. and Unix symlinks are supported).
  225. </p>
  226. </div>
  227. </div>
  228. <div class="navfooter">
  229. <table width="100%" summary="Navigation footer">
  230. <tr>
  231. <td width="40%" align="left"><a accesskey="p" href="appendix-standards.config">Prev</a> </td>
  232. <td width="20%" align="center">
  233. <a accesskey="u" href="appendix-standards">Up</a>
  234. </td>
  235. <td width="40%" align="right"> <a accesskey="n" href="appendix-naming">Next</a></td>
  236. </tr>
  237. <tr>
  238. <td width="40%" align="left" valign="top">A.5. Universal Configuration </td>
  239. <td width="20%" align="center">
  240. <a accesskey="h" href="index">Home</a>
  241. </td>
  242. <td width="40%" align="right" valign="top"> Appendix B. Naming Conventions</td>
  243. </tr>
  244. </table>
  245. </div>
  246. <div xmlns="" class="revinfo"></div>
  247. </body>
  248. </html>