Changeset 6867
- Timestamp:
- 01/01/08 02:32:08 (9 months ago)
- Files:
-
- branches/1.1/lib/config/sfLoader.class.php (modified) (1 diff)
- branches/1.1/lib/util/sfAutoload.class.php (modified) (7 diffs)
- branches/1.1/lib/util/sfBrowser.class.php (modified) (25 diffs)
- branches/1.1/lib/util/sfCore.class.php (modified) (8 diffs)
- branches/1.1/lib/util/sfFinder.class.php (modified) (2 diffs)
- branches/1.1/lib/util/sfInflector.class.php (modified) (1 diff)
- branches/1.1/lib/util/sfToolkit.class.php (modified) (8 diffs)
- branches/1.1/lib/util/sfYaml.class.php (modified) (4 diffs)
- branches/1.1/lib/util/sfYamlInline.class.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/config/sfLoader.class.php
r6721 r6867 414 414 } 415 415 416 /** 417 * Loads config.php files from plugins 418 * 419 * @return void 420 */ 416 421 static public function loadPluginConfig() 417 422 { 418 423 if ($pluginConfigs = glob(sfConfig::get('sf_symfony_lib_dir').'/plugins/*/config/config.php')) 419 424 { 425 foreach($pluginConfigs as $config) 426 { 427 require_once($config); 428 } 429 } 430 431 if ($pluginConfigs = glob(sfConfig::get('sf_plugins_dir').'/*/config/config.php')) 432 { 420 433 foreach ($pluginConfigs as $config) 421 434 { 422 include($config); 423 } 424 } 425 426 if ($pluginConfigs = glob(sfConfig::get('sf_plugins_dir').'/*/config/config.php')) 427 { 428 foreach ($pluginConfigs as $config) 429 { 430 include($config); 435 require_once($config); 431 436 } 432 437 } branches/1.1/lib/util/sfAutoload.class.php
r6807 r6867 29 29 $classes = array(); 30 30 31 protected function __construct() 32 { 33 } 34 31 /** 32 * Retrieves the singleton instance of this class. 33 * 34 * @return sfAutoload A sfAutoload implementation instance. 35 */ 35 36 static public function getInstance() 36 37 { … … 43 44 } 44 45 46 /** 47 * Register sfAutoload in spl autoloader. 48 * 49 * @return void 50 */ 45 51 public function register() 46 52 { … … 50 56 } 51 57 58 /** 59 * Unregister sfAutoload from spl autoloader. 60 * 61 * @return void 62 */ 52 63 public function unregister() 53 64 { … … 55 66 } 56 67 68 /** 69 * Sets path to class. 70 * 71 * @param string A class name. 72 * @param string Path to class. 73 * 74 * @return void 75 */ 57 76 public function setClassPath($class, $path) 58 77 { … … 62 81 } 63 82 83 /** 84 * Get path to class. 85 * 86 * @param string A class name. 87 * 88 * @return void 89 */ 64 90 public function getClassPath($class) 65 91 { … … 67 93 } 68 94 95 /** 96 * Reloads all registered classes. 97 * 98 * @param boolean Force delete of autoload cache? 99 * 100 * @return void 101 */ 69 102 public function reloadClasses($force = false) 70 103 { … … 107 140 } 108 141 109 function autoloadAgain($class) 142 /** 143 * Reloads a class. 144 * 145 * @param string A class name. 146 * 147 * @return boolean Returns true if the class has been loaded 148 */ 149 public function autoloadAgain($class) 110 150 { 111 151 self::reloadClasses(true); branches/1.1/lib/util/sfBrowser.class.php
r6817 r6867 33 33 $currentException = null; 34 34 35 /** 36 * Class constructor. 37 * 38 * @param string Hostname to browse 39 * @param string Remote address to spook 40 * @param array Options for sfBrowser 41 * 42 * @return void 43 */ 35 44 public function __construct($hostname = null, $remote = null, $options = array()) 36 45 { … … 38 47 } 39 48 49 /** 50 * Initializes sfBrowser - sets up environment 51 * 52 * @param string Hostname to browse 53 * @param string Remote address to spook 54 * @param array Options for sfBrowser 55 * 56 * @return void 57 */ 40 58 public function initialize($hostname = null, $remote = null, $options = array()) 41 59 { … … 60 78 } 61 79 80 /** 81 * Sets variable name 82 * 83 * @param string The variable name 84 * @param mixed The value 85 * 86 * @return sfBrowser 87 */ 62 88 public function setVar($name, $value) 63 89 { … … 67 93 } 68 94 69 public function setAuth($login, $password) 70 { 71 $this->vars['PHP_AUTH_USER'] = $login; 95 /** 96 * Sets username and password for simulating http authentication. 97 * 98 * @param string The username 99 * @param string The password 100 * 101 * @return sfBrowser 102 */ 103 public function setAuth($username, $password) 104 { 105 $this->vars['PHP_AUTH_USER'] = $username; 72 106 $this->vars['PHP_AUTH_PW'] = $password; 73 107 … … 75 109 } 76 110 111 /** 112 * Gets a uri. 113 * 114 * @param string The URI to fetch 115 * @param array The Request parameters 116 * 117 * @return sfBrowser 118 */ 77 119 public function get($uri, $parameters = array()) 78 120 { … … 80 122 } 81 123 124 /** 125 * Posts a uri. 126 * 127 * @param string The URI to fetch 128 * @param array The Request parameters 129 * 130 * @return sfBrowser 131 */ 82 132 public function post($uri, $parameters = array()) 83 133 { … … 85 135 } 86 136 137 /** 138 * Calls a request to a uri. 139 * 140 * @param string The URI to fetch 141 * @param string The request method 142 * @param array The Request parameters 143 * @param boolean Change the browser history stack? 144 * 145 * @return sfBrowser 146 */ 87 147 public function call($uri, $method = 'get', $parameters = array(), $changeStack = true) 88 148 { … … 231 291 } 232 292 293 /** 294 * Go back in the browser history stack. 295 * 296 * @return sfBrowser 297 */ 233 298 public function back() 234 299 { … … 242 307 } 243 308 309 /** 310 * Go forward in the browser history stack. 311 * 312 * @return sfBrowser 313 */ 244 314 public function forward() 245 315 { … … 253 323 } 254 324 325 /** 326 * Reload the current browser. 327 * 328 * @return sfBrowser 329 */ 255 330 public function reload() 256 331 { … … 263 338 } 264 339 340 /** 341 * Get response dom css selector. 342 * 343 * @return sfDomCssSelector 344 */ 265 345 public function getResponseDomCssSelector() 266 346 { … … 273 353 } 274 354 355 /** 356 * Get response dom. 357 * 358 * @return sfDomCssSelector 359 */ 275 360 public function getResponseDom() 276 361 { … … 283 368 } 284 369 370 /** 371 * Gets context. 372 * 373 * @return sfContext 374 */ 285 375 public function getContext() 286 376 { … … 288 378 } 289 379 380 /** 381 * Gets response. 382 * 383 * @return sfWebResponse 384 */ 290 385 public function getResponse() 291 386 { … … 293 388 } 294 389 390 /** 391 * Gets request. 392 * 393 * @return sfWebRequest 394 */ 295 395 public function getRequest() 296 396 { … … 298 398 } 299 399 400 /** 401 * Gets current exception 402 * 403 * @return sfException 404 */ 300 405 public function getCurrentException() 301 406 { … … 303 408 } 304 409 410 /** 411 * Follow redirects? 412 * 413 * @throws sfException If request was not a redirect 414 * 415 * @return sfBrowser 416 */ 305 417 public function followRedirect() 306 418 { … … 313 425 } 314 426 427 /** 428 * Sets a form field in the browser. 429 * 430 * @param string The field name 431 * @param string The field value 432 * 433 * @return sfBrowser 434 */ 315 435 public function setField($name, $value) 316 436 { … … 321 441 } 322 442 323 // link or button 443 /** 444 * Simulates a click on a link or button. 445 * 446 * @param string $name The link or button text 447 * @param array $arguments 448 * 449 * @return sfBrowser 450 */ 324 451 public function click($name, $arguments = array()) 325 452 { … … 467 594 } 468 595 596 /** 597 * Parses arguments as array 598 * 599 * @param string The argument name 600 * @param string The argument value 601 * @param array $vars 602 */ 469 603 protected function parseArgumentAsArray($name, $value, &$vars) 470 604 { … … 496 630 } 497 631 632 /** 633 * Reset browser to original state 634 * 635 * @return sfBrowser 636 */ 498 637 public function restart() 499 638 { … … 509 648 } 510 649 650 /** 651 * Shutdown function to clean up and remove sessions 652 * 653 * @return void 654 */ 511 655 public function shutdown() 512 656 { … … 515 659 } 516 660 661 /** 662 * Fixes uri removing # declarations and front controller. 663 * 664 * @param string The URI to fix 665 * @return string The fixed uri 666 */ 517 667 protected function fixUri($uri) 518 668 { … … 543 693 } 544 694 695 /** 696 * Creates a new session in the browser. 697 * 698 * @return void 699 */ 545 700 protected function newSession() 546 701 { … … 548 703 } 549 704 705 /** 706 * Listener for exceptions 707 * 708 * @param sfEvent The event to handle 709 * 710 * @return void 711 */ 550 712 public function listenToException(sfEvent $event) 551 713 { branches/1.1/lib/util/sfCore.class.php
r6825 r6867 10 10 11 11 /** 12 * core symfony class.12 * Core symfony class - loads symfony classes and bootstraps the symfony environment. 13 13 * 14 14 * @package symfony … … 19 19 class sfCore 20 20 { 21 /** 22 * The current symfony version. 23 */ 21 24 const VERSION = '1.1.0-DEV'; 22 25 26 /** 27 * Bootstraps the symfony environment. 28 * 29 * @param string The path to the project directory. 30 * @param mixed The application name or null. 31 * @param mixed The dimension name or null. 32 * 33 * @return void 34 */ 23 35 static public function bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir) 24 36 { … … 51 63 } 52 64 65 /** 66 * Loads symfony core classes and configuration. 67 * 68 * @return void 69 */ 53 70 static public function callBootstrap() 54 71 { … … 91 108 } 92 109 110 /** 111 * Loads symfony core classes + configuration + autoloader. 112 * 113 * @param string The path to the project directory. 114 * @param mixed The application name or null. 115 * @param boolean In a test? 116 * @param mixed The dimension name or null. 117 * 118 * @return void 119 */ 93 120 static public function initConfiguration($sf_symfony_lib_dir, $sf_symfony_data_dir, $test = false) 94 121 { … … 140 167 } 141 168 169 /** 170 * Extends php include path to include symfony path. 171 * 172 * @return void 173 */ 142 174 static public function initIncludePath() 143 175 { … … 151 183 } 152 184 153 // check to see if we're not in a cache cleaning process 185 /** 186 * Check lock files to see if we're not in a cache cleaning process. 187 * 188 * @return void 189 */ 154 190 static public function checkLock() 155 191 { … … 164 200 } 165 201 202 /** 203 * Checks symfony version and clears cache if recent update. 204 * 205 * @return void 206 */ 166 207 static public function checkSymfonyVersion() 167 208 { … … 174 215 } 175 216 217 /** 218 * Initializes directory layout for the project. 219 * 220 * @param string The path to the project directory. 221 * @param mixed The application name or null. 222 * @param mixed The environment name or null. 223 * @param mixed The dimension name or null. 224 * 225 * @return void 226 */ 176 227 static public function initDirectoryLayout($sf_root_dir, $sf_app = null, $sf_environment = null) 177 228 { branches/1.1/lib/util/sfFinder.class.php
r5560 r6867 4 4 * This file is part of the symfony package. 5 5 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 6 * 6 * 7 7 * For the full copyright and license information, please view the LICENSE 8 8 * file that was distributed with this source code. 9 9 */ 10 10 11 /**12 *13 * @package symfony14 * @subpackage util15 * @author Fabien Potencier <fabien.potencier@symfony-project.com>16 * @version SVN: $Id$17 */18 11 19 12 /** … … 339 332 $here_dir = getcwd(); 340 333 $numargs = func_num_args(); 341 $arg_list = func_get_args(); 334 $arg_list = func_get_args(); 342 335 343 336 // first argument is an array? branches/1.1/lib/util/sfInflector.class.php
r1415 r6867 113 113 { 114 114 if (substr($lower_case_and_underscored_word, -3) === '_id') 115 $lower_case_and_underscored_word = substr($lower_case_and_underscored_word, 0, -3); 115 { 116 $lower_case_and_underscored_word = substr($lower_case_and_underscored_word, 0, -3); 117 } 118 116 119 return ucfirst(str_replace('_', ' ', $lower_case_and_underscored_word)); 117 120 } branches/1.1/lib/util/sfToolkit.class.php
r4597 r6867 175 175 } 176 176 177 /** 178 * Strips comments from php source code 179 * 180 * @param string PHP source code. 181 * 182 * @return string Comment free source code. 183 */ 177 184 public static function stripComments($source) 178 185 { … … 223 230 } 224 231 232 /** 233 * Strip slashes recursively from array 234 * 235 * @param array the value to strip 236 * 237 * @return array clean value with slashes stripped 238 */ 225 239 public static function stripslashesDeep($value) 226 240 { … … 296 310 } 297 311 312 /** 313 * Converts string to array 314 * 315 * @param string the value to convert to array 316 * 317 * @return array 318 */ 298 319 public static function stringToArray($string) 299 320 { … … 322 343 * 323 344 * @param string 345 * @param boolean Quote? 346 * 324 347 * @return mixed 325 348 */ … … 366 389 * 367 390 * @param string the value to perform the replacement on 391 * 368 392 * @return string the value with substitutions made 369 393 */ … … 384 408 } 385 409 410 /** 411 * Checks if array values are empty 412 * 413 * @param array the array to check 414 * @return boolean true if empty, otherwise false 415 */ 386 416 public static function isArrayValuesEmpty($array) 387 417 { … … 456 486 } 457 487 488 /** 489 * Returns an array value for a path. 490 * 491 * @param array The values to search 492 * @param string The token name 493 * @param array Default if not found 494 * 495 * @return array 496 */ 458 497 public static function getArrayValueForPath($values, $name, $default = null) 459 498 { … … 487 526 } 488 527 528 /** 529 * Get path to php cli. 530 * 531 * @throws sfException If no php cli found 532 * @return string 533 */ 489 534 public static function getPhpCli() 490 535 { branches/1.1/lib/util/sfYaml.class.php
r4620 r6867 31 31 * </code> 32 32 * 33 * @param string $input Path of YAML file or string containing YAML 34 * 33 35 * @return array 34 * @param string $input Path of YAML file or string containing YAML35 36 */ 36 37 public static function load($input) … … 67 68 * to convert the array into friendly YAML. 68 69 * 70 * @param array $array PHP array 71 * 69 72 * @return string 70 * @param array $array PHP array71 73 */ 72 74 public static function dump($array) … … 86 88 } 87 89 90 /** 91 * Get contents of input. 92 * 93 * @param string $input 94 * 95 * @return string 96 */ 88 97 protected static function getIncludeContents($input) 89 98 { … … 105 114 106 115 /** 107 * Wraps echo to automatically provide a newline 116 * Wraps echo to automatically provide a newline. 117 * 118 * @param string The string to echo with new line 108 119 */ 109 120 function echoln($string) branches/1.1/lib/util/sfYamlInline.class.php
r6807 r6867 19 19 class sfYamlInline 20 20 { 21 /** 22 * Load YAML into a PHP array. 23 * 24 * @param string YAML 25 * 26 * @return array PHP array 27 */ 21 28 static public function load($value) 22 29 { … … 39 46 } 40 47 48 /** 49 * Dumps PHP array to YAML. 50 * 51 * @param mixed PHP 52 * 53 * @return string YAML 54 */ 41 55 static public function dump($value) 42 56 { … … 64 78 } 65 79 80 /** 81 * Dumps PHP array to YAML 82 * 83 * @param array The array to dump 84 * 85 * @return string YAML 86 */ 66 87 static protected function dumpArray($value) 67 88 { … … 92 113 } 93 114 115 /** 116 * Parses scalar to yaml 117 * 118 * @param scalar $scalar 119 * @param string $delimiters 120 * @param array String delimiter 121 * @param integer $i 122 * @param boolean $evaluate 123 * 124 * @return string YAML 125 */ 94 126 static protected function parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true) 95 127 { … … 126 158 } 127 159 160 /** 161 * Parses quotes scalar 162 * 163 * @param string $scalar 164 * @param integer $i 165 * 166 * @return string YAML 167 */ 128 168 static protected function parseQuotedScalar($scalar, &$i) 129 169 { … … 154 194 } 155 195 196 /** 197 * Parse sequence to yaml 198 * 199 * @param string $sequence 200 * @param integer $i 201 * 202 * @return string YAML 203 */ 156 204 static protected function parseSequence($sequence, &$i = 0) 157 205 { … … 189 237 } 190 238 239 /** 240 * Parses mapping. 241 * 242 * @param string $mapping 243 * @param integer $i 244 * 245 * @return string YAML 246 */ 191 247 static protected function parseMapping($mapping, &$i = 0) 192 248 { … … 248 304 } 249 305 306 /** 307 * Evaluates scalars and replaces magic values. 308 * 309 * @param string $scalar 310 * 311 * @return string YAML 312 */ 250 313 static protected function evaluateScalar($scalar) 251 314 {