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

CLI version of admin/replace.php please

XMLWordPrintable

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

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

            jonof Jonathon Fowler
            howardsmiller Howard Miller
            David Monllaó David Monllaó
            Sam Hemelryk Sam Hemelryk
            Ankit Agarwal Ankit Agarwal
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.