mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Fix setting xdebug.mode
This commit is contained in:
parent
8862a73fdd
commit
d74064b67a
@ -24,7 +24,7 @@ describe('Config tests', () => {
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
expect(linux).toContain(
|
expect(linux).toContain(
|
||||||
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata" | sudo tee -a "${ini_file[@]}"'
|
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata" | sudo tee -a "${pecl_file:-${ini_file[@]}}"'
|
||||||
);
|
);
|
||||||
|
|
||||||
linux = await config.addINIValues(
|
linux = await config.addINIValues(
|
||||||
@ -40,7 +40,7 @@ describe('Config tests', () => {
|
|||||||
'darwin'
|
'darwin'
|
||||||
);
|
);
|
||||||
expect(darwin).toContain(
|
expect(darwin).toContain(
|
||||||
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata" | sudo tee -a "${ini_file[@]}"'
|
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata" | sudo tee -a "${pecl_file:-${ini_file[@]}}"'
|
||||||
);
|
);
|
||||||
|
|
||||||
darwin = await config.addINIValues(
|
darwin = await config.addINIValues(
|
||||||
|
@ -28,43 +28,36 @@ describe('Config tests', () => {
|
|||||||
it('checking addCoverage with Xdebug on windows', async () => {
|
it('checking addCoverage with Xdebug on windows', async () => {
|
||||||
const win32: string = await coverage.addCoverage('xdebug', '7.4', 'win32');
|
const win32: string = await coverage.addCoverage('xdebug', '7.4', 'win32');
|
||||||
expect(win32).toContain('Add-Extension xdebug');
|
expect(win32).toContain('Add-Extension xdebug');
|
||||||
expect(win32).toContain('xdebug.mode=coverage');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('checking addCoverage with Xdebug on linux', async () => {
|
it('checking addCoverage with Xdebug on linux', async () => {
|
||||||
const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux');
|
const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux');
|
||||||
expect(linux).toContain('add_extension xdebug');
|
expect(linux).toContain('add_extension xdebug');
|
||||||
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('checking addCoverage with Xdebug3 on linux', async () => {
|
it('checking addCoverage with Xdebug3 on linux', async () => {
|
||||||
const linux: string = await coverage.addCoverage('xdebug3', '7.4', 'linux');
|
const linux: string = await coverage.addCoverage('xdebug3', '7.4', 'linux');
|
||||||
expect(linux).toContain('add_extension_from_source xdebug');
|
expect(linux).toContain('add_extension_from_source xdebug');
|
||||||
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('checking addCoverage with Xdebug3 on linux', async () => {
|
it('checking addCoverage with Xdebug3 on linux', async () => {
|
||||||
const linux: string = await coverage.addCoverage('xdebug3', '8.0', 'linux');
|
const linux: string = await coverage.addCoverage('xdebug3', '8.0', 'linux');
|
||||||
expect(linux).toContain('add_extension xdebug');
|
expect(linux).toContain('add_extension xdebug');
|
||||||
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('checking addCoverage with Xdebug on linux', async () => {
|
it('checking addCoverage with Xdebug on linux', async () => {
|
||||||
const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux');
|
const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux');
|
||||||
expect(linux).toContain('add_extension xdebug');
|
expect(linux).toContain('add_extension xdebug');
|
||||||
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('checking addCoverage with Xdebug3 on linux', async () => {
|
it('checking addCoverage with Xdebug3 on linux', async () => {
|
||||||
const linux: string = await coverage.addCoverage('xdebug3', '8.1', 'linux');
|
const linux: string = await coverage.addCoverage('xdebug3', '8.1', 'linux');
|
||||||
expect(linux).toContain('add_extension xdebug');
|
expect(linux).toContain('add_extension xdebug');
|
||||||
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('checking addCoverage with Xdebug on linux', async () => {
|
it('checking addCoverage with Xdebug on linux', async () => {
|
||||||
const linux: string = await coverage.addCoverage('xdebug', '8.1', 'linux');
|
const linux: string = await coverage.addCoverage('xdebug', '8.1', 'linux');
|
||||||
expect(linux).toContain('add_extension xdebug');
|
expect(linux).toContain('add_extension xdebug');
|
||||||
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('checking addCoverage with Xdebug on darwin', async () => {
|
it('checking addCoverage with Xdebug on darwin', async () => {
|
||||||
|
5
dist/index.js
vendored
5
dist/index.js
vendored
@ -2337,9 +2337,8 @@ const config = __importStar(__webpack_require__(641));
|
|||||||
async function addCoverageXdebug(extension, version, os_version, pipe) {
|
async function addCoverageXdebug(extension, version, os_version, pipe) {
|
||||||
const xdebug = (await extensions.addExtension(extension, version, os_version, true)) +
|
const xdebug = (await extensions.addExtension(extension, version, os_version, true)) +
|
||||||
pipe;
|
pipe;
|
||||||
const ini = await config.addINIValues('xdebug.mode=coverage', os_version, true);
|
|
||||||
const log = await utils.addLog('$tick', extension, 'Xdebug enabled as coverage driver', os_version);
|
const log = await utils.addLog('$tick', extension, 'Xdebug enabled as coverage driver', os_version);
|
||||||
return [xdebug, ini, log].join('\n');
|
return xdebug + '\n' + log;
|
||||||
}
|
}
|
||||||
exports.addCoverageXdebug = addCoverageXdebug;
|
exports.addCoverageXdebug = addCoverageXdebug;
|
||||||
/**
|
/**
|
||||||
@ -2474,7 +2473,7 @@ async function addINIValuesUnix(ini_values_csv) {
|
|||||||
});
|
});
|
||||||
return ('echo "' +
|
return ('echo "' +
|
||||||
ini_values.join('\n') +
|
ini_values.join('\n') +
|
||||||
'" | sudo tee -a "${ini_file[@]}" >/dev/null 2>&1' +
|
'" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1' +
|
||||||
script);
|
script);
|
||||||
}
|
}
|
||||||
exports.addINIValuesUnix = addINIValuesUnix;
|
exports.addINIValuesUnix = addINIValuesUnix;
|
||||||
|
@ -17,7 +17,7 @@ export async function addINIValuesUnix(
|
|||||||
return (
|
return (
|
||||||
'echo "' +
|
'echo "' +
|
||||||
ini_values.join('\n') +
|
ini_values.join('\n') +
|
||||||
'" | sudo tee -a "${ini_file[@]}" >/dev/null 2>&1' +
|
'" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null 2>&1' +
|
||||||
script
|
script
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -19,18 +19,13 @@ export async function addCoverageXdebug(
|
|||||||
const xdebug =
|
const xdebug =
|
||||||
(await extensions.addExtension(extension, version, os_version, true)) +
|
(await extensions.addExtension(extension, version, os_version, true)) +
|
||||||
pipe;
|
pipe;
|
||||||
const ini = await config.addINIValues(
|
|
||||||
'xdebug.mode=coverage',
|
|
||||||
os_version,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
const log = await utils.addLog(
|
const log = await utils.addLog(
|
||||||
'$tick',
|
'$tick',
|
||||||
extension,
|
extension,
|
||||||
'Xdebug enabled as coverage driver',
|
'Xdebug enabled as coverage driver',
|
||||||
os_version
|
os_version
|
||||||
);
|
);
|
||||||
return [xdebug, ini, log].join('\n');
|
return xdebug + '\n' + log;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,7 +3,8 @@ export tick="✓"
|
|||||||
export cross="✗"
|
export cross="✗"
|
||||||
export curl_opts=(-sL)
|
export curl_opts=(-sL)
|
||||||
export old_versions="5.[3-5]"
|
export old_versions="5.[3-5]"
|
||||||
export jit_versions="8.[0-1]"
|
export jit_versions="8.[0-9]"
|
||||||
|
export xdebug3_versions="7.[2-4]|8.[0-9]"
|
||||||
export tool_path_dir="/usr/local/bin"
|
export tool_path_dir="/usr/local/bin"
|
||||||
export composer_bin="$HOME/.composer/vendor/bin"
|
export composer_bin="$HOME/.composer/vendor/bin"
|
||||||
export composer_json="$HOME/.composer/composer.json"
|
export composer_json="$HOME/.composer/composer.json"
|
||||||
@ -107,10 +108,19 @@ enable_extension() {
|
|||||||
sudo phpenmod -v "$version" "$1" >/dev/null 2>&1
|
sudo phpenmod -v "$version" "$1" >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
if ! check_extension "$1" && [ -e "${ext_dir:?}/$1.so" ]; then
|
if ! check_extension "$1" && [ -e "${ext_dir:?}/$1.so" ]; then
|
||||||
echo "$2=${ext_dir:?}/$1.so" >>"${pecl_file:-${ini_file[@]}}"
|
echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to configure PHP
|
||||||
|
configure_php() {
|
||||||
|
(
|
||||||
|
echo -e "date.timezone=UTC\nmemory_limit=-1"
|
||||||
|
[[ "$version" =~ $jit_versions ]] && echo -e "opcache.enable=1\nopcache.jit_buffer_size=256M\nopcache.jit=1235"
|
||||||
|
[[ "$version" =~ $xdebug3_versions ]] && echo -e "xdebug.mode=coverage"
|
||||||
|
) | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
# Function to configure PECL.
|
# Function to configure PECL.
|
||||||
configure_pecl() {
|
configure_pecl() {
|
||||||
if ! [ -e /tmp/pecl_config ]; then
|
if ! [ -e /tmp/pecl_config ]; then
|
||||||
|
@ -139,8 +139,7 @@ setup_php() {
|
|||||||
fi
|
fi
|
||||||
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
||||||
sudo chmod 777 "$ini_file" "${tool_path_dir:?}"
|
sudo chmod 777 "$ini_file" "${tool_path_dir:?}"
|
||||||
echo -e "date.timezone=UTC\nmemory_limit=-1" >>"$ini_file"
|
configure_php
|
||||||
[[ "$version" =~ ${jit_versions:?} ]] && echo -e "opcache.enable=1\nopcache.jit_buffer_size=256M\nopcache.jit=1235" >>"$ini_file"
|
|
||||||
ext_dir=$(php -i | grep -Ei "extension_dir => /" | sed -e "s|.*=> s*||")
|
ext_dir=$(php -i | grep -Ei "extension_dir => /" | sed -e "s|.*=> s*||")
|
||||||
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
|
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
|
||||||
sudo mkdir -m 777 -p "$ext_dir" "$HOME/.composer"
|
sudo mkdir -m 777 -p "$ext_dir" "$HOME/.composer"
|
||||||
|
@ -278,10 +278,10 @@ setup_php() {
|
|||||||
pecl_file="$scan_dir"/99-pecl.ini
|
pecl_file="$scan_dir"/99-pecl.ini
|
||||||
mapfile -t ini_file < <(sudo find "$ini_dir/.." -name "php.ini" -exec readlink -m {} +)
|
mapfile -t ini_file < <(sudo find "$ini_dir/.." -name "php.ini" -exec readlink -m {} +)
|
||||||
link_pecl_file
|
link_pecl_file
|
||||||
|
configure_php
|
||||||
sudo rm -rf /usr/local/bin/phpunit >/dev/null 2>&1
|
sudo rm -rf /usr/local/bin/phpunit >/dev/null 2>&1
|
||||||
sudo chmod 777 "${ini_file[@]}" "$pecl_file" "${tool_path_dir:?}"
|
sudo chmod 777 "${ini_file[@]}" "$pecl_file" "${tool_path_dir:?}"
|
||||||
sudo cp "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
|
sudo cp "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
|
||||||
[[ "$version" =~ ${jit_versions:?} ]] && echo -e "opcache.enable=1\nopcache.jit_buffer_size=256M\nopcache.jit=1235" | sudo tee -a "${ini_file[@]}" >/dev/null 2>&1
|
|
||||||
add_log "${tick:?}" "PHP" "$status PHP $semver"
|
add_log "${tick:?}" "PHP" "$status PHP $semver"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -419,7 +419,7 @@ if($installed.MajorMinorVersion -ne $version) {
|
|||||||
Add-Log $cross "PHP" "Could not setup PHP $version"
|
Add-Log $cross "PHP" "Could not setup PHP $version"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
('date.timezone=UTC', 'memory_limit=-1') | ForEach-Object { $p=$_.split('='); Set-PhpIniKey -Key $p[0] -Value $p[1] -Path $php_dir }
|
('date.timezone=UTC', 'memory_limit=-1', 'xdebug.mode=coverage') | ForEach-Object { $p=$_.split('='); Set-PhpIniKey -Key $p[0] -Value $p[1] -Path $php_dir }
|
||||||
if($version -lt "5.5") {
|
if($version -lt "5.5") {
|
||||||
('libeay32.dll', 'ssleay32.dll') | ForEach-Object { Invoke-WebRequest -Uri $bintray/$_ -OutFile $php_dir\$_ >$null 2>&1 }
|
('libeay32.dll', 'ssleay32.dll') | ForEach-Object { Invoke-WebRequest -Uri $bintray/$_ -OutFile $php_dir\$_ >$null 2>&1 }
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user