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

CLI version of admin/replace.php please

    Details

    • Testing Instructions:
      Hide

      1. Insert the string "//xyz" somewhere in a text field that you can observe.
      2. Check that running sudo -u www-data php admin/tool/replace/cli/replace.php --search=$'\xfe' --replace=x exits with an "Invalid characters were found in..." error. (The $'\xfe' under Bash creates an invalid UTF-8 character.)
      2. Check that running sudo -u www-data php admin/tool/replace/cli/replace.php --search=//xyz --replace=//wxyz exits with a "The replacement is longer than original..." error.
      3. Check that sudo -u www-data php admin/tool/replace/cli/replace.php --search=//xyz --replace=//wxyz --shorten prompts for confirmation, and after accepting the warning, finishes with a "Success" message.
      4. Check that your inserted "//xyz" has been replaced with "//wxyz".

      Use your appropriate equivalent for sudo -u www-data as necessary.

      Show
      1. Insert the string "//xyz" somewhere in a text field that you can observe. 2. Check that running sudo -u www-data php admin/tool/replace/cli/replace.php --search=$'\xfe' --replace=x exits with an "Invalid characters were found in..." error. (The $'\xfe' under Bash creates an invalid UTF-8 character.) 2. Check that running sudo -u www-data php admin/tool/replace/cli/replace.php --search=//xyz --replace=//wxyz exits with a "The replacement is longer than original..." error. 3. Check that sudo -u www-data php admin/tool/replace/cli/replace.php --search=//xyz --replace=//wxyz --shorten prompts for confirmation, and after accepting the warning, finishes with a "Success" message. 4. Check that your inserted "//xyz" has been replaced with "//wxyz". Use your appropriate equivalent for sudo -u www-data as necessary.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-25763_master

      Description

      A CLI version of the admin/replace.php script would be really useful. Really thinking about automating a test upgrade from 1.9 to 2.0. All the other steps can be scripted but not this one (easily).

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  5 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    11/May/15