for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Phinx\Migration\AbstractMigration;
class DefaultAcl extends AbstractMigration
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
/**
* Migrate Up.
*/
public function up()
$roles = [
[
'id' => 1,
'name' => 'system'
],
'id' => 2,
'name' => 'admin'
'id' => 3,
'name' => 'member'
'id' => 4,
'name' => 'guest'
];
$this->table('acl_roles')->insert($roles)->save();
$privileges = [
'roleId' => 2,
'module' => 'acl',
'privilege' => 'Management'
'privilege' => 'View'
'module' => 'api',
'privilege' => 'Users/Id'
'privilege' => 'Users/Profile'
'module' => 'cache',
'module' => 'dashboard',
'privilege' => 'Dashboard'
'module' => 'pages',
'module' => 'system',
'privilege' => 'Info'
'module' => 'users',
'privilege' => 'EditEmail'
'privilege' => 'EditPassword'
'privilege' => 'ViewProfile'
'roleId' => 3,
$this->table('acl_privileges')->insert($privileges)->save();
$usersRoles = [
'userId' => 1,
'roleId' => 1
'userId' => 2,
'roleId' => 2
'userId' => 3,
'roleId' => 3
$this->table('acl_users_roles')->insert($usersRoles)->save();
}
* Migrate Down.
public function down()
$this->execute('DELETE FROM acl_users_roles');
$this->execute('DELETE FROM acl_privileges');
$this->execute('DELETE FROM acl_roles');
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.