First commit
This commit is contained in:
commit
3a568602da
36 changed files with 1584 additions and 0 deletions
40
migrations/dev_1.php
Executable file
40
migrations/dev_1.php
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace pedodev\tagging\migrations;
|
||||
|
||||
class dev_1 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return isset($this->config['pedodev_tagging']);
|
||||
}
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return ['\phpbb\db\migration\data\v330\v330'];
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return [
|
||||
|
||||
['config.add', ['pedodev_tagging', 1]],
|
||||
|
||||
['module.add', [
|
||||
'acp',
|
||||
'ACP_CAT_DOT_MODS',
|
||||
'ACP_TAGGING_TITLE'
|
||||
]],
|
||||
|
||||
['module.add', [
|
||||
'acp',
|
||||
'ACP_TAGGING_TITLE',
|
||||
[
|
||||
'module_basename' => '\pedodev\tagging\acp\main_module',
|
||||
'modes' => ['settings'],
|
||||
],
|
||||
]],
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
23
migrations/dev_2.php
Executable file
23
migrations/dev_2.php
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace pedodev\tagging\migrations;
|
||||
|
||||
class dev_2 extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return ['\phpbb\db\migration\data\v330\v330'];
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
|
||||
$tag_directory_filepath = "{$phpbb_root_path}/ext/pedodev/tagging/taglist";
|
||||
|
||||
if (!file_exists($tag_directory_filepath)) {
|
||||
mkdir($tag_directory_filepath, 0644);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
24
migrations/dev_3.php
Executable file
24
migrations/dev_3.php
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace pedodev\tagging\migrations;
|
||||
|
||||
class dev_3 extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return ['\phpbb\db\migration\data\v330\v330'];
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
|
||||
$tag_list_filepath = "{$phpbb_root_path}/ext/pedodev/tagging/taglist.json";
|
||||
|
||||
if (!file_exists($tag_list_filepath)) {
|
||||
touch($tag_list_filepath);
|
||||
chmod($tag_list_filepath, 0644);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
38
migrations/dev_4.php
Executable file
38
migrations/dev_4.php
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace pedodev\tagging\migrations;
|
||||
|
||||
class dev_4 extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return ['\phpbb\db\migration\data\v330\v330'];
|
||||
}
|
||||
|
||||
public function update_schema()
|
||||
{
|
||||
return [
|
||||
|
||||
'add_tables' => [
|
||||
$this->table_prefix . 'content_tags' => [
|
||||
'COLUMNS' => [
|
||||
'id' => ['ULINT', NULL, 'auto_increment'],
|
||||
'post_id' => ['ULINT', 0, 'NON-NULL'],
|
||||
'tag_id' => ['USINT', 0, 'NON-NULL'],
|
||||
],
|
||||
'PRIMARY_KEY' => 'id',
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
public function revert_schema()
|
||||
{
|
||||
return [
|
||||
'drop_tables' => [
|
||||
$this->table_prefix . 'content_tags',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
23
migrations/dev_5.php
Executable file
23
migrations/dev_5.php
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace pedodev\tagging\migrations;
|
||||
|
||||
class dev_5 extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return ['\phpbb\db\migration\data\v330\v330'];
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return [
|
||||
|
||||
['permission.add', ['u_pedodev_tagging_cantagposts']],
|
||||
['permission.permission_set', ['ROLE_USER_LIMITED', 'u_pedodev_tagging_cantagposts']],
|
||||
['permission.permission_set', ['ROLE_USER_STANDARD', 'u_pedodev_tagging_cantagposts']],
|
||||
['permission.permission_set', ['ROLE_USER_FULL', 'u_pedodev_tagging_cantagposts']],
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue