- Timestamp:
- 10/19/08 00:32:49 (2 years ago)
- Files:
-
- fActiveRecord.php (modified) (8 diffs)
- fAuthorization.php (modified) (5 diffs)
- fBuffer.php (modified) (2 diffs)
- fCookie.php (modified) (7 diffs)
- fCore.php (modified) (17 diffs)
- fCryptography.php (modified) (10 diffs)
- fDatabase.php (modified) (25 diffs)
- fDate.php (modified) (8 diffs)
- fDirectory.php (modified) (9 diffs)
- fEmail.php (modified) (18 diffs)
- fEmptySetException.php (modified) (1 diff)
- fEnvironmentException.php (modified) (1 diff)
- fFile.php (modified) (5 diffs)
- fFilesystem.php (modified) (10 diffs)
- fRecordSet.php (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
fActiveRecord.php
r314 r315 Hide Line Numbers 1 1 <?php 2 2 /** 3 * An {@link http://en.wikipedia.org/wiki/Active_record_pattern active record pattern}base class3 * An [http://en.wikipedia.org/wiki/Active_record_pattern active record pattern] base class 4 4 * 5 * This class uses {@link fORMSchema}to inspect your database and provides an5 * This class uses fORMSchema to inspect your database and provides an 6 6 * OO interface to a single database table. The class dynamically handles 7 7 * method calls for getting, setting and other operations on columns. It also … … 28 28 29 29 /** 30 * Sets a value to the $values array, preserving the old value in $old_values30 * Sets a value to the `$values` array, preserving the old value in `$old_values` 31 31 * 32 32 * @internal … … 122 122 * value has changed. The value associated with each key is an array of 123 123 * old values with the first entry being the oldest value. The static 124 * methods {@link assign()}, {@link changed()}, {@link has()} and125 * {@link retrieve()} are the bestway to interact with this array.124 * methods ::assign(), ::changed(), ::has() and ::retrieve() are the best 125 * way to interact with this array. 126 126 * 127 127 * @var array … … 133 133 * 134 134 * This array is used to cache related records so that a database query 135 * is not required each time related records are accessed. The 136 * {@link fORMRelated} class handles most of the interaction with this 137 * array. 135 * is not required each time related records are accessed. The fORMRelated 136 * class handles most of the interaction with this array. 138 137 * 139 138 * @var array … … 155 154 * Handles all method calls for columns, related records and hook callbacks 156 155 * 157 * Dynamically handles get, set, prepare, encode and inspect methods for 158 * each column in this record. Method names are in the form verbColumName(). 159 * 160 * This method also handles associate, build, count and link verbs for 161 * records in many-to-many relationships; build, count and populate verbs 162 * for all related records in one-to-many relationships and the create verb 163 * for all related records in *-to-one relationships. 164 * 165 * replace:: hook callbacks registered through 166 * {@link fORM::registerHookCallback()} will be delegated via this method. 156 * Dynamically handles `get`, `set`, `prepare`, `encode` and `inspect` 157 * methods for each column in this record. Method names are in the form 158 * `verbColumName()`. 159 * 160 * This method also handles `associate`, `build`, `count` and `link` verbs 161 * for records in many-to-many relationships; `build`, `count` and 162 * `populate` verbs for all related records in one-to-many relationships 163 * and the `create` verb for all related records in *-to-one relationships. 164 * 165 * `replace::` hook callbacks registered through 166 * fORM::registerHookCallback() will be delegated via this method. 167 167 * 168 168 * @throws fValidationException … … 316 316 * @throws fNotFoundException 317 317 * 318 * @param mixed $primary_key The primary key value(s). If multi-field, use an associative array of (string) {field name} => (mixed) {value}.318 * @param mixed $primary_key The primary key value(s). If multi-field, use an associative array of `(string) {field name} => (mixed) {value}`. 319 319 * @return fActiveRecord 320 320 */ … … 677 677 * - **float**: takes 1 parameter to specify the number of decimal places 678 678 * - **date, time, timestamp**: `format()` will be called on the fDate/fTime/fTimestamp object with the 1 parameter specified 679 * - **objects**: the object will be converted to a string by `__toString()` or a stringcast and then will be run through fHTML::encode()679 * - **objects**: the object will be converted to a string by `__toString()` or a `(string)` cast and then will be run through fHTML::encode() 680 680 * - **all other data types**: the value will be run through fHTML::encode() 681 681 * … … 1045 1045 * 1046 1046 * Below are the transformations performed: 1047 * - varchar, char, text columns: will run through {@link fHTML::prepare()} 1048 * - boolean: will return 'Yes' or 'No' 1049 * - integer: will add thousands/millions/etc. separators 1050 * - float: will add thousands/millions/etc. separators and takes 1 parameter to specify the number of decimal places 1051 * - date, time, timestamp: format() will be called on the {@link fDate}/{@link fTime}/{@link fTimestamp} object with the 1 parameter specified 1052 * - objects: objects: the object will be converted to a string by __toString() or a string cast and then will be run through {@link fHTML::prepare()} 1047 * 1048 * - **varchar, char, text**: will run through fHTML::prepare() 1049 * - **boolean**: will return `'Yes'` or `'No'` 1050 * - **integer**: will add thousands/millions/etc. separators 1051 * - **float**: will add thousands/millions/etc. separators and takes 1 parameter to specify the number of decimal places 1052 * - **date, time, timestamp**: `format()` will be called on the fDate/fTime/fTimestamp object with the 1 parameter specified 1053 * - **objects**: the object will be converted to a string by `__toString()` or a `(string)` cast and then will be run through fHTML::prepare() 1053 1054 * 1054 1055 * @param string $column The name of the column to retrieve fAuthorization.php
r311 r315 Hide Line Numbers 63 63 * Adds a named IP address or range, or array of addresses and/or ranges 64 64 * 65 * This method allows {@link checkIP()} to be called with a name instead66 * of theactual IPs.67 * 68 * @param string $name The name to give the IP address (es)/range(s)69 * @param mixed $ip_ranges This can be string (or array of strings) of the IP (s) or IP range(s) to restrict to. Please see the {@link checkIP()} method description for details on the allowable formats.65 * This method allows ::checkIP() to be called with a name instead of the 66 * actual IPs. 67 * 68 * @param string $name The name to give the IP addresses/ranges 69 * @param mixed $ip_ranges This can be string (or array of strings) of the IPs or IP ranges to restrict to - please see ::checkIP() for format details 70 70 * @return void 71 71 */ … … 139 139 * Checks to see if the user is from the IPs or IP ranges specified 140 140 * 141 * The $ip_rangesparameter can be either a single string, or an array of141 * The `$ip_ranges` parameter can be either a single string, or an array of 142 142 * strings, each of which should be in one of the following formats: 143 * - A single IP address: 144 * - 192.168.1.1 145 * - 208.77.188.166 146 * - A CIDR range 147 * - 192.168.1.0/24 148 * - 208.77.188.160/28 149 * - An IP/subnet mask combination 150 * - 192.168.1.0/255.255.255.0 151 * - 208.77.188.160/255.255.255.240 152 * 153 * @param mixed $ip_ranges This can be string (or array of strings) of the IPs or IP ranges to restrict to. See method description for details. 143 * 144 * - A single IP address: 145 * - 192.168.1.1 146 * - 208.77.188.166 147 * - A CIDR range 148 * - 192.168.1.0/24 149 * - 208.77.188.160/28 150 * - An IP/subnet mask combination 151 * - 192.168.1.0/255.255.255.0 152 * - 208.77.188.160/255.255.255.240 153 * 154 * @param mixed $ip_ranges A string (or array of strings) of the IPs or IP ranges to restrict to - see method description for details 154 155 * @return boolean If the user is coming from (one of) the IPs or ranges specified 155 156 */ … … 274 275 275 276 /** 276 * Gets the value that was set as the user token, NULLif no token has been set277 * 278 * @return mixed The user token that had been set, NULLif none277 * Gets the value that was set as the user token, `NULL` if no token has been set 278 * 279 * @return mixed The user token that had been set, `NULL` if none 279 280 */ 280 281 static public function getUserToken() … … 368 369 * Sets the authorization levels to use for level checking 369 370 * 370 * @param array $levels An associative array of (string) {level} => (integer), for each level371 * @param array $levels An associative array of `(string) {level} => (integer) {value}`, for each level 371 372 * @return void 372 373 */ … … 406 407 * Array should be formatted like: 407 408 * 408 * <pre>409 * {{{ 409 410 * array ( 410 * (string) {resource name} => array((mixed) {permission}, ... ), ... 411 * (string) {resource name} => array( 412 * (mixed) {permission}, ... 413 * ), ... 411 414 * ) 412 * </pre>413 * 414 * The resource name or the permission may be the single character '*'415 * }}} 416 * 417 * The resource name or the permission may be the single character `'*'` 415 418 * which acts as a wildcard. 416 419 * 417 * @param array $acls The logged in user's ACLs (see method description for format)420 * @param array $acls The logged in user's ACLs - see method description for format 418 421 * @return void 419 422 */ fBuffer.php
r311 r315 Hide Line Numbers 1 1 <?php 2 2 /** 3 * Provides a single, simplified interface for {@link http://php.net/outcontrol output buffering}to prevent nested buffering issues and provide a more logical API3 * Provides a single, simplified interface for [http://php.net/outcontrol output buffering] to prevent nested buffering issues and provide a more logical API 4 4 * 5 5 * @copyright Copyright (c) 2008 William Bond … … 187 187 188 188 /** 189 * Starts capturing output, should be used with {@link stopCapture()}to grab output from code that does not offer an option of returning a value instead of outputting it189 * Starts capturing output, should be used with ::stopCapture() to grab output from code that does not offer an option of returning a value instead of outputting it 190 190 * 191 191 * @return void fCookie.php
r311 r315 Hide Line Numbers 63 63 64 64 /** 65 * Gets a cookie value from $_COOKIE, while allowing a default value to be provided65 * Gets a cookie value from `$_COOKIE`, while allowing a default value to be provided 66 66 * 67 67 * @param string $name The name of the cookie to retrieve … … 103 103 * 104 104 * The following methods allow for setting default parameters for this method: 105 * - {@link setDefaultExpires()}: Sets the default for the $expires parameter 106 * - {@link setDefaultPath()}: Sets the default for the $path parameter 107 * - {@link setDefaultDomain()}: Sets the default for the $domain parameter 108 * - {@link setDefaultSecure()}: Sets the default for the $secure parameter 109 * - {@link setDefaultHTTPOnly()}: Sets the default for the $httponly parameter 105 * 106 * - ::setDefaultExpires(): Sets the default for the `$expires` parameter 107 * - ::setDefaultPath(): Sets the default for the `$path` parameter 108 * - ::setDefaultDomain(): Sets the default for the `$domain` parameter 109 * - ::setDefaultSecure(): Sets the default for the `$secure` parameter 110 * - ::setDefaultHTTPOnly(): Sets the default for the `$httponly` parameter 110 111 * 111 112 * @param string $name The name of the cookie to set 112 113 * @param mixed $value The value of the cookie to set 113 * @param string|integer $expires A relative string to be interpreted by {@link http://php.net/strtotime strtotime()}or an integer unix timestamp114 * @param string|integer $expires A relative string to be interpreted by [http://php.net/strtotime strtotime()] or an integer unix timestamp 114 115 * @param string $path The path this cookie applies to 115 116 * @param string $domain The domain this cookie applies to … … 176 177 * Sets the default domain to use for cookies 177 178 * 178 * This value will be used when the $domain parameter of the {@link set()}179 * method is not specified or is set to NULL.179 * This value will be used when the `$domain` parameter of the ::set() 180 * method is not specified or is set to `NULL`. 180 181 * 181 182 * @param string $domain The default domain to use for cookies … … 191 192 * Sets the default expiration date to use for cookies 192 193 * 193 * This value will be used when the $expires parameter of the {@link set()}194 * method is not specified or is set to NULL.194 * This value will be used when the `$expires` parameter of the ::set() 195 * method is not specified or is set to `NULL`. 195 196 * 196 197 * @param string|integer $expires The default expiration date to use for cookies … … 206 207 * Sets the default httponly flag to use for cookies 207 208 * 208 * This value will be used when the $httponly parameter of the {@link set()}209 * method is not specified or is set to NULL.209 * This value will be used when the `$httponly` parameter of the ::set() 210 * method is not specified or is set to `NULL`. 210 211 * 211 212 * @param boolean $httponly The default httponly flag to use for cookies … … 221 222 * Sets the default path to use for cookies 222 223 * 223 * This value will be used when the $path parameter of the {@link set()}224 * method is not specified or is set to NULL.224 * This value will be used when the `$path` parameter of the ::set() 225 * method is not specified or is set to `NULL`. 225 226 * 226 227 * @param string $path The default path to use for cookies … … 234 235 235 236 /** 236 * Sets the default httponly flag to use for cookies 237 * 238 * @param boolean $httponly The default secure flag to use for cookies 237 * Sets the default secure flag to use for cookies 238 * 239 * This value will be used when the `$secure` parameter of the ::set() 240 * method is not specified or is set to `NULL`. 241 * 242 * @param boolean $secure The default secure flag to use for cookies 239 243 * @return void 240 244 */ fCore.php
r311 r315 Hide Line Numbers 192 192 * multiple parameters. 193 193 * 194 * <pre> 194 * {{{ 195 * #!php 195 196 * // Passing multiple parameters in a normal fashion 196 197 * fCore::call('Class::method', TRUE, 0, 'test'); … … 198 199 * // Passing multiple parameters in a parameters array 199 200 * fCore::call('Class::method', array(TRUE, 0, 'test')); 200 * </pre>201 * }}} 201 202 * 202 203 * To pass parameters by reference they must be assigned to an … … 205 206 * will be passed by value. 206 207 * 207 * <pre> 208 * {{{ 209 * #!php 208 210 * // Passing parameters by reference 209 211 * fCore::call('Class::method', array(&$var1, &$var2)); 210 * </pre>212 * }}} 211 213 * 212 214 * @param callback $callback The function or method to call … … 258 260 * Checks an error/exception destination to make sure it is valid 259 261 * 260 * @param string $destination The destination for the exception. An email, file or the string 'html'.261 * @return string|boolean 'email', 'file', 'html' or FALSE262 * @param string $destination The destination for the exception. An email, file or the string `'html'`. 263 * @return string|boolean `'email'`, `'file'`, `'html'` or `FALSE` 262 264 */ 263 265 static private function checkDestination($destination) … … 301 303 302 304 /** 303 * Creates a string representation of any variable using predefined strings for booleans, nulland empty strings305 * Creates a string representation of any variable using predefined strings for booleans, `NULL` and empty strings 304 306 * 305 307 * The string output format of this method is very similar to the output of 306 * {@link http://php.net/print_r print_r()}except that the following values308 * [http://php.net/print_r print_r()] except that the following values 307 309 * are represented as special strings: 308 * - TRUE: {true} 309 * - FALSE: {false} 310 * - NULL: {null} 311 * - '': {empty_string} 310 * 311 * - `TRUE`: `'{true}'` 312 * - `FALSE`: `'{false}'` 313 * - `NULL`: `'{null}'` 314 * - `''`: `'{empty_string}'` 312 315 * 313 316 * @param mixed $data The value to dump … … 374 377 375 378 /** 376 * Enables debug messages globally, i.e. they will be shown for any call to {@link debug()}379 * Enables debug messages globally, i.e. they will be shown for any call to ::debug() 377 380 * 378 381 * @param boolean $flag If debugging messages should be shown … … 388 391 * Turns on a feature where undefined constants are automatically created with the string value equivalent to the name 389 392 * 390 * This functionality only works if {@link enableErrorHandling()}has been393 * This functionality only works if ::enableErrorHandling() has been 391 394 * called first. This functionality may have a very slight performance 392 * impact since a E_STRICTerror message must be captured and then a393 * call to {@link http://php.net/define define()}is made.395 * impact since a `E_STRICT` error message must be captured and then a 396 * call to [http://php.net/define define()] is made. 394 397 * 395 398 * @return void … … 413 416 * Turns on developer-friendly error handling that includes context information including a backtrace and superglobal dumps 414 417 * 415 * All errors that match the current error_reporting() level will be 418 * All errors that match the current 419 * [http://php.net/error_reporting error_reporting()] level will be 416 420 * redirected to the destination and will include a full backtrace. In 417 421 * addition, dumps of the following superglobals will be made to aid in 418 422 * debugging: 419 * - $_SERVER 420 * - $_POST 421 * - $_GET 422 * - $_SESSION 423 * - $_FILES 424 * - $_COOKIE 423 * 424 * - `$_SERVER` 425 * - `$_POST` 426 * - `$_GET` 427 * - `$_SESSION` 428 * - `$_FILES` 429 * - `$_COOKIE` 425 430 * 426 431 * The superglobal dumps are only done once per page, however a backtrace … … 429 434 * If an email address is specified for the destination, only one email 430 435 * will be sent per script execution. If both error and 431 * {@link enableExceptionHandling() exception handling}are set to the same436 * [enableExceptionHandling() exception handling] are set to the same 432 437 * email address, the email will contain both errors and exceptions. 433 438 * 434 * @param string $destination The destination for the errors and context information - an email address, a file path or the string 'html'439 * @param string $destination The destination for the errors and context information - an email address, a file path or the string `'html'` 435 440 * @return void 436 441 */ … … 450 455 * 451 456 * Any uncaught exception will be redirected to the destination specified, 452 * and the page will execute the $closing_code callback before exiting. The 453 * destination will receive a message with the exception messaage, a full 454 * backtrace and dumps of the following superglobals to aid in debugging: 455 * - $_SERVER 456 * - $_POST 457 * - $_GET 458 * - $_SESSION 459 * - $_FILES 460 * - $_COOKIE 457 * and the page will execute the `$closing_code` callback before exiting. 458 * The destination will receive a message with the exception messaage, a 459 * full backtrace and dumps of the following superglobals to aid in 460 * debugging: 461 * 462 * - `$_SERVER` 463 * - `$_POST` 464 * - `$_GET` 465 * - `$_SESSION` 466 * - `$_FILES` 467 * - `$_COOKIE` 461 468 * 462 469 * The superglobal dumps are only done once per page, however a backtrace … … 468 475 * If an email address is specified for the destination, only one email 469 476 * will be sent per script execution. If both exception and 470 * {@link enableErrorHandling() error handling}are set to the same477 * [enableErrorHandling() error handling] are set to the same 471 478 * email address, the email will contain both exceptions and errors. 472 479 * 473 * @param string $destination The destination for the exception and context information - an email address, a file path or the string 'html'480 * @param string $destination The destination for the exception and context information - an email address, a file path or the string `'html'` 474 481 * @param callback $closing_code This callback will happen after the exception is handled and before page execution stops. Good for printing a footer. 475 * @param array $parameters The parameters to send to $closing_code482 * @param array $parameters The parameters to send to `$closing_code` 476 483 * @return void 477 484 */ … … 490 497 491 498 /** 492 * Prints the {@link dump()} of a value in a pre tag with the class "exposed"499 * Prints the ::dump() of a value in a pre tag with the class `exposed` 493 500 * 494 501 * @param mixed $data The value to show … … 504 511 * Generates some information about the context of an error or exception 505 512 * 506 * @return string A string containing $_SERVER, $_GET, $_POST, $_FILES, $_SESSSION513 * @return string A string containing `$_SERVER`, `$_GET`, `$_POST`, `$_FILES`, `$_SESSION` and `$_COOKIE` 507 514 */ 508 515 static private function generateContext() … … 521 528 * Returns the (generalized) operating system the code is currently running on 522 529 * 523 * @return string Either 'windows', 'solaris' or 'linux/unix'(linux, *BSD)530 * @return string Either `'windows'`, `'solaris'` or `'linux/unix'` (linux, *BSD) 524 531 */ 525 532 static public function getOS() … … 652 659 653 660 /** 654 * Adds a callback for when certain types of exceptions are {@link toss() tossed}661 * Adds a callback for when certain types of exceptions are [toss() tossed] 655 662 * 656 663 * The callback will be called when any exception of the class, or any … … 786 793 787 794 /** 788 * Returns TRUE for non-empty strings, numbers, objects, empty numbers and string-like numbers (such as 0, 0.0, '0')795 * Returns `TRUE` for non-empty strings, numbers, objects, empty numbers and string-like numbers (such as `0`, `0.0`, `'0'`) 789 796 * 790 797 * @param mixed $value The value to check … … 838 845 * The default error handler in PHP will show the line number of this 839 846 * method as the triggering code. To get a full backtrace, use 840 * {@link enableErrorHandling()}.841 * 842 * @param string $error_type The type of error to trigger: 'error', 'warning', 'notice'847 * ::enableErrorHandling(). 848 * 849 * @param string $error_type The type of error to trigger: `'error'`, `'warning'`, `'notice'` 843 850 * @param string $message The error message 844 851 * @return void fCryptography.php
r273 r315 Hide Line Numbers 1 1 <?php 2 2 /** 3 * Provides cryptography functionality, including hashing, symmetric key encryption and publickey encryption3 * Provides cryptography functionality, including hashing, symmetric-key encryption and public-key encryption 4 4 * 5 5 * @copyright Copyright (c) 2007-2008 William Bond … … 29 29 30 30 /** 31 * Checks a password against a hash 31 * Checks a password against a hash created with ::hashPassword() 32 32 * 33 33 * @param string $password The password to check … … 171 171 172 172 /** 173 * Decrypts ciphertext encrypted using public-key encryption via {@link publicKeyEncrypt()}173 * Decrypts ciphertext encrypted using public-key encryption via ::publicKeyEncrypt() 174 174 * 175 175 * A public key (X.509 certificate) is required for encryption and a … … 243 243 * @param string $plaintext The content to be encrypted 244 244 * @param string $public_key_file The path to an X.509 public key certificate 245 * @return string A base-64 encoded result containing a Flourish fingerprint and suitable for decryption using {@link publicKeyDecrypt()}245 * @return string A base-64 encoded result containing a Flourish fingerprint and suitable for decryption using ::publicKeyDecrypt() 246 246 */ 247 247 static public function publicKeyEncrypt($plaintext, $public_key_file) … … 282 282 * @param string $private_key_file The path to a PEM-encoded private key 283 283 * @param string $password The password for the private key 284 * @return string The base64-encoded signature 284 * @return string The base64-encoded signature suitable for verification using ::publicKeyVerify() 285 285 */ 286 286 static public function publicKeySign($plaintext, $private_key_file, $password) … … 307 307 308 308 /** 309 * Checks a signature for plaintext to verify the creator 309 * Checks a signature for plaintext to verify the creator - works with ::publicKeySign() 310 310 * 311 311 * A private key (PEM) is required for signing and a public key … … 340 340 341 341 /** 342 * Generates a random number using mt_rand() - make sure {@link seedRandom()} has been called342 * Generates a random number using [http://php.net/mt_rand mt_rand()] after ensuring a good PRNG seed 343 343 * 344 344 * @param integer $min The minimum number to return … … 360 360 * 361 361 * @param integer $length The length of string to return 362 * @param string $type The type of string to return , can be 'alphanumeric', 'alpha', 'numeric', or 'hexadecimal'362 * @param string $type The type of string to return: `'alphanumeric'`, `'alpha'`, `'numeric'`, or `'hexadecimal'` 363 363 * @return string A random string of the type and length specified 364 364 */ … … 454 454 455 455 /** 456 * Decrypts ciphertext encrypted using symmetric-key encryption via {@link symmetricKeyEncrypt()}456 * Decrypts ciphertext encrypted using symmetric-key encryption via ::symmetricKeyEncrypt() 457 457 * 458 458 * Since this is symmetric-key cryptography, the same key is used for … … 526 526 * @param string $plaintext The content to be encrypted 527 527 * @param string $secret_key The secret key to use for encryption 528 * @return string An encrypted and base-64 encoded result containing a Flourish fingerprint and suitable for decryption using {@link symmetricKeyDecrypt()}528 * @return string An encrypted and base-64 encoded result containing a Flourish fingerprint and suitable for decryption using ::symmetricKeyDecrypt() 529 529 */ 530 530 static public function symmetricKeyEncrypt($plaintext, $secret_key) fDatabase.php
r311 r315 Hide Line Numbers 4 4 * 5 5 * This class is implemented to use the UTF-8 character encoding. Please see 6 * {@link http://flourishlib.com/docs/UTF-8}for more information.6 * http://flourishlib.com/docs/UTF-8 for more information. 7 7 * 8 8 * The following databases are supported: 9 * - {@link http://microsoft.com/sql/ MSSQL} 10 * - {@link http://mysql.com MySQL} 11 * - {@link http://postgresql.org PostgreSQL} 12 * - {@link http://sqlite.org SQLite} 9 * 10 * - [http://microsoft.com/sql/ MSSQL] 11 * - [http://mysql.com MySQL] 12 * - [http://postgresql.org PostgreSQL] 13 * - [http://sqlite.org SQLite] 13 14 * 14 15 * The class will automatically use the first of the following extensions it finds: 15 * - MSSQL (via ODBC) 16 * - {@link http://php.net/pdo_odbc pdo_odbc} 17 * - {@link http://php.net/odbc odbc} 18 * - MSSQL 19 * - {@link http://msdn.microsoft.com/en-us/library/cc296221.aspx sqlsrv} 20 * - {@link http://php.net/pdo_dblib pdo_dblib} 21 * - {@link http://php.net/mssql mssql} (or {@link http://php.net/sybase sybase}) 22 * - MySQL 23 * - {@link http://php.net/mysql mysql} 24 * - {@link http://php.net/mysqli mysqli} 25 * - {@link http://php.net/pdo_mysql pdo_mysql} 26 * - PostgreSQL 27 * - {@link http://php.net/pgsql pgsql} 28 * - {@link http://php.net/pdo_pgsql pdo_pgsql} 29 * - SQLite 30 * - {@link http://php.net/pdo_sqlite pdo_sqlite} (for v3.x) 31 * - {@link http://php.net/sqlite sqlite} (for v2.x) 16 * 17 * - MSSQL (via ODBC) 18 * - [http://php.net/pdo_odbc pdo_odbc] 19 * - [http://php.net/odbc odbc] 20 * - MSSQL 21 * - [http://msdn.microsoft.com/en-us/library/cc296221.aspx sqlsrv] 22 * - [http://php.net/pdo_dblib pdo_dblib] 23 * - [http://php.net/mssql mssql] (or [http://php.net/sybase sybase]) 24 * - MySQL 25 * - [http://php.net/mysql mysql] 26 * - [http://php.net/mysqli mysqli] 27 * - [http://php.net/pdo_mysql pdo_mysql] 28 * - PostgreSQL 29 * - [http://php.net/pgsql pgsql] 30 * - [http://php.net/pdo_pgsql pdo_pgsql] 31 * - SQLite 32 * - [http://php.net/pdo_sqlite pdo_sqlite] (for v3.x) 33 * - [http://php.net/sqlite sqlite] (for v2.x) 32 34 * 33 35 * @copyright Copyright (c) 2007-2008 William Bond … … 75 77 * 76 78 * Options include: 77 * - mssql, mysql, mysqli, odbc, pgsql, sqlite, sqlsrv, pdo 79 * 80 * - `'mssql'` 81 * - `'mysql'` 82 * - `'mysqli'` 83 * - `'odbc'` 84 * - `'pgsql'` 85 * - `'sqlite'` 86 * - `'sqlsrv'` 87 * - `'pdo'` 78 88 * 79 89 * @var string … … 131 141 132 142 /** 133 * The database type (postgresql, mysql, sqlite)143 * The database type: `'mssql'`, `'mysql'`, `'postgresql'`, or `'sqlite'` 134 144 * 135 145 * @var string … … 153 163 154 164 /** 155 * Establishes a connection to the database.156 * 157 * @param string $type The type of the database: 'mssql', 'mysql', 'postgresql', 'sqlite'158 * @param string $database Name of the database. If an ODBC connection 'dsn:'concatenated with the DSN, if SQLite the path to the database file.165 * Configures the connection to a database - connection is not made until the first query is executed 166 * 167 * @param string $type The type of the database: `'mssql'`, `'mysql'`, `'postgresql'`, `'sqlite'` 168 * @param string $database Name of the database. If an ODBC connection `'dsn:'` concatenated with the DSN, if SQLite the path to the database file. 159 169 * @param string $username Database username, required for all databases except SQLite 160 170 * @param string $password The password for the username specified … … 607 617 * 608 618 * It is recommended to use the error handling features of 609 * {@link fCore::enableErrorHandling()}to log or email these warnings.610 * 611 * @param integer $threshold The limit of how long an SQL query can take before a warning is triggered619 * fCore::enableErrorHandling() to log or email these warnings. 620 * 621 * @param integer $threshold The limit (in milliseconds) of how long an SQL query can take before a warning is triggered 612 622 * @return void 613 623 */ … … 622 632 * 623 633 * The valid data types are: 624 * - blob 625 * - boolean 626 * - date 627 * - float 628 * - integer 629 * - string (also varchar, char or text) 630 * - time 631 * - timestamp 634 * 635 * - `'blob'` 636 * - `'boolean'` 637 * - `'date'` 638 * - `'float'` 639 * - `'integer'` 640 * - `'string'` (also varchar, char or text) 641 * - `'varchar'` 642 * - `'char'` 643 * - `'text'` 644 * - `'time'` 645 * - `'timestamp'` 632 646 * 633 647 * In addition to being able to specify the data type, you can also pass 634 648 * in an SQL statement with data type placeholders in the following form: 635 * - %l for a blob 636 * - %b for a boolean 637 * - %d for a date 638 * - %f for a float 639 * - %i for an integer 640 * - %s for a string 641 * - %t for a time 642 * - %p for a timestamp 649 * 650 * - `%l` for a blob 651 * - `%b` for a boolean 652 * - `%d` for a date 653 * - `%f` for a float 654 * - `%i` for an integer 655 * - `%s` for a string 656 * - `%t` for a time 657 * - `%p` for a timestamp 643 658 * 644 659 * @param string $sql_or_type This can either be the data type to escape or an SQL string with a data type placeholder - see method description 645 * @param mixed $value,... The value to escape - you should pass a single value if a data type is specified or a value for each placeholder 660 * @param mixed $value The value to escape - you should pass a single value if a data type is specified or a value for each placeholder 661 * @param mixed ... 646 662 * @return string The escaped value/SQL 647 663 */ … … 798 814 * Escapes a blob for use in SQL, includes surround quotes when appropriate 799 815 * 800 * A NULL value will be returned as 'NULL'816 * A `NULL` value will be returned as `'NULL'` 801 817 * 802 818 * @param string $value The blob to escape … … 830 846 * Escapes a boolean for use in SQL, includes surround quotes when appropriate 831 847 * 832 * A NULL value will be returned as 'NULL'848 * A `NULL` value will be returned as `'NULL'` 833 849 * 834 850 * @param boolean $value The boolean to escape … … 852 868 * Escapes a date for use in SQL, includes surrounding quotes 853 869 * 854 * A NULL or invalid value will be returned as 'NULL'870 * A `NULL` or invalid value will be returned as `'NULL'` 855 871 * 856 872 * @param string $value The date to escape … … 872 888 * Escapes a float for use in SQL 873 889 * 874 * A NULL value will be returned as 'NULL'890 * A `NULL` value will be returned as `'NULL'` 875 891 * 876 892 * @param float $value The float to escape … … 895 911 * Escapes an integer for use in SQL 896 912 * 897 * A NULL or invalid value will be returned as 'NULL'913 * A `NULL` or invalid value will be returned as `'NULL'` 898 914 * 899 915 * @param integer $value The integer to escape … … 918 934 * Escapes a string for use in SQL, includes surrounding quotes 919 935 * 920 * A NULL value will be returned as 'NULL'936 * A `NULL` value will be returned as `'NULL'` 921 937 * 922 938 * @param string $value The string to escape … … 995 1011 * Escapes a time for use in SQL, includes surrounding quotes 996 1012 * 997 * A NULL or invalid value will be returned as 'NULL'1013 * A `NULL` or invalid value will be returned as `'NULL'` 998 1014 * 999 1015 * @param string $value The time to escape … … 1015 1031 * Escapes a timestamp for use in SQL, includes surrounding quotes 1016 1032 * 1017 * A NULL or invalid value will be returned as 'NULL'1033 * A `NULL` or invalid value will be returned as `'NULL'` 1018 1034 * 1019 1035 * @param string $value The timestamp to escape … … 1201 1217 1202 1218 /** 1203 * Gets the php extension being used (mssql, mysql, mysqli, pgsql, sqlite, or pdo)1219 * Gets the php extension being used 1204 1220 * 1205 1221 * @internal … … 1216 1232 * Gets the database type 1217 1233 * 1218 * @return string The database type (mssql, mysql, pgsql or sqlite)1234 * @return string The database type: `'mssql'`, `'mysql'`, `'postgresql'` or `'sqlite'` 1219 1235 */ 1220 1236 public function getType() … … 1359 1375 * @param string $sql The SQL to check for a transaction query 1360 1376 * @param string $result_class The type of result object to create 1361 * @return mixed If the connection is not via PDO will return FALSE, otherwise an object of the type $result_class1377 * @return mixed If the connection is not via PDO will return `FALSE`, otherwise an object of the type $result_class 1362 1378 */ 1363 1379 private function handleTransactionQueries($sql, $result_class) … … 1424 1440 1425 1441 /** 1426 * Executes one or more sql queries 1427 * 1428 * @param string $sql One or more SQL statements 1429 * @param mixed $value,... The optional value(s) to place into any placeholders in the SQL - see {@link escape()} for details 1442 * Executes one or more SQL queries 1443 * 1444 * @param string $sql One or more SQL statements 1445 * @param mixed $value The optional value(s) to place into any placeholders in the SQL - see ::escape() for details 1446 * @param mixed ... 1430 1447 * @return fResult|array The fResult object(s) for the query 1431 1448 */ … … 1503 1520 * 1504 1521 * @param fResult $result The result object for the query 1505 * @param mixed $resource Only applicable for pdo, odbc and sqlsrv extentions, this is either the PDOStatement object or odbc or sqlsrvresource1522 * @param mixed $resource Only applicable for `pdo`, `odbc` and `sqlsrv` extentions, this is either the `PDOStatement` object or `odbc` or `sqlsrv` resource 1506 1523 * @return void 1507 1524 */ … … 1604 1621 * Translates the SQL statement using fSQLTranslation and executes it 1605 1622 * 1606 * @param string $sql One or more SQL statements 1607 * @param mixed $value,... The optional value(s) to place into any placeholders in the SQL - see {@link escape()} for details 1623 * @param string $sql One or more SQL statements 1624 * @param mixed $value The optional value(s) to place into any placeholders in the SQL - see ::escape() for details 1625 * @param mixed ... 1608 1626 * @return fResult|array The fResult object(s) for the query 1609 1627 */ … … 1634 1652 * be deleted. 1635 1653 * 1636 * @param string $sql A single SQL statement 1637 * @param mixed $value,... The optional value(s) to place into any placeholders in the SQL - see {@link escape()} for details 1654 * @param string $sql A single SQL statement 1655 * @param mixed $value The optional value(s) to place into any placeholders in the SQL - see ::escape() for details 1656 * @param mixed ... 1638 1657 * @return fUnbufferedResult The result object for the unbuffered query 1639 1658 */ … … 1706 1725 * is executed, the old result will be deleted. 1707 1726 * 1708 * @param string $sql A single SQL statement 1709 * @param mixed $value,... The optional value(s) to place into any placeholders in the SQL - see {@link escape()} for details 1727 * @param string $sql A single SQL statement 1728 * @param mixed $value The optional value(s) to place into any placeholders in the SQL - see ::escape() for details 1729 * @param mixed ... 1710 1730 * @return fUnbufferedResult The result object for the unbuffered query 1711 1731 */ … … 1732 1752 * 1733 1753 * The valid data types are: 1734 * - blob (or %l) 1735 * - boolean (or %b) 1736 * - date (or %d) 1737 * - float (or %f) 1738 * - integer (or %i) 1739 * - string (also %s, varchar, char or text) 1740 * - time (or %t) 1741 * - timestamp (or %p) 1754 * 1755 * - `'blob'` (or `'%l'`) 1756 * - `'boolean'` (or `'%b'`) 1757 * - `'date'` (or `'%d'`) 1758 * - `'float'` (or `'%f'`) 1759 * - `'integer'` (or `'%i'`) 1760 * - `'string'` (also `'%s, `'varchar'`, `'char'` or `'text'`) 1761 * - `'time'` (or `'%t'`) 1762 * - `'timestamp'` (or `'%p'`) 1742 1763 * 1743 1764 * @param string $data_type The data type being unescaped - see method description for valid values … … 1872 1893 * 1873 1894 * @param string $value The value to unescape 1874 * @return string The time in HH:MM:SSformat1895 * @return string The time in `HH:MM:SS` format 1875 1896 */ 1876 1897 private function unescapeTime($value) … … 1884 1905 * 1885 1906 * @param string $value The value to unescape 1886 * @return string The timestamp in YYYY-MM-DD HH:MM:SSformat1907 * @return string The timestamp in `YYYY-MM-DD HH:MM:SS` format 1887 1908 */ 1888 1909 private function unescapeTimestamp($value) fDate.php
r267 r315 Hide Line Numbers 1 1 <?php 2 2 /** 3 * Represents a date 3 * Represents a date as a value object 4 4 * 5 5 * @copyright Copyright (c) 2007-2008 William Bond … … 28 28 * @throws fValidationException 29 29 * 30 * @param fDate|object|string|integer $date The date to represent, NULLis interpreted as today30 * @param fDate|object|string|integer $date The date to represent, `NULL` is interpreted as today 31 31 * @return fDate 32 32 */ … … 73 73 74 74 /** 75 * Returns this date in 'Y-m-d'format76 * 77 * @return string The 'Y-m-d'format of this date75 * Returns this date in `Y-m-d` format 76 * 77 * @return string The `Y-m-d` format of this date 78 78 */ 79 79 public function __toString() … … 84 84 85 85 /** 86 * Changes the date by the adjustment specified, only a sjustments of a day or more will be made86 * Changes the date by the adjustment specified, only adjustments of a day or more will be made 87 87 * 88 88 * @throws fValidationException … … 124 124 * @throws fValidationException 125 125 * 126 * @param string $format The {@link http://php.net/date date()} function compatible formatting string, or a format name from {@link fTimestamp::defineFormat()}126 * @param string $format The [http://php.net/date date()] function compatible formatting string, or a format name from fTimestamp::defineFormat() 127 127 * @return string The formatted date 128 128 */ … … 151 151 * 152 152 * The output will read like: 153 * - "This date is {return value} the provided one" when a date it passed 154 * - "This date is {return value}" when no date is passed and comparing with today 153 * 154 * - "This date is `{return value}` the provided one" when a date it passed 155 * - "This date is `{return value}`" when no date is passed and comparing with today 155 156 * 156 157 * Examples of output for a date passed might be: 157 * - 2 days after 158 * - 1 year before 159 * - same day 158 * 159 * - `'2 days after'` 160 * - `'1 year before'` 161 * - `'same day'` 160 162 * 161 163 * Examples of output for no date passed might be: 162 * - 2 days from now 163 * - 1 year ago 164 * - today 164 * 165 * - `'2 days from now'` 166 * - `'1 year ago'` 167 * - `'today'` 165 168 * 166 169 * You would never get the following output since it includes more than one unit of time measurement: 167 * - 3 weeks and 1 day 168 * - 1 year and 2 months 170 * 171 * - `'3 weeks and 1 day'` 172 * - `'1 year and 2 months'` 169 173 * 170 174 * Values that are close to the next largest unit of measure will be rounded up: 171 * - 6 days would be represented as 1 week, however 5 days would not 172 * - 29 days would be represented as 1 month, but 21 days would be shown as 3 weeks 173 * 174 * @param fDate|object|string|integer $other_date The date to create the difference with, NULL is interpreted as today 175 * 176 * - `6 days` would be represented as `1 week`, however `5 days` would not 177 * - `29 days` would be represented as `1 month`, but `21 days` would be shown as `3 weeks` 178 * 179 * @param fDate|object|string|integer $other_date The date to create the difference with, `NULL` is interpreted as today 175 180 * @return string The fuzzy difference in time between the this date and the one provided 176 181 */ … … 241 246 * Returns the difference between the two dates in seconds 242 247 * 243 * @param fDate|object|string|integer $other_date The date to calculate the difference with, NULLis interpreted as today244 * @return integer The difference between the two dates in seconds, positive if $other_dateis before this date or negative if after248 * @param fDate|object|string|integer $other_date The date to calculate the difference with, `NULL` is interpreted as today 249 * @return integer The difference between the two dates in seconds, positive if `$other_date` is before this date or negative if after 245 250 */ 246 251 public function getSecondsDifference($other_date=NULL) … … 258 263 * modify the current date: 259 264 * 260 * To change the date to the first of the month: 261 * 262 * <pre> 263 * Y-m-01 264 * </pre> 265 * 266 * To change the date to the last of the month: 267 * 268 * <pre> 269 * Y-m-t 270 * </pre> 271 * 272 * To change the date to the 5th week of the year: 273 * 274 * <pre> 275 * Y-\W5-N 276 * </pre> 265 * - `'Y-m-01'` to change the date to the first of the month 266 * - `'Y-m-t'` to change the date to the last of the month 267 * - `'Y-\W5-N'` to change the date to the 5th week of the year 277 268 * 278 269 * @param string $format The current date will be formatted with this string, and the output used to create a new object fDirectory.php
r274 r315 Hide Line Numbers 79 79 80 80 /** 81 * Makes sure a directory has a / or \at the end81 * Makes sure a directory has a `/` or `\` at the end 82 82 * 83 83 * @param string $directory The directory to check … … 111 111 * Creates an object to represent a directory on the filesystem 112 112 * 113 * If multiple fDirectory objects are created for a single directory, 114 * they will reflect changes in each other including rename and delete 115 * actions. 116 * 113 117 * @throws fValidationException 114 118 * … … 173 177 174 178 /** 175 * When used in a string context, represents the file as the filename176 * 177 * @return string The f ilename of the file179 * Returns the full filesystem path for the directory 180 * 181 * @return string The full filesystem path 178 182 */ 179 183 public function __toString() … … 184 188 185 189 /** 186 * Will delete a directory and all files and folders inside of it190 * Will delete a directory and all files and directories inside of it 187 191 * 188 192 * This operation will not be performed until the filesystem transaction … … 222 226 * Gets the disk usage of the directory and all files and folders contained within 223 227 * 224 * May be incorrect if files over 2GB exist. 228 * This method may return incorrect results if files over 2GB exist and the 229 * server uses a 32 bit operating system 225 230 * 226 231 * @param boolean $format If the filesize should be formatted for human readability 227 232 * @param integer $decimal_places The number of decimal places to format to (if enabled) 228 * @return integer|string If formatted a string with filesize in b/kb/mb/gb/tb, otherwise an integer233 * @return integer|string If formatted, a string with filesize in b/kb/mb/gb/tb, otherwise an integer 229 234 */ 230 235 public function getFilesize($format=FALSE, $decimal_places=1) … … 250 255 * Gets the parent directory 251 256 * 252 * @return fDirectory The object representing the parent dir 257 * @return fDirectory The object representing the parent directory 253 258 */ 254 259 public function getParent() … … 275 280 * 276 281 * If the web path is requested, uses translations set with 277 * {@link fFilesystem::addWebPathTranslation()}282 * fFilesystem::addWebPathTranslation() 278 283 * 279 284 * @param boolean $translate_to_web_path If the path should be the web path … … 384 389 385 390 /** 386 * Performs a scandir on a directory, removing the . and .. folder references387 * 388 * @return array The fFile and fDirectory objects for the files/folders in this directory391 * Performs a [http://php.net/scandir scandir()] on a directory, removing the `.` and `..` entries 392 * 393 * @return array The fFile (or fImage) and fDirectory objects for the files/directories in this directory 389 394 */ 390 395 public function scan() … … 411 416 412 417 /** 413 * Performs a recursive scandir on a directory, removing the . and .. folder references414 * 415 * @return array The fFile and fDirectory objects for the files/ folders(listed recursively) in this directory418 * Performs a **recursive** [http://php.net/scandir scandir()] on a directory, removing the `.` and `..` entries 419 * 420 * @return array The fFile and fDirectory objects for the files/directory (listed recursively) in this directory 416 421 */ 417 422 public function scanRecursive() fEmail.php
r309 r315 Hide Line Numbers 3 3 * Allows creating and sending a single email containing plaintext, HTML, attachments and S/MIME encryption 4 4 * 5 * Please note that this class uses the {@link http://php.net/function.mail mail()}5 * Please note that this class uses the [http://php.net/function.mail mail()] 6 6 * function, and thus would have poor performance if used for mass mailing. 7 7 * 8 8 * This class is implemented to use the UTF-8 character encoding. Please see 9 * {@link http://flourishlib.com/docs/UTF-8}for more information.9 * http://flourishlib.com/docs/UTF-8 for more information. 10 10 * 11 11 * @copyright Copyright (c) 2008 William Bond … … 29 29 * 30 30 * The matches will be: 31 * - [0]: The whole email address 32 * - [1]: The name before the @ 33 * - [2]: The domain/ip after the @ 31 * 32 * - `[0]`: The whole email address 33 * - `[1]`: The name before the `@` 34 * - `[2]`: The domain/ip after the `@` 34 35 * 35 36 * @var string … … 44 45 45 46 /** 46 * A regular expression to match a 'name <email>'string, exluding those with comments and folding whitespace47 * A regular expression to match a `name <email>` string, exluding those with comments and folding whitespace 47 48 * 48 49 * The matches will be: 49 * - [0]: The whole name and email address 50 * - [1]: The name 51 * - [2]: The whole email address 52 * - [3]: The email username before the @ 53 * - [4]: The email domain/ip after the @ 50 * 51 * - `[0]`: The whole name and email address 52 * - `[1]`: The name 53 * - `[2]`: The whole email address 54 * - `[3]`: The email username before the `@` 55 * - `[4]`: The email domain/ip after the `@` 54 56 * 55 57 * @var string … … 68 70 69 71 /** 70 * Flags if the class should use popento send mail via sendmail72 * Flags if the class should use [http://php.net/popen popen()] to send mail via sendmail 71 73 * 72 74 * @var boolean … … 75 77 76 78 /** 77 * Flags if the class should convert \r\n to \nfor qmail. This makes invalid email headers that may work.79 * Flags if the class should convert `\r\n` to `\n` for qmail. This makes invalid email headers that may work. 78 80 * 79 81 * @var boolean … … 83 85 84 86 /** 85 * Sets the class to try and fix broken qmail implementations that add \r to \r\n87 * Sets the class to try and fix broken qmail implementations that add `\r` to `\r\n` 86 88 * 87 89 * @return void … … 293 295 * Adds an attachment to the email 294 296 * 295 * Duplicate filenameswill be changed to be unique.297 * If a duplicate filename is detected, it will be changed to be unique. 296 298 * 297 299 * @param string $filename The name of the file to attach … … 383 385 * Takes a multi-address email header and builds it out using an array of emails 384 386 * 385 * @param string $header The header name without ': ', the header is non-blank, ': 'will be added387 * @param string $header The header name without `': '`, the header is non-blank, `': '` will be added 386 388 * @param array $emails The email addresses for the header 387 * @return string The email header with a trailing "\r\n"389 * @return string The email header with a trailing `\r\n` 388 390 */ 389 391 private function buildMultiAddressHeader($header, $emails) … … 430 432 431 433 /** 432 * Turns a name and email into a '"name" <email>' string, or just 'email'if no name is provided434 * Turns a name and email into a `"name" <email>` string, or just `email` if no name is provided 433 435 * 434 436 * This method will remove newline characters from the name and email, and 435 * will remove any backslash ( \) and double quote (") characters from437 * will remove any backslash (`\`) and double quote (`"`) characters from 436 438 * the name. 437 439 * … … 526 528 * 527 529 * @param string $boundary The boundary to use for the top level mime block 528 * @return string The headers to be sent to the mail()function530 * @return string The headers to be sent to the [http://php.net/function.mail mail()] function 529 531 */ 530 532 private function createHeaders($boundary) … … 578 580 * @param string $headers The headers for the message 579 581 * @param string $body The message body 580 * @return array 0 => The message headers, 1=> The message body582 * @return array `0` => The message headers, `1` => The message body 581 583 */ 582 584 private function createSMIMEBody($to, $subject, $headers, $body) … … 964 966 * Adds the email address the email will be bounced to 965 967 * 966 * This email address will be set to the Return-Path and Errors-To headers.968 * This email address will be set to the `Return-Path` header. 967 969 * 968 970 * @param string $email The email address to bounce to … … 980 982 981 983 /** 982 * Adds the From:email address to the email984 * Adds the `From:` email address to the email 983 985 * 984 986 * @param string $email The email address being sent from … … 1000 1002 * 1001 1003 * This method accepts either ASCII or UTF-8 encoded text. Please see 1002 * {@link http://flourishlib.com/docs/UTF-8}for more information.1004 * http://flourishlib.com/docs/UTF-8 for more information. 1003 1005 * 1004 1006 * @param string $html The HTML version of the email body … … 1015 1017 * 1016 1018 * This method accepts either ASCII or UTF-8 encoded text. Please see 1017 * {@link http://flourishlib.com/docs/UTF-8}for more information.1019 * http://flourishlib.com/docs/UTF-8 for more information. 1018 1020 * 1019 1021 * @param string $plaintext The plaintext version of the email body … … 1027 1029 1028 1030 /** 1029 * Adds the Reply-To:email address to the email1031 * Adds the `Reply-To:` email address to the email 1030 1032 * 1031 1033 * @param string $email The email address to reply to … … 1044 1046 1045 1047 /** 1046 * Adds the Sender:email address to the email1047 * 1048 * The Sender: header is used to indicate someone other than the From:1048 * Adds the `Sender:` email address to the email 1049 * 1050 * The `Sender:` header is used to indicate someone other than the `From:` 1049 1051 * address is actually submitting the message to the network. 1050 1052 * … … 1067 1069 * 1068 1070 * This method accepts either ASCII or UTF-8 encoded text. Please see 1069 * {@link http://flourishlib.com/docs/UTF-8}for more information.1071 * http://flourishlib.com/docs/UTF-8 for more information. 1070 1072 * 1071 1073 * @param string $subject The subject of the email fEmptySetException.php
r214 r315 Hide Line Numbers 1 1 <?php 2 2 /** 3 * An exception when an {@link fRecordSet}does not contain any elements3 * An exception when an fRecordSet does not contain any elements 4 4 * 5 5 * @copyright Copyright (c) 2007-2008 William Bond fEnvironmentException.php
r214 r315 Hide Line Numbers 1 1 <?php 2 2 /** 3 * An exception caused by an environment error 3 * An exception caused by an environment error such a file permissions 4 4 * 5 5 * @copyright Copyright (c) 2007-2008 William Bond fFile.php
r273 r315 Hide Line Numbers 88 88 * Creates an object to represent a file on the filesystem 89 89 * 90 * If multiple fFile objects are created for a single file, they will 91 * reflect changes in each other including rename and delete actions. 92 * 90 93 * @throws fValidationException 91 94 * … … 143 146 144 147 /** 145 * When used in a string context, represents the file as the filename146 * 147 * @return string The filename of the file148 * Returns the filename of the file 149 * 150 * @return string The filename 148 151 */ 149 152 public function __toString() … … 312 315 * Gets the size of the file 313 316 * 314 * May be incorrect for files over 2GB on certain operating systems.317 * The return value may be incorrect for files over 2GB on 32-bit OSes. 315 318 * 316 319 * @param boolean $format If the filesize should be formatted for human readability … … 337 340 * 338 341 * If the web path is requested, uses translations set with 339 * {@link fFilesystem::addWebPathTranslation()}342 * fFilesystem::addWebPathTranslation() 340 343 * 341 344 * @param boolean $translate_to_web_path If the path should be the web path … … 395 398 * 396 399 * @param string $new_filename The new full path to the file 397 * @param boolean $overwrite If the new filename already exists, TRUE will cause the file to be overwritten, FALSEwill cause the new filename to change400 * @param boolean $overwrite If the new filename already exists, `TRUE` will cause the file to be overwritten, `FALSE` will cause the new filename to change 398 401 * @return void 399 402 */ fFilesystem.php
r286 r315 Hide Line Numbers 1 1 <?php 2 2 /** 3 * Handles filesystem-level tasks 3 * Handles filesystem-level tasks including filesystem transactions and the reference map to keep all fFile and fDirectory objects in sync 4 4 * 5 5 * @copyright Copyright (c) 2008 William Bond … … 82 82 * for output into HTML. 83 83 * 84 * By default the DOCUMENT_ROOT will be converted to a blank string, in85 * essence stripping it from filesystem paths.84 * By default the `$_SERVER['DOCUMENT_ROOT']` will be converted to a blank 85 * string, in essence stripping it from filesystem paths. 86 86 * 87 87 * @param string $search_path The path to look for … … 103 103 * Flourish filesystem transactions are NOT full ACID-compliant 104 104 * transactions, but rather more of an filesystem undo buffer which can 105 * return the filesystem to the state when begin() was called. If your PHP105 * return the filesystem to the state when ::begin() was called. If your PHP 106 106 * script dies in the middle of an operation this functionality will do 107 107 * nothing for you and all operations will be retained, except for deletes … … 160 160 161 161 /** 162 * Takes a file size and converts it to bytes162 * Takes a file size including a unit of measure (i.e. kb, GB, M) and converts it to bytes 163 163 * 164 164 * @param string $size The size to convert to bytes … … 213 213 * 214 214 * @param string $file_path The file to rename 215 * @param string $element The piece of information to return ('dirname', 'basename', 'extension', or 'filename')215 * @param string $element The piece of information to return: `'dirname'`, `'basename'`, `'extension'`, or `'filename'` 216 216 * @return array The file's dirname, basename, extension and filename 217 217 */ … … 258 258 * 259 259 * @param string $file The name of the file or directory 260 * @return mixed Will return NULLif no match, or the exception object if a match occurs260 * @return mixed Will return `NULL` if no match, or the exception object if a match occurs 261 261 */ 262 262 static public function &hookExceptionMap($file) … … 278 278 * 279 279 * @param string $file The name of the file or directory 280 * @return mixed Will return NULLif no match, or the exception object if a match occurs280 * @return mixed Will return `NULL` if no match, or the exception object if a match occurs 281 281 */ 282 282 static public function &hookFilenameMap($file) … … 304 304 * 305 305 * @param string $file The filename to check 306 * @param string $new_extension The new extension for the filename, do not include .306 * @param string $new_extension The new extension for the filename, should not include `.` 307 307 * @return string The unique file name 308 308 */ … … 343 343 * @internal 344 344 * 345 * @param string $file A file or directory name, directories should end in / or \345 * @param string $file A file or directory name, directories should end in `/` or `\` 346 346 * @param Exception $exception The exception for this file/directory 347 347 * @return void … … 381 381 * Updates the filename map recursively, causing all objects representing a directory to be updated 382 382 * 383 * Also update dall files and directories in the specified directory to the new paths.383 * Also updates all files and directories in the specified directory to the new paths. 384 384 * 385 385 * @internal fRecordSet.php
r308 r315 Hide Line Numbers 24 24 25 25 /** 26 * Callbacks registered for the __call() handler26 * Callbacks registered for the ::__call() handler 27 27 * 28 28 * @var array … … 32 32 33 33 /** 34 * Creates an {@link fRecordSet}by specifying the class to create plus the where conditions and order by rules34 * Creates an fRecordSet by specifying the class to create plus the where conditions and order by rules 35 35 * 36 36 * The where conditions array can contain key => value entries in any of the following formats (where VALUE/VALUE2 can be of any data type): 37 * <pre> 38 * - '%column%=' => VALUE, // column = VALUE 39 * - '%column%!' => VALUE, // column <> VALUE 40 * - '%column%~' => VALUE, // column LIKE '%VALUE%' 41 * - '%column%<' => VALUE, // column < VALUE 42 * - '%column%<=' => VALUE, // column <= VALUE 43 * - '%column%>' => VALUE, // column > VALUE 44 * - '%column%>=' => VALUE, // column >= VALUE 45 * - '%column%=' => array(VALUE, VALUE2,...), // column IN (VALUE, VALUE2, ...) 46 * - '%column%!' => array(VALUE, VALUE2,...), // column NOT IN (VALUE, VALUE2, ...) 47 * - '%column%~' => array(VALUE, VALUE2,...), // (column LIKE '%VALUE%' OR column LIKE '%VALUE2%' OR column ...) 48 * - '%column%!|%column2%<|%column3%=' => array(VALUE, VALUE2, VALUE3), // (column <> '%VALUE%' OR column2 < '%VALUE2%' OR column3 = '%VALUE3%') 49 * - '%column%|%column2%|%column3%~' => VALUE, // (column LIKE '%VALUE%' OR column2 LIKE '%VALUE2%' OR column3 LIKE '%VALUE%') 50 * - '%column%|%column2%|%column3%~' => array(VALUE, VALUE2,...) // ((column LIKE '%VALUE%' OR column2 LIKE '%VALUE%' OR column3 LIKE '%VALUE%') AND (column LIKE '%VALUE2%' OR column2 LIKE '%VALUE2%' OR column3 LIKE '%VALUE2%') AND ...) 51 * </pre> 37 * 38 * {{{ 39 * '%column%=' => VALUE, // column = VALUE 40 * '%column%!' => VALUE, // column <> VALUE 41 * '%column%~' => VALUE, // column LIKE '%VALUE%' 42 * '%column%<' => VALUE, // column < VALUE 43 * '%column%<=' => VALUE, // column <= VALUE 44 * '%column%>' => VALUE, // column > VALUE 45 * '%column%>=' => VALUE, // column >= VALUE 46 * '%column%=' => array(VALUE, VALUE2,...), // column IN (VALUE, VALUE2, ...) 47 * '%column%!' => array(VALUE, VALUE2,...), // column NOT IN (VALUE, VALUE2, ...) 48 * '%column%~' => array(VALUE, VALUE2,...), // (column LIKE '%VALUE%' OR column LIKE '%VALUE2%' OR column ...) 49 * '%column%!|%column2%<|%column3%=' => array(VALUE, VALUE2, VALUE3), // (column <> '%VALUE%' OR column2 < '%VALUE2%' OR column3 = '%VALUE3%') 50 * '%column%|%column2%|%column3%~' => VALUE, // (column LIKE '%VALUE%' OR column2 LIKE '%VALUE2%' OR column3 LIKE '%VALUE%') 51 * '%column%|%column2%|%column3%~' => array(VALUE, VALUE2,...) // ((column LIKE '%VALUE%' OR column2 LIKE '%VALUE%' OR column3 LIKE '%VALUE%') AND (column LIKE '%VALUE2%' OR column2 LIKE '%VALUE2%' OR column3 LIKE '%VALUE2%') AND ...) 52 * }}} 52 53 * 53 54 * The order bys array can contain key => value entries in any of the following formats: 54 * <pre> 55 * - '%column%' => 'asc' // 'first_name' => 'asc' 56 * - '%column%' => 'desc' // 'last_name' => 'desc' 57 * - '%expression%' => 'asc' // "CASE first_name WHEN 'smith' THEN 1 ELSE 2 END" => 'asc' 58 * - '%expression%' => 'desc' // "CASE first_name WHEN 'smith' THEN 1 ELSE 2 END" => 'desc' 59 * </pre> 55 * 56 * {{{ 57 * '%column%' => 'asc' // 'first_name' => 'asc' 58 * '%column%' => 'desc' // 'last_name' => 'desc' 59 * '%expression%' => 'asc' // "CASE first_name WHEN 'smith' THEN 1 ELSE 2 END" => 'asc' 60 * '%expression%' => 'desc' // "CASE first_name WHEN 'smith' THEN 1 ELSE 2 END" => 'desc' 61 * }}} 60 62 * 61 63 * The %column% in both the where conditions and order bys can be in any of the formats: 62 * <pre> 63 * - '%column%' // e.g. 'first_name' 64 * - '%current_table%.%column%' // e.g. 'users.first_name' 65 * - '%related_table%.%column%' // e.g. 'user_groups.name' 66 * - '%related_table%{%route%}.%column%' // e.g. 'user_groups{user_group_id}.name' 67 * - '%related_table%=>%once_removed_related_table%.%column%' // e.g. 'user_groups=>permissions.level' 68 * - '%related_table%{%route%}=>%once_removed_related_table%.%column%' // e.g. 'user_groups{user_group_id}=>permissions.level' 69 * - '%related_table%=>%once_removed_related_table%{%route%}.%column%' // e.g. 'user_groups=>permissions{read}.level' 70 * - '%related_table%{%route%}=>%once_removed_related_table%{%route%}.%column%' // e.g. 'user_groups{user_group_id}=>permissions{read}.level' 71 * </pre> 72 * 73 * @param string $class The class to create the {@link fRecordSet} of 64 * 65 * {{{ 66 * '%column%' // e.g. 'first_name' 67 * '%current_table%.%column%' // e.g. 'users.first_name' 68 * '%related_table%.%column%' // e.g. 'user_groups.name' 69 * '%related_table%{%route%}.%column%' // e.g. 'user_groups{user_group_id}.name' 70 * '%related_table%=>%once_removed_related_table%.%column%' // e.g. 'user_groups=>permissions.level' 71 * '%related_table%{%route%}=>%once_removed_related_table%.%column%' // e.g. 'user_groups{user_group_id}=>permissions.level' 72 * '%related_table%=>%once_removed_related_table%{%route%}.%column%' // e.g. 'user_groups=>permissions{read}.level' 73 * '%related_table%{%route%}=>%once_removed_related_table%{%route%}.%column%' // e.g. 'user_groups{user_group_id}=>permissions{read}.level' 74 * }}} 75 * 76 * @param string $class The class to create the fRecordSet of 74 77 * @param array $where_conditions The column => value comparisons for the where clause 75 78 * @param array $order_bys The column => direction values to use for sorting 76 79 * @param integer $limit The number of records to fetch 77 80 * @param integer $page The page offset to use when limiting records 78 * @return fRecordSet A set of {@link fActiveRecord}objects81 * @return fRecordSet A set of fActiveRecord objects 79 82 */ 80 83 static public function build($class, $where_conditions=array(), $order_bys=array(), $limit=NULL, $page=NULL) … … 142 145 143 146 /** 144 * Creates an {@link fRecordSet}from an array of records147 * Creates an fRecordSet from an array of records 145 148 * 146 149 * @throws fValidationException … … 160 163 161 164 /** 162 * Creates an {@link fRecordSet}from an SQL statement165 * Creates an fRecordSet from an SQL statement 163 166 * 164 167 * @param string $class The type of object to create … … 178 181 179 182 /** 180 * Registers a callback to be called when a specific method is handled by __call()183 * Registers a callback to be called when a specific method is handled by ::__call() 181 184 * 182 185 * The callback should accept the following parameters: 183 * - $record_set: The actual record set 184 * - $class: The class of each record 185 * - &$records: The ordered array of fActiveRecords 186 * - &$pointer: The current array pointer for the records array 187 * - &$associate: If the record should be associated with an fActiveRecord holding it 186 * 187 * - **`$record_set`**: The actual record set 188 * - **`$class`**: The class of each record 189 * - **`&$records`**: The ordered array of fActiveRecords 190 * - **`&$pointer`**: The current array pointer for the records array 191 * - **`&$associate`**: If the record should be associated with an fActiveRecord holding it 188 192 * 189 193 * @param string $method The method to hook for … … 211 215 212 216 /** 213 * A flag to indicate this should record set should be associated to the parent {@link fActiveRecord}object217 * A flag to indicate this should record set should be associated to the parent fActiveRecord object 214 218 * 215 219 * @var boolean … … 225 229 226 230 /** 227 * The number of rows that would have been returned if a LIMITclause had not been used231 * The number of rows that would have been returned if a `LIMIT` clause had not been used 228 232 * 229 233 * @var integer … … 232 236 233 237 /** 234 * The SQL to get the total number of rows that would have been returned if a LIMITclause had not been used238 * The SQL to get the total number of rows that would have been returned if a `LIMIT` clause had not been used 235 239 * 236 240 * @var string … … 254 258 255 259 /** 256 * Allows for preloading of related records by dynamically creating preload{related plural class}() methods 260 * Allows for preloading of related records for all records in record set 261 * 262 * 257 263 * 258 264 * @throws fValidationException … … 301 307 * 302 308 * @param string $class The type of records to create 303 * @param fResult $result_object The {@link fResult}object of the records to create304 * @param string $non_limited_count_sql An SQL statement to get the total number of rows that would have been returned if a LIMIT clause had not been used. Should only be passed if a LIMITclause is used.309 * @param fResult $result_object The fResult object of the records to create 310 * @param string $non_limited_count_sql An SQL statement to get the total number of rows that would have been returned if a `LIMIT` clause had not been used. Should only be passed if a `LIMIT` clause is used. 305 311 * @return fRecordSet 306 312 */ … … 453 459 * Returns the number of records in the set 454 460 * 455 * @param boolean $ignore_limit If set to TRUE, this method will return the number of records that would be in the set if there was no LIMITclause461 * @param boolean $ignore_limit If set to `TRUE`, this method will return the number of records that would be in the set if there was no `LIMIT` clause 456 462 * @return integer The number of records in the set 457 463 */ … … 497 503 * Filters the record set via a callback 498 504 * 499 * @param callback $callback The callback can be either a callback that accepts a single parameter and returns a boolean, or a string like '{record}::methodName' to filter based on the output of $record->methodName()505 * @param callback $callback The callback can be either a callback that accepts a single parameter and returns a boolean, or a string like `'{record}::methodName'` to filter based on the output of `$record->methodName()` 500 506 * @return fRecordSet A new fRecordSet with the filtered records 501 507 */ … … 529 535 530 536 /** 531 * Flags this record set for association with the {@link fActiveRecord}object that references it537 * Flags this record set for association with the fActiveRecord object that references it 532 538 * 533 539 * @internal … … 546 552 * @throws fValidationException 547 553 * 548 * @return object|false The current record or FALSEif no remaining records554 * @return object|false The current record or `FALSE` if no remaining records 549 555 */ 550 556 public function fetchRecord() … … 618 624 619 625 /** 620 * Returns if this record set is flagged for association with the {@link fActiveRecord}object that references it626 * Returns if this record set is flagged for association with the fActiveRecord object that references it 621 627 * 622 628 * @internal … … 647 653 * 648 654 * The record will be passed to the callback as the first parameter unless 649 * it's position is specified by the placeholder string '{record}'. More655 * it's position is specified by the placeholder string `'{record}'`. More 650 656 * details further down. 651 657 * 652 658 * Additional parameters can be passed to the callback in one of two 653 659 * different ways: 660 * 654 661 * - Passing a non-array value will cause it to be passed to the callback 655 662 * - Passing an array value will cause the array values to be passed to the callback with their corresponding record … … 660 667 * 661 668 * To allow passing the record as a specific parameter to the callback, a 662 * placeholder string '{record}'will be replaced with a the record. You663 * can also specify '{record}::methodName'to cause the output of a method669 * placeholder string `'{record}'` will be replaced with a the record. You 670 * can also specify `'{record}::methodName'` to cause the output of a method 664 671 * from the record to be passed instead of the whole record. 665 672 * 666 * @param callback $callback The callback to pass the values to 667 * @param mixed $parameter,... The parameter to pass to the callback - see method description for details 673 * @param callback $callback The callback to pass the values to 674 * @param mixed $parameter The parameter to pass to the callback - see method description for details 675 * @param mixed ... 668 676 * @return array An array of the results from the callback 669 677 */ 670 public function map($callback )678 public function map($callback, $parameter) 671 679 { 672 680 $parameters = array_slice(func_get_args(), 1); … … 955 963 * 956 964 * The callback should take two parameters: 957 * - The first two records on the first call if no $inital_value is specified 958 * - The initial value and the first record for the first call if an $initial_value is specified 965 * 966 * - The first two records on the first call if no `$inital_value` is specified 967 * - The initial value and the first record for the first call if an `$initial_value` is specified 959 968 * - The result of the last call plus the next record for the second and subsequent calls 960 969 * … … 1001 1010 * Sorts the set by the return value of a method from the class created and rewind the interator 1002 1011 * 1003 * This methods uses {@link fUTF8::inatcmp()}to perform comparisons.1012 * This methods uses fUTF8::inatcmp() to perform comparisons. 1004 1013 * 1005 1014 * @throws fValidationException 1006 1015 * 1007 1016 * @param string $method The method to call on each object to get the value to sort by 1008 * @param string $direction Either 'asc' or 'desc'1017 * @param string $direction Either `'asc'` or `'desc'` 1009 1018 * @return void 1010 1019 */ … … 1035 1044 1036 1045 /** 1037 * Sorts the set by passing the callback to {@link http://php.net/usort usort()}and rewinds the interator1046 * Sorts the set by passing the callback to [http://php.net/usort `usort()`] and rewinds the interator 1038 1047 * 1039 1048 * @throws fValidationException 1040 1049 * 1041 * @param mixed $callback The function/method to pass to usort()1050 * @param mixed $callback The function/method to pass to `usort()` 1042 1051 * @return void 1043 1052 */ … … 1050 1059 1051 1060 /** 1052 * Throws a {@link fEmptySetException} if the {@link fRecordSet}is empty1061 * Throws an fEmptySetException if the record set is empty 1053 1062 * 1054 1063 * @throws fEmptySetException
