Dadparvar
Well-known member
This is my Setup.php file:
And this is the command I use:
The result is:
I should add that
Questions:
PHP:
<?php
namespace Dadparvar\FloatingMenu;
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;
public function installStep1()
{
$this->schemaManager()->alterTable('xf_user_option', function (Alter $table)
{
$table->addColumn('dadparvar_floatingmenu_show', 'tinyint', 3)->setDefault(1);
});
}
public function installStep2()
{
$this->schemaManager()->createTable('xf_dadparvar_floatingmenu_item', function (Create $table)
{
$table->addColumn('item_id', 'int')->autoIncrement();
$table->addColumn('parent_id', 'int')->setDefault(0);
$table->addColumn('title', 'varchar', '150');
$table->addColumn('icon', 'varchar', '150')->setDefault('');
$table->addColumn('link', 'varchar', '200')->setDefault('');
$table->addColumn('description', 'varchar', '250')->setDefault('');
$table->addColumn('user_criteria', 'mediumblob');
$table->addColumn('page_criteria', 'mediumblob');
$table->addColumn('display_order', 'int')->setDefault(0);
$table->addColumn('target_blank', 'tinyint', 3)->setDefault(0);
$table->addColumn('open_overlay', 'tinyint', 3)->setDefault(0);
$table->addColumn('active', 'tinyint', 3)->setDefault(1);
});
}
}
And this is the command I use:
Code:
php cmd.php xf-addon:setup-step Dadparvar/FloatingMenu install
The result is:
- installStep1 correctly executed and the column added
- installStep2 didn't execute (I get the error below, in PowerShell)
Code:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in C:\wamp64\www\xf2\src\XF\Db\Mysqli\Statement.php on line 122
memory_limit
and upload_max_filesize
and post_max_size
are set to 1024M.Questions:
- Is something wrong with my settings?
- according to THIS, I couldn't Run a specific Setup step. When I set the step number it says: "Too many arguments, expected arguments "command" "id" "step-type".". Am I doing something wrong?