SneakyDave
Well-known member
I might be confused about this, but running the CLI creating a new addon, and I get to the step where it asks me:
If I answer yes, I get this Setup class generated:
If I choose to generate a Setup class that DOESN'T support running steps, I get this class generated:
Isn't that backwards? Wouldn't $stepParms be needed in the Setup class that was using multiple steps?
Does your Setup need to support running multiple steps? (y/n)
If I answer yes, I get this Setup class generated:
Code:
<?php
namespace AddonWithSteps;
use XF\AddOn\AbstractSetup;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
use XF\AddOn\StepRunnerUpgradeTrait;
class Setup extends AbstractSetup
{
use StepRunnerInstallTrait;
use StepRunnerUpgradeTrait;
use StepRunnerUninstallTrait;
}
If I choose to generate a Setup class that DOESN'T support running steps, I get this class generated:
Code:
use XF\AddOn\AbstractSetup;
class Setup extends AbstractSetup
{
public function install(array $stepParams = [])
{
// TODO: Implement install() method.
}
public function upgrade(array $stepParams = [])
{
// TODO: Implement upgrade() method.
}
public function uninstall(array $stepParams = [])
{
// TODO: Implement uninstall() method.
}
}
Isn't that backwards? Wouldn't $stepParms be needed in the Setup class that was using multiple steps?