Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

pull in all changes from the sf-webapp #732

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ vendor/*
composer.lock
bin/dbunit
bin/phpunit
.idea
2 changes: 1 addition & 1 deletion library/Zend/Controller/Dispatcher/Standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function dispatch(Zend_Controller_Request_Abstract $request, Zend_Control
$controller = $request->getControllerName();
if (!$this->getParam('useDefaultControllerAlways') && !empty($controller)) {
require_once 'Zend/Controller/Dispatcher/Exception.php';
throw new Zend_Controller_Dispatcher_Exception('Invalid controller specified (' . $request->getControllerName() . ')');
throw new Zend_Controller_Dispatcher_Exception('Invalid controller specified.');
}

$className = $this->getDefaultControllerClass($request);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Form/Decorator/Description.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function getClass()
{
$class = $this->getOption('class');
if (null === $class) {
$class = 'hint';
$class = 'hint note';
$this->setOption('class', $class);
}

Expand Down
44 changes: 23 additions & 21 deletions library/Zend/Http/Client/Adapter/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,26 +221,6 @@ public function connect($host, $port = 80, $secure = false)
curl_setopt($this->_curl, CURLOPT_PORT, intval($port));
}

// Set connection timeout
$connectTimeout = $this->_config['timeout'];
$constant = CURLOPT_CONNECTTIMEOUT;
if (defined('CURLOPT_CONNECTTIMEOUT_MS')) {
$connectTimeout *= 1000;
$constant = constant('CURLOPT_CONNECTTIMEOUT_MS');
}
curl_setopt($this->_curl, $constant, $connectTimeout);

// Set request timeout (once connection is established)
if (array_key_exists('request_timeout', $this->_config)) {
$requestTimeout = $this->_config['request_timeout'];
$constant = CURLOPT_TIMEOUT;
if (defined('CURLOPT_TIMEOUT_MS')) {
$requestTimeout *= 1000;
$constant = constant('CURLOPT_TIMEOUT_MS');
}
curl_setopt($this->_curl, $constant, $requestTimeout);
}

// Set Max redirects
curl_setopt($this->_curl, CURLOPT_MAXREDIRS, $this->_config['maxredirects']);

Expand Down Expand Up @@ -421,7 +401,9 @@ public function write($method, $uri, $httpVersion = 1.1, $headers = array(), $bo
curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
} elseif ($method == Zend_Http_Client::DELETE) {
// This is a DELETE by a setRawData string
curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
if(!empty(trim($body))) {
curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
}
} elseif ($method == Zend_Http_Client::OPTIONS) {
// This is an OPTIONS by a setRawData string
curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $body);
Expand All @@ -439,6 +421,26 @@ public function write($method, $uri, $httpVersion = 1.1, $headers = array(), $bo
}
}

// Set connection timeout
$connectTimeout = $this->_config['timeout'];
$constant = CURLOPT_CONNECTTIMEOUT;
if (defined('CURLOPT_CONNECTTIMEOUT_MS')) {
$connectTimeout *= 1000;
$constant = constant('CURLOPT_CONNECTTIMEOUT_MS');
}
curl_setopt($this->_curl, $constant, $connectTimeout);

// Set request timeout (once connection is established)
if (array_key_exists('request_timeout', $this->_config)) {
$requestTimeout = $this->_config['request_timeout'];
$constant = CURLOPT_TIMEOUT;
if (defined('CURLOPT_TIMEOUT_MS')) {
$requestTimeout *= 1000;
$constant = constant('CURLOPT_TIMEOUT_MS');
}
curl_setopt($this->_curl, $constant, $requestTimeout);
}

// send the request
$response = curl_exec($this->_curl);

Expand Down
10 changes: 8 additions & 2 deletions library/Zend/Session/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ class Zend_Session_Exception extends Zend_Exception
*/
static public function handleSessionStartError($errno, $errstr, $errfile, $errline, $errcontext)
{
self::$sessionStartError = $errfile . '(Line:' . $errline . '): Error #' . $errno . ' ' . $errstr;
if (error_reporting() == 0) {
return;
}
self::$sessionStartError = $errfile . '(Line:' . $errline . '): Error #' . $errno . ' ' . $errstr . ' ' . json_encode($errcontext);
}

/**
Expand All @@ -68,7 +71,10 @@ static public function handleSessionStartError($errno, $errstr, $errfile, $errli
*/
static public function handleSilentWriteClose($errno, $errstr, $errfile, $errline, $errcontext)
{
self::$sessionStartError .= PHP_EOL . $errfile . '(Line:' . $errline . '): Error #' . $errno . ' ' . $errstr;
if (error_reporting() == 0) {
return;
}
self::$sessionStartError .= PHP_EOL . $errfile . '(Line:' . $errline . '): Error #' . $errno . ' ' . $errstr . ' ' . json_encode($errcontext);
}
}