Changeset 214 for trunk/docs
- Timestamp:
- Dec 12, 2006 12:28:01 AM (17 years ago)
- Location:
- trunk/docs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/coding_standards.txt
r209 r214 7 7 ====================================================================== 8 8 9 We're following the PEAR coding standards, with minor modifications.10 11 This is essential reading:9 Our standards follow closely the PEAR coding standards. 10 11 Essential reading: 12 12 http://pear.php.net/manual/en/standards.php 13 13 … … 24 24 remains "Auth_SQL" 25 25 26 some_file.i htmlHTML file, which may or may not have some PHP,26 some_file.inc.html HTML file, which may or may not have some PHP, 27 27 but will be included by some other PHP file. Never 28 28 includes sensitive code as these files may be accessed … … 30 30 31 31 script.cli.php A command-line executable script, possibly executed 32 with CRON , usually outputs TEXT, notHTML.33 34 dbname.mysql Database schema file that goes with the application.32 with CRON. Outputs TEXT if any instead of HTML. 33 34 schema.mysql Database schema file that goes with the application. 35 35 36 36 main.screen.css CSS file with media: screen/print/all … … 182 182 // Here comes the HTML... 183 183 ?> 184 <div align="right"class="sc-tiny">185 [ <a href="<?php echo $app->oHREF('contact.php') ?>">Contact us</a> ]184 <div class="sc-tiny"> 185 <a href="<?php echo $app->ohref('/contact.php') ?>">Contact us</a> 186 186 </div> 187 187 <?php … … 200 200 http://java.sun.com/products/jdk/javadoc/writingdoccomments/index.html 201 201 202 Here is an example of the codebase method Email::validEmail(): 203 202 204 <?php 203 205 /** 204 * Description of function. 206 * Validates an email address based on the recommendations in RFC 3696. 207 * Is more loose than restrictive, to allow the many valid variants of 208 * email addresses while catching the most common mistakes. Checks an array too. 209 * http://www.faqs.org/rfcs/rfc822.html 210 * http://www.faqs.org/rfcs/rfc2822.html 211 * http://www.faqs.org/rfcs/rfc3696.html 212 * http://www.faqs.org/rfcs/rfc1035.html 205 213 * 206 214 * @access public 207 * @param string $db_table Database table. 208 * @param string $db_column Database column containing set or enum datatype. 209 * @return array The set/enum values or false on failure. 215 * @param mixed $email Address to check, string or array. 216 * @return bool Validity of address. 210 217 * @author Quinn Comendant <quinn@strangecode.com> 211 * @version 1.0 212 * @since 24 Feb 2004 19:34:04 218 * @since 30 Nov 2005 22:00:50 213 219 */ 214 function getSetEnumFieldValues()220 function validEmail($email) 215 221 { 216 $db =& DB::getInstance(); 217 218 $qid = $db->query("SHOW COLUMNS FROM $db_table LIKE '$db_col'",false); 219 220 $row = mysql_fetch_row($qid); 221 if (preg_match('/^enum|^set/i', $row[1]) && preg_match_all("/'([^']*)'/", $row[1], $match)) { 222 return $match[1]; 222 $app =& App::getInstance(); 223 224 // If an array, check values recursively. 225 if (is_array($email)) { 226 foreach ($email as $e) { 227 if (!$this->validEmail($e)) { 228 return false; 229 } 230 } 231 return true; 223 232 } else { 224 return false; 233 // To be valid email address must match regex and fit within the lenth constraints. 234 if (preg_match($this->getParam('regex'), $email, $e_parts) && strlen($e_parts[2]) < 64 && strlen($e_parts[3]) < 255) { 235 return true; 236 } else { 237 $app->logMsg(sprintf('Invalid email: %s', $email), LOG_INFO, __FILE__, __LINE__); 238 return false; 239 } 225 240 } 226 241 } -
trunk/docs/file_layout.txt
r137 r214 1 Updated: 26 Aug 2005 14:37:42 2 3 ====================================================================================== 4 Codebase can be located anywhere, as long as it is in the application's include path. 5 ====================================================================================== 1 Updated: 11 Dec 2006 16:25:10 2 ===================================================================== 6 3 7 4 codebase/ 8 bin/ 9 (generic command-line scripts and applications) 5 bin/ (generic command-line scripts and applications) 6 acl.cli.php (Tool for managing the permissions of an ACL.inc.php based system) 7 extract_gettext.pl (tool for exporting all the strings called by the _("Gettext function") ) 10 8 file_importer.php 11 9 install.sh 12 pedit_permissions.sh13 10 module_maker/ (scripts for generating modules) 14 11 _config.inc.php … … 16 13 list_template.cli.php 17 14 module.cli.php 18 skel/ 19 (templates for generating modules) 15 skel/ (templates for generating modules) 20 16 adm_form.ihtml 21 17 adm_list.ihtml … … 26 22 sql.cli.php 27 23 validation.cli.php 24 pedit_permissions.sh 25 css/ (generic CSS files to be included using lib/CSS.inc.php) 26 admin.inc.css (CSS for the generic Strangecode administration system) 27 codebase.inc.css (CSS for html output by codebase libraries) 28 utilities.inc.css (generic CSS tools) 28 29 docs/ 29 codebase_script_template.php30 30 coding_standards.txt 31 example_config.inc.php (an example of the _config.inc.php site-boot document) 32 example_script_template.php 31 33 example_virtualhost_directive.txt 32 34 file_layout.txt 33 software_licence.txt 34 todo.txt 35 gpl.txt 36 revision_history.txt 37 version.txt (the version number of this codebase) 35 38 lib/ 36 App.inc.php (functions dealing with sessions, href/url/IP manipulation, directories.) 37 Auth_File.inc.php (file-based authentication system.) 38 Auth_SQL.inc.php (sql-based authentication system.) 39 ACL.inc.php (provides Access Control List functionality) 40 App.inc.php (provides global application functionality: sessions, href/url/IP manipulation, directories) 41 Auth_File.inc.php (file-based authentication system) 42 Auth_SQL.inc.php (sql-based authentication system) 39 43 AuthorizeNet.inc.php (routines for connection to authorize.net's advanced processing interface) 40 CSS.inc.php 41 DB.inc.php (database abstraction layer.) 42 DBSessionHandler.inc.php (database session handler.) 43 FormValidator.inc.php (validation routines used to test incoming user data.) 44 Cache.inc.php (provides session-based caching functionality for quick retreival of all PHP data types) 45 CSS.inc.php (manage and deliver CSS data) 46 DB.inc.php (minimal database abstraction layer) 47 DBSessionHandler.inc.php (database session handler) 48 Email.inc.php (provides email validation and sending functionality) 49 FormValidator.inc.php (validation routines used to test incoming user data) 44 50 Google_API.inc.php (class for connecting to, querying, and dealing with data of the Google API) 45 ImageThumb.inc.php (automated image thumbnailing routines.) 51 Heirarchy.php (class for manipulation of heirarchies) 52 Image.inc.php (manage printing of images related to db records) 53 ImageThumb.inc.php (automated image thumbnailing routines) 54 Lock.inc.php (db record locking system) 46 55 MCVE.inc.php 47 Nav.inc.php (navigation element management class)) 48 NodeHeirarchy.php (class for manipulation of node heirarchies.) 56 Navigation.inc.php (navigation element management class)) 49 57 PageNumbers.inc.php (class for managing and printing various elements of page numbers and pagenation) 50 58 PageSequence.inc.php (manage a sequence of steps and data from step form elements, like order checkout or signup) … … 52 60 PEdit.inc.php (page-by-page file-based content management system) 53 61 Prefs.inc.php (class for semi-permenent storage of values) 54 Lock.inc.php (db record locking system)55 Version.inc.php (db record versioning system)56 62 ScriptTimer.inc.php (timer for scripts) 57 Cache.inc.php (class for accessing a cache in a users session, stores any variables for quick retreival)58 63 SortOrder.inc.php (class dealing with sorting of columns in database generated lists) 59 64 SpellCheck.inc.php 60 TemplateGlue.inc.php (functions that generating html .)61 Upload.inc.php (class that manages uploading of files .)62 Utilities.inc.php (functions for general utility: setting defaults, num/string functions, etc .)63 services/64 65 TemplateGlue.inc.php (functions that generating html) 66 Upload.inc.php (class that manages uploading of files) 67 Utilities.inc.php (functions for general utility: setting defaults, num/string functions, etc) 68 Version.inc.php (db record versioning system) 69 services/ (codebase scripts that are only useful when web accessible, i.e. to be used in a doc root) 65 70 admins.php 66 71 css.php … … 71 76 password.php 72 77 phpinfo.php 73 templates 78 provides 79 templates/ 74 80 versions.php 81 tests/ (unit-based tests for all codebase libraries) 82 83 =================================================================================== 84 Group of applications and related files, usually installed at /home/user/www.domain.com/ 75 85 76 86 77 ====================================================================================== 78 Group of applications and related files, usually installed at /home/user/www.domain.com/ 79 ====================================================================================== 80 81 global/ 82 (global level configuration and libraries for a group of sites/apps) 87 global/ (global level configuration and libraries for a group of sites/apps) 83 88 config.inc.php (system-wide configuration) 84 89 db_auth.inc.php (db-authentication for CLI scripts. chown'ed by user executing cron, NOT apache). 85 90 86 docs/ 87 (documents specific to a group of sites/apps) 88 tei_db.mysql (db schema) 91 docs/ (documents specific to a group of sites/apps) 92 schema.mysql 89 93 90 bin/ 91 (global level command-line scripts) 94 bin/ (global level command-line scripts) 92 95 93 admin/ 94 (DocumentRoot for the admin application) 96 admin/ (DocumentRoot for the admin application) 95 97 _config.inc.php 96 98 _templates/ (templates used for the admin docroot) … … 107 109 versions.php (manage db record versions) 108 110 109 html/ 110 (DocumentRoot of main site application) 111 _config.inc.php (configuration options and defaults specific to this site. included first in each script.) 111 html/(DocumentRoot of main site application) 112 _config.inc.php (configuration options and defaults specific to this site. included first in each script) 112 113 _templates/ (site specific templates. templates here override global codebase templates with same name) 113 114 css.php (style sheets loader)
Note: See TracChangeset
for help on using the changeset viewer.