Development

Changeset 6867

You must first sign up to be able to contribute.

Changeset 6867

Show
Ignore:
Timestamp:
01/01/08 02:32:08 (2 years ago)
Author:
dwhittle
Message:

dwhittle: added phpdoc + fixed coding standards

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/config/sfLoader.class.php

    r6721 r6867  
    414414  } 
    415415 
     416  /** 
     417   * Loads config.php files from plugins 
     418   * 
     419   * @return void 
     420   */ 
    416421  static public function loadPluginConfig() 
    417422  { 
    418423    if ($pluginConfigs = glob(sfConfig::get('sf_symfony_lib_dir').'/plugins/*/config/config.php')) 
    419424    { 
     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    { 
    420433      foreach ($pluginConfigs as $config) 
    421434      { 
    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); 
    431436      } 
    432437    } 
  • branches/1.1/lib/util/sfAutoload.class.php

    r6807 r6867  
    2929    $classes = array(); 
    3030 
    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   */ 
    3536  static public function getInstance() 
    3637  { 
     
    4344  } 
    4445 
     46  /** 
     47   * Register sfAutoload in spl autoloader. 
     48   * 
     49   * @return void 
     50   */ 
    4551  public function register() 
    4652  { 
     
    5056  } 
    5157 
     58  /** 
     59   * Unregister sfAutoload from spl autoloader. 
     60   * 
     61   * @return void 
     62   */ 
    5263  public function unregister() 
    5364  { 
     
    5566  } 
    5667 
     68  /** 
     69   * Sets path to class. 
     70   * 
     71   * @param  string  A class name. 
     72   * @param  string  Path to class. 
     73   * 
     74   * @return void 
     75   */ 
    5776  public function setClassPath($class, $path) 
    5877  { 
     
    6281  } 
    6382 
     83  /** 
     84   * Get path to class. 
     85   * 
     86   * @param  string  A class name. 
     87   * 
     88   * @return void 
     89   */ 
    6490  public function getClassPath($class) 
    6591  { 
     
    6793  } 
    6894 
     95  /** 
     96   * Reloads all registered classes. 
     97   * 
     98   * @param  boolean Force delete of autoload cache? 
     99   * 
     100   * @return void 
     101   */ 
    69102  public function reloadClasses($force = false) 
    70103  { 
     
    107140  } 
    108141 
    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) 
    110150  { 
    111151    self::reloadClasses(true); 
  • branches/1.1/lib/util/sfBrowser.class.php

    r6817 r6867  
    3333    $currentException   = null; 
    3434 
     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   */ 
    3544  public function __construct($hostname = null, $remote = null, $options = array()) 
    3645  { 
     
    3847  } 
    3948 
     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   */ 
    4058  public function initialize($hostname = null, $remote = null, $options = array()) 
    4159  { 
     
    6078  } 
    6179 
     80  /** 
     81   * Sets variable name 
     82   * 
     83   * @param string The variable name 
     84   * @param mixed  The value 
     85   * 
     86   * @return sfBrowser 
     87   */ 
    6288  public function setVar($name, $value) 
    6389  { 
     
    6793  } 
    6894 
    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; 
    72106    $this->vars['PHP_AUTH_PW']   = $password; 
    73107 
     
    75109  } 
    76110 
     111  /** 
     112   * Gets a uri. 
     113   * 
     114   * @param string The URI to fetch 
     115   * @param array  The Request parameters 
     116   * 
     117   * @return sfBrowser 
     118   */ 
    77119  public function get($uri, $parameters = array()) 
    78120  { 
     
    80122  } 
    81123 
     124  /** 
     125   * Posts a uri. 
     126   * 
     127   * @param string The URI to fetch 
     128   * @param array  The Request parameters 
     129   * 
     130   * @return sfBrowser 
     131   */ 
    82132  public function post($uri, $parameters = array()) 
    83133  { 
     
    85135  } 
    86136 
     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   */ 
    87147  public function call($uri, $method = 'get', $parameters = array(), $changeStack = true) 
    88148  { 
     
    231291  } 
    232292 
     293  /** 
     294   * Go back in the browser history stack. 
     295   * 
     296   * @return sfBrowser 
     297   */ 
    233298  public function back() 
    234299  { 
     
    242307  } 
    243308 
     309  /** 
     310   * Go forward in the browser history stack. 
     311   * 
     312   * @return sfBrowser 
     313   */ 
    244314  public function forward() 
    245315  { 
     
    253323  } 
    254324 
     325  /** 
     326   * Reload the current browser. 
     327   * 
     328   * @return sfBrowser 
     329   */ 
    255330  public function reload() 
    256331  { 
     
    263338  } 
    264339 
     340  /** 
     341   * Get response dom css selector. 
     342   * 
     343   * @return sfDomCssSelector 
     344   */ 
    265345  public function getResponseDomCssSelector() 
    266346  { 
     
    273353  } 
    274354 
     355  /** 
     356   * Get response dom. 
     357   * 
     358   * @return sfDomCssSelector 
     359   */ 
    275360  public function getResponseDom() 
    276361  { 
     
    283368  } 
    284369 
     370  /** 
     371   * Gets context. 
     372   * 
     373   * @return sfContext 
     374   */ 
    285375  public function getContext() 
    286376  { 
     
    288378  } 
    289379 
     380  /** 
     381   * Gets response. 
     382   * 
     383   * @return sfWebResponse 
     384   */ 
    290385  public function getResponse() 
    291386  { 
     
    293388  } 
    294389 
     390  /** 
     391   * Gets request. 
     392   * 
     393   * @return sfWebRequest 
     394   */ 
    295395  public function getRequest() 
    296396  { 
     
    298398  } 
    299399 
     400  /** 
     401   * Gets current exception 
     402   * 
     403   * @return sfException 
     404   */ 
    300405  public function getCurrentException() 
    301406  { 
     
    303408  } 
    304409 
     410  /** 
     411   * Follow redirects? 
     412   * 
     413   * @throws sfException If request was not a redirect 
     414   * 
     415   * @return sfBrowser 
     416   */ 
    305417  public function followRedirect() 
    306418  { 
     
    313425  } 
    314426 
     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   */ 
    315435  public function setField($name, $value) 
    316436  { 
     
    321441  } 
    322442 
    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   */ 
    324451  public function click($name, $arguments = array()) 
    325452  { 
     
    467594  } 
    468595 
     596  /** 
     597   * Parses arguments as array 
     598   * 
     599   * @param string The argument name 
     600   * @param string The argument value 
     601   * @param array  $vars 
     602   */ 
    469603  protected function parseArgumentAsArray($name, $value, &$vars) 
    470604  { 
     
    496630  } 
    497631 
     632  /** 
     633   * Reset browser to original state 
     634   * 
     635   * @return sfBrowser 
     636   */ 
    498637  public function restart() 
    499638  { 
     
    509648  } 
    510649 
     650  /** 
     651   * Shutdown function to clean up and remove sessions 
     652   * 
     653   * @return void 
     654   */ 
    511655  public function shutdown() 
    512656  { 
     
    515659  } 
    516660 
     661  /** 
     662   * Fixes uri removing # declarations and front controller. 
     663   * 
     664   * @param string The URI to fix 
     665   * @return string The fixed uri 
     666   */ 
    517667  protected function fixUri($uri) 
    518668  { 
     
    543693  } 
    544694 
     695  /** 
     696   * Creates a new session in the browser. 
     697   * 
     698   * @return void 
     699   */ 
    545700  protected function newSession() 
    546701  { 
     
    548703  } 
    549704 
     705  /** 
     706   * Listener for exceptions 
     707   * 
     708   * @param sfEvent The event to handle 
     709   * 
     710   * @return void 
     711   */ 
    550712  public function listenToException(sfEvent $event) 
    551713  { 
  • branches/1.1/lib/util/sfCore.class.php

    r6825 r6867  
    1010 
    1111/** 
    12  * core symfony class
     12 * Core symfony class - loads symfony classes and bootstraps the symfony environment
    1313 * 
    1414 * @package    symfony 
     
    1919class sfCore 
    2020{ 
     21  /** 
     22   * The current symfony version. 
     23   */ 
    2124  const VERSION = '1.1.0-DEV'; 
    2225 
     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   */ 
    2335  static public function bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir) 
    2436  { 
     
    5163  } 
    5264 
     65  /** 
     66   * Loads symfony core classes and configuration. 
     67   * 
     68   * @return void 
     69   */ 
    5370  static public function callBootstrap() 
    5471  { 
     
    91108  } 
    92109 
     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   */ 
    93120  static public function initConfiguration($sf_symfony_lib_dir, $sf_symfony_data_dir, $test = false) 
    94121  { 
     
    140167  } 
    141168 
     169  /** 
     170   * Extends php include path to include symfony path. 
     171   * 
     172   * @return void 
     173   */ 
    142174  static public function initIncludePath() 
    143175  { 
     
    151183  } 
    152184 
    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   */ 
    154190  static public function checkLock() 
    155191  { 
     
    164200  } 
    165201 
     202  /** 
     203   * Checks symfony version and clears cache if recent update. 
     204   * 
     205   * @return void 
     206   */ 
    166207  static public function checkSymfonyVersion() 
    167208  { 
     
    174215  } 
    175216 
     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   */ 
    176227  static public function initDirectoryLayout($sf_root_dir, $sf_app = null, $sf_environment = null) 
    177228  { 
  • branches/1.1/lib/util/sfFinder.class.php

    r5560 r6867  
    44 * This file is part of the symfony package. 
    55 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> 
    6  *  
     6 * 
    77 * For the full copyright and license information, please view the LICENSE 
    88 * file that was distributed with this source code. 
    99 */ 
    1010 
    11 /** 
    12  * 
    13  * @package    symfony 
    14  * @subpackage util 
    15  * @author     Fabien Potencier <fabien.potencier@symfony-project.com> 
    16  * @version    SVN: $Id$ 
    17  */ 
    1811 
    1912/** 
     
    339332    $here_dir = getcwd(); 
    340333    $numargs  = func_num_args(); 
    341     $arg_list = func_get_args();  
     334    $arg_list = func_get_args(); 
    342335 
    343336    // first argument is an array? 
  • branches/1.1/lib/util/sfInflector.class.php

    r1415 r6867  
    113113  { 
    114114    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 
    116119    return ucfirst(str_replace('_', ' ', $lower_case_and_underscored_word)); 
    117120  } 
  • branches/1.1/lib/util/sfToolkit.class.php

    r4597 r6867  
    175175  } 
    176176 
     177  /** 
     178   * Strips comments from php source code 
     179   * 
     180   * @param  string  PHP source code. 
     181   * 
     182   * @return string  Comment free source code. 
     183   */ 
    177184  public static function stripComments($source) 
    178185  { 
     
    223230  } 
    224231 
     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   */ 
    225239  public static function stripslashesDeep($value) 
    226240  { 
     
    296310  } 
    297311 
     312  /** 
     313   * Converts string to array 
     314   * 
     315   * @param string the value to convert to array 
     316   * 
     317   * @return array 
     318   */ 
    298319  public static function stringToArray($string) 
    299320  { 
     
    322343   * 
    323344   * @param  string 
     345   * @param  boolean Quote? 
     346   * 
    324347   * @return mixed 
    325348   */ 
     
    366389   * 
    367390   * @param string the value to perform the replacement on 
     391   * 
    368392   * @return string the value with substitutions made 
    369393   */ 
     
    384408  } 
    385409 
     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   */ 
    386416  public static function isArrayValuesEmpty($array) 
    387417  { 
     
    456486  } 
    457487 
     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   */ 
    458497  public static function getArrayValueForPath($values, $name, $default = null) 
    459498  { 
     
    487526  } 
    488527 
     528  /** 
     529   * Get path to php cli. 
     530   * 
     531   * @throws sfException If no php cli found 
     532   * @return string 
     533   */ 
    489534  public static function getPhpCli() 
    490535  { 
  • branches/1.1/lib/util/sfYaml.class.php

    r4620 r6867  
    3131   *  </code> 
    3232   * 
     33   * @param string $input Path of YAML file or string containing YAML 
     34   * 
    3335   * @return array 
    34    * @param string $input Path of YAML file or string containing YAML 
    3536   */ 
    3637  public static function load($input) 
     
    6768   * to convert the array into friendly YAML. 
    6869   * 
     70   * @param array $array PHP array 
     71   * 
    6972   * @return string 
    70    * @param array $array PHP array 
    7173   */ 
    7274  public static function dump($array) 
     
    8688  } 
    8789 
     90  /** 
     91   * Get contents of input. 
     92   * 
     93   * @param string $input 
     94   * 
     95   * @return string 
     96   */ 
    8897  protected static function getIncludeContents($input) 
    8998  { 
     
    105114 
    106115/** 
    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 
    108119 */ 
    109120function echoln($string) 
  • branches/1.1/lib/util/sfYamlInline.class.php

    r6807 r6867  
    1919class sfYamlInline 
    2020{ 
     21  /** 
     22   * Load YAML into a PHP array. 
     23   * 
     24   * @param string YAML 
     25   * 
     26   * @return array PHP array 
     27   */ 
    2128  static public function load($value) 
    2229  { 
     
    3946  } 
    4047 
     48  /** 
     49   * Dumps PHP array to YAML. 
     50   * 
     51   * @param mixed PHP 
     52   * 
     53   * @return string YAML 
     54   */ 
    4155  static public function dump($value) 
    4256  { 
     
    6478  } 
    6579 
     80  /** 
     81   * Dumps PHP array to YAML 
     82   * 
     83   * @param array   The array to dump 
     84   * 
     85   * @return string YAML 
     86   */ 
    6687  static protected function dumpArray($value) 
    6788  { 
     
    92113  } 
    93114 
     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   */ 
    94126  static protected function parseScalar($scalar, $delimiters = null, $stringDelimiters = array('"', "'"), &$i = 0, $evaluate = true) 
    95127  { 
     
    126158  } 
    127159 
     160  /** 
     161   * Parses quotes scalar 
     162   * 
     163   * @param string $scalar 
     164   * @param integer $i 
     165   * 
     166   * @return string YAML 
     167   */ 
    128168  static protected function parseQuotedScalar($scalar, &$i) 
    129169  { 
     
    154194  } 
    155195 
     196  /** 
     197   * Parse sequence to yaml 
     198   * 
     199   * @param string $sequence 
     200   * @param integer $i 
     201   * 
     202   * @return string YAML 
     203   */ 
    156204  static protected function parseSequence($sequence, &$i = 0) 
    157205  { 
     
    189237  } 
    190238 
     239  /** 
     240   * Parses mapping. 
     241   * 
     242   * @param string $mapping 
     243   * @param integer $i 
     244   * 
     245   * @return string YAML 
     246   */ 
    191247  static protected function parseMapping($mapping, &$i = 0) 
    192248  { 
     
    248304  } 
    249305 
     306  /** 
     307   * Evaluates scalars and replaces magic values. 
     308   * 
     309   * @param string $scalar 
     310   * 
     311   * @return string YAML 
     312   */ 
    250313  static protected function evaluateScalar($scalar) 
    251314  { 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.