Skip to content

Commit 4a0e8b9

Browse files
Merge pull request #60 from VSEphpbb/updates
Minor updates
2 parents ae5e2c0 + ceb54f4 commit 4a0e8b9

7 files changed

Lines changed: 17 additions & 12 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
],
2222
"require": {
23-
"php": ">=5.3.9",
23+
"php": ">=5.4.0",
2424
"symfony/console": "2.8.*",
2525
"symfony/finder": "2.8.*"
2626
},

controller/main.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,17 @@ public function handle()
119119
'NAME' => $value,
120120
'DESC' => $this->user->lang('SKELETON_QUESTION_' . strtoupper($value) . '_UI'),
121121
'DESC_EXPLAIN' => array_key_exists('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN', $this->user->lang) ? $this->user->lang('SKELETON_QUESTION_' . strtoupper($value) . '_EXPLAIN') : '',
122-
'VALUE' => $this->request->variable($value, (string) $default),
122+
'VALUE' => $this->request->variable($value, (string) $default, true),
123123
));
124124
}
125125

126126
$author_values = array();
127127
foreach ($dialog_questions['author'] as $value => $default)
128128
{
129-
$author_values[$value] = $this->request->variable($value, array((string) $default));
129+
$author_values[$value] = $this->request->variable($value, array((string) $default), true);
130130
}
131131

132-
$num_authors = max(1, sizeof($author_values['author_name']));
132+
$num_authors = max(1, count($author_values['author_name']));
133133
for ($i = 0; $i < $num_authors; $i++)
134134
{
135135
foreach ($dialog_questions['author'] as $value => $default)
@@ -182,7 +182,7 @@ protected function get_composer_data()
182182
$this->data['extension'][$value] = $this->get_user_input($value, $default);
183183
}
184184

185-
$num_authors = max(1, sizeof($this->request->variable('author_name', array(''))));
185+
$num_authors = max(1, count($this->request->variable('author_name', array(''))));
186186
for ($i = 0; $i < $num_authors; $i++)
187187
{
188188
foreach ($dialog_questions['author'] as $value => $default)
@@ -274,10 +274,10 @@ protected function get_request_variable($value, $default, $array_key = null)
274274

275275
if ($array_key !== null)
276276
{
277-
$return_value = $this->request->variable($value, array((string) $default));
277+
$return_value = $this->request->variable($value, array((string) $default), true);
278278
return isset($return_value[$array_key]) ? (string) $return_value[$array_key] : (string) $default;
279279
}
280280

281-
return $this->request->variable($value, (string) $default);
281+
return $this->request->variable($value, (string) $default, true);
282282
}
283283
}

ext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ public function is_enableable()
2828
/**
2929
* Check PHP requirements
3030
*
31-
* Requires PHP 5.3.9 or greater
31+
* Requires PHP 5.4.0 or greater
3232
* Requires PHP ZipArchive binary
3333
*
3434
* @return bool
3535
*/
3636
protected function php_requirements()
3737
{
38-
return phpbb_version_compare(PHP_VERSION, '5.3.9', '>=') && class_exists('ZipArchive');
38+
return phpbb_version_compare(PHP_VERSION, '5.4.0', '>=') && class_exists('ZipArchive');
3939
}
4040

4141
/**

helper/packager.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,9 @@ public function get_composer_json_from_data($data)
228228
);
229229
}
230230

231-
$body = json_encode($composer, JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES);
231+
$body = json_encode($composer, JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES + JSON_UNESCAPED_UNICODE);
232232
$body = str_replace(array('&lt;', '&gt;'), array('<', '>'), $body);
233+
$body .= PHP_EOL;
233234

234235
return $body;
235236
}

skeleton/README.md.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ Copy the extension to phpBB/ext/{{ EXTENSION.vendor_name }}/{{ EXTENSION.extensi
66

77
Go to "ACP" > "Customise" > "Extensions" and enable the "{{ EXTENSION.extension_display_name }}" extension.
88

9+
{% if COMPONENT.tests %}
910
## Tests and Continuous Integration
1011

11-
We use Travis-CI as a continuous integration server and phpunit for our unit testing. See more information on the [phpBB development wiki](https://wiki.phpbb.com/Unit_Tests).
12+
We use Travis-CI as a continuous integration server and phpunit for our unit testing. See more information on the [phpBB Developer Docs](https://area51.phpbb.com/docs/dev/31x/testing/index.html).
1213
To run the tests locally, you need to install phpBB from its Git repository. Afterwards run the following command from the phpBB Git repository's root:
1314

1415
Windows:
@@ -19,6 +20,7 @@ others:
1920

2021
phpBB/vendor/bin/phpunit -c phpBB/ext/{{ EXTENSION.vendor_name }}/{{ EXTENSION.extension_name }}/phpunit.xml.dist
2122

23+
{% endif %}
2224
## License
2325

2426
[GPLv2](license.txt)

skeleton/acp/main_module.php.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ namespace {{ EXTENSION.vendor_name }}\{{ EXTENSION.extension_name }}\acp;
1515
*/
1616
class main_module
1717
{
18+
public $page_title;
19+
public $tpl_name;
1820
public $u_action;
1921
2022
public function main($id, $mode)

skeleton/build.xml.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{% set destination = '${' ~ 'destination-filename}' %}
1010
{% set dependencies = '${' ~ 'has-dependencies}' %}
1111
<?xml version="1.0" encoding="UTF-8"?>
12-
<project name="{{ vendor }}/{{ extension }} Build Script" description="Builds an extension.zip from a git repository" default="all">
12+
<project name="{{ EXTENSION.extension_display_name }} Build Script" description="Builds an extension.zip from a git repository" default="all">
1313
<property name="vendor-name" value="{{ EXTENSION.vendor_name }}" />
1414
<property name="extension-name" value="{{ EXTENSION.extension_name }}" />
1515
<!--

0 commit comments

Comments
 (0)