INFRA-132 - Change "else if" to "elseif"
[civicrm-core.git] / CRM / Core / IDS.php
index c6055cf9d804c9df355153ad8870f1bae974f0bf..75713269ee1c6c71eb3dafc323883b80650fe636 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -35,7 +35,7 @@
 class CRM_Core_IDS {
 
   /**
-   * define the threshold for the ids reactions
+   * Define the threshold for the ids reactions
    */
   private $threshold = array(
     'log' => 25,
@@ -44,7 +44,7 @@ class CRM_Core_IDS {
   );
 
   /**
-   * the init object
+   * The init object
    */
   private $init = NULL;
 
@@ -77,7 +77,8 @@ class CRM_Core_IDS {
     try {
       $init = IDS_Init::init($configFile);
       $ids  = new IDS_Monitor($_REQUEST, $init);
-    } catch (Exception $e) {
+    }
+    catch (Exception $e) {
       // might be an old stale copy of Config.IDS.ini
       // lets try to rebuild it again and see if it works
       $configFile = self::createConfigFile(TRUE);
@@ -96,12 +97,13 @@ class CRM_Core_IDS {
   /**
    * Create the default config file for the IDS system
    *
-   * @param boolean $force should we recreate it irrespective if it exists or not
+   * @param bool $force
+   *   Should we recreate it irrespective if it exists or not.
    *
    * @return string the full path to the config file
    * @static
    */
-  static function createConfigFile($force = FALSE) {
+  public static function createConfigFile($force = FALSE) {
     $config = CRM_Core_Config::singleton();
     $configFile = $config->configAndLogDir . 'Config.IDS.ini';
     if (!$force && file_exists($configFile)) {
@@ -205,11 +207,9 @@ class CRM_Core_IDS {
    * This function writes an entry about the intrusion
    * to the intrusion database
    *
-   * @param $result
+   * @param array $result
    * @param int $reaction
    *
-   * @internal param array $results
-   *
    * @return boolean
    */
   private function log($result, $reaction = 0) {
@@ -280,4 +280,3 @@ class CRM_Core_IDS {
     CRM_Core_Error::fatal($msg);
   }
 }
-