I'm following the Add-on Demo: https://xenforo.com/xf2-docs/dev/lets-build-an-add-on/
When I try to run
I get the following error:
This is my Setup.php file:
I'm sure this is some amazingly stupid mistake?
When I try to run
Code:
php cmd.php xf-addon:install-step Demo/Portal 1
I get the following error:
Code:
PHP Fatal error: Class Demo\Portal\Setup contains 3 abstract methods and must therefore be declared abstract or implement the remaining methods (XF\AddOn\AbstractSetup::install, XF\AddOn\AbstractSetup::upgrade, XF\AddOn\AbstractSetup::uninstall) in .../src/addons/Demo/Portal/Setup.php on line 22
This is my Setup.php file:
Code:
<?php
namespace Demo\Portal2;
use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;
use XF\Db\Schema\Alter;
use XF\Db\Schema\Create;
class Setup extends AbstractSetup
{
use StepRunnerInstallTrait;
use StepRunnerUpgradeTrait;
use StepRunnerUninstallTrait;
}
class Setup extends \XF\AddOn\AbstractSetup
{
public function installStep1()
{
$this->schemaManager()->alterTable('xf_forum', function(Alter $table)
{
$table->addColumn('demo_portal_auto_feature', 'tinyint')->setDefault(0);
});
}
public function installStep2()
{
$this->schemaManager()->alterTable('xf_thread', function(Alter $table)
{
$table->addColumn('demo_portal_featured', 'tinyint')->setDefault(0);
});
}
public function installStep3()
{
$this->schemaManager()->createTable('xf_demo_portal_featured_thread', function(Create $table)
{
$table->addColumn('thread_id', 'int');
$table->addColumn('featured_date', 'int');
$table->addPrimaryKey('thread_id');
});
}
}
I'm sure this is some amazingly stupid mistake?