Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use camelCase

  • Loading branch information...
commit c3f4f17a2dd0516ddd6785c798bd13619a90fcdb 1 parent 5b80e06
@neeckeloo neeckeloo authored
Showing with 373 additions and 376 deletions.
  1. +27 −27 library/Zend/Captcha/Image.php
  2. +1 −1  library/Zend/Console/Getopt.php
  3. +3 −3 library/Zend/Feed/Reader/Entry/Rss.php
  4. +3 −3 library/Zend/Feed/Reader/Feed/Rss.php
  5. +8 −8 library/Zend/Feed/Reader/Reader.php
  6. +7 −7 library/Zend/Form/Annotation/AllowEmpty.php
  7. +2 −2 library/Zend/Http/Client/Adapter/AdapterInterface.php
  8. +10 −10 library/Zend/Http/Client/Adapter/Proxy.php
  9. +40 −40 library/Zend/Http/Client/Adapter/Socket.php
  10. +3 −3 library/Zend/Http/Client/Adapter/Test.php
  11. +37 −37 library/Zend/Http/Client/Cookies.php
  12. +38 −38 library/Zend/Http/Cookies.php
  13. +21 −24 library/Zend/Json/Decoder.php
  14. +14 −14 library/Zend/Json/Encoder.php
  15. +4 −4 library/Zend/Ldap/Collection/DefaultIterator.php
  16. +4 −4 library/Zend/Ldap/Ldif/Encoder.php
  17. +2 −2 library/Zend/Loader/ModuleAutoloader.php
  18. +4 −4 library/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php
  19. +6 −6 library/Zend/Mail/Storage/Maildir.php
  20. +62 −62 library/Zend/Mail/Storage/Writable/Maildir.php
  21. +33 −33 library/Zend/Soap/Client.php
  22. +4 −4 library/Zend/Soap/Client/Common.php
  23. +2 −2 library/Zend/Soap/Client/Local.php
  24. +34 −34 library/Zend/Soap/Wsdl.php
  25. +2 −2 library/Zend/Validator/Hostname.php
  26. +2 −2 library/Zend/View/Helper/HeadStyle.php
