-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathInfoModule7.php
More file actions
61 lines (50 loc) · 1.43 KB
/
InfoModule7.php
File metadata and controls
61 lines (50 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
namespace DrupalCodeBuilder\Generator;
/**
* Generator class for module info data for Drupal 7.
*/
class InfoModule7 extends InfoModule {
/**
* {@inheritdoc}
*/
const INFO_COMPONENT_TYPE = 'IniFile';
/**
* {@inheritdoc}
*/
const INFO_FILENAME = '%module.info';
/**
* {@inheritdoc}
*/
protected static $propertiesAcquiredFromRoot = [
'base',
'readable_name',
'short_description',
'module_dependencies',
'module_package',
];
/**
* Create lines of file body for Drupal 7.
*/
function infoData(): array {
$lines = $this->getInfoFileEmptyLines();
$lines['name'] = $this->component_data['readable_name'];
$lines['description'] = $this->component_data['short_description'];
if (!empty( $this->component_data['module_dependencies'])) {
// For lines which form a set with the same key and array markers,
// simply make an array.
foreach ( $this->component_data['module_dependencies'] as $dependency) {
$lines['dependencies'][] = $dependency;
}
}
if (!empty( $this->component_data['module_package'])) {
$lines['package'] = $this->component_data['module_package'];
}
$lines['core'] = "7.x";
if (!empty($extra_lines = $this->getContainedComponentInfoLines())) {
// Add a blank line before the extra lines.
$lines[] = '';
$lines = array_merge($lines, $extra_lines);
}
return $lines;
}
}