Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-30966

print_object() does not look nice when used in CLI scripts

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.2, 2.3
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Libraries
    • Labels:
    • Environment:
      GNU/Linux is the supported platform for CLI scripts, Mac OS should work too.
    • Testing Instructions:
      Hide

      1. Write two simple scripts that call print_object() - one for web and one for CLI
      2. TEST: Make sure the output for the web works as it used to (no regression test)
      3. TEST: Make sire the output for the command line does not print HTML rubbish

      Show
      1. Write two simple scripts that call print_object() - one for web and one for CLI 2. TEST: Make sure the output for the web works as it used to (no regression test) 3. TEST: Make sire the output for the command line does not print HTML rubbish
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-30966-print-object

      Description

      During the development, using a code like

      print_object($something); die(); // DONOTCOMMIT

      is a useful debugging trick to stop execution of the script and dump the information about some object. However, the current implementation of the print_object() expects it prints to a web page. When used in a CLI script, the output does not look nice.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Mar/12