View
54 library/Zend/Captcha/Image.php
@@ -490,7 +490,7 @@ protected function generateImage($id, $word)
$h = $this->getHeight();
$fsize = $this->getFontSize();
- $img_file = $this->getImgDir() . $id . $this->getSuffix();
+ $imgFile = $this->getImgDir() . $id . $this->getSuffix();
if (empty($this->startImage)) {
$img = imagecreatetruecolor($w, $h);
@@ -508,26 +508,26 @@ protected function generateImage($id, $word)
$h = imagesy($img);
}
- $text_color = imagecolorallocate($img, 0, 0, 0);
- $bg_color = imagecolorallocate($img, 255, 255, 255);
- imagefilledrectangle($img, 0, 0, $w-1, $h-1, $bg_color);
+ $textColor = imagecolorallocate($img, 0, 0, 0);
+ $bgColor = imagecolorallocate($img, 255, 255, 255);
+ imagefilledrectangle($img, 0, 0, $w-1, $h-1, $bgColor);
$textbox = imageftbbox($fsize, 0, $font, $word);
$x = ($w - ($textbox[2] - $textbox[0])) / 2;
$y = ($h - ($textbox[7] - $textbox[1])) / 2;
- imagefttext($img, $fsize, 0, $x, $y, $text_color, $font, $word);
+ imagefttext($img, $fsize, 0, $x, $y, $textColor, $font, $word);
// generate noise
for ($i=0; $i < $this->dotNoiseLevel; $i++) {
- imagefilledellipse($img, mt_rand(0, $w), mt_rand(0, $h), 2, 2, $text_color);
+ imagefilledellipse($img, mt_rand(0, $w), mt_rand(0, $h), 2, 2, $textColor);
}
for ($i=0; $i < $this->lineNoiseLevel; $i++) {
- imageline($img, mt_rand(0, $w), mt_rand(0, $h), mt_rand(0, $w), mt_rand(0, $h), $text_color);
+ imageline($img, mt_rand(0, $w), mt_rand(0, $h), mt_rand(0, $w), mt_rand(0, $h), $textColor);
}
// transformed image
$img2 = imagecreatetruecolor($w, $h);
- $bg_color = imagecolorallocate($img2, 255, 255, 255);
- imagefilledrectangle($img2, 0, 0, $w-1, $h-1, $bg_color);
+ $bgColor = imagecolorallocate($img2, 255, 255, 255);
+ imagefilledrectangle($img2, 0, 0, $w-1, $h-1, $bgColor);
// apply wave transforms
$freq1 = $this->randomFreq();
@@ -551,29 +551,29 @@ protected function generateImage($id, $word)
if ($sx < 0 || $sy < 0 || $sx >= $w - 1 || $sy >= $h - 1) {
continue;
} else {
- $color = (imagecolorat($img, $sx, $sy) >> 16) & 0xFF;
- $color_x = (imagecolorat($img, $sx + 1, $sy) >> 16) & 0xFF;
- $color_y = (imagecolorat($img, $sx, $sy + 1) >> 16) & 0xFF;
- $color_xy = (imagecolorat($img, $sx + 1, $sy + 1) >> 16) & 0xFF;
+ $color = (imagecolorat($img, $sx, $sy) >> 16) & 0xFF;
+ $colorX = (imagecolorat($img, $sx + 1, $sy) >> 16) & 0xFF;
+ $colorY = (imagecolorat($img, $sx, $sy + 1) >> 16) & 0xFF;
+ $colorXY = (imagecolorat($img, $sx + 1, $sy + 1) >> 16) & 0xFF;
}
- if ($color == 255 && $color_x == 255 && $color_y == 255 && $color_xy == 255) {
+ if ($color == 255 && $colorX == 255 && $colorY == 255 && $colorXY == 255) {
// ignore background
continue;
- } elseif ($color == 0 && $color_x == 0 && $color_y == 0 && $color_xy == 0) {
+ } elseif ($color == 0 && $colorX == 0 && $colorY == 0 && $colorXY == 0) {
// transfer inside of the image as-is
$newcolor = 0;
} else {
// do antialiasing for border items
- $frac_x = $sx-floor($sx);
- $frac_y = $sy-floor($sy);
- $frac_x1 = 1-$frac_x;
- $frac_y1 = 1-$frac_y;
-
- $newcolor = $color * $frac_x1 * $frac_y1
- + $color_x * $frac_x * $frac_y1
- + $color_y * $frac_x1 * $frac_y
- + $color_xy * $frac_x * $frac_y;
+ $fracX = $sx - floor($sx);
+ $fracY = $sy - floor($sy);
+ $fracX1 = 1 - $fracX;
+ $fracY1 = 1 - $fracY;
+
+ $newcolor = $color * $fracX1 * $fracY1
+ + $colorX * $fracX * $fracY1
+ + $colorY * $fracX1 * $fracY
+ + $colorXY * $fracX * $fracY;
}
imagesetpixel($img2, $x, $y, imagecolorallocate($img2, $newcolor, $newcolor, $newcolor));
@@ -582,14 +582,14 @@ protected function generateImage($id, $word)
// generate noise
for ($i=0; $i<$this->dotNoiseLevel; $i++) {
- imagefilledellipse($img2, mt_rand(0, $w), mt_rand(0, $h), 2, 2, $text_color);
+ imagefilledellipse($img2, mt_rand(0, $w), mt_rand(0, $h), 2, 2, $textColor);
}
for ($i=0; $i<$this->lineNoiseLevel; $i++) {
- imageline($img2, mt_rand(0, $w), mt_rand(0, $h), mt_rand(0, $w), mt_rand(0, $h), $text_color);
+ imageline($img2, mt_rand(0, $w), mt_rand(0, $h), mt_rand(0, $w), mt_rand(0, $h), $textColor);
}
- imagepng($img2, $img_file);
+ imagepng($img2, $imgFile);
imagedestroy($img);
imagedestroy($img2);
}
View
2  library/Zend/Console/Getopt.php
@@ -637,7 +637,7 @@ public function setAliases($aliasMap)
/**
* Define help messages for options.
*
- * The parameter $help_map is an associative array
+ * The parameter $helpMap is an associative array
* mapping option name (short or long) to the help string.
*
* @param array $helpMap
View
6 library/Zend/Feed/Reader/Entry/Rss.php
@@ -97,9 +97,9 @@ public function getAuthors()
}
$authors = array();
- $authors_dc = $this->getExtension('DublinCore')->getAuthors();
- if (!empty($authors_dc)) {
- foreach ($authors_dc as $author) {
+ $authorsDc = $this->getExtension('DublinCore')->getAuthors();
+ if (!empty($authorsDc)) {
+ foreach ($authorsDc as $author) {
$authors[] = array(
'name' => $author['name']
);
View
6 library/Zend/Feed/Reader/Feed/Rss.php
@@ -88,9 +88,9 @@ public function getAuthors()
}
$authors = array();
- $authors_dc = $this->getExtension('DublinCore')->getAuthors();
- if (!empty($authors_dc)) {
- foreach ($authors_dc as $author) {
+ $authorsDc = $this->getExtension('DublinCore')->getAuthors();
+ if (!empty($authorsDc)) {
+ foreach ($authorsDc as $author) {
$authors[] = array(
'name' => $author['name']
);
View
16 library/Zend/Feed/Reader/Reader.php
@@ -269,7 +269,7 @@ public static function import($uri, $etag = null, $lastModified = null)
*/
public static function importString($string)
{
- $libxml_errflag = libxml_use_internal_errors(true);
+ $libxmlErrflag = libxml_use_internal_errors(true);
$oldValue = libxml_disable_entity_loader(true);
$dom = new DOMDocument;
$status = $dom->loadXML(trim($string));
@@ -281,7 +281,7 @@ public static function importString($string)
}
}
libxml_disable_entity_loader($oldValue);
- libxml_use_internal_errors($libxml_errflag);
+ libxml_use_internal_errors($libxmlErrflag);
if (!$status) {
// Build error message
@@ -346,12 +346,12 @@ public static function findFeedLinks($uri)
throw new Exception\RuntimeException("Failed to access $uri, got response code " . $response->getStatusCode());
}
$responseHtml = $response->getBody();
- $libxml_errflag = libxml_use_internal_errors(true);
+ $libxmlErrflag = libxml_use_internal_errors(true);
$oldValue = libxml_disable_entity_loader(true);
$dom = new DOMDocument;
$status = $dom->loadHTML(trim($responseHtml));
libxml_disable_entity_loader($oldValue);
- libxml_use_internal_errors($libxml_errflag);
+ libxml_use_internal_errors($libxmlErrflag);
if (!$status) {
// Build error message
$error = libxml_get_last_error();
@@ -401,14 +401,14 @@ public static function detectType($feed, $specOnly = false)
ini_restore('track_errors');
ErrorHandler::stop();
if (!$status) {
- if (!isset($php_errormsg)) {
+ if (!isset($phpErrormsg)) {
if (function_exists('xdebug_is_enabled')) {
- $php_errormsg = '(error message not available, when XDebug is running)';
+ $phpErrormsg = '(error message not available, when XDebug is running)';
} else {
- $php_errormsg = '(error message not available)';
+ $phpErrormsg = '(error message not available)';
}
}
- throw new Exception\RuntimeException("DOMDocument cannot parse XML: $php_errormsg");
+ throw new Exception\RuntimeException("DOMDocument cannot parse XML: $phpErrormsg");
}
} else {
throw new Exception\InvalidArgumentException('Invalid object/scalar provided: must'
View
14 library/Zend/Form/Annotation/AllowEmpty.php
@@ -16,7 +16,7 @@
* AllowEmpty annotation
*
* Presence of this annotation is a hint that the associated
- * \Zend\InputFilter\Input should enable the allow_empty flag.
+ * \Zend\InputFilter\Input should enable the allowEmpty flag.
*
* @Annotation
* @package Zend_Form
@@ -27,7 +27,7 @@ class AllowEmpty
/**
* @var bool
*/
- protected $allow_empty = true;
+ protected $allowEmpty = true;
/**
* Receive and process the contents of an annotation
@@ -40,14 +40,14 @@ public function __construct(array $data)
$data['value'] = false;
}
- $allow_empty = $data['value'];
+ $allowEmpty = $data['value'];
- if (!is_bool($allow_empty)) {
+ if (!is_bool($allowEmpty)) {
$filter = new BooleanFilter();
- $allow_empty = $filter->filter($allow_empty);
+ $allowEmpty = $filter->filter($allowEmpty);
}
- $this->allow_empty = $allow_empty;
+ $this->allowEmpty = $allowEmpty;
}
/**
@@ -57,6 +57,6 @@ public function __construct(array $data)
*/
public function getAllowEmpty()
{
- return $this->allow_empty;
+ return $this->allowEmpty;
}
}
View
4 library/Zend/Http/Client/Adapter/AdapterInterface.php
@@ -43,12 +43,12 @@ public function connect($host, $port = 80, $secure = false);
*
* @param string $method
* @param \Zend\Uri\Uri $url
- * @param string $http_ver
+ * @param string $httpVer
* @param array $headers
* @param string $body
* @return string Request as text
*/
- public function write($method, $url, $http_ver = '1.1', $headers = array(), $body = '');
+ public function write($method, $url, $httpVer = '1.1', $headers = array(), $body = '');
/**
* Read response from server
View
20 library/Zend/Http/Client/Adapter/Proxy.php
@@ -113,16 +113,16 @@ public function connect($host, $port = 80, $secure = false)
*
* @param string $method
* @param \Zend\Uri\Uri $uri
- * @param string $http_ver
+ * @param string $httpVer
* @param array $headers
* @param string $body
* @throws AdapterException\RuntimeException
* @return string Request as string
*/
- public function write($method, $uri, $http_ver = '1.1', $headers = array(), $body = '')
+ public function write($method, $uri, $httpVer = '1.1', $headers = array(), $body = '')
{
// If no proxy is set, fall back to default Socket adapter
- if (! $this->config['proxy_host']) return parent::write($method, $uri, $http_ver, $headers, $body);
+ if (! $this->config['proxy_host']) return parent::write($method, $uri, $httpVer, $headers, $body);
// Make sure we're properly connected
if (! $this->socket) {
@@ -132,7 +132,7 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
$host = $this->config['proxy_host'];
$port = $this->config['proxy_port'];
- if ($this->connected_to[0] != "tcp://$host" || $this->connected_to[1] != $port) {
+ if ($this->connectedTo[0] != "tcp://$host" || $this->connectedTo[1] != $port) {
throw new AdapterException\RuntimeException("Trying to write but we are connected to the wrong proxy server");
}
@@ -145,7 +145,7 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
// if we are proxying HTTPS, preform CONNECT handshake with the proxy
if ($uri->getScheme() == 'https' && (! $this->negotiated)) {
- $this->connectHandshake($uri->getHost(), $uri->getPort(), $http_ver, $headers);
+ $this->connectHandshake($uri->getHost(), $uri->getPort(), $httpVer, $headers);
$this->negotiated = true;
}
@@ -158,9 +158,9 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
if ($uri->getQuery()) {
$path .= '?' . $uri->getQuery();
}
- $request = "$method $path HTTP/$http_ver\r\n";
+ $request = "$method $path HTTP/$httpVer\r\n";
} else {
- $request = "$method $uri HTTP/$http_ver\r\n";
+ $request = "$method $uri HTTP/$httpVer\r\n";
}
// Add all headers to the request string
@@ -198,13 +198,13 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
*
* @param string $host
* @param integer $port
- * @param string $http_ver
+ * @param string $httpVer
* @param array $headers
* @throws AdapterException\RuntimeException
*/
- protected function connectHandshake($host, $port = 443, $http_ver = '1.1', array &$headers = array())
+ protected function connectHandshake($host, $port = 443, $httpVer = '1.1', array &$headers = array())
{
- $request = "CONNECT $host:$port HTTP/$http_ver\r\n" .
+ $request = "CONNECT $host:$port HTTP/$httpVer\r\n" .
"Host: " . $this->config['proxy_host'] . "\r\n";
// Add the user-agent header
View
80 library/Zend/Http/Client/Adapter/Socket.php
@@ -51,14 +51,14 @@ class Socket implements HttpAdapter, StreamInterface
*
* @var array
*/
- protected $connected_to = array(null, null);
+ protected $connectedTo = array(null, null);
/**
* Stream for storing output
*
* @var resource
*/
- protected $out_stream = null;
+ protected $outStream = null;
/**
* Parameters array
@@ -189,11 +189,11 @@ public function getStreamContext()
public function connect($host, $port = 80, $secure = false)
{
// If we are connected to the wrong host, disconnect first
- $connected_host = (strpos($this->connected_to[0], '://'))
- ? substr($this->connected_to[0], (strpos($this->connected_to[0], '://') + 3), strlen($this->connected_to[0]))
- : $this->connected_to[0];
+ $connectedHost = (strpos($this->connectedTo[0], '://'))
+ ? substr($this->connectedTo[0], (strpos($this->connectedTo[0], '://') + 3), strlen($this->connectedTo[0]))
+ : $this->connectedTo[0];
- if ($connected_host != $host || $this->connected_to[1] != $port) {
+ if ($connectedHost != $host || $this->connectedTo[1] != $port) {
if (is_resource($this->socket)) {
$this->close();
}
@@ -311,8 +311,8 @@ public function connect($host, $port = 80, $secure = false)
$host = 'tcp://' . $host;
}
- // Update connected_to
- $this->connected_to = array($host, $port);
+ // Update connectedTo
+ $this->connectedTo = array($host, $port);
}
}
@@ -322,13 +322,13 @@ public function connect($host, $port = 80, $secure = false)
*
* @param string $method
* @param \Zend\Uri\Uri $uri
- * @param string $http_ver
+ * @param string $httpVer
* @param array $headers
* @param string $body
* @throws AdapterException\RuntimeException
* @return string Request as string
*/
- public function write($method, $uri, $http_ver = '1.1', $headers = array(), $body = '')
+ public function write($method, $uri, $httpVer = '1.1', $headers = array(), $body = '')
{
// Make sure we're properly connected
if (! $this->socket) {
@@ -337,7 +337,7 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
$host = $uri->getHost();
$host = (strtolower($uri->getScheme()) == 'https' ? $this->config['ssltransport'] : 'tcp') . '://' . $host;
- if ($this->connected_to[0] != $host || $this->connected_to[1] != $uri->getPort()) {
+ if ($this->connectedTo[0] != $host || $this->connectedTo[1] != $uri->getPort()) {
throw new AdapterException\RuntimeException('Trying to write but we are connected to the wrong host');
}
@@ -347,7 +347,7 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
// Build request headers
$path = $uri->getPath();
if ($uri->getQuery()) $path .= '?' . $uri->getQuery();
- $request = "{$method} {$path} HTTP/{$http_ver}\r\n";
+ $request = "{$method} {$path} HTTP/{$httpVer}\r\n";
foreach ($headers as $k => $v) {
if (is_string($k)) $v = ucfirst($k) . ": $v";
$request .= "$v\r\n";
@@ -425,11 +425,11 @@ public function read()
}
// If we got a 'transfer-encoding: chunked' header
- $transfer_encoding = $headers->get('transfer-encoding');
- $content_length = $headers->get('content-length');
- if ($transfer_encoding !== false) {
+ $transferEncoding = $headers->get('transfer-encoding');
+ $contentLength = $headers->get('content-length');
+ if ($transferEncoding !== false) {
- if (strtolower($transfer_encoding->getFieldValue()) == 'chunked') {
+ if (strtolower($transferEncoding->getFieldValue()) == 'chunked') {
do {
$line = fgets($this->socket);
@@ -449,19 +449,19 @@ public function read()
$chunksize = hexdec($chunksize);
// Read next chunk
- $read_to = ftell($this->socket) + $chunksize;
+ $readTo = ftell($this->socket) + $chunksize;
do {
- $current_pos = ftell($this->socket);
- if ($current_pos >= $read_to) break;
+ $currentPos = ftell($this->socket);
+ if ($currentPos >= $readTo) break;
- if ($this->out_stream) {
- if (stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {
+ if ($this->outStream) {
+ if (stream_copy_to_stream($this->socket, $this->outStream, $readTo - $currentPos) == 0) {
$this->_checkSocketReadTimeout();
break;
}
} else {
- $line = fread($this->socket, $read_to - $current_pos);
+ $line = fread($this->socket, $readTo - $currentPos);
if ($line === false || strlen($line) === 0) {
$this->_checkSocketReadTimeout();
break;
@@ -475,45 +475,45 @@ public function read()
ErrorHandler::stop();
$this->_checkSocketReadTimeout();
- if (!$this->out_stream) {
+ if (!$this->outStream) {
$response .= $chunk;
}
} while ($chunksize > 0);
} else {
$this->close();
throw new AdapterException\RuntimeException('Cannot handle "' .
- $transfer_encoding->getFieldValue() . '" transfer encoding');
+ $transferEncoding->getFieldValue() . '" transfer encoding');
}
// We automatically decode chunked-messages when writing to a stream
// this means we have to disallow the Zend_Http_Response to do it again
- if ($this->out_stream) {
+ if ($this->outStream) {
$response = str_ireplace("Transfer-Encoding: chunked\r\n", '', $response);
}
// Else, if we got the content-length header, read this number of bytes
- } elseif ($content_length !== false) {
+ } elseif ($contentLength !== false) {
// If we got more than one Content-Length header (see ZF-9404) use
// the last value sent
- if (is_array($content_length)) {
- $content_length = $content_length[count($content_length) - 1];
+ if (is_array($contentLength)) {
+ $contentLength = $contentLength[count($contentLength) - 1];
}
- $contentLength = $content_length->getFieldValue();
+ $contentLength = $contentLength->getFieldValue();
- $current_pos = ftell($this->socket);
+ $currentPos = ftell($this->socket);
$chunk = '';
- for ($read_to = $current_pos + $contentLength;
- $read_to > $current_pos;
- $current_pos = ftell($this->socket)) {
+ for ($readTo = $currentPos + $contentLength;
+ $readTo > $currentPos;
+ $currentPos = ftell($this->socket)) {
- if ($this->out_stream) {
- if (stream_copy_to_stream($this->socket, $this->out_stream, $read_to - $current_pos) == 0) {
+ if ($this->outStream) {
+ if (stream_copy_to_stream($this->socket, $this->outStream, $readTo - $currentPos) == 0) {
$this->_checkSocketReadTimeout();
break;
}
} else {
- $chunk = fread($this->socket, $read_to - $current_pos);
+ $chunk = fread($this->socket, $readTo - $currentPos);
if ($chunk === false || strlen($chunk) === 0) {
$this->_checkSocketReadTimeout();
break;
@@ -530,8 +530,8 @@ public function read()
} else {
do {
- if ($this->out_stream) {
- if (stream_copy_to_stream($this->socket, $this->out_stream) == 0) {
+ if ($this->outStream) {
+ if (stream_copy_to_stream($this->socket, $this->outStream) == 0) {
$this->_checkSocketReadTimeout();
break;
}
@@ -571,7 +571,7 @@ public function close()
ErrorHandler::stop();
}
$this->socket = null;
- $this->connected_to = array(null, null);
+ $this->connectedTo = array(null, null);
}
/**
@@ -603,7 +603,7 @@ protected function _checkSocketReadTimeout()
*/
public function setOutputStream($stream)
{
- $this->out_stream = $stream;
+ $this->outStream = $stream;
return $this;
}
View
6 library/Zend/Http/Client/Adapter/Test.php
@@ -122,12 +122,12 @@ public function connect($host, $port = 80, $secure = false)
*
* @param string $method
* @param \Zend\Uri\Uri $uri
- * @param string $http_ver
+ * @param string $httpVer
* @param array $headers
* @param string $body
* @return string Request as string
*/
- public function write($method, $uri, $http_ver = '1.1', $headers = array(), $body = '')
+ public function write($method, $uri, $httpVer = '1.1', $headers = array(), $body = '')
{
$host = $uri->getHost();
$host = (strtolower($uri->getScheme()) == 'https' ? 'sslv2://' . $host : $host);
@@ -138,7 +138,7 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
$path = '/';
}
if ($uri->getQuery()) $path .= '?' . $uri->getQuery();
- $request = "{$method} {$path} HTTP/{$http_ver}\r\n";
+ $request = "{$method} {$path} HTTP/{$httpVer}\r\n";
foreach ($headers as $k => $v) {
if (is_string($k)) $v = ucfirst($k) . ": $v";
$request .= "$v\r\n";
View
74 library/Zend/Http/Client/Cookies.php
@@ -94,13 +94,13 @@ public function __construct()
* or as a string - in which case an object is created from the string.
*
* @param Cookie|string $cookie
- * @param Uri\Uri|string $ref_uri Optional reference URI (for domain, path, secure)
+ * @param Uri\Uri|string $refUri Optional reference URI (for domain, path, secure)
* @throws Exception\InvalidArgumentException if invalid $cookie value
*/
- public function addCookie($cookie, $ref_uri = null)
+ public function addCookie($cookie, $refUri = null)
{
if (is_string($cookie)) {
- $cookie = Cookie::fromString($cookie, $ref_uri);
+ $cookie = Cookie::fromString($cookie, $refUri);
}
if ($cookie instanceof Cookie) {
@@ -123,30 +123,30 @@ public function addCookie($cookie, $ref_uri = null)
* Parse an HTTP response, adding all the cookies set in that response
*
* @param Response $response
- * @param Uri\Uri|string $ref_uri Requested URI
+ * @param Uri\Uri|string $refUri Requested URI
*/
- public function addCookiesFromResponse(Response $response, $ref_uri)
+ public function addCookiesFromResponse(Response $response, $refUri)
{
- $cookie_hdrs = $response->getHeaders()->get('Set-Cookie');
+ $cookieHdrs = $response->getHeaders()->get('Set-Cookie');
- if (is_array($cookie_hdrs)) {
- foreach ($cookie_hdrs as $cookie) {
- $this->addCookie($cookie, $ref_uri);
+ if (is_array($cookieHdrs)) {
+ foreach ($cookieHdrs as $cookie) {
+ $this->addCookie($cookie, $refUri);
}
- } elseif (is_string($cookie_hdrs)) {
- $this->addCookie($cookie_hdrs, $ref_uri);
+ } elseif (is_string($cookieHdrs)) {
+ $this->addCookie($cookieHdrs, $refUri);
}
}
/**
* Get all cookies in the cookie jar as an array
*
- * @param int $ret_as Whether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
+ * @param int $retAs Whether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
* @return array|string
*/
- public function getAllCookies($ret_as = self::COOKIE_OBJECT)
+ public function getAllCookies($retAs = self::COOKIE_OBJECT)
{
- $cookies = $this->_flattenCookiesArray($this->cookies, $ret_as);
+ $cookies = $this->_flattenCookiesArray($this->cookies, $retAs);
return $cookies;
}
@@ -157,13 +157,13 @@ public function getAllCookies($ret_as = self::COOKIE_OBJECT)
*
* @param string|Uri\Uri $uri URI to check against (secure, domain, path)
* @param boolean $matchSessionCookies Whether to send session cookies
- * @param int $ret_as Whether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
+ * @param int $retAs Whether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
* @param int $now Override the current time when checking for expiry time
* @throws Exception\InvalidArgumentException if invalid URI
* @return array|string
*/
public function getMatchingCookies($uri, $matchSessionCookies = true,
- $ret_as = self::COOKIE_OBJECT, $now = null)
+ $retAs = self::COOKIE_OBJECT, $now = null)
{
if (is_string($uri)) {
$uri = Uri\UriFactory::factory($uri, 'http');
@@ -188,7 +188,7 @@ public function getMatchingCookies($uri, $matchSessionCookies = true,
$ret[] = $cookie;
// Now, use self::_flattenCookiesArray again - only to convert to the return format ;)
- $ret = $this->_flattenCookiesArray($ret, $ret_as);
+ $ret = $this->_flattenCookiesArray($ret, $retAs);
return $ret;
}
@@ -197,12 +197,12 @@ public function getMatchingCookies($uri, $matchSessionCookies = true,
* Get a specific cookie according to a URI and name
*
* @param Uri\Uri|string $uri The uri (domain and path) to match
- * @param string $cookie_name The cookie's name
- * @param int $ret_as Whether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
- * @throws Exception\InvalidArgumentException if invalid URI specified or invalid $ret_as value
+ * @param string $cookieName The cookie's name
+ * @param int $retAs Whether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
+ * @throws Exception\InvalidArgumentException if invalid URI specified or invalid $retAs value
* @return Cookie|string
*/
- public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT)
+ public function getCookie($uri, $cookieName, $retAs = self::COOKIE_OBJECT)
{
if (is_string($uri)) {
$uri = Uri\UriFactory::factory($uri, 'http');
@@ -220,10 +220,10 @@ public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT)
$path = substr($path, 0, strrpos($path, '/'));
if (! $path) $path = '/';
- if (isset($this->cookies[$uri->getHost()][$path][$cookie_name])) {
- $cookie = $this->cookies[$uri->getHost()][$path][$cookie_name];
+ if (isset($this->cookies[$uri->getHost()][$path][$cookieName])) {
+ $cookie = $this->cookies[$uri->getHost()][$path][$cookieName];
- switch ($ret_as) {
+ switch ($retAs) {
case self::COOKIE_OBJECT:
return $cookie;
break;
@@ -234,7 +234,7 @@ public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT)
break;
default:
- throw new Exception\InvalidArgumentException("Invalid value passed for \$ret_as: {$ret_as}");
+ throw new Exception\InvalidArgumentException("Invalid value passed for \$retAs: {$retAs}");
break;
}
}
@@ -247,23 +247,23 @@ public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT)
* cookies array (or parts of it)
*
* @param \Zend\Http\Header\Cookie|array $ptr
- * @param int $ret_as What value to return
+ * @param int $retAs What value to return
* @return array|string
*/
- protected function _flattenCookiesArray($ptr, $ret_as = self::COOKIE_OBJECT)
+ protected function _flattenCookiesArray($ptr, $retAs = self::COOKIE_OBJECT)
{
if (is_array($ptr)) {
- $ret = ($ret_as == self::COOKIE_STRING_CONCAT ? '' : array());
+ $ret = ($retAs == self::COOKIE_STRING_CONCAT ? '' : array());
foreach ($ptr as $item) {
- if ($ret_as == self::COOKIE_STRING_CONCAT) {
- $ret .= $this->_flattenCookiesArray($item, $ret_as);
+ if ($retAs == self::COOKIE_STRING_CONCAT) {
+ $ret .= $this->_flattenCookiesArray($item, $retAs);
} else {
- $ret = array_merge($ret, $this->_flattenCookiesArray($item, $ret_as));
+ $ret = array_merge($ret, $this->_flattenCookiesArray($item, $retAs));
}
}
return $ret;
} elseif ($ptr instanceof Cookie) {
- switch ($ret_as) {
+ switch ($retAs) {
case self::COOKIE_STRING_ARRAY:
return array($ptr->__toString());
break;
@@ -312,14 +312,14 @@ protected function _matchPath($domains, $path)
{
$ret = array();
- foreach ($domains as $dom => $paths_array) {
- foreach (array_keys($paths_array) as $cpath) {
+ foreach ($domains as $dom => $pathsArray) {
+ foreach (array_keys($pathsArray) as $cpath) {
if (Cookie::matchCookiePath($cpath, $path)) {
if (! isset($ret[$dom])) {
$ret[$dom] = array();
}
- $ret[$dom][$cpath] = $paths_array[$cpath];
+ $ret[$dom][$cpath] = $pathsArray[$cpath];
}
}
}
@@ -338,10 +338,10 @@ protected function _matchPath($domains, $path)
* @return Cookies
* @todo Add the $uri functionality.
*/
- public static function fromResponse(Response $response, $ref_uri)
+ public static function fromResponse(Response $response, $refUri)
{
$jar = new self();
- $jar->addCookiesFromResponse($response, $ref_uri);
+ $jar->addCookiesFromResponse($response, $refUri);
return $jar;
}
View
76 library/Zend/Http/Cookies.php
@@ -71,13 +71,13 @@ public function __construct(Headers $headers)
* or as a string - in which case an object is created from the string.
*
* @param Cookie|string $cookie
- * @param Uri\Uri|string $ref_uri Optional reference URI (for domain, path, secure)
+ * @param Uri\Uri|string $refUri Optional reference URI (for domain, path, secure)
* @throws Exception\InvalidArgumentException
*/
- public function addCookie(Cookie $cookie, $ref_uri = null)
+ public function addCookie(Cookie $cookie, $refUri = null)
{
if (is_string($cookie)) {
- $cookie = Cookie::fromString($cookie, $ref_uri);
+ $cookie = Cookie::fromString($cookie, $refUri);
}
if ($cookie instanceof Cookie) {
@@ -100,30 +100,30 @@ public function addCookie(Cookie $cookie, $ref_uri = null)
* Parse an HTTP response, adding all the cookies set in that response
*
* @param Response $response
- * @param Uri\Uri|string $ref_uri Requested URI
+ * @param Uri\Uri|string $refUri Requested URI
*/
- public function addCookiesFromResponse(Response $response, $ref_uri)
+ public function addCookiesFromResponse(Response $response, $refUri)
{
- $cookie_hdrs = $response->getHeaders()->get('Set-Cookie');
+ $cookieHdrs = $response->getHeaders()->get('Set-Cookie');
- if (is_array($cookie_hdrs)) {
- foreach ($cookie_hdrs as $cookie) {
- $this->addCookie($cookie, $ref_uri);
+ if (is_array($cookieHdrs)) {
+ foreach ($cookieHdrs as $cookie) {
+ $this->addCookie($cookie, $refUri);
}
- } elseif (is_string($cookie_hdrs)) {
- $this->addCookie($cookie_hdrs, $ref_uri);
+ } elseif (is_string($cookieHdrs)) {
+ $this->addCookie($cookieHdrs, $refUri);
}
}
/**
* Get all cookies in the cookie jar as an array
*
- * @param int $ret_as Whether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
+ * @param int $retAs Whether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
* @return array|string
*/
- public function getAllCookies($ret_as = self::COOKIE_OBJECT)
+ public function getAllCookies($retAs = self::COOKIE_OBJECT)
{
- $cookies = $this->_flattenCookiesArray($this->cookies, $ret_as);
+ $cookies = $this->_flattenCookiesArray($this->cookies, $retAs);
return $cookies;
}
@@ -134,13 +134,13 @@ public function getAllCookies($ret_as = self::COOKIE_OBJECT)
*
* @param string|Uri\Uri $uri URI to check against (secure, domain, path)
* @param boolean $matchSessionCookies Whether to send session cookies
- * @param int $ret_as Whether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
+ * @param int $retAs Whether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
* @param int $now Override the current time when checking for expiry time
* @throws Exception\InvalidArgumentException if invalid URI specified
* @return array|string
*/
public function getMatchingCookies($uri, $matchSessionCookies = true,
- $ret_as = self::COOKIE_OBJECT, $now = null)
+ $retAs = self::COOKIE_OBJECT, $now = null)
{
if (is_string($uri)) {
$uri = Uri\UriFactory::factory($uri, 'http');
@@ -165,7 +165,7 @@ public function getMatchingCookies($uri, $matchSessionCookies = true,
$ret[] = $cookie;
// Now, use self::_flattenCookiesArray again - only to convert to the return format ;)
- $ret = $this->_flattenCookiesArray($ret, $ret_as);
+ $ret = $this->_flattenCookiesArray($ret, $retAs);
return $ret;
}
@@ -174,12 +174,12 @@ public function getMatchingCookies($uri, $matchSessionCookies = true,
* Get a specific cookie according to a URI and name
*
* @param Uri\Uri|string $uri The uri (domain and path) to match
- * @param string $cookie_name The cookie's name
- * @param int $ret_as Whether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
- * @throws Exception\InvalidArgumentException if invalid URI specified or invalid $ret_as value
+ * @param string $cookieName The cookie's name
+ * @param int $retAs Whether to return cookies as objects of \Zend\Http\Header\Cookie or as strings
+ * @throws Exception\InvalidArgumentException if invalid URI specified or invalid $retAs value
* @return Cookie|string
*/
- public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT)
+ public function getCookie($uri, $cookieName, $retAs = self::COOKIE_OBJECT)
{
if (is_string($uri)) {
$uri = Uri\UriFactory::factory($uri, 'http');
@@ -197,10 +197,10 @@ public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT)
$path = substr($path, 0, strrpos($path, '/'));
if (! $path) $path = '/';
- if (isset($this->cookies[$uri->getHost()][$path][$cookie_name])) {
- $cookie = $this->cookies[$uri->getHost()][$path][$cookie_name];
+ if (isset($this->cookies[$uri->getHost()][$path][$cookieName])) {
+ $cookie = $this->cookies[$uri->getHost()][$path][$cookieName];
- switch ($ret_as) {
+ switch ($retAs) {
case self::COOKIE_OBJECT:
return $cookie;
break;
@@ -211,7 +211,7 @@ public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT)
break;
default:
- throw new Exception\InvalidArgumentException("Invalid value passed for \$ret_as: {$ret_as}");
+ throw new Exception\InvalidArgumentException("Invalid value passed for \$retAs: {$retAs}");
break;
}
}
@@ -224,23 +224,23 @@ public function getCookie($uri, $cookie_name, $ret_as = self::COOKIE_OBJECT)
* cookies array (or parts of it)
*
* @param \Zend\Http\Header\Cookie|array $ptr
- * @param int $ret_as What value to return
+ * @param int $retAs What value to return
* @return array|string
*/
- protected function _flattenCookiesArray($ptr, $ret_as = self::COOKIE_OBJECT)
+ protected function _flattenCookiesArray($ptr, $retAs = self::COOKIE_OBJECT)
{
if (is_array($ptr)) {
- $ret = ($ret_as == self::COOKIE_STRING_CONCAT ? '' : array());
+ $ret = ($retAs == self::COOKIE_STRING_CONCAT ? '' : array());
foreach ($ptr as $item) {
- if ($ret_as == self::COOKIE_STRING_CONCAT) {
- $ret .= $this->_flattenCookiesArray($item, $ret_as);
+ if ($retAs == self::COOKIE_STRING_CONCAT) {
+ $ret .= $this->_flattenCookiesArray($item, $retAs);
} else {
- $ret = array_merge($ret, $this->_flattenCookiesArray($item, $ret_as));
+ $ret = array_merge($ret, $this->_flattenCookiesArray($item, $retAs));
}
}
return $ret;
} elseif ($ptr instanceof Cookie) {
- switch ($ret_as) {
+ switch ($retAs) {
case self::COOKIE_STRING_ARRAY:
return array($ptr->__toString());
break;
@@ -289,14 +289,14 @@ protected function _matchPath($domains, $path)
{
$ret = array();
- foreach ($domains as $dom => $paths_array) {
- foreach (array_keys($paths_array) as $cpath) {
+ foreach ($domains as $dom => $pathsArray) {
+ foreach (array_keys($pathsArray) as $cpath) {
if (Cookie::matchCookiePath($cpath, $path)) {
if (! isset($ret[$dom])) {
$ret[$dom] = array();
}
- $ret[$dom][$cpath] = $paths_array[$cpath];
+ $ret[$dom][$cpath] = $pathsArray[$cpath];
}
}
}
@@ -311,14 +311,14 @@ protected function _matchPath($domains, $path)
* of the cookie.
*
* @param Response $response HTTP Response object
- * @param Uri\Uri|string $ref_uri The requested URI
+ * @param Uri\Uri|string $refUri The requested URI
* @return Cookies
* @todo Add the $uri functionality.
*/
- public static function fromResponse(Response $response, $ref_uri)
+ public static function fromResponse(Response $response, $refUri)
{
$jar = new self();
- $jar->addCookiesFromResponse($response, $ref_uri);
+ $jar->addCookiesFromResponse($response, $refUri);
return $jar;
}
View
45 library/Zend/Json/Decoder.php
@@ -302,10 +302,10 @@ protected function _getNextToken()
return(self::EOF);
}
- $str = $this->source;
- $str_length = $this->sourceLength;
- $i = $this->offset;
- $start = $i;
+ $str = $this->source;
+ $strLength = $this->sourceLength;
+ $i = $this->offset;
+ $start = $i;
switch ($str{$i}) {
case '{':
@@ -330,7 +330,7 @@ protected function _getNextToken()
$result = '';
do {
$i++;
- if ($i >= $str_length) {
+ if ($i >= $strLength) {
break;
}
@@ -338,7 +338,7 @@ protected function _getNextToken()
if ($chr == '\\') {
$i++;
- if ($i >= $str_length) {
+ if ($i >= $strLength) {
break;
}
$chr = $str{$i};
@@ -378,28 +378,28 @@ protected function _getNextToken()
} else {
$result .= $chr;
}
- } while ($i < $str_length);
+ } while ($i < $strLength);
$this->token = self::DATUM;
//$this->tokenValue = substr($str, $start + 1, $i - $start - 1);
$this->tokenValue = $result;
break;
case 't':
- if (($i+ 3) < $str_length && substr($str, $start, 4) == "true") {
+ if (($i+ 3) < $strLength && substr($str, $start, 4) == "true") {
$this->token = self::DATUM;
}
$this->tokenValue = true;
$i += 3;
break;
case 'f':
- if (($i+ 4) < $str_length && substr($str, $start, 5) == "false") {
+ if (($i+ 4) < $strLength && substr($str, $start, 5) == "false") {
$this->token = self::DATUM;
}
$this->tokenValue = false;
$i += 4;
break;
case 'n':
- if (($i+ 3) < $str_length && substr($str, $start, 4) == "null") {
+ if (($i+ 3) < $strLength && substr($str, $start, 4) == "null") {
$this->token = self::DATUM;
}
$this->tokenValue = NULL;
@@ -454,15 +454,12 @@ protected function _getNextToken()
*/
public static function decodeUnicodeString($chrs)
{
- $chrs = (string) $chrs;
- $delim = substr($chrs, 0, 1);
- $utf8 = '';
- $strlen_chrs = strlen($chrs);
+ $chrs = (string) $chrs;
+ $utf8 = '';
+ $strlenChrs = strlen($chrs);
- for ($i = 0; $i < $strlen_chrs; $i++) {
-
- $substr_chrs_c_2 = substr($chrs, $i, 2);
- $ord_chrs_c = ord($chrs[$i]);
+ for ($i = 0; $i < $strlenChrs; $i++) {
+ $ordChrsC = ord($chrs[$i]);
switch (true) {
case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $i, 6)):
@@ -478,34 +475,34 @@ public static function decodeUnicodeString($chrs)
$utf8 .= $utf8char;
$i += 5;
break;
- case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
+ case ($ordChrsC >= 0x20) && ($ordChrsC <= 0x7F):
$utf8 .= $chrs{$i};
break;
- case ($ord_chrs_c & 0xE0) == 0xC0:
+ case ($ordChrsC & 0xE0) == 0xC0:
// characters U-00000080 - U-000007FF, mask 110XXXXX
//see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $i, 2);
++$i;
break;
- case ($ord_chrs_c & 0xF0) == 0xE0:
+ case ($ordChrsC & 0xF0) == 0xE0:
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $i, 3);
$i += 2;
break;
- case ($ord_chrs_c & 0xF8) == 0xF0:
+ case ($ordChrsC & 0xF8) == 0xF0:
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $i, 4);
$i += 3;
break;
- case ($ord_chrs_c & 0xFC) == 0xF8:
+ case ($ordChrsC & 0xFC) == 0xF8:
// characters U-00200000 - U-03FFFFFF, mask 111110XX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $i, 5);
$i += 4;
break;
- case ($ord_chrs_c & 0xFE) == 0xFC:
+ case ($ordChrsC & 0xFE) == 0xFC:
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $i, 6);
View
28 library/Zend/Json/Encoder.php
@@ -446,35 +446,35 @@ public static function encodeClasses(array $classNames, $package = '')
*/
public static function encodeUnicodeString($value)
{
- $strlen_var = strlen($value);
+ $strlenVar = strlen($value);
$ascii = "";
/**
* Iterate over every character in the string,
* escaping with a slash or encoding to UTF-8 where necessary
*/
- for ($i = 0; $i < $strlen_var; $i++) {
- $ord_var_c = ord($value[$i]);
+ for ($i = 0; $i < $strlenVar; $i++) {
+ $ordVarC = ord($value[$i]);
switch (true) {
- case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
+ case (($ordVarC >= 0x20) && ($ordVarC <= 0x7F)):
// characters U-00000000 - U-0000007F (same as ASCII)
$ascii .= $value[$i];
break;
- case (($ord_var_c & 0xE0) == 0xC0):
+ case (($ordVarC & 0xE0) == 0xC0):
// characters U-00000080 - U-000007FF, mask 110XXXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- $char = pack('C*', $ord_var_c, ord($value[$i + 1]));
+ $char = pack('C*', $ordVarC, ord($value[$i + 1]));
$i += 1;
$utf16 = self::_utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
- case (($ord_var_c & 0xF0) == 0xE0):
+ case (($ordVarC & 0xF0) == 0xE0):
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- $char = pack('C*', $ord_var_c,
+ $char = pack('C*', $ordVarC,
ord($value[$i + 1]),
ord($value[$i + 2]));
$i += 2;
@@ -482,10 +482,10 @@ public static function encodeUnicodeString($value)
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
- case (($ord_var_c & 0xF8) == 0xF0):
+ case (($ordVarC & 0xF8) == 0xF0):
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- $char = pack('C*', $ord_var_c,
+ $char = pack('C*', $ordVarC,
ord($value[$i + 1]),
ord($value[$i + 2]),
ord($value[$i + 3]));
@@ -494,10 +494,10 @@ public static function encodeUnicodeString($value)
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
- case (($ord_var_c & 0xFC) == 0xF8):
+ case (($ordVarC & 0xFC) == 0xF8):
// characters U-00200000 - U-03FFFFFF, mask 111110XX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- $char = pack('C*', $ord_var_c,
+ $char = pack('C*', $ordVarC,
ord($value[$i + 1]),
ord($value[$i + 2]),
ord($value[$i + 3]),
@@ -507,10 +507,10 @@ public static function encodeUnicodeString($value)
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
- case (($ord_var_c & 0xFE) == 0xFC):
+ case (($ordVarC & 0xFE) == 0xFC):
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- $char = pack('C*', $ord_var_c,
+ $char = pack('C*', $ordVarC,
ord($value[$i + 1]),
ord($value[$i + 2]),
ord($value[$i + 3]),
View
8 library/Zend/Ldap/Collection/DefaultIterator.php
@@ -197,14 +197,14 @@ public function current()
return null;
}
- $entry = array('dn' => $this->key());
- $ber_identifier = null;
+ $entry = array('dn' => $this->key());
+ $berIdentifier = null;
$resource = $this->ldap->getResource();
ErrorHandler::start();
$name = ldap_first_attribute(
$resource, $this->current,
- $ber_identifier
+ $berIdentifier
);
ErrorHandler::stop();
@@ -240,7 +240,7 @@ public function current()
ErrorHandler::start();
$name = ldap_next_attribute(
$resource, $this->current,
- $ber_identifier
+ $berIdentifier
);
ErrorHandler::stop();
}
View
8 library/Zend/Ldap/Ldif/Encoder.php
@@ -185,13 +185,13 @@ protected function encodeString($string, &$base64 = null)
* ; and less-than ("<" , ASCII 60 decimal)
*
*/
- $unsafe_init_char = array(0, 10, 13, 32, 58, 60);
+ $unsafeInitChar = array(0, 10, 13, 32, 58, 60);
/*
* SAFE-CHAR = %x01-09 / %x0B-0C / %x0E-7F
* ; any value <= 127 decimal except NUL, LF,
* ; and CR
*/
- $unsafe_char = array(0, 10, 13);
+ $unsafeChar = array(0, 10, 13);
$base64 = false;
for ($i = 0; $i < strlen($string); $i++) {
@@ -199,10 +199,10 @@ protected function encodeString($string, &$base64 = null)
if ($char >= 127) {
$base64 = true;
break;
- } elseif ($i === 0 && in_array($char, $unsafe_init_char)) {
+ } elseif ($i === 0 && in_array($char, $unsafeInitChar)) {
$base64 = true;
break;
- } elseif (in_array($char, $unsafe_char)) {
+ } elseif (in_array($char, $unsafeChar)) {
$base64 = true;
break;
}
View
4 library/Zend/Loader/ModuleAutoloader.php
@@ -132,8 +132,8 @@ public function autoload($class)
continue;
}
- $moduleName_buffer = str_replace($namespace . "\\", "", $moduleName );
- $path .= DIRECTORY_SEPARATOR . $moduleName_buffer . DIRECTORY_SEPARATOR;
+ $moduleNameBuffer = str_replace($namespace . "\\", "", $moduleName );
+ $path .= DIRECTORY_SEPARATOR . $moduleNameBuffer . DIRECTORY_SEPARATOR;
$classLoaded = $this->loadModuleFromDir($path, $class);
if ($classLoaded) {
View
8 library/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php
@@ -148,11 +148,11 @@ protected function _hmacMd5($key, $data, $block = 64)
$key = str_pad($key, $block, "\0");
}
- $k_ipad = substr($key, 0, 64) ^ str_repeat(chr(0x36), 64);
- $k_opad = substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64);
+ $kIpad = substr($key, 0, 64) ^ str_repeat(chr(0x36), 64);
+ $kOpad = substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64);
- $inner = pack('H32', md5($k_ipad . $data));
- $digest = md5($k_opad . $inner);
+ $inner = pack('H32', md5($kIpad . $data));
+ $digest = md5($kOpad . $inner);
return $digest;
}
View
12 library/Zend/Mail/Storage/Maildir.php
@@ -291,9 +291,9 @@ protected function _openMaildir($dirname)
*
* @param resource $dh dir handle used for search
* @param string $dirname dirname of dir in $dh
- * @param array $default_flags default flags for given dir
+ * @param array $defaultFlags default flags for given dir
*/
- protected function _getMaildirFiles($dh, $dirname, $default_flags = array())
+ protected function _getMaildirFiles($dh, $dirname, $defaultFlags = array())
{
while (($entry = readdir($dh)) !== false) {
if ($entry[0] == '.' || !is_file($dirname . $entry)) {
@@ -318,16 +318,16 @@ protected function _getMaildirFiles($dh, $dirname, $default_flags = array())
$flags = '';
}
- $named_flags = $default_flags;
+ $namedFlags = $defaultFlags;
$length = strlen($flags);
for ($i = 0; $i < $length; ++$i) {
$flag = $flags[$i];
- $named_flags[$flag] = isset(static::$knownFlags[$flag]) ? static::$knownFlags[$flag] : $flag;
+ $namedFlags[$flag] = isset(static::$knownFlags[$flag]) ? static::$knownFlags[$flag] : $flag;
}
$data = array('uniq' => $uniq,
- 'flags' => $named_flags,
- 'flaglookup' => array_flip($named_flags),
+ 'flags' => $namedFlags,
+ 'flaglookup' => array_flip($namedFlags),
'filename' => $dirname . $entry);
if ($size !== null) {
$data['size'] = (int) $size;
View
124 library/Zend/Mail/Storage/Writable/Maildir.php
@@ -365,10 +365,10 @@ protected function _createTmpFile($folder = 'INBOX')
// we should retry to create a unique id if a file with the same name exists
// to avoid a script timeout we only wait 1 second (instead of 2) and stop
// after a defined retry count
- // if you change this variable take into account that it can take up to $max_tries seconds
+ // if you change this variable take into account that it can take up to $maxTries seconds
// normally we should have a valid unique name after the first try, we're just following the "standard" here
- $max_tries = 5;
- for ($i = 0; $i < $max_tries; ++$i) {
+ $maxTries = 5;
+ for ($i = 0; $i < $maxTries; ++$i) {
$uniq = $this->_createUniqueId();
if (!file_exists($tmpdir . $uniq)) {
// here is the race condition! - as defined in the standard
@@ -384,7 +384,7 @@ protected function _createTmpFile($folder = 'INBOX')
}
if (!$fh) {
- throw new StorageException\RuntimeException("tried $max_tries unique ids for a temp file, but all were taken"
+ throw new StorageException\RuntimeException("tried $maxTries unique ids for a temp file, but all were taken"
. ' - giving up');
}
@@ -404,25 +404,25 @@ protected function _createTmpFile($folder = 'INBOX')
protected function _getInfoString(&$flags)
{
// accessing keys is easier, faster and it removes duplicated flags
- $wanted_flags = array_flip($flags);
- if (isset($wanted_flags[Storage::FLAG_RECENT])) {
+ $wantedFlags = array_flip($flags);
+ if (isset($wantedFlags[Storage::FLAG_RECENT])) {
throw new StorageException\InvalidArgumentException('recent flag may not be set');
}
$info = ':2,';
$flags = array();
foreach (Storage\Maildir::$knownFlags as $char => $flag) {
- if (!isset($wanted_flags[$flag])) {
+ if (!isset($wantedFlags[$flag])) {
continue;
}
$info .= $char;
$flags[$char] = $flag;
- unset($wanted_flags[$flag]);
+ unset($wantedFlags[$flag]);
}
- if (!empty($wanted_flags)) {
- $wanted_flags = implode(', ', array_keys($wanted_flags));
- throw new StorageException\InvalidArgumentException('unknown flag(s): ' . $wanted_flags);
+ if (!empty($wantedFlags)) {
+ $wantedFlags = implode(', ', array_keys($wantedFlags));
+ throw new StorageException\InvalidArgumentException('unknown flag(s): ' . $wantedFlags);
}
return $info;
@@ -456,44 +456,44 @@ public function appendMessage($message, $folder = null, $flags = null, $recent =
if ($flags === null) {
$flags = array(Storage::FLAG_SEEN);
}
- $info = $this->_getInfoString($flags);
- $temp_file = $this->_createTmpFile($folder->getGlobalName());
+ $info = $this->_getInfoString($flags);
+ $tempFile = $this->_createTmpFile($folder->getGlobalName());
// TODO: handle class instances for $message
if (is_resource($message) && get_resource_type($message) == 'stream') {
- stream_copy_to_stream($message, $temp_file['handle']);
+ stream_copy_to_stream($message, $tempFile['handle']);
} else {
- fwrite($temp_file['handle'], $message);
+ fwrite($tempFile['handle'], $message);
}
- fclose($temp_file['handle']);
+ fclose($tempFile['handle']);
// we're adding the size to the filename for maildir++
- $size = filesize($temp_file['filename']);
+ $size = filesize($tempFile['filename']);
if ($size !== false) {
$info = ',S=' . $size . $info;
}
- $new_filename = $temp_file['dirname'] . DIRECTORY_SEPARATOR;
- $new_filename .= $recent ? 'new' : 'cur';
- $new_filename .= DIRECTORY_SEPARATOR . $temp_file['uniq'] . $info;
+ $newFilename = $tempFile['dirname'] . DIRECTORY_SEPARATOR;
+ $newFilename .= $recent ? 'new' : 'cur';
+ $newFilename .= DIRECTORY_SEPARATOR . $tempFile['uniq'] . $info;
// we're throwing any exception after removing our temp file and saving it to this variable instead
$exception = null;
- if (!link($temp_file['filename'], $new_filename)) {
+ if (!link($tempFile['filename'], $newFilename)) {
$exception = new StorageException\RuntimeException('cannot link message file to final dir');
}
ErrorHandler::start(E_WARNING);
- unlink($temp_file['filename']);
+ unlink($tempFile['filename']);
ErrorHandler::stop();
if ($exception) {
throw $exception;
}
- $this->files[] = array('uniq' => $temp_file['uniq'],
+ $this->files[] = array('uniq' => $tempFile['uniq'],
'flags' => $flags,
- 'filename' => $new_filename);
+ 'filename' => $newFilename);
if ($this->quota) {
$this->_addQuotaEntry((int) $size, 1);
}
@@ -517,7 +517,7 @@ public function copyMessage($id, $folder)
}
$filedata = $this->_getFileData($id);
- $old_file = $filedata['filename'];
+ $oldFile = $filedata['filename'];
$flags = $filedata['flags'];
// copied message can't be recent
@@ -527,29 +527,29 @@ public function copyMessage($id, $folder)
$info = $this->_getInfoString($flags);
// we're creating the copy as temp file before moving to cur/
- $temp_file = $this->_createTmpFile($folder->getGlobalName());
+ $tempFile = $this->_createTmpFile($folder->getGlobalName());
// we don't write directly to the file
- fclose($temp_file['handle']);
+ fclose($tempFile['handle']);
// we're adding the size to the filename for maildir++
- $size = filesize($old_file);
+ $size = filesize($oldFile);
if ($size !== false) {
$info = ',S=' . $size . $info;
}
- $new_file = $temp_file['dirname'] . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . $temp_file['uniq'] . $info;
+ $newFile = $tempFile['dirname'] . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . $tempFile['uniq'] . $info;
// we're throwing any exception after removing our temp file and saving it to this variable instead
$exception = null;
- if (!copy($old_file, $temp_file['filename'])) {
+ if (!copy($oldFile, $tempFile['filename'])) {
$exception = new StorageException\RuntimeException('cannot copy message file');
- } elseif (!link($temp_file['filename'], $new_file)) {
+ } elseif (!link($tempFile['filename'], $newFile)) {
$exception = new StorageException\RuntimeException('cannot link message file to final dir');
}
ErrorHandler::start(E_WARNING);
- unlink($temp_file['filename']);
+ unlink($tempFile['filename']);
ErrorHandler::stop();
if ($exception) {
@@ -559,9 +559,9 @@ public function copyMessage($id, $folder)
if ($folder->getGlobalName() == $this->currentFolder
|| ($this->currentFolder == 'INBOX' && $folder->getGlobalName() == '/')
) {
- $this->files[] = array('uniq' => $temp_file['uniq'],
+ $this->files[] = array('uniq' => $tempFile['uniq'],
'flags' => $flags,
- 'filename' => $new_file);
+ 'filename' => $newFile);
}
if ($this->quota) {
@@ -589,7 +589,7 @@ public function moveMessage($id, $folder)
}
$filedata = $this->_getFileData($id);
- $old_file = $filedata['filename'];
+ $oldFile = $filedata['filename'];
$flags = $filedata['flags'];
// moved message can't be recent
@@ -599,26 +599,26 @@ public function moveMessage($id, $folder)
$info = $this->_getInfoString($flags);
// reserving a new name
- $temp_file = $this->_createTmpFile($folder->getGlobalName());
- fclose($temp_file['handle']);
+ $tempFile = $this->_createTmpFile($folder->getGlobalName());
+ fclose($tempFile['handle']);
// we're adding the size to the filename for maildir++
- $size = filesize($old_file);
+ $size = filesize($oldFile);
if ($size !== false) {
$info = ',S=' . $size . $info;
}
- $new_file = $temp_file['dirname'] . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . $temp_file['uniq'] . $info;
+ $newFile = $tempFile['dirname'] . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . $tempFile['uniq'] . $info;
// we're throwing any exception after removing our temp file and saving it to this variable instead
$exception = null;
- if (!rename($old_file, $new_file)) {
+ if (!rename($oldFile, $newFile)) {
$exception = new StorageException\RuntimeException('cannot move message file');
}
ErrorHandler::start(E_WARNING);
- unlink($temp_file['filename']);
+ unlink($tempFile['filename']);
ErrorHandler::stop();
if ($exception) {
@@ -646,17 +646,17 @@ public function setFlags($id, $flags)
$filedata = $this->_getFileData($id);
// NOTE: double dirname to make sure we always move to cur. if recent flag has been set (message is in new) it will be moved to cur.
- $new_filename = dirname(dirname($filedata['filename'])) . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . "$filedata[uniq]$info";
+ $newFilename = dirname(dirname($filedata['filename'])) . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . "$filedata[uniq]$info";
ErrorHandler::start();
- $test = rename($filedata['filename'], $new_filename);
+ $test = rename($filedata['filename'], $newFilename);
$error = ErrorHandler::stop();
if (!$test) {
throw new StorageException\RuntimeException('cannot rename file', 0, $error);
}
$filedata['flags'] = $flags;
- $filedata['filename'] = $new_filename;
+ $filedata['filename'] = $newFilename;
$this->files[$id - 1] = $filedata;
}
@@ -748,7 +748,7 @@ protected function _calculateMaildirsize()
{
$timestamps = array();
$messages = 0;
- $total_size = 0;
+ $totalSize = 0;
if (is_array($this->quota)) {
$quota = $this->quota;
@@ -798,7 +798,7 @@ protected function _calculateMaildirsize()
strtok($entry, '=');
$filesize = strtok(':');
if (is_numeric($filesize)) {
- $total_size += $filesize;
+ $totalSize += $filesize;
++$messages;
continue;
}
@@ -808,7 +808,7 @@ protected function _calculateMaildirsize()
// ignore, as we assume file got removed
continue;
}
- $total_size += $size;
+ $totalSize += $size;
++$messages;
}
}
@@ -825,7 +825,7 @@ protected function _calculateMaildirsize()
}
$definition = implode(',', $definition);
fwrite($fh, "$definition\n");
- fwrite($fh, "$total_size $messages\n");
+ fwrite($fh, "$totalSize $messages\n");
fclose($fh);
rename($tmp['filename'], $this->rootdir . 'maildirsize');
foreach ($timestamps as $dir => $timestamp) {
@@ -835,7 +835,7 @@ protected function _calculateMaildirsize()
}
}
- return array('size' => $total_size,
+ return array('size' => $totalSize,
'count' => $messages,
'quota' => $quota);
}
@@ -848,7 +848,7 @@ protected function _calculateMaildirsize()
protected function _calculateQuota($forceRecalc = false)
{
$fh = null;
- $total_size = 0;
+ $totalSize = 0;
$messages = 0;
$maildirsize = '';
if (!$forceRecalc && file_exists($this->rootdir . 'maildirsize') && filesize($this->rootdir . 'maildirsize') < 5120) {
@@ -864,7 +864,7 @@ protected function _calculateQuota($forceRecalc = false)
}
if (!$fh) {
$result = $this->_calculateMaildirsize();
- $total_size = $result['size'];
+ $totalSize = $result['size'];
$messages = $result['count'];
$quota = $result['quota'];
} else {
@@ -885,26 +885,26 @@ protected function _calculateQuota($forceRecalc = false)
unset($maildirsize[0]);
foreach ($maildirsize as $line) {
list($size, $count) = explode(' ', trim($line));
- $total_size += $size;
+ $totalSize += $size;
$messages += $count;
}
}
- $over_quota = false;
- $over_quota = $over_quota || (isset($quota['size']) && $total_size > $quota['size']);
- $over_quota = $over_quota || (isset($quota['count']) && $messages > $quota['count']);
+ $overQuota = false;
+ $overQuota = $overQuota || (isset($quota['size']) && $totalSize > $quota['size']);
+ $overQuota = $overQuota || (isset($quota['count']) && $messages > $quota['count']);
// NOTE: $maildirsize equals false if it wasn't set (AKA we recalculated) or it's only
// one line, because $maildirsize[0] gets unsetted.
// Also we're using local time to calculate the 15 minute offset. Touching a file just for known the
// local time of the file storage isn't worth the hassle.
- if ($over_quota && ($maildirsize || filemtime($this->rootdir . 'maildirsize') > time() - 900)) {
+ if ($overQuota && ($maildirsize || filemtime($this->rootdir . 'maildirsize') > time() - 900)) {
$result = $this->_calculateMaildirsize();
- $total_size = $result['size'];
+ $totalSize = $result['size'];
$messages = $result['count'];
$quota = $result['quota'];
- $over_quota = false;
- $over_quota = $over_quota || (isset($quota['size']) && $total_size > $quota['size']);
- $over_quota = $over_quota || (isset($quota['count']) && $messages > $quota['count']);
+ $overQuota = false;
+ $overQuota = $overQuota || (isset($quota['size']) && $totalSize > $quota['size']);
+ $overQuota = $overQuota || (isset($quota['count']) && $messages > $quota['count']);
}
if ($fh) {
@@ -912,10 +912,10 @@ protected function _calculateQuota($forceRecalc = false)
fclose($fh);
}
- return array('size' => $total_size,
+ return array('size' => $totalSize,
'count' => $messages,
'quota' => $quota,
- 'over_quota' => $over_quota);
+ 'over_quota' => $overQuota);
}
protected function _addQuotaEntry($size, $count = 1)
View
66 library/Zend/Soap/Client.php
@@ -56,18 +56,18 @@ class Client implements ServerClient
protected $use = null;
protected $login = null;
protected $password = null;
- protected $proxy_host = null;
- protected $proxy_port = null;
- protected $proxy_login = null;
- protected $proxy_password = null;
- protected $local_cert = null;
+ protect