Skip to content

Commit dfb6250

Browse files
committed
Merge branch 'staging' of github.com:joomla/joomla-cms into 3.10-dev
2 parents 27dcb5f + 1c78eef commit dfb6250

File tree

11 files changed

+202
-144
lines changed

11 files changed

+202
-144
lines changed

administrator/components/com_privacy/models/request.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ public function validate($form, $data, $group = null)
427427
return false;
428428
}
429429

430+
// Make sure the status is always 0
431+
$validatedData['status'] = 0;
432+
430433
// The user cannot create a request for their own account
431434
if (strtolower(JFactory::getUser()->email) === strtolower($validatedData['email']))
432435
{

build/build.php

Lines changed: 89 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function usage($command)
2828
{
2929
echo PHP_EOL;
3030
echo 'Usage: php ' . $command . ' [options]' . PHP_EOL;
31-
echo PHP_TAB . '[options]:'.PHP_EOL;
31+
echo PHP_TAB . '[options]:' . PHP_EOL;
3232
echo PHP_TAB . PHP_TAB . '--remote <remote>:' . PHP_TAB . 'The git remote reference to build from (ex: `tags/3.8.6`, `4.0-dev`), defaults to the most recent tag for the repository' . PHP_EOL;
3333
echo PHP_TAB . PHP_TAB . '--exclude-zip:' . PHP_TAB . PHP_TAB . 'Exclude the generation of .zip packages' . PHP_EOL;
3434
echo PHP_TAB . PHP_TAB . '--exclude-gzip:' . PHP_TAB . PHP_TAB . 'Exclude the generation of .tar.gz packages' . PHP_EOL;
@@ -71,6 +71,9 @@ function usage($command)
7171
$excludeBzip2 = isset($options['exclude-bzip2']);
7272
$showHelp = isset($options['help']);
7373

74+
// Disable the generation of extra text files
75+
$includeExtraTextfiles = false;
76+
7477
if ($showHelp)
7578
{
7679
usage($argv[0]);
@@ -84,6 +87,9 @@ function usage($command)
8487
$tagVersion = system($systemGit . ' describe --tags `' . $systemGit . ' rev-list --tags --max-count=1`', $tagVersion);
8588
$remote = 'tags/' . $tagVersion;
8689
chdir($here);
90+
91+
// We are in release mode so we need the extra text files
92+
$includeExtraTextfiles = true;
8793
}
8894

8995
echo "Start build for remote $remote.\n";
@@ -228,18 +234,21 @@ function usage($command)
228234
// Loop through and add all files except: tests, installation, build, .git, .travis, travis, phpunit, .md, or images
229235
foreach ($files as $file)
230236
{
231-
if (substr($file, 0, 1) === 'R') {
232-
$fileName = substr($file, strrpos($file, "\t") + 1);
233-
} else {
234-
$fileName = substr($file, 2);
237+
if (substr($file, 0, 1) === 'R')
238+
{
239+
$fileName = substr($file, strrpos($file, "\t") + 1);
240+
}
241+
else
242+
{
243+
$fileName = substr($file, 2);
235244
}
236-
$folderPath = explode('/', $fileName);
237-
$baseFolderName = $folderPath[0];
238245

239-
$doNotPackageFile = in_array(trim($fileName), $doNotPackage);
240-
$doNotPatchFile = in_array(trim($fileName), $doNotPatch);
246+
$folderPath = explode('/', $fileName);
247+
$baseFolderName = $folderPath[0];
248+
$doNotPackageFile = in_array(trim($fileName), $doNotPackage);
249+
$doNotPatchFile = in_array(trim($fileName), $doNotPatch);
241250
$doNotPackageBaseFolder = in_array($baseFolderName, $doNotPackage);
242-
$doNotPatchBaseFolder = in_array($baseFolderName, $doNotPatch);
251+
$doNotPatchBaseFolder = in_array($baseFolderName, $doNotPatch);
243252

244253
if ($doNotPackageFile || $doNotPatchFile || $doNotPackageBaseFolder || $doNotPatchBaseFolder)
245254
{
@@ -389,84 +398,98 @@ function usage($command)
389398

390399
chdir('..');
391400

392-
foreach (array_keys($checksums) as $packageName)
401+
// Thats only needed when we release a version
402+
if ($includeExtraTextfiles)
393403
{
394-
echo "Generating checksums for $packageName\n";
395404

396-
foreach (array('md5', 'sha1', 'sha256', 'sha384', 'sha512') as $hash)
405+
foreach (array_keys($checksums) as $packageName)
397406
{
398-
if (file_exists('packages/' . $packageName))
399-
{
400-
$checksums[$packageName][$hash] = hash_file($hash, 'packages/' . $packageName);
401-
}
402-
else
407+
echo "Generating checksums for $packageName\n";
408+
409+
foreach (array('sha256', 'sha384', 'sha512') as $hash)
403410
{
404-
echo "Package $packageName not found in build directories\n";
411+
if (file_exists('packages/' . $packageName))
412+
{
413+
$checksums[$packageName][$hash] = hash_file($hash, 'packages/' . $packageName);
414+
}
415+
else
416+
{
417+
echo "Package $packageName not found in build directories\n";
418+
}
405419
}
406420
}
407-
}
408-
409-
echo "Generating checksums.txt file\n";
410421

411-
$checksumsContent = '';
422+
echo "Generating checksums.txt file\n";
412423

413-
foreach ($checksums as $packageName => $packageHashes)
414-
{
415-
$checksumsContent .= "Filename: $packageName\n";
424+
$checksumsContent = '';
416425

417-
foreach ($packageHashes as $hashType => $hash)
426+
foreach ($checksums as $packageName => $packageHashes)
418427
{
419-
$checksumsContent .= "$hashType: $hash\n";
420-
}
428+
$checksumsContent .= "Filename: $packageName\n";
421429

422-
$checksumsContent .= "\n";
423-
}
430+
foreach ($packageHashes as $hashType => $hash)
431+
{
432+
$checksumsContent .= "$hashType: $hash\n";
433+
}
424434

425-
file_put_contents('checksums.txt', $checksumsContent);
435+
$checksumsContent .= "\n";
436+
}
426437

427-
echo "Generating github_release.txt file\n";
438+
file_put_contents('checksums.txt', $checksumsContent);
428439

429-
$githubContent = array();
430-
$githubText = '';
431-
$releaseText = array(
432-
'FULL' => 'New Joomla! Installations ',
433-
'POINT' => 'Update from Joomla! ' . $version . '.' . $previousRelease . ' ',
434-
'MINOR' => 'Update from Joomla! ' . $version . '.x ',
435-
'UPGRADE' => 'Update from Joomla! 2.5 or previous 3.x releases ',
436-
);
437-
$githubLink = 'https://github.com/joomla/joomla-cms/releases/download/' . $tagVersion . '/';
440+
echo "Generating github_release.txt file\n";
438441

439-
foreach ($checksums as $packageName => $packageHashes)
440-
{
441-
$type = '';
442-
if (strpos($packageName, 'Full_Package') !== false)
442+
$githubContent = array();
443+
$githubText = '';
444+
$releaseText = array(
445+
'FULL' => 'New Joomla! Installations ',
446+
'POINT' => 'Update from Joomla! ' . $version . '.' . $previousRelease . ' ',
447+
'MINOR' => 'Update from Joomla! ' . $version . '.x ',
448+
'UPGRADE' => 'Update from Joomla! 2.5 or previous 3.x releases ',
449+
);
450+
$githubLink = 'https://github.com/joomla/joomla-cms/releases/download/' . $tagVersion . '/';
451+
452+
foreach ($checksums as $packageName => $packageHashes)
443453
{
444-
$type = 'FULL';
445-
} elseif (strpos($packageName, 'Patch_Package') !== false) {
446-
if (strpos($packageName, '.x_to') !== false) {
447-
$type = 'MINOR';
448-
} else {
449-
$type = 'POINT';
454+
$type = '';
455+
456+
if (strpos($packageName, 'Full_Package') !== false)
457+
{
458+
$type = 'FULL';
459+
}
460+
elseif (strpos($packageName, 'Patch_Package') !== false)
461+
{
462+
if (strpos($packageName, '.x_to') !== false)
463+
{
464+
$type = 'MINOR';
465+
}
466+
else
467+
{
468+
$type = 'POINT';
469+
}
470+
}
471+
elseif (strpos($packageName, 'Update_Package') !== false)
472+
{
473+
$type = 'UPGRADE';
450474
}
451-
} elseif (strpos($packageName, 'Update_Package') !== false) {
452-
$type = 'UPGRADE';
475+
476+
$githubContent[$type][] = '[' . substr($packageName, strpos($packageName, 'Package') + 7) . '](' . $githubLink . $packageName . ')';
453477
}
454478

455-
$githubContent[$type][] = '[' . substr($packageName, strpos($packageName, 'Package') + 7) . '](' . $githubLink . $packageName . ')';
456-
}
479+
foreach ($releaseText as $type => $text)
480+
{
481+
if (empty($githubContent[$type]))
482+
{
483+
continue;
484+
}
457485

458-
foreach($releaseText as $type => $text)
459-
{
460-
if (empty($githubContent[$type])) {
461-
continue;
462-
}
486+
$githubText .= $text;
487+
$githubText .= implode(" | ", $githubContent[$type]);
463488

464-
$githubText .= $text;
465-
$githubText .= implode(" | ", $githubContent[$type]);
489+
$githubText .= "\n";
490+
}
466491

467-
$githubText .= "\n";
492+
file_put_contents('github_release.txt', $githubText);
468493
}
469494

470-
file_put_contents('github_release.txt', $githubText);
471-
472495
echo "Build of version $fullVersion complete!\n";

build/bump.php

Lines changed: 51 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -36,49 +36,49 @@ function usage($command)
3636
const PHP_TAB = "\t";
3737

3838
// File paths.
39-
$versionFile = '/libraries/src/Version.php';
39+
$versionFile = '/libraries/src/Version.php';
4040

41-
$coreXmlFiles = array(
42-
'/administrator/manifests/files/joomla.xml',
43-
);
41+
$coreXmlFiles = array(
42+
'/administrator/manifests/files/joomla.xml',
43+
);
4444

4545
$languageXmlFiles = array(
46-
'/language/en-GB/en-GB.xml',
47-
'/language/en-GB/install.xml',
48-
'/administrator/language/en-GB/en-GB.xml',
49-
'/administrator/language/en-GB/install.xml',
50-
'/installation/language/en-GB/en-GB.xml',
51-
);
46+
'/language/en-GB/en-GB.xml',
47+
'/language/en-GB/install.xml',
48+
'/administrator/language/en-GB/en-GB.xml',
49+
'/administrator/language/en-GB/install.xml',
50+
'/installation/language/en-GB/en-GB.xml',
51+
);
5252

5353
$languagePackXmlFile = '/administrator/manifests/packages/pkg_en-GB.xml';
5454

5555
$antJobFile = '/build.xml';
5656

5757
$readMeFiles = array(
58-
'/README.md',
59-
'/README.txt',
60-
);
58+
'/README.md',
59+
'/README.txt',
60+
);
6161

6262
/*
6363
* Change copyright date exclusions.
6464
* Some systems may try to scan the .git directory, exclude it.
65-
* Also exclude build resources such as the packaging space or the API documentation build.
65+
* Also exclude build resources such as the packaging space or the API documentation build
66+
* as well as external libraries.
6667
*/
6768
$directoryLoopExcludeDirectories = array(
68-
'/.git',
69-
'/build/api/',
70-
'/build/coverage/',
71-
'/build/tmp/',
72-
'/libraries/vendor/',
73-
'/libraries/phputf8/',
74-
'/libraries/php-encryption/',
75-
'/libraries/phpass/',
76-
'/libraries/idna_convert/',
77-
'/libraries/fof/',
78-
);
79-
80-
$directoryLoopExcludeFiles = array(
81-
);
69+
'/.git',
70+
'/build/api/',
71+
'/build/coverage/',
72+
'/build/tmp/',
73+
'/libraries/vendor/',
74+
'/libraries/phputf8/',
75+
'/libraries/php-encryption/',
76+
'/libraries/phpass/',
77+
'/libraries/idna_convert/',
78+
'/libraries/fof/',
79+
);
80+
81+
$directoryLoopExcludeFiles = array();
8282

8383
// Check arguments (exit if incorrect cli arguments).
8484
$opts = getopt("v:c:");
@@ -157,20 +157,20 @@ function usage($command)
157157
$versionSubParts = explode('.', $versionParts[0]);
158158

159159
$version = array(
160-
'main' => $versionSubParts[0] . '.' . $versionSubParts[1],
161-
'major' => $versionSubParts[0],
162-
'minor' => $versionSubParts[1],
163-
'patch' => $versionSubParts[2],
164-
'extra' => (!empty($versionParts[1]) ? $versionParts[1] : '') . (!empty($versionParts[2]) ? (!empty($versionParts[1]) ? '-' : '') . $versionParts[2] : ''),
165-
'release' => $versionSubParts[0] . '.' . $versionSubParts[1] . '.' . $versionSubParts[2],
166-
'dev_devel' => $versionSubParts[2] . (!empty($versionParts[1]) ? '-' . $versionParts[1] : '') . (!empty($versionParts[2]) ? '-' . $versionParts[2] : ''),
167-
'dev_status' => $dev_status,
168-
'build' => '',
169-
'reldate' => date('j-F-Y'),
170-
'reltime' => date('H:i'),
171-
'reltz' => 'GMT',
172-
'credate' => date('F Y'),
173-
);
160+
'main' => $versionSubParts[0] . '.' . $versionSubParts[1],
161+
'major' => $versionSubParts[0],
162+
'minor' => $versionSubParts[1],
163+
'patch' => $versionSubParts[2],
164+
'extra' => (!empty($versionParts[1]) ? $versionParts[1] : '') . (!empty($versionParts[2]) ? (!empty($versionParts[1]) ? '-' : '') . $versionParts[2] : ''),
165+
'release' => $versionSubParts[0] . '.' . $versionSubParts[1] . '.' . $versionSubParts[2],
166+
'dev_devel' => $versionSubParts[2] . (!empty($versionParts[1]) ? '-' . $versionParts[1] : '') . (!empty($versionParts[2]) ? '-' . $versionParts[2] : ''),
167+
'dev_status' => $dev_status,
168+
'build' => '',
169+
'reldate' => date('j-F-Y'),
170+
'reltime' => date('H:i'),
171+
'reltz' => 'GMT',
172+
'credate' => date('F Y'),
173+
);
174174

175175
// Version Codename.
176176
if (!empty($opts['c']))
@@ -180,21 +180,23 @@ function usage($command)
180180

181181
// Prints version information.
182182
echo PHP_EOL;
183-
echo 'Version data:'. PHP_EOL;
183+
echo 'Version data:' . PHP_EOL;
184184
echo '- Main:' . PHP_TAB . PHP_TAB . PHP_TAB . $version['main'] . PHP_EOL;
185185
echo '- Release:' . PHP_TAB . PHP_TAB . $version['release'] . PHP_EOL;
186-
echo '- Full:' . PHP_TAB . PHP_TAB . PHP_TAB . $version['main'] . '.' . $version['dev_devel'] . PHP_EOL;
186+
echo '- Full:' . PHP_TAB . PHP_TAB . PHP_TAB . $version['main'] . '.' . $version['dev_devel'] . PHP_EOL;
187187
echo '- Build:' . PHP_TAB . PHP_TAB . $version['build'] . PHP_EOL;
188188
echo '- Dev Level:' . PHP_TAB . PHP_TAB . $version['dev_devel'] . PHP_EOL;
189189
echo '- Dev Status:' . PHP_TAB . PHP_TAB . $version['dev_status'] . PHP_EOL;
190190
echo '- Release date:' . PHP_TAB . PHP_TAB . $version['reldate'] . PHP_EOL;
191191
echo '- Release time:' . PHP_TAB . PHP_TAB . $version['reltime'] . PHP_EOL;
192-
echo '- Release timezone:' . PHP_TAB . $version['reltz'] . PHP_EOL;
192+
echo '- Release timezone:' . PHP_TAB . $version['reltz'] . PHP_EOL;
193193
echo '- Creation date:' . PHP_TAB . $version['credate'] . PHP_EOL;
194+
194195
if (!empty($version['codename']))
195196
{
196197
echo '- Codename:' . PHP_TAB . PHP_TAB . $version['codename'] . PHP_EOL;
197198
}
199+
198200
echo PHP_EOL;
199201

200202
$rootPath = dirname(__DIR__);
@@ -214,10 +216,12 @@ function usage($command)
214216
$fileContents = preg_replace("#RELDATE\s*=\s*'[^\']*'#", "RELDATE = '" . $version['reldate'] . "'", $fileContents);
215217
$fileContents = preg_replace("#RELTIME\s*=\s*'[^\']*'#", "RELTIME = '" . $version['reltime'] . "'", $fileContents);
216218
$fileContents = preg_replace("#RELTZ\s*=\s*'[^\']*'#", "RELTZ = '" . $version['reltz'] . "'", $fileContents);
219+
217220
if (!empty($version['codename']))
218221
{
219222
$fileContents = preg_replace("#CODENAME\s*=\s*'[^\']*'#", "CODENAME = '" . $version['codename'] . "'", $fileContents);
220223
}
224+
221225
file_put_contents($rootPath . $versionFile, $fileContents);
222226
}
223227

@@ -276,8 +280,8 @@ function usage($command)
276280

277281
$changedFilesSinceVersion = 0;
278282
$year = date('Y');
279-
$directory = new \RecursiveDirectoryIterator($rootPath);
280-
$iterator = new \RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST);
283+
$directory = new RecursiveDirectoryIterator($rootPath);
284+
$iterator = new RecursiveIteratorIterator($directory, RecursiveIteratorIterator::SELF_FIRST);
281285

282286
foreach ($iterator as $file)
283287
{

0 commit comments

Comments
 (0)