Skip to content

Commit

Permalink
Merge branch '4.2-dev' into feature/application-interface-controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Jun 28, 2022
2 parents bc33ec0 + cb90094 commit 972140b
Show file tree
Hide file tree
Showing 123 changed files with 18,212 additions and 17,998 deletions.
@@ -0,0 +1,9 @@
-- Set core extensions as locked extensions.
UPDATE `#__extensions`
SET `locked` = 1
WHERE (`type` = 'plugin' AND
(
(`folder` = 'system' AND `element` = 'schedulerunner')
OR (`folder` = 'task' AND `element` IN ('checkfiles', 'demotasks', 'requests', 'sitestatus'))
)
);
@@ -0,0 +1,9 @@
-- Set core extensions as locked extensions.
UPDATE "#__extensions"
SET "locked" = 1
WHERE ("type" = 'plugin' AND
(
("folder" = 'system' AND "element" = 'schedulerunner')
OR ("folder" = 'task' AND "element" IN ('checkfiles', 'demotasks', 'requests', 'sitestatus'))
)
);
1,021 changes: 486 additions & 535 deletions build/build.php

Large diffs are not rendered by default.

368 changes: 165 additions & 203 deletions build/bump.php

Large diffs are not rendered by default.

223 changes: 105 additions & 118 deletions build/deleted_file_check.php
@@ -1,4 +1,5 @@
<?php

/**
* This file is used to build the list of deleted files between two reference points.
*
Expand All @@ -25,11 +26,11 @@

function usage($command)
{
echo PHP_EOL;
echo 'Usage: php ' . $command . ' [options]' . PHP_EOL;
echo PHP_TAB . '--from <ref>:' . PHP_TAB . 'Starting commit reference (branch/tag)' . PHP_EOL;
echo PHP_TAB . '--to <ref>:' . PHP_TAB . 'Ending commit reference (branch/tag) [optional]' . PHP_EOL;
echo PHP_EOL;
echo PHP_EOL;
echo 'Usage: php ' . $command . ' [options]' . PHP_EOL;
echo PHP_TAB . '--from <ref>:' . PHP_TAB . 'Starting commit reference (branch/tag)' . PHP_EOL;
echo PHP_TAB . '--to <ref>:' . PHP_TAB . 'Ending commit reference (branch/tag) [optional]' . PHP_EOL;
echo PHP_EOL;
}

/*
Expand All @@ -39,39 +40,37 @@ function usage($command)
$options = getopt('', array('from:', 'to::'));

// We need the from reference, otherwise we're doomed to fail
if (empty($options['from']))
{
echo PHP_EOL;
echo 'Missing starting directory' . PHP_EOL;
if (empty($options['from'])) {
echo PHP_EOL;
echo 'Missing starting directory' . PHP_EOL;

usage($argv[0]);
usage($argv[0]);

exit(1);
exit(1);
}

// Missing the to reference? No problem, grab the current HEAD
if (empty($options['to']))
{
echo PHP_EOL;
echo 'Missing ending directory' . PHP_EOL;
if (empty($options['to'])) {
echo PHP_EOL;
echo 'Missing ending directory' . PHP_EOL;

usage($argv[0]);
usage($argv[0]);

exit(1);
exit(1);
}

// Directories to skip for the check (needs to include anything from J3 we want to keep)
$previousReleaseExclude = [
$options['from'] . '/administrator/components/com_search',
$options['from'] . '/components/com_search',
$options['from'] . '/images/sampledata',
$options['from'] . '/installation',
$options['from'] . '/media/plg_quickicon_eos310',
$options['from'] . '/media/system/images',
$options['from'] . '/modules/mod_search',
$options['from'] . '/plugins/fields/repeatable',
$options['from'] . '/plugins/quickicon/eos310',
$options['from'] . '/plugins/search',
$options['from'] . '/administrator/components/com_search',
$options['from'] . '/components/com_search',
$options['from'] . '/images/sampledata',
$options['from'] . '/installation',
$options['from'] . '/media/plg_quickicon_eos310',
$options['from'] . '/media/system/images',
$options['from'] . '/modules/mod_search',
$options['from'] . '/plugins/fields/repeatable',
$options['from'] . '/plugins/quickicon/eos310',
$options['from'] . '/plugins/search',
];

/**
Expand All @@ -82,17 +81,16 @@ function usage($command)
* @return bool True if you need to recurse or if the item is acceptable
*/
$previousReleaseFilter = function ($file, $key, $iterator) use ($previousReleaseExclude) {
if ($iterator->hasChildren() && !in_array($file->getPathname(), $previousReleaseExclude))
{
return true;
}
if ($iterator->hasChildren() && !in_array($file->getPathname(), $previousReleaseExclude)) {
return true;
}

return $file->isFile();
return $file->isFile();
};

