Changeset 931
- Timestamp:
- 10/31/2007 11:49:47 PM (13 months ago)
- Location:
- trunk/system/libraries
- Files:
-
- 14 modified
-
Cache.php (modified) (4 diffs)
-
Encrypt.php (modified) (7 diffs)
-
Ftp.php (modified) (17 diffs)
-
Image_lib.php (modified) (1 diff)
-
Input.php (modified) (9 diffs)
-
Loader.php (modified) (6 diffs)
-
Model.php (modified) (1 diff)
-
Pagination.php (modified) (6 diffs)
-
Profiler.php (modified) (3 diffs)
-
Router.php (modified) (3 diffs)
-
Session.php (modified) (12 diffs)
-
URI.php (modified) (7 diffs)
-
User_agent.php (modified) (7 diffs)
-
View.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/Cache.php
r929 r931 14 14 protected $driver; 15 15 16 /* 17 * Method: __construct 18 * Set up driver and get groups 19 * 20 * Parameters: 21 * config - custom configuration 22 */ 16 23 function __construct($config = array()) 17 24 { … … 21 28 } 22 29 30 /* 31 * Method: get 32 * Get data from cache 33 * 34 * Parameters: 35 * name - name of cache entry 36 * 37 * Returns: 38 * Cached data 39 */ 23 40 function get($name) 24 41 { … … 26 43 } 27 44 45 /* 46 * Method: set 47 * Save data into cache 48 * 49 * Parameters: 50 * name - name of cache entry 51 * item - data to save 52 * 53 * Returns: 54 * TRUE or FALSE 55 */ 28 56 function set($name, $item) 29 57 { … … 31 59 } 32 60 61 /* 62 * Method: del 63 * Delete cache entry 64 * 65 * Parameters: 66 * name - name of cache entry 67 * 68 * Returns: 69 * TRUE or FALSE 70 */ 33 71 function del($name) 34 72 { -
trunk/system/libraries/Encrypt.php
r929 r931 79 79 * 80 80 * Returns: 81 * The encoded string .81 * The encoded string 82 82 */ 83 83 public function encode($string, $key = '') … … 103 103 * 104 104 * Returns: 105 * The decoded data .105 * The decoded data 106 106 */ 107 107 public function decode($string, $key = '') … … 130 130 * 131 131 * Returns: 132 * The encoded string .132 * The encoded string 133 133 */ 134 134 protected function xor_encode($string, $key) … … 161 161 * 162 162 * Returns: 163 * The decoded data .163 * The decoded data 164 164 */ 165 165 protected function xor_decode($string, $key) … … 185 185 * 186 186 * Returns: 187 * The combined string and key .187 * The combined string and key 188 188 */ 189 189 protected function xor_merge($string, $key) … … 209 209 * 210 210 * Returns: 211 * The encoded string .211 * The encoded string 212 212 */ 213 213 public function mcrypt_encode($data, $key) … … 228 228 * 229 229 * Returns: 230 * The decoded data .230 * The decoded data 231 231 */ 232 232 public function mcrypt_decode($data, $key) -
trunk/system/libraries/Ftp.php
r929 r931 61 61 * 62 62 * Returns: 63 * TRUE or FALSE .63 * TRUE or FALSE 64 64 */ 65 65 public function connect($config = array()) … … 102 102 * 103 103 * Returns: 104 * TRUE or FALSE .104 * TRUE or FALSE 105 105 */ 106 106 private function login() … … 114 114 * 115 115 * Returns: 116 * TRUE or FALSE .116 * TRUE or FALSE 117 117 */ 118 118 private function is_conn() … … 143 143 * 144 144 * Returns: 145 * TRUE or FALSE .145 * TRUE or FALSE 146 146 */ 147 147 public function changedir($path = '', $supress_debug = FALSE) … … 175 175 * 176 176 * Returns: 177 * TRUE or FALSE .177 * TRUE or FALSE 178 178 */ 179 179 public function mkdir($path = '', $permissions = NULL) … … 213 213 * 214 214 * Returns: 215 * TRUE or FALSE .215 * TRUE or FALSE 216 216 */ 217 217 public function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL) … … 266 266 * 267 267 * Returns: 268 * TRUE or FALSE .268 * TRUE or FALSE 269 269 */ 270 270 public function rename($old_file, $new_file, $move = FALSE) … … 298 298 * 299 299 * Returns: 300 * TRUE or FALSE .300 * TRUE or FALSE 301 301 */ 302 302 public function move($old_file, $new_file) … … 313 313 * 314 314 * Returns: 315 * TRUE or FALSE .315 * TRUE or FALSE 316 316 */ 317 317 public function delete_file($filepath) … … 336 336 /* 337 337 * Method: delete_dir 338 * Delete a folder and recursively delete everything (including sub-folders) contained within it .338 * Delete a folder and recursively delete everything (including sub-folders) contained within it 339 339 * 340 340 * Parameters: … … 342 342 * 343 343 * Returns: 344 * TRUE or FALSE .344 * TRUE or FALSE 345 345 */ 346 346 public function delete_dir($filepath) … … 390 390 * 391 391 * Returns: 392 * TRUE or FALSE .392 * TRUE or FALSE 393 393 */ 394 394 public function chmod($path, $perm) … … 447 447 * This function recursively reads a folder and everything it contains (including 448 448 * sub-folders) and creates a mirror via FTP based on it. Whatever the directory structure 449 * of the original file path will be recreated on the server .449 * of the original file path will be recreated on the server 450 450 * 451 451 * Parameters: … … 454 454 * 455 455 * Returns: 456 * TRUE or FALSE .456 * TRUE or FALSE 457 457 */ 458 458 public function mirror($locpath, $rempath) … … 502 502 * 503 503 * Returns: 504 * Extracted file extension .504 * Extracted file extension 505 505 */ 506 506 private function get_extension($filename) … … 552 552 * 553 553 * Returns: 554 * TRUE or FALSE .554 * TRUE or FALSE 555 555 */ 556 556 public function close() … … 562 562 } 563 563 564 /**565 * Display error message566 *567 * @access private568 * @param string569 * @return boolean570 */571 564 /* 572 565 * Method: error -
trunk/system/libraries/Image_lib.php
r816 r931 146 146 * properties using ImageMagick and NetPBM 147 147 * 148 * Note :GD is not required for this function148 * Note - GD is not required for this function 149 149 * 150 150 */ -
trunk/system/libraries/Input.php
r915 r931 1 1 <?php defined('SYSPATH') or die('No direct script access.'); 2 /* *3 * Kohana: The swift, small, and secure PHP5 framework2 /* 3 * Class: Input 4 4 * 5 * @package Kohana 6 * @author Kohana Team 7 * @copyright Copyright (c) 2007 Kohana Team 8 * @link http://kohanaphp.com 9 * @license http://kohanaphp.com/license.html 10 * @since Version 2.0 11 * @filesource 12 * $Id$ 13 */ 14 15 /** 16 * Input Class 17 * 18 * @category Libraries 19 * @author Rick Ellis, Kohana Team 20 * @copyright Copyright (c) 2006, EllisLab, Inc. 21 * @license http://www.codeigniter.com/user_guide/license.html 22 * @link http://kohanaphp.com/user_guide/en/libraries/input.html 5 * Kohana Source Code: 6 * author - Rick Ellis, Kohana Team 7 * copyright - Copyright (c) 2006, EllisLab, Inc. 8 * license - <http://www.codeigniter.com/user_guide/license.html> 23 9 */ 24 10 class Input_Core { … … 31 17 public $user_agent = FALSE; 32 18 33 /** 34 * Constructor 35 * 36 * Sets whether to globally enable the XSS processing 37 * and whether to allow the $_GET array 38 * 39 * @access public 40 * @return void 19 /* 20 * Method: __construct 21 * Sets whether to globally enable the XSS processing and whether to allow the $_GET array 41 22 */ 42 23 public function __construct() … … 113 94 } 114 95 115 /** 116 * Fetch an item from a global array 117 * 118 * @access protected 119 * @param string 120 * @param array 121 * @return string 96 /* 97 * Method: __call 98 * Fetch an item from a global array 99 * 100 * Parameters: 101 * global - array to access (get, post, cookie or server) 102 * args - arguments (array key, xss_clean) 103 * 104 * Returns: 105 * Value of array item 122 106 */ 123 107 public function __call($global, $args = array()) … … 167 151 } 168 152 169 /* *170 * Clean Input Data171 * 172 * This is a helper function. It escapes data and173 * standardizes newline characters to \n174 * 175 * @access protected176 * @param string177 * @returnstring153 /* 154 * Method: clean_input_data 155 * This is a helper function. It escapes data and standardizes newline characters to \n 156 * 157 * Parameters: 158 * str - string to clean 159 * 160 * Returns: 161 * Cleaned string 178 162 */ 179 163 protected function clean_input_data($str) … … 203 187 } 204 188 205 /** 206 * Clean Keys 207 * 208 * This is a helper function. To prevent malicious users 209 * from trying to exploit keys we make sure that keys are 210 * only named with alpha-numeric text and a few other items. 211 * 212 * @access protected 213 * @param string 214 * @return string 189 /* 190 * Method: clean_input_keys 191 * This is a helper function. To prevent malicious users 192 * from trying to exploit keys we make sure that keys are 193 * only named with alpha-numeric text and a few other items. 194 * 195 * Parameters: 196 * str - string to clean 197 * 198 * Returns: 199 * Cleaned string 215 200 */ 216 201 protected function clean_input_keys($str) … … 224 209 } 225 210 226 /** 227 * Fetch the IP Address 228 * 229 * @access public 230 * @return string 211 /* 212 * Method: ip_address 213 * Fetch the IP Address 214 * 215 * Returns: 216 * IP address 231 217 */ 232 218 public function ip_address() … … 272 258 } 273 259 274 /** 275 * Validate IP Address 276 * 277 * Validates an IPv4 address based on RFC specifications 278 * 279 * @access public 280 * @param string 281 * @return boolean 260 /* 261 * Method: valid_ip 262 * Validates an IPv4 address based on RFC specifications 263 * 264 * Parameters: 265 * ip - IP to validate 266 * 267 * Returns: 268 * TRUE or FALSE 282 269 */ 283 270 public function valid_ip($ip) … … 286 273 } 287 274 288 /** 289 * User Agent 290 * 291 * @access public 292 * @return string 275 /* 276 * Method: user_agent 277 * Get the user agent of the current request 278 * 279 * Returns: 280 * The user agent 293 281 */ 294 282 public function user_agent() … … 302 290 } 303 291 304 /** 305 * XSS Clean implemented by HTML Purifier 306 * 307 * Note: This function should only be used to deal with data upon submission. 308 * It's not something that should be used for general runtime processing 309 * since it requires a fair amount of processing overhead. 310 * 311 * @access public 312 * @param string 313 * @param string 314 * @return string 292 /* 293 * Method: xss_clean 294 * Clean cross site scripting exploits from string. 295 * HTMLPurifier may be used if installed, otherwise defaults to built in method. 296 * Note - This function should only be used to deal with data upon submission. 297 * It's not something that should be used for general runtime processing 298 * since it requires a fair amount of processing overhead. 299 * 300 * Parameters: 301 * string - string to clean 302 * tool - xss_clean method to use ('htmlpurifier' or defaults to built in method) 303 * 304 * Returns: 305 * Cleaned string 315 306 */ 316 307 public function xss_clean($string, $tool = '') -
trunk/system/libraries/Loader.php
r828 r931 1 1 <?php defined('SYSPATH') or die('No direct script access.'); 2 /* *3 * Kohana: The swift, small, and secure PHP5 framework2 /* 3 * Class: Loader 4 4 * 5 * @package Kohana 6 * @author Kohana Team 7 * @copyright Copyright (c) 2007 Kohana Team 8 * @link http://kohanaphp.com 9 * @license http://kohanaphp.com/license.html 10 * @since Version 2.0 11 * @filesource 12 * $Id$ 13 */ 14 15 /** 16 * Loader Class 17 * 18 * @category Libraries 19 * @author Kohana Team 20 * @link http://kohanaphp.com/user_guide/en/libraries/loader.html 5 * Kohana Source Code: 6 * author - Kohana Team 7 * copyright - (c) 2007 Kohana Team 8 * license - <http://kohanaphp.com/license.html> 21 9 */ 22 10 class Loader_Core { 23 11 24 /** 25 * Constructor 12 /* 13 * Method: __construct 14 * Autoloads libraries and models specified in config file 26 15 */ 27 16 public function __construct() … … 55 44 } 56 45 57 /** 58 * Library 46 /* 47 * Method: library 48 * Load library 59 49 * 60 * @access public 61 * @param string 62 * @param array 63 * @param boolean 64 * @return mixed 50 * Parameters: 51 * name - library name 52 * config - custom configuration 53 * return - return library instance instead of adding to Kohana instance 54 * 55 * Returns: 56 * FALSE - library is already loaded 57 * Object - instance of library if 'return' parameter is TRUE 65 58 */ 66 59 public function library($name, $config = array(), $return = FALSE) … … 85 78 } 86 79 87 /** 88 * Database 80 /* 81 * Method: database 82 * Load database 89 83 * 90 * @access public 91 * @param string 92 * @param boolean 93 * @return mixed 84 * Parameters: 85 * group - Database config group to use 86 * return - return database instance instead of adding to Kohana instance 87 * 88 * Returns: 89 * Database instance if 'return' parameter is TRUE 94 90 */ 95 91 public function database($group = 'default', $return = FALSE) … … 104 100 } 105 101 106 /** 107 * Helper 102 /* 103 * Method: helper 104 * Load helper 108 105 * 109 * @access public 110 * @param string 111 * @return void 106 * Parameters: 107 * name - helper name 112 108 */ 113 109 public function helper($name) … … 129 125 } 130 126 131 /** 132 * Model 127 /* 128 * Method: model 129 * Load model 133 130 * 134 * @access public 135 * @param string 136 * @param mixed 137 * @return mixed 131 * Parameters: 132 * name - model name 133 * alias - custom name for accessing model, or TRUE to return instance of model 134 * 135 * Returns: 136 * FALSE - model is already loaded 137 * Object - instance of model if 'alias' parameter is TRUE 138 138 */ 139 139 public function model($name, $alias = FALSE) … … 164 164 } 165 165 166 /** 167 * View 166 /* 167 * Method: view 168 * Load view 168 169 * 169 * @access public 170 * @param string 171 * @param array 172 * @return object 170 * Parameters: 171 * name - view name 172 * data - data to make accessible within view 173 * 174 * Returns: 175 * Instance of specified view 173 176 */ 174 177 public function view($name, $data = array()) -
trunk/system/libraries/Model.php
r816 r931 1 1 <?php defined('SYSPATH') or die('No direct script access.');
