Merge pull request #4928 from totten/master-batch0
[civicrm-core.git] / CRM / Core / Config.php
index a7f7947646eaff57041a0cad72615eea5edba36f..984d4dbd3f2acb05bacdaf94ce15a6fa5fd7713e 100644 (file)
@@ -187,11 +187,12 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   /**
    * Singleton function used to manage this object.
    *
-   * @param $loadFromDB boolean  whether to load from the database
-   * @param $force      boolean  whether to force a reconstruction
+   * @param bool $loadFromDB
+   *   whether to load from the database.
+   * @param bool $force
+   *   whether to force a reconstruction.
    *
    * @return CRM_Core_Config
-   * @static
    */
   public static function &singleton($loadFromDB = TRUE, $force = FALSE) {
     if (self::$_singleton === NULL || $force) {
@@ -482,7 +483,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
           $url = CRM_Utils_System::url('civicrm/admin/setting/path', 'reset=1');
           CRM_Core_Session::setStatus(ts('%1 has an incorrect directory path. Please go to the <a href="%2">path setting page</a> and correct it.', array(
             1 => $key,
-            2 => $url
+            2 => $url,
           )), ts('Check Settings'), 'alert');
         }
       }
@@ -525,7 +526,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
       $this->geocodeMethod = 'CRM_Utils_Geocode_' . $this->mapProvider;
     }
 
-    require_once (str_replace('_', DIRECTORY_SEPARATOR, $this->userFrameworkClass) . '.php');
+    require_once str_replace('_', DIRECTORY_SEPARATOR, $this->userFrameworkClass) . '.php';
     $class = $this->userFrameworkClass;
     // redundant with _setUserFrameworkConfig
     $this->userSystem = new $class();
@@ -534,7 +535,8 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   /**
    * Retrieve a mailer to send any mail from the application
    *
-   * @param boolean $persist open a persistent smtp connection, should speed up mailings
+   * @param bool $persist
+   *   Open a persistent smtp connection, should speed up mailings.
    * @return object
    */
   public static function &getMailer($persist = FALSE) {
@@ -612,9 +614,11 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
   /**
    * Create a new instance of a PEAR Mail driver
    *
-   * @param string $driver 'CRM_Mailing_BAO_Spool' or a name suitable for Mail::factory()
+   * @param string $driver
+   *   'CRM_Mailing_BAO_Spool' or a name suitable for Mail::factory().
    * @param array $params
-   * @return Mail (More specifically, a class which implements the "send()" function)
+   * @return object
+   *   More specifically, a class which implements the "send()" function
    */
   public static function _createMailer($driver, $params) {
     if ($driver == 'CRM_Mailing_BAO_Spool') {
@@ -650,7 +654,12 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
 
     // Whether we delete/create or simply preserve directories, we should
     // certainly make sure the restrictions are enforced.
-    foreach (array($this->templateCompileDir, $this->uploadDir, $this->configAndLogDir, $this->customFileUploadDir) as $dir) {
+    foreach (array(
+               $this->templateCompileDir,
+               $this->uploadDir,
+               $this->configAndLogDir,
+               $this->customFileUploadDir
+             ) as $dir) {
       if ($dir && is_dir($dir)) {
         CRM_Utils_File::restrictAccess($dir);
       }
@@ -661,10 +670,9 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
    * Verify that the needed parameters are not null in the config
    *
    * @param CRM_Core_Config (reference ) the system config object
-   * @param array           (reference ) the parameters that need a value
+   * @param array (reference ) the parameters that need a value
    *
    * @return boolean
-   * @static
    */
   public static function check(&$config, &$required) {
     foreach ($required as $name) {
@@ -684,7 +692,9 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
     CRM_Core_DAO::executeQuery($query);
   }
 
-  // This method should initialize auth sources
+  /**
+   * This method should initialize auth sources
+   */
   public function initAuthSrc() {
     $session = CRM_Core_Session::singleton();
     if ($session->get('userID') && !$session->get('authSrc')) {
@@ -737,7 +747,8 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
       $this->userPermissionClass->upgradePermissions(
         CRM_Core_Permission::basicPermissions()
       );
-    } else {
+    }
+    else {
       // Cannot store permissions -- warn if any modules require them
       $modules_with_perms = array();
       foreach ($module_files as $module_file) {