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

CLI version of admin/replace.php please

    XMLWordPrintable

Details

    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • MOODLE_29_STABLE
    • MDL-25763_master
    • Easy
    • 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.

    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).

      Attachments

        Issue Links

          Activity

            People

              jonof Jonathon Fowler
              howardsmiller Howard Miller
              David Monllaó David Monllaó
              Sam Hemelryk Sam Hemelryk
              Ankit Agarwal Ankit Agarwal
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/May/15