Skip to content

Instantly share code, notes, and snippets.

@baschny
Created November 16, 2013 12:47
Show Gist options
  • Save baschny/7499812 to your computer and use it in GitHub Desktop.
Save baschny/7499812 to your computer and use it in GitHub Desktop.
TYPO3 CMS AdditionalConfiguration.php adaptations for easy use of "git bisect". If you want to use "git bisect" on 6.2 development, you end up having to change your configuration depending if certain features are in or not. This addition to AdditionalConfiguration.php help automating these changes for you at runtime depending if certain commit i…
<?php
# ...
function isCommitIncluded($commit) {
$cmd = sprintf('GIT_DIR=%s/.git git log -1 %s^..HEAD', PATH_site . 'typo3_src', $commit);
$output = '';
exec($cmd, $output);
return (count($output) > 0);
}
function adaptConfiguration() {
// installToolPassword salted password?
if (isCommitIncluded('d1199a8880f6cf83371e120a1b82dc46d6b9a9bf')) {
$GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'] = '$P$C770F95algGkMWiR3rbI6XoSBd4bJm/';
} else {
$GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'] = md5('password');
}
// package management not included?
if (!isCommitIncluded('84d6207c827ecba09dd7f357ca02369de569c12a')) {
// rebuild old extListArray
$packageStatesConfiguration = include(PATH_typo3conf . 'PackageStates.php');
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray'] = array();
foreach ($packageStatesConfiguration['packages'] as $packageName => $setup) {
if ($setup['state'] === 'active') {
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray'][] = $packageName;
}
}
}
}
adaptConfiguration();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment