Skip to content

Commit

Permalink
Merge branch '1.x-1.x' into issue-111-update-command
Browse files Browse the repository at this point in the history
  • Loading branch information
yorkshire-pudding committed May 23, 2024
2 parents 895f556 + a26e570 commit 4e2edd4
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 24 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ and this project follows the
## [Unreleased]

### Added
- Configuration and tool (Box) to build Phar files
- Configuration and tool (Box) to build Phar files.
- Support for reporting database config storage in status command.
### Changed
- Updated Lando file to reflect Lando v3.21.0
- Updated Lando file to reflect Lando v3.21.0.
- Lando dev/testing recipe updated to allow to switch bee version with rebuild.
### Fixed
### Fixed
- GitHub Action tests failing.
- Warning if database settings in array and port not included.
- Failure to find existing core submodule dependencies.

### [1.x-1.0.1] - 2024-04-24

Expand Down
36 changes: 21 additions & 15 deletions commands/download.bee.inc
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,23 @@ function download_bee_callback($arguments, $options) {

// Get list of all core projects so we don't try to download core dependencies
// when we download a named project.
$core_project_list = array();
if (!empty($_bee_backdrop_root)) {
// Look in folders for core modules, themes and layouts.
$project_types = array('module', 'theme', 'layout');
foreach ($project_types as $project_type) {
$core_project_path = "{$_bee_backdrop_root}/core/{$project_type}s";
$core_projects_raw = array();
$core_projects_raw = glob($core_project_path . "/*", GLOB_ONLYDIR);
// Extract the project name and add it to a single list.
foreach ($core_projects_raw as $core_project) {
$core_projects[] = basename($core_project);
$locations = array('core');
$core_projects_set = download_bee_find_all_projects($project_type, $locations);

// Add each project to a common array.
foreach ($core_projects_set as $key => $core_project) {
$core_projects[$key] = $core_project;
// Create a simple array of names for debug purposes.
$core_project_list[] = $key;
}
}
// Provide list of core projects for debug purposes.
bee_message(bt("Core projects are: !list", array(
'!list' => implode(",", $core_projects),
'!list' => implode(",", $core_project_list),
)), 'log');
}

Expand Down Expand Up @@ -154,7 +156,7 @@ function download_bee_callback($arguments, $options) {
$dependency = explode(" ", $dependency, 2);
$dependency = $dependency[0];
// Check if the dependency is a core project.
$dependency_is_core = in_array($dependency, $core_projects);
$dependency_is_core = isset($core_projects[$dependency]);
// Check if dependency exists in the site file system. Only
// check contrib dependencies.
if (!$dependency_is_core) {
Expand Down Expand Up @@ -535,21 +537,26 @@ function download_bee_download_project($project, array $info, $destination) {
* The type of project to list:
* - module
* - theme
* - layout
* This will find projects in both core and contrib.
* - layout.
* @param array $locations
* Array of 'locations'. These are not path locations, but location types. By
* default, this is 'core' and 'contrib', but you could limit to just 'core'
* or just 'contrib'.
*
* @return array
* An associative array of all projects with their locations, together with
* the location type and project type.
*/
function download_bee_find_all_projects($type) {
function download_bee_find_all_projects($type,
array $locations = array('core', 'contrib')) {
global $_bee_backdrop_root, $_bee_backdrop_site;
// Create an empty array for files.
$files = array();
// Create an empty array for projects.
$projects = array();
// Set the pattern to look for .info files.
$pattern = '#\.info$#';
// Define the locations to search.
$locations = array('core','contrib');
// Check if we need to add 'site_contrib' to list of locations.
(empty($_bee_backdrop_site)) ?: $locations[] = 'site_contrib';
// Loop through each location.
foreach ($locations as $location) {
Expand All @@ -574,7 +581,6 @@ function download_bee_find_all_projects($type) {
);
$files = bee_file_scan_directory($path, $pattern, $options);
// Modify each record to meet our needs.
$projects[] = array();
foreach ($files as &$file) {
// Add the revised project record to a common list of projects.
$key = $file->name;
Expand Down
34 changes: 28 additions & 6 deletions commands/status.bee.inc
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,38 @@ function status_bee_callback($arguments, $options) {
array('value' => bt('Drupal compatibility')),
array('value' => ($settings['backdrop_drupal_compatibility']) ? 'on' : 'off'),
);
if ($config_directories['active'] && is_dir($config_directories['active'])) {
// Active config storage.
$config_active_class = isset($settings['config_active_class']) ? $settings['config_active_class'] : 'ConfigFileStorage';
$config_active_storage = '';
if ($config_active_class == 'ConfigDatabaseStorage') {
$config_active_storage = 'Database';
}
else {
if ($config_directories['active'] && is_dir($config_directories['active'])) {
$config_active_storage = realpath($config_directories['active']);
}
}
if ($config_active_storage) {
$rows[] = array(
array('value' => bt('Config dir active')),
array('value' => realpath($config_directories['active'])),
array('value' => bt('Config storage active')),
array('value' => $config_active_storage),
);
}
if ($config_directories['staging'] && is_dir($config_directories['staging'])) {
// Staging config storage.
$config_staging_class = isset($settings['config_staging_class']) ? $settings['config_staging_class'] : 'ConfigFileStorage';
$config_staging_storage = '';
if ($config_staging_class == 'ConfigDatabaseStorage') {
$config_staging_storage = 'Database';
}
else {
if ($config_directories['staging'] && is_dir($config_directories['staging'])) {
$config_staging_storage = realpath($config_directories['staging']);
}
}
if ($config_staging_storage) {
$rows[] = array(
array('value' => bt('Config dir staging')),
array('value' => realpath($config_directories['staging'])),
array('value' => bt('Config storage staging')),
array('value' => $config_staging_storage),
);
}

Expand Down

0 comments on commit 4e2edd4

Please sign in to comment.