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

Make Upgrades work again #453

Closed
wants to merge 1 commit into from
Closed
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
19 changes: 17 additions & 2 deletions classes/OpenXdmod/Migration/Version750to800/DatabasesMigration.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
<?php
namespace OpenXdmod\Migration\Version700To701;
namespace OpenXdmod\Migration\Version750To800;

/**
* Migrate databases from version 7.5.0 to 8.0.0.
*/
class DatabasesMigration extends \OpenXdmod\Migration\Version660To700\DatabasesMigration
class DatabasesMigration extends \OpenXdmod\Migration\DatabasesMigration
{
/**
* @see \OpenXdmod\Migration\Migration::__construct
**/
public function __construct($currentVersion, $newVersion)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary? If no constructor is defined the next constructor up the chain should be called. Same thing for execute(). For example,

class Migrate
{
    public function __construct($currentVersion, $newVersion)
    {
        echo sprintf('%s::%s(%s, %s)', __CLASS__, __FUNCTION__, $currentVersion, $newVersion) . PHP_EOL;
    }
}

class M2 extends Migrate
{
}

$m = new Migrate(1, 2);
$m2 = new M2(2, 3);
smgallo@dave:~/tmp$ php test_parent_constructor.php 
Migrate::__construct(1, 2)
Migrate::__construct(2, 3)

{
parent::__construct($currentVersion, $newVersion);
}

/**
* @see \OpenXdmod\Migration\Migration::execute
**/
public function execute()
{
parent::execute();
}
}