Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Rescue Master Branch PR: Update MigrationTask class to be an abstract class #10458

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/Dev/MigrationTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
*
* <b>Creating Migration Tasks</b>
*
* To create your own migration task all you need to do is define your own subclass of MigrationTask and define the
* following functions
* To create your own migration task, you need to define your own subclass of MigrationTask
* and implement the following methods
*
* <i>mysite/code/MyMigrationTask.php</i>
* <i>app/src/MyMigrationTask.php</i>
*
* <code>
* class MyMigrationTask extends BuildTask {
* class MyMigrationTask extends MigrationTask {
*
* private static $segment = 'MyMigrationTask'; // segment in the dev/tasks/ namespace for URL access
* protected $title = "My Database Migrations"; // title of the script
* protected $description = "Description"; // description of what it does
* protected $description = "My Description"; // description of what it does
*
* public function run($request) {
* if ($request->getVar('Direction') == 'down') {
Expand All @@ -37,18 +38,19 @@
* </code>
*
* <b>Running Migration Tasks</b>
* To run any tasks you can find them under the dev/ namespace. To run the above script you would need to run
* the following and note - Either the site has to be in [devmode](debugging) or you need to add ?isDev=1 to the URL
* You can find all tasks under the dev/tasks/ namespace.
* To run the above script you would need to run the following and note - Either the site has to be
* in [devmode](debugging) or you need to add ?isDev=1 to the URL.
*
* <code>
* // url to visit if in dev mode.
* http://www.yoursite.com/dev/tasks/MyMigrationTask
* https://www.yoursite.com/dev/tasks/MyMigrationTask
*
* // url if you are in live mode but need to run this
* http://www.yoursite.com/dev/tasks/MyMigrationTask?isDev=1
* // url to visit if you are in live mode but need to run this
* https://www.yoursite.com/dev/tasks/MyMigrationTask?isDev=1
* </code>
*/
class MigrationTask extends BuildTask
abstract class MigrationTask extends BuildTask
{

private static $segment = 'MigrationTask';
Expand Down