for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of tenside/core.
*
* (c) Christian Schiffler <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* This project is provided in good faith and hope to be usable by anyone.
* @package tenside/core
* @author Christian Schiffler <[email protected]>
* @copyright 2015 Christian Schiffler <[email protected]>
* @license https://github.com/tenside/core/blob/master/LICENSE MIT
* @link https://github.com/tenside/core
* @filesource
*/
namespace Tenside\Core\SelfTest\Cli;
use Tenside\Core\SelfTest\AbstractSelfTest;
use Tenside\Core\Util\FunctionAvailabilityCheck;
* This class tests that proc_open is available.
class SelfTestCanSpawnProcesses extends AbstractSelfTest
{
* Check that we have a correct CLI executable of PHP.
* @return void
public function doTest()
$this->setMessage('Check if PHP may spawn processes.');
if (!FunctionAvailabilityCheck::isFunctionDefined('proc_open')) {
$this->markFailed(
'The process execution relies on proc_open, which is not available on your PHP installation.'
);
return;
}
if (FunctionAvailabilityCheck::isFunctionBlacklistedInSuhosin('proc_open')) {
'The process execution relies on proc_open, which is disabled in Suhosin on your PHP installation. ' .
'Please remove "proc_open" from "suhosin.executor.func.blacklist" in php.ini'
if (FunctionAvailabilityCheck::isFunctionBlacklistedInPhpIni('proc_open')) {
'The process execution relies on proc_open, which is disabled in your PHP installation. ' .
'Please remove "proc_open" from "disabled_functions" in php.ini'
$this->markSuccess();