Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-3763

php.ini directives should be of the specified type

    XMLWordPrintable

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
      None
    • Message:
      Change that directive to be of the proper type.
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Targeted languages:
      PHP
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      1min
    • Analysis Scope:
      Main Sources, Test Sources

      Description

      Directives in the php.ini files can be of type boolean, integer or string.
      For boolean acceptable values are 0, 1, true, false, yes, no, on and off.
      For integers they can be qualified with k, m or g. E.g. 16k means 16000.
      The complete list of directive is at http://php.net/manual/en/ini.list.php

      Noncompliant Code Example

      allow_url_include = 42; Noncompliant, should be a boolean
      max_execution_time = "1024"; Noncompliant, should be an integer
      

      Compliant Solution

      allow_url_include = false
      max_execution_time = 1024
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jeanchristophe.collet Jean-Christophe Collet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: