Issues (29)

migrations/install_module.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 *
4
 * Topic Prefixes extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2016 phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\topicprefixes\migrations;
12
13
/**
14
 * Class install_module
15
 */
16
class install_module extends \phpbb\db\migration\migration
0 ignored issues
show
The type phpbb\db\migration\migration was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
{
18
	/**
19
	 * @inheritdoc
20
	 */
21
	public function effectively_installed()
22
	{
23
		$sql = 'SELECT module_id
24
			FROM ' . $this->table_prefix . "modules
25
			WHERE module_class = 'acp'
26
				AND module_langname = 'ACP_MANAGE_PREFIXES'";
27
		$result = $this->db->sql_query($sql);
28
		$module_id = $this->db->sql_fetchfield('module_id');
29
		$this->db->sql_freeresult($result);
30
31
		return $module_id !== false;
32
	}
33
34
	/**
35
	 * @inheritdoc
36
	 */
37
	public static function depends_on()
38
	{
39
		return ['\phpbb\topicprefixes\migrations\install_schema'];
40
	}
41
42
	/**
43
	 * @inheritdoc
44
	 */
45
	public function update_data()
46
	{
47
		return [
48
			['module.add', ['acp', 'ACP_CAT_DOT_MODS', 'ACP_TOPIC_PREFIXES']],
49
			['module.add', ['acp', 'ACP_TOPIC_PREFIXES', [
50
				'module_basename'	=> '\phpbb\topicprefixes\acp\topic_prefixes_module',
51
				'modes'				=> ['manage'],
52
			]]],
53
		];
54
	}
55
}
56