// Directories to skip for the check
$newReleaseExclude = [
$options['to'] . '/installation'
$options['to'] . '/installation'
];

/**
Expand All @@ -103,50 +101,45 @@ function usage($command)
* @return bool True if you need to recurse or if the item is acceptable
*/
$newReleaseFilter = function ($file, $key, $iterator) use ($newReleaseExclude) {
if ($iterator->hasChildren() && !in_array($file->getPathname(), $newReleaseExclude))
{
return true;
}
if ($iterator->hasChildren() && !in_array($file->getPathname(), $newReleaseExclude)) {
return true;
}

return $file->isFile();
return $file->isFile();
};

$previousReleaseDirIterator = new RecursiveDirectoryIterator($options['from'], RecursiveDirectoryIterator::SKIP_DOTS);
$previousReleaseIterator = new RecursiveIteratorIterator(
new RecursiveCallbackFilterIterator($previousReleaseDirIterator, $previousReleaseFilter),
RecursiveIteratorIterator::SELF_FIRST
new RecursiveCallbackFilterIterator($previousReleaseDirIterator, $previousReleaseFilter),
RecursiveIteratorIterator::SELF_FIRST
);
$previousReleaseFiles = [];
$previousReleaseFolders = [];

foreach ($previousReleaseIterator as $info)
{
if ($info->isDir())
{
$previousReleaseFolders[] = "'" . str_replace($options['from'], '', $info->getPathname()) . "',";
continue;
}
foreach ($previousReleaseIterator as $info) {
if ($info->isDir()) {
$previousReleaseFolders[] = "'" . str_replace($options['from'], '', $info->getPathname()) . "',";
continue;
}

$previousReleaseFiles[] = "'" . str_replace($options['from'], '', $info->getPathname()) . "',";
$previousReleaseFiles[] = "'" . str_replace($options['from'], '', $info->getPathname()) . "',";
}

$newReleaseDirIterator = new RecursiveDirectoryIterator($options['to'], RecursiveDirectoryIterator::SKIP_DOTS);
$newReleaseIterator = new RecursiveIteratorIterator(
new RecursiveCallbackFilterIterator($newReleaseDirIterator, $newReleaseFilter),
RecursiveIteratorIterator::SELF_FIRST
new RecursiveCallbackFilterIterator($newReleaseDirIterator, $newReleaseFilter),
RecursiveIteratorIterator::SELF_FIRST
);
$newReleaseFiles = [];
$newReleaseFolders = [];

foreach ($newReleaseIterator as $info)
{
if ($info->isDir())
{
$newReleaseFolders[] = "'" . str_replace($options['to'], '', $info->getPathname()) . "',";
continue;
}
foreach ($newReleaseIterator as $info) {
if ($info->isDir()) {
$newReleaseFolders[] = "'" . str_replace($options['to'], '', $info->getPathname()) . "',";
continue;
}

$newReleaseFiles[] = "'" . str_replace($options['to'], '', $info->getPathname()) . "',";
$newReleaseFiles[] = "'" . str_replace($options['to'], '', $info->getPathname()) . "',";
}

$filesDifference = array_diff($previousReleaseFiles, $newReleaseFiles);
Expand All @@ -155,45 +148,44 @@ function usage($command)

// Specific files (e.g. language files) that we want to keep on upgrade
$filesToKeep = [
"'/administrator/components/com_joomlaupdate/restore_finalisation.php',",
"'/administrator/language/en-GB/en-GB.com_search.ini',",
"'/administrator/language/en-GB/en-GB.com_search.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_editors-xtd_weblink.ini',",
"'/administrator/language/en-GB/en-GB.plg_editors-xtd_weblink.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_fields_repeatable.ini',",
"'/administrator/language/en-GB/en-GB.plg_fields_repeatable.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_quickicon_eos310.ini',",
"'/administrator/language/en-GB/en-GB.plg_quickicon_eos310.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_categories.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_categories.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_contacts.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_contacts.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_content.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_content.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_newsfeeds.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_newsfeeds.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_tags.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_tags.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_weblinks.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_weblinks.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_system_weblinks.ini',",
"'/administrator/language/en-GB/en-GB.plg_system_weblinks.sys.ini',",
"'/language/en-GB/en-GB.com_search.ini',",
"'/language/en-GB/en-GB.mod_search.ini',",
"'/language/en-GB/en-GB.mod_search.sys.ini',",
"'/administrator/components/com_joomlaupdate/restore_finalisation.php',",
"'/administrator/language/en-GB/en-GB.com_search.ini',",
"'/administrator/language/en-GB/en-GB.com_search.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_editors-xtd_weblink.ini',",
"'/administrator/language/en-GB/en-GB.plg_editors-xtd_weblink.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_fields_repeatable.ini',",
"'/administrator/language/en-GB/en-GB.plg_fields_repeatable.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_quickicon_eos310.ini',",
"'/administrator/language/en-GB/en-GB.plg_quickicon_eos310.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_categories.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_categories.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_contacts.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_contacts.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_content.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_content.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_newsfeeds.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_newsfeeds.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_tags.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_tags.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_weblinks.ini',",
"'/administrator/language/en-GB/en-GB.plg_search_weblinks.sys.ini',",
"'/administrator/language/en-GB/en-GB.plg_system_weblinks.ini',",
"'/administrator/language/en-GB/en-GB.plg_system_weblinks.sys.ini',",
"'/language/en-GB/en-GB.com_search.ini',",
"'/language/en-GB/en-GB.mod_search.ini',",
"'/language/en-GB/en-GB.mod_search.sys.ini',",
];

// Specific folders that we want to keep on upgrade
$foldersToKeep = [
"'/bin',",
"'/bin',",
];

// Remove folders from the results which we want to keep on upgrade
foreach ($foldersToKeep as $folder)
{
if (($key = array_search($folder, $foldersDifference)) !== false) {
unset($foldersDifference[$key]);
}
foreach ($foldersToKeep as $folder) {
if (($key = array_search($folder, $foldersDifference)) !== false) {
unset($foldersDifference[$key]);
}
}

asort($filesDifference);
Expand All @@ -202,34 +194,29 @@ function usage($command)
$deletedFiles = [];
$renamedFiles = [];

foreach ($filesDifference as $file)
{
// Don't remove any specific files (e.g. language files) that we want to keep on upgrade
if (array_search($file, $filesToKeep) !== false)
{
continue;
}

// Check for files which might have been renamed only
$matches = preg_grep('/^' . preg_quote($file, '/') . '$/i', $newReleaseFiles);

if ($matches !== false)
{
foreach ($matches as $match)
{
if (dirname($match) === dirname($file) && strtolower(basename($match)) === strtolower(basename($file)))
{
// File has been renamed only: Add to renamed files list
$renamedFiles[] = substr($file, 0, -1) . ' => ' . $match;

// Go on with the next file in $filesDifference
continue 2;
}
}
}

// File has been really deleted and not just renamed
$deletedFiles[] = $file;
foreach ($filesDifference as $file) {
// Don't remove any specific files (e.g. language files) that we want to keep on upgrade
if (array_search($file, $filesToKeep) !== false) {
continue;
}

// Check for files which might have been renamed only
$matches = preg_grep('/^' . preg_quote($file, '/') . '$/i', $newReleaseFiles);

if ($matches !== false) {
foreach ($matches as $match) {
if (dirname($match) === dirname($file) && strtolower(basename($match)) === strtolower(basename($file))) {
// File has been renamed only: Add to renamed files list
$renamedFiles[] = substr($file, 0, -1) . ' => ' . $match;

// Go on with the next file in $filesDifference
continue 2;
}
}
}

// File has been really deleted and not just renamed
$deletedFiles[] = $file;
}

// Write the lists to files for later reference
Expand Down

0 comments on commit 972140b

Please sign in to comment.