Open tyler36 opened 6 months ago
Was asked on slack
I ... wonder... can it just ask if you want to autoconfigure?
Thoughts?
It is possible to ask questions at install time, but it's tweaky. ddev-platformsh asks for config items (keys).
and
Hopefully, we can do something when ddev/ddev/pull/6406 gets merged.
Mabe we can split this to make it work for all?
For Drupal it seems to be required to update the settings.php ... for OpenMage it would be enough to copy default settings - ddev.xhgui.php
- to app/etc/includes
path, thats autoloaded. I guess other frameworks have custom autoload paths too. (?)
For me this works perfect ... no need to edit Mage.php as i added to README :(
if (getenv('IS_DDEV_PROJECT') && getenv('NO_XHGUI') !== '1') {
if (file_exists($xhgui = '/mnt/ddev_config/xhgui/collector/xhgui.collector.php')) {
require_once $xhgui;
}
}
Note: NO_XHGUI
env
With having xhgui.collector included phpunit (9.6, php7.4) fails with ...
running testsSerialization of 'Closure' is not allowed
To fix, i added this to phpunit.xml.dist
<php>
<env name="NO_XHGUI" value="1"/>
</php>
@rfay why confused?
Sorry @sreichel , I don't understand your question or what it's referring to.
@rfay why confused?
I asked why you reacted with a "confused" emoji.
I don't have very good vision. I thought it was a smiley.
Made some suggestions. setup.sh
needs to be updated, to switch project types ...i'll try to make PR later.
Untested seetup.sh
(drupal versions needs to be fixed)
#!/usr/bin/env bash
#ddev-generated
set -e
XHGUI_SETTINGS=ddev.xhgui.php
case $DDEV_PROJECT_TYPE in
magento)
# Copy over settings
cp xhgui/scripts/$XHGUI_SETTINGS $DDEV_APPROOT/$DDEV_DOCROOT/app/etc/includes/
;;
drupal | drupal)
# Early return if disable_settings_management is true.
if ( ddev debug configyaml 2>/dev/null | grep 'disable_settings_management:\s*true' >/dev/null 2>&1 ) ; then
exit 0
fi
# Copy over settings
cp xhgui/scripts/$XHGUI_SETTINGS $DDEV_APPROOT/$DDEV_DOCROOT/sites/default/
# Add settings
SETTINGS_FILE_NAME="${DDEV_APPROOT}/${DDEV_DOCROOT}/sites/default/settings.php"
echo "Settings file name: ${SETTINGS_FILE_NAME}"
grep -qF $XHGUI_SETTINGS $SETTINGS_FILE_NAME || echo "
// Include settings required for XHGUI.
if ((file_exists(__DIR__ . '/$XHGUI_SETTINGS') && getenv('IS_DDEV_PROJECT') == 'true')) {
include __DIR__ . '/$XHGUI_SETTINGS';
}" >> $SETTINGS_FILE_NAME
;;
*)
# echo -n "?"
;;
esac
# Add perftools/php-profiler
if ( ddev composer show --all | grep -v perftools/php-profiler >/dev/null 2>&1 ) ; then
ddev composer require perftools/php-profiler --dev
fi
Hopefully, this will trigger similar PRs for other frameworks when this is merge
Can i help?
Hi @sreichel,
Thank you for your suggestion. We apologize for the delay in addressing your changes. The maintainer is currently unavailable but is expected to return in about a week. Your patience is greatly appreciated!
This PR is an attempt to automate the steps for installtion on Drupal.
This address issues #30 .
Hopefully, this will trigger similar PRs for other frameworks when this is merge.