Skip to content

Commit 6ded005

Browse files
authored
Upgrade package (#172)
* Release 2.1.0 (#158) * Release 2.1.0 * Fix buildTools * Temp patch for SMF 2.1.3 (in dev) bugs (#160) * Temp patch for SMF 2.1.3 (in dev) bugs * fix buildTools * Remove the buildTools Sub Module (#169) * Restore Build Tools (#170) * Restore Build Tools * Bad action * No sub modules * Change the year * Fix #164 by ensuring we do better versioning checks
1 parent a239b77 commit 6ded005

File tree

10 files changed

+151
-103
lines changed

10 files changed

+151
-103
lines changed

.github/scripts/check-license.php

100755100644
Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,31 @@
110110
if (!preg_match('~' . implode('', $yearMatch) . '~i', $contents))
111111
die('Error: The software year is incorrect in ' . $currentFile . "\n");
112112

113-
// Check the version is correct.
114-
$versionMatch = $match;
115-
$sd_version_whitespace = 40;
116-
$versionMatch[14] = '\* SimpleDesk Version: ' . $currentVersion . ' {' . ($sd_version_whitespace - strlen($currentVersion)) . '}\*' . '[\r]?\n';
117-
if (!preg_match('~' . implode('', $versionMatch) . '~i', $contents))
118-
{
119-
$badVersion = true;
120-
foreach ($ignoreFilesVersion as $if)
121-
if (preg_match('~' . $if . '~i', $currentFile))
122-
$badVersion = false;
113+
/* Remove once we only support PHP 8.0 and above */
114+
if (! function_exists('str_ends_with')) {
115+
function str_ends_with(string $haystack, string $needle): bool
116+
{
117+
$needle_len = strlen($needle);
118+
return ($needle_len === 0 || 0 === substr_compare($haystack, $needle, - $needle_len));
119+
}
120+
}
123121

124-
if ($badVersion)
125-
die('Error: The version is incorrect in ' . $currentFile . "\n");
122+
// Check the version is correct, but only for alpha/beta/rc builds. As well, the "final" .0 releases.
123+
if (stripos($currentVersion, 'alpha') > 0 || stripos($currentVersion, 'beta') > 0 || stripos($currentVersion, 'RC') > 0 || str_ends_with($currentVersion, '.0'))
124+
{
125+
$versionMatch = $match;
126+
$sd_version_whitespace = 40;
127+
$versionMatch[14] = '\* SimpleDesk Version: ' . $currentVersion . ' {' . ($sd_version_whitespace - strlen($currentVersion)) . '}\*' . '[\r]?\n';
128+
if (!preg_match('~' . implode('', $versionMatch) . '~i', $contents))
129+
{
130+
$badVersion = true;
131+
foreach ($ignoreFilesVersion as $if)
132+
if (preg_match('~' . $if . '~i', $currentFile))
133+
$badVersion = false;
134+
135+
if ($badVersion)
136+
die('Error: The version is incorrect in ' . $currentFile . "\n");
137+
}
126138
}
127139

128140
die('Stop here' . "\n");

.github/workflows/Syntax-Check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: PHP Syntax Check
22

33
on:
44
push:
5-
branches: [ smf21, smf20, master ]
5+
branches: [ smf21, master ]
66
pull_request:
7-
branches: [ smf21, smf20, master ]
7+
branches: [ smf21, master ]
88

99
workflow_dispatch:
1010
jobs:
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
operating-system: [ ubuntu-latest ]
16-
php: [ '7.1', '7.2', '7.3', '7.4', '8.0' ]
16+
php: [ '7.4', '8.0', '8.1' ]
1717
name: PHP ${{ matrix.php }} Syntax Check
1818
steps:
1919
- uses: actions/checkout@master

install-sd.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Any questions, please contact SimpleDesk.net *
1414
* *
1515
***************************************************************
16-
* SimpleDesk Version: 2.1.0 *
16+
* SimpleDesk Version: 2.1.1 *
1717
* File Info: install.php *
1818
**************************************************************/
1919

@@ -91,8 +91,8 @@ function sd_initialize_install()
9191
require_once(getcwd() . '/SSI.php');
9292
elseif (!defined('SMF')) // If we are outside SMF and can't find SSI.php, then throw an error
9393
die('<b>Error:</b> Cannot install - please verify you put this file in the same place as SMF\'s SSI.php.');
94-
elseif (@version_compare(PHP_VERSION, '5.3.8', '<'))
95-
die('<b>Error:</b> SimpleDesk 2.1 requires PHP 5.3.8 to be installed on your server.');
94+
elseif (@version_compare(PHP_VERSION, '7.4.0', '<'))
95+
die('<b>Error:</b> SimpleDesk 2.1 requires PHP 7.4.0 to be installed on your server.');
9696

9797
if (SMF == 'SSI')
9898
db_extend('packages');

package-info.xml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,42 @@
33
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
44
<id>SimpleDeskTeam:SimpleDesk</id>
55
<name>SimpleDesk - Integrated Helpdesk for Simple Machines Forum</name>
6-
<version>2.1.0</version>
6+
<version>2.1.1</version>
77
<type>modification</type>
88

9-
<install for="2.1 RC4, 2.1.0-2.1.99">
9+
<upgrade from="2.1.0" for="2.1.3-2.1.99">
10+
<!-- language files -->
11+
<require-dir name="sd_language" destination="$themes_dir/default/languages" />
12+
13+
<!-- sources -->
14+
<require-dir name="sd_source" destination="$sourcedir" />
15+
16+
<!-- templates -->
17+
<require-dir name="sd_template" destination="$themedir" />
18+
19+
<!-- images -->
20+
<require-dir name="images/simpledesk" destination="$themes_dir/default/images" />
21+
<require-dir name="images/sd_plugins" destination="$themes_dir/default/images" />
22+
<require-dir name="images/shd" destination="$imagesdir/admin" />
23+
<require-file name="images/feature_shd.png" destination="$themes_dir/default/images/admin" /><!-- explicitly called from default theme in ACP -->
24+
25+
<!-- css -->
26+
<require-file name="css/helpdesk.css" destination="$themedir/css" />
27+
<require-file name="css/helpdesk_admin.css" destination="$themedir/css" />
28+
<require-file name="css/helpdesk_responsive.css" destination="$themedir/css" />
29+
<require-file name="css/helpdesk_icons.css" destination="$themedir/css" />
30+
31+
<!-- scripts -->
32+
<require-file name="scripts/helpdesk_admin.js" destination="$themedir/scripts" />
33+
<require-file name="scripts/helpdesk.js" destination="$themedir/scripts" />
34+
35+
<!-- bundled plugins -->
36+
<require-dir name="sd_plugins_source" destination="$sourcedir" />
37+
<require-dir name="sd_plugins_template" destination="$themes_dir/default" />
38+
<require-dir name="sd_plugins_lang" destination="$languagedir" />
39+
</upgrade>
40+
41+
<install for="2.1.3-2.1.99">
1042
<!-- readme files -->
1143
<readme lang="english" parsebbc="true" type="file">language-readme/readme.english.txt</readme>
1244

@@ -100,7 +132,7 @@
100132
<credits url="https://www.simpledesk.net" license="BSD 3-Clause" licenseurl="https://github.com/SimpleMachines/SimpleDesk/blob/master/license.txt" copyright="2010-2021">Simple Desk</credits>
101133
</install>
102134

103-
<uninstall for="2.1 RC4, 2.1.0-2.1.99">
135+
<uninstall for="2.1.3-2.1.99">
104136
<!-- database changes, undone -->
105137
<database>uninstall-sd-optional.php</database>
106138
<code type="file">uninstall-sd-required.php</code>

sd_plugins_source/front_page/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ function shdplugin_front_page()
5353
'description' => 'shdp_frontpage_desc',
5454
'author' => 'SimpleDesk Team',
5555
'website' => 'https://www.simpledesk.net/',
56-
'version' => '1.0.1',
56+
'version' => '2.1.0',
5757
'compatibility' => array(
58-
'SimpleDesk 2.1 RC1', // should tie up with the SHD_VERSION constants
58+
'SimpleDesk 2.1.*', // should tie up with the SHD_VERSION constants
5959
),
6060
'acp_url' => 'action=admin;area=helpdesk_options;sa=frontpage',
6161
),

0 commit comments

Comments
 (0)