Page MenuHomeIn-Portal Phabricator

D137.id350.diff
No OneTemporary

File Metadata

Created
Wed, Feb 26, 9:05 AM

D137.id350.diff

Index: branches/5.3.x/composer.json
===================================================================
--- branches/5.3.x/composer.json
+++ branches/5.3.x/composer.json
@@ -2,7 +2,8 @@
"name": "In-Portal",
"require": {
"symfony/console": "~2.6",
- "stecman/symfony-console-completion": "~0.5"
+ "stecman/symfony-console-completion": "~0.5",
+ "symfony/process": "^2.7"
},
"require-dev": {
"aik099/phpunit-mink": "~2.0",
Index: branches/5.3.x/composer.lock
===================================================================
--- branches/5.3.x/composer.lock
+++ branches/5.3.x/composer.lock
@@ -1,10 +1,10 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
- "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "36a7149b43200b7f6376b78988f5138f",
+ "hash": "e57cf4dcb89e749c1707598be9560ba2",
"packages": [
{
"name": "stecman/symfony-console-completion",
@@ -108,6 +108,55 @@
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2015-05-02 15:18:45"
+ },
+ {
+ "name": "symfony/process",
+ "version": "v2.7.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Process.git",
+ "reference": "f7b3f73f70a7f8f49a1c838dc3debbf054732d8e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Process/zipball/f7b3f73f70a7f8f49a1c838dc3debbf054732d8e",
+ "reference": "f7b3f73f70a7f8f49a1c838dc3debbf054732d8e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9"
+ },
+ "require-dev": {
+ "symfony/phpunit-bridge": "~2.7"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.7-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Process\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Process Component",
+ "homepage": "https://symfony.com",
+ "time": "2015-08-27 06:45:45"
}
],
"packages-dev": [
@@ -121,7 +170,7 @@
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aik099/CodingStandard/zipball/987a6781521c9293b3e36ff3877cdff63010b291",
+ "url": "https://api.github.com/repos/aik099/CodingStandard/zipball/b2d0a7b7e4b69f8a7024c462d511c5a09f46ccb6",
"reference": "987a6781521c9293b3e36ff3877cdff63010b291",
"shasum": ""
},
Index: branches/5.3.x/core/install/cache/class_structure.php
===================================================================
--- branches/5.3.x/core/install/cache/class_structure.php
+++ branches/5.3.x/core/install/cache/class_structure.php
@@ -141,6 +141,7 @@
'PhraseTagProcessor' => '/core/units/phrases/phrase_tp.php',
'PhrasesEventHandler' => '/core/units/phrases/phrases_event_handler.php',
'PriorityEventHandler' => '/core/units/priorites/priority_eh.php',
+ 'ProcessBuilder' => '/core/kernel/utility/ProcessBuilder.php',
'PromoBlockEventHandler' => '/core/units/promo_blocks/promo_block_eh.php',
'PromoBlockGroupEventHandler' => '/core/units/promo_block_groups/promo_block_group_eh.php',
'PromoBlockGroupTagProcessor' => '/core/units/promo_block_groups/promo_block_group_tp.php',
@@ -1226,6 +1227,13 @@
0 => 'kDBEventHandler',
),
),
+ 'ProcessBuilder' => array(
+ 'type' => 1,
+ 'modifiers' => 0,
+ 'extends' => array(
+ 0 => 'kBase',
+ ),
+ ),
'PromoBlockEventHandler' => array(
'type' => 1,
'modifiers' => 0,
Index: branches/5.3.x/core/install/prerequisites.php
===================================================================
--- branches/5.3.x/core/install/prerequisites.php
+++ branches/5.3.x/core/install/prerequisites.php
@@ -117,7 +117,7 @@
function CheckSystemRequirements()
{
$ret = Array ();
- $ret['php_version'] = version_compare(PHP_VERSION, '5.3.2', '>=');
+ $ret['php_version'] = version_compare(PHP_VERSION, '5.3.9', '>=');
if ( function_exists('apache_get_modules') ) {
$mod_rewrite = in_array('mod_rewrite', apache_get_modules());
Index: branches/5.3.x/core/install/step_templates/sys_requirements.tpl
===================================================================
--- branches/5.3.x/core/install/step_templates/sys_requirements.tpl
+++ branches/5.3.x/core/install/step_templates/sys_requirements.tpl
@@ -11,7 +11,7 @@
</tr>';
$check_titles = Array (
- 'php_version' => 'PHP version 5.3.2 or above<span class="error">*</span>',
+ 'php_version' => 'PHP version 5.3.9 or above<span class="error">*</span>',
'url_rewriting' => 'URL rewriting support',
'java' => 'Java template compression',
'composer' => 'Dependencies via Composer<span class="error">*</span>',
Index: branches/5.3.x/core/install/steps_db.xml
===================================================================
--- branches/5.3.x/core/install/steps_db.xml
+++ branches/5.3.x/core/install/steps_db.xml
@@ -222,7 +222,7 @@
<![CDATA[
<p>The <i>System Requirements Check</i> option should be used to ensure proper system behavior in the current environment.</p>
<p>
- <b>PHP version 5.3.2 or above<span class="error">*</span></b><br/>
+ <b>PHP version 5.3.9 or above<span class="error">*</span></b><br/>
Use this PHP version or better to ensure normal website operation on every day basis.
</p>
<p>
Index: branches/5.3.x/core/kernel/utility/ProcessBuilder.php
===================================================================
--- branches/5.3.x/core/kernel/utility/ProcessBuilder.php
+++ branches/5.3.x/core/kernel/utility/ProcessBuilder.php
@@ -0,0 +1,307 @@
+<?php
+/**
+* @version $Id$
+* @package In-Portal
+* @copyright Copyright (C) 1997 - 2015 Intechnic. All rights reserved.
+* @license GNU/GPL
+* In-Portal is Open Source software.
+* This means that this software may have been modified pursuant
+* the GNU General Public License, and as distributed it includes
+* or is derivative of works licensed under the GNU General Public License
+* or other free or open source software licenses.
+* See http://www.in-portal.org/license for copyright notices and details.
+*/
+
+use Symfony\Component\Process\Process;
+use Symfony\Component\Process\ProcessUtils;
+
+defined('FULL_PATH') or die('restricted access!');
+
+class ProcessBuilder extends kBase
+{
+
+ /**
+ * Command to run.
+ *
+ * @var string
+ */
+ protected $command;
+
+ /**
+ * Executable to run.
+ *
+ * @var string
+ */
+ protected $executable;
+
+ /**
+ * The "executable" arguments.
+ *
+ * @var array
+ */
+ protected $arguments;
+
+ /**
+ * The working directory.
+ *
+ * @var string|null
+ */
+ protected $workingDirectory;
+
+ /**
+ * The environment variables.
+ *
+ * @var array
+ */
+ protected $env;
+
+ /**
+ * The input.
+ *
+ * @var mixed
+ */
+ protected $input;
+
+ /**
+ * The timeout in seconds or null to disable.
+ *
+ * @var integer|null
+ */
+ protected $timeout;
+
+ /**
+ * An array of options for proc_open.
+ *
+ * @var array
+ */
+ protected $options = array();
+
+ /**
+ * Creates class instance.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+
+ $this->reset();
+ }
+
+ /**
+ * Set's prefix and special.
+ *
+ * @param string $prefix Prefix.
+ * @param string $special Special.
+ *
+ * @return void
+ * @throws Exception Every time, When called.
+ */
+ public function Init($prefix, $special)
+ {
+ $error_msg = sprintf(
+ 'Please use "%s" method instead of "%s" to create "%s" object.',
+ '<strong>makeClass</strong>',
+ '<strong>recallObject</strong>',
+ '<strong>' . __CLASS__ . '</strong>'
+ );
+
+ throw new Exception($error_msg);
+ }
+
+ /**
+ * Resets state to allow building another process.
+ *
+ * @return void
+ */
+ public function reset()
+ {
+ $this->command = '';
+ $this->executable = '';
+ $this->arguments = array();
+ $this->workingDirectory = null;
+ $this->env = array();
+ $this->input = null;
+ $this->timeout = 60;
+ $this->options = array();
+ }
+
+ /**
+ * Sets command.
+ *
+ * @param string $command Command.
+ *
+ * @return static
+ */
+ public function setCommand($command)
+ {
+ $this->command = $command;
+
+ return $this;
+ }
+
+ /**
+ * Sets executable.
+ *
+ * @param string $executable Executable.
+ *
+ * @return static
+ */
+ public function setExecutable($executable)
+ {
+ $this->executable = $executable;
+
+ return $this;
+ }
+
+ /**
+ * Adds an argument.
+ *
+ * @param mixed $argument Argument.
+ *
+ * @return static
+ */
+ public function add($argument)
+ {
+ $this->arguments[] = $argument;
+
+ return $this;
+ }
+
+ /**
+ * Sets the working directory.
+ *
+ * @param string|null $cwd The working directory or null to use the working dir of the current PHP process.
+ *
+ * @return static
+ */
+ public function setWorkingDirectory($cwd)
+ {
+ $this->workingDirectory = $cwd;
+
+ return $this;
+ }
+
+ /**
+ * Sets an environment variable.
+ * Setting a variable overrides its previous value. Use `null` to unset a
+ * defined environment variable.
+ *
+ * @param string $name The variable name.
+ * @param null|string $value The variable value.
+ *
+ * @return static
+ */
+ public function setEnv($name, $value)
+ {
+ $this->env[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Sets the input of the process.
+ *
+ * @param mixed $input The input as a string.
+ *
+ * @return static
+ */
+ public function setInput($input)
+ {
+ $this->input = ProcessUtils::validateInput(sprintf('%s::%s', __CLASS__, __FUNCTION__), $input);
+
+ return $this;
+ }
+
+ /**
+ * Adds a proc_open option.
+ *
+ * @param string $name The option name.
+ * @param string $value The option value.
+ *
+ * @return static
+ */
+ public function setOption($name, $value)
+ {
+ $this->options[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Sets the process timeout.
+ *
+ * @param float|null $timeout Timeout or null to disable.
+ *
+ * @return static
+ * @throws InvalidArgumentException When negative timeout is given.
+ */
+ public function setTimeout($timeout)
+ {
+ if ( $timeout === null ) {
+ $this->timeout = null;
+
+ return $this;
+ }
+
+ $timeout = (float)$timeout;
+
+ if ( $timeout < 0 ) {
+ throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.');
+ }
+
+ $this->timeout = $timeout;
+
+ return $this;
+ }
+
+ /**
+ * Creates process.
+ *
+ * @return Process
+ * @throws LogicException When incompatible builder parameters are set.
+ */
+ public function build()
+ {
+ if ( isset($this->executable) && isset($this->command) ) {
+ throw new LogicException('Use setCommand() or setExecutable(), not both.');
+ }
+
+ if ( isset($this->command) && $this->arguments ) {
+ throw new LogicException('The add() can only be used with setExecutable().');
+ }
+
+ return new Process(
+ $this->getCommandLine(),
+ $this->workingDirectory,
+ array_replace($_ENV, $_SERVER, $this->env),
+ $this->input,
+ $this->timeout,
+ $this->options
+ );
+ }
+
+ /**
+ * Builds commandline.
+ *
+ * @return string
+ * @throws LogicException When none of "command" or "executable" isn't set.
+ */
+ protected function getCommandLine()
+ {
+ if ( isset($this->command) ) {
+ return $this->command;
+ }
+
+ if ( isset($this->executable) ) {
+ $arguments = array_merge(array($this->executable), $this->arguments);
+ $escaped_arguments = array_map(
+ array('Symfony\\Component\\Process\\ProcessUtils', 'escapeArgument'),
+ $arguments
+ );
+
+ return implode(' ', $escaped_arguments);
+ }
+
+ throw new LogicException('You must use setCommand() or setExecutable() before getting the process.');
+ }
+
+}

Event Timeline