Permalink
Browse files

Merge remote-tracking branch 'upstream/1.4' into 1.4

  • Loading branch information...
rdavaillaud committed Jan 4, 2013
2 parents 627225f + 75d9b19 commit 07b31612331b7be02ea7c9046a98b1d467a9a546
Showing with 1,763 additions and 871 deletions.
  1. +17 −0 CHANGELOG
  2. +2 −2 lib/autoload/sfAutoloadAgain.class.php
  3. +1 −1 lib/autoload/sfCoreAutoload.class.php
  4. +2 −2 lib/controller/sfController.class.php
  5. +2 −2 lib/database/sfPDODatabase.class.php
  6. +5 −3 lib/debug/sfTimerManager.class.php
  7. +4 −3 lib/exception/sfException.class.php
  8. +23 −1 lib/form/sfForm.class.php
  9. +4 −4 lib/plugins/sfDoctrinePlugin/lib/database/sfDoctrineConnectionProfiler.class.php
  10. +14 −8 lib/request/sfWebRequest.class.php
  11. +2 −2 lib/storage/sfPDOSessionStorage.class.php
  12. +18 −6 lib/vendor/swiftmailer/classes/Swift.php
  13. +0 −3 lib/vendor/swiftmailer/classes/Swift/Attachment.php
  14. +1 −4 lib/vendor/swiftmailer/classes/Swift/ByteStream/AbstractFilterableInputStream.php
  15. +0 −2 lib/vendor/swiftmailer/classes/Swift/ByteStream/ArrayByteStream.php
  16. +78 −21 lib/vendor/swiftmailer/classes/Swift/ByteStream/FileByteStream.php
  17. +1 −1 lib/vendor/swiftmailer/classes/Swift/CharacterReader.php
  18. +12 −17 lib/vendor/swiftmailer/classes/Swift/CharacterReader/GenericFixedWidthReader.php
  19. +12 −13 lib/vendor/swiftmailer/classes/Swift/CharacterReader/UsAsciiReader.php
  20. +44 −45 lib/vendor/swiftmailer/classes/Swift/CharacterReader/Utf8Reader.php
  21. +0 −1 lib/vendor/swiftmailer/classes/Swift/CharacterReaderFactory.php
  22. +36 −22 lib/vendor/swiftmailer/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php
  23. +0 −2 lib/vendor/swiftmailer/classes/Swift/CharacterStream/ArrayCharacterStream.php
  24. +0 −2 lib/vendor/swiftmailer/classes/Swift/CharacterStream/NgCharacterStream.php
  25. +0 −1 lib/vendor/swiftmailer/classes/Swift/DependencyContainer.php
  26. +0 −1 lib/vendor/swiftmailer/classes/Swift/DependencyException.php
  27. +0 −3 lib/vendor/swiftmailer/classes/Swift/EmbeddedFile.php
  28. +0 −1 lib/vendor/swiftmailer/classes/Swift/Encoder.php
  29. +0 −1 lib/vendor/swiftmailer/classes/Swift/Encoder/Base64Encoder.php
  30. +44 −11 lib/vendor/swiftmailer/classes/Swift/Encoder/QpEncoder.php
  31. +0 −2 lib/vendor/swiftmailer/classes/Swift/Encoder/Rfc2231Encoder.php
  32. +0 −1 lib/vendor/swiftmailer/classes/Swift/Encoding.php
  33. +0 −2 lib/vendor/swiftmailer/classes/Swift/Events/CommandEvent.php
  34. +0 −2 lib/vendor/swiftmailer/classes/Swift/Events/CommandListener.php
  35. +0 −2 lib/vendor/swiftmailer/classes/Swift/Events/EventDispatcher.php
  36. +0 −1 lib/vendor/swiftmailer/classes/Swift/Events/EventObject.php
  37. +0 −1 lib/vendor/swiftmailer/classes/Swift/Events/ResponseEvent.php
  38. +0 −2 lib/vendor/swiftmailer/classes/Swift/Events/ResponseListener.php
  39. +3 −10 lib/vendor/swiftmailer/classes/Swift/Events/SendEvent.php
  40. +0 −2 lib/vendor/swiftmailer/classes/Swift/Events/SendListener.php
  41. +0 −8 lib/vendor/swiftmailer/classes/Swift/Events/SimpleEventDispatcher.php
  42. +0 −1 lib/vendor/swiftmailer/classes/Swift/Events/TransportChangeEvent.php
  43. +0 −2 lib/vendor/swiftmailer/classes/Swift/Events/TransportChangeListener.php
  44. +0 −2 lib/vendor/swiftmailer/classes/Swift/Events/TransportExceptionEvent.php
  45. +0 −2 lib/vendor/swiftmailer/classes/Swift/Events/TransportExceptionListener.php
  46. +0 −2 lib/vendor/swiftmailer/classes/Swift/FailoverTransport.php
  47. +100 −6 lib/vendor/swiftmailer/classes/Swift/FileSpool.php
  48. +0 −1 lib/vendor/swiftmailer/classes/Swift/FileStream.php
  49. +0 −1 lib/vendor/swiftmailer/classes/Swift/Filterable.php
  50. +0 −2 lib/vendor/swiftmailer/classes/Swift/Image.php
  51. +0 −1 lib/vendor/swiftmailer/classes/Swift/IoException.php
  52. +0 −2 lib/vendor/swiftmailer/classes/Swift/KeyCache.php
  53. +0 −5 lib/vendor/swiftmailer/classes/Swift/KeyCache/ArrayKeyCache.php
  54. +35 −18 lib/vendor/swiftmailer/classes/Swift/KeyCache/DiskKeyCache.php
  55. +112 −0 lib/vendor/swiftmailer/classes/Swift/KeyCache/DummyKeyCache.php
  56. +0 −2 lib/vendor/swiftmailer/classes/Swift/KeyCache/KeyCacheInputStream.php
  57. +0 −4 lib/vendor/swiftmailer/classes/Swift/KeyCache/NullKeyCache.php
  58. +0 −2 lib/vendor/swiftmailer/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php
  59. +0 −2 lib/vendor/swiftmailer/classes/Swift/LoadBalancedTransport.php
  60. +0 −2 lib/vendor/swiftmailer/classes/Swift/MailTransport.php
  61. +20 −75 lib/vendor/swiftmailer/classes/Swift/Mailer.php
  62. +0 −1 lib/vendor/swiftmailer/classes/Swift/Mailer/ArrayRecipientIterator.php
  63. +84 −0 lib/vendor/swiftmailer/classes/Swift/MemorySpool.php
  64. +0 −3 lib/vendor/swiftmailer/classes/Swift/Message.php
  65. +7 −7 lib/vendor/swiftmailer/classes/Swift/Mime/Attachment.php
  66. +0 −3 lib/vendor/swiftmailer/classes/Swift/Mime/ContentEncoder.php
  67. +0 −4 lib/vendor/swiftmailer/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php
  68. +0 −3 lib/vendor/swiftmailer/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php
  69. +24 −6 lib/vendor/swiftmailer/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php
  70. +3 −6 lib/vendor/swiftmailer/classes/Swift/Mime/EmbeddedFile.php
  71. +0 −1 lib/vendor/swiftmailer/classes/Swift/Mime/EncodingObserver.php
  72. +178 −0 lib/vendor/swiftmailer/classes/Swift/Mime/Grammar.php
  73. +0 −1 lib/vendor/swiftmailer/classes/Swift/Mime/HeaderEncoder.php
  74. +26 −1 lib/vendor/swiftmailer/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php
  75. +10 −39 lib/vendor/swiftmailer/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php
  76. +0 −1 lib/vendor/swiftmailer/classes/Swift/Mime/HeaderFactory.php
  77. +0 −1 lib/vendor/swiftmailer/classes/Swift/Mime/HeaderSet.php
  78. +51 −143 lib/vendor/swiftmailer/classes/Swift/Mime/Headers/AbstractHeader.php
  79. +3 −2 lib/vendor/swiftmailer/classes/Swift/Mime/Headers/DateHeader.php
  80. +26 −21 lib/vendor/swiftmailer/classes/Swift/Mime/Headers/IdentificationHeader.php
  81. +18 −8 lib/vendor/swiftmailer/classes/Swift/Mime/Headers/MailboxHeader.php
  82. +16 −22 lib/vendor/swiftmailer/classes/Swift/Mime/Headers/ParameterizedHeader.php
  83. +24 −10 lib/vendor/swiftmailer/classes/Swift/Mime/Headers/PathHeader.php
  84. +5 −6 lib/vendor/swiftmailer/classes/Swift/Mime/Headers/UnstructuredHeader.php
  85. +0 −1 lib/vendor/swiftmailer/classes/Swift/Mime/Message.php
  86. +0 −3 lib/vendor/swiftmailer/classes/Swift/Mime/MimeEntity.php
  87. +35 −7 lib/vendor/swiftmailer/classes/Swift/Mime/MimePart.php
  88. +0 −1 lib/vendor/swiftmailer/classes/Swift/Mime/ParameterizedHeader.php
  89. +13 −16 lib/vendor/swiftmailer/classes/Swift/Mime/SimpleHeaderFactory.php
  90. +0 −2 lib/vendor/swiftmailer/classes/Swift/Mime/SimpleHeaderSet.php
  91. +21 −8 lib/vendor/swiftmailer/classes/Swift/Mime/SimpleMessage.php
  92. +73 −14 lib/vendor/swiftmailer/classes/Swift/Mime/SimpleMimeEntity.php
  93. +0 −2 lib/vendor/swiftmailer/classes/Swift/MimePart.php
  94. +0 −3 lib/vendor/swiftmailer/classes/Swift/Plugins/AntiFloodPlugin.php
  95. +0 −7 lib/vendor/swiftmailer/classes/Swift/Plugins/BandwidthMonitorPlugin.php
  96. +59 −18 lib/vendor/swiftmailer/classes/Swift/Plugins/DecoratorPlugin.php
  97. +68 −0 lib/vendor/swiftmailer/classes/Swift/Plugins/ImpersonatePlugin.php
  98. +0 −10 lib/vendor/swiftmailer/classes/Swift/Plugins/LoggerPlugin.php
  99. +77 −0 lib/vendor/swiftmailer/classes/Swift/Plugins/MessageLogger.php
  100. +0 −1 lib/vendor/swiftmailer/classes/Swift/Plugins/Pop/Pop3Exception.php
  101. +0 −2 lib/vendor/swiftmailer/classes/Swift/Plugins/PopBeforeSmtpPlugin.php
  102. +0 −1 lib/vendor/swiftmailer/classes/Swift/Plugins/Reporter.php
  103. +0 −3 lib/vendor/swiftmailer/classes/Swift/Plugins/ReporterPlugin.php
  104. +0 −2 lib/vendor/swiftmailer/classes/Swift/Plugins/Reporters/HitReporter.php
  105. +0 −2 lib/vendor/swiftmailer/classes/Swift/Plugins/Reporters/HtmlReporter.php
  106. +0 −4 lib/vendor/swiftmailer/classes/Swift/Plugins/ThrottlerPlugin.php
  107. +16 −1 lib/vendor/swiftmailer/classes/Swift/Preferences.php
  108. +0 −1 lib/vendor/swiftmailer/classes/Swift/RfcComplianceException.php
  109. +0 −2 lib/vendor/swiftmailer/classes/Swift/SendmailTransport.php
  110. +0 −2 lib/vendor/swiftmailer/classes/Swift/SmtpTransport.php
  111. +2 −0 lib/vendor/swiftmailer/classes/Swift/Spool.php
  112. +0 −1 lib/vendor/swiftmailer/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php
  113. +0 −1 lib/vendor/swiftmailer/classes/Swift/StreamFilters/StringReplacementFilter.php
  114. +0 −2 lib/vendor/swiftmailer/classes/Swift/StreamFilters/StringReplacementFilterFactory.php
  115. +1 −3 lib/vendor/swiftmailer/classes/Swift/Transport.php
  116. +32 −16 lib/vendor/swiftmailer/classes/Swift/Transport/AbstractSmtpTransport.php
  117. +0 −3 lib/vendor/swiftmailer/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php
  118. +0 −3 lib/vendor/swiftmailer/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php
  119. +0 −3 lib/vendor/swiftmailer/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php
  120. +0 −3 lib/vendor/swiftmailer/classes/Swift/Transport/Esmtp/AuthHandler.php
  121. +0 −1 lib/vendor/swiftmailer/classes/Swift/Transport/Esmtp/Authenticator.php
  122. +0 −1 lib/vendor/swiftmailer/classes/Swift/Transport/EsmtpHandler.php
  123. +71 −15 lib/vendor/swiftmailer/classes/Swift/Transport/EsmtpTransport.php
  124. +1 −3 lib/vendor/swiftmailer/classes/Swift/Transport/FailoverTransport.php
  125. +0 −2 lib/vendor/swiftmailer/classes/Swift/Transport/IoBuffer.php
  126. +2 −5 lib/vendor/swiftmailer/classes/Swift/Transport/LoadBalancedTransport.php
  127. +9 −6 lib/vendor/swiftmailer/classes/Swift/Transport/MailTransport.php
  128. +2 −5 lib/vendor/swiftmailer/classes/Swift/Transport/SendmailTransport.php
  129. +2 −3 lib/vendor/swiftmailer/classes/Swift/Transport/SimpleMailInvoker.php
  130. +1 −0 lib/vendor/swiftmailer/classes/Swift/Transport/SpoolTransport.php
  131. +67 −14 lib/vendor/swiftmailer/classes/Swift/Transport/StreamBuffer.php
  132. +0 −1 lib/vendor/swiftmailer/classes/Swift/TransportException.php
  133. +38 −0 lib/vendor/swiftmailer/classes/Swift/Validate.php
  134. +9 −0 lib/vendor/swiftmailer/dependency_maps/message_deps.php
  135. +11 −3 lib/vendor/swiftmailer/dependency_maps/mime_deps.php
  136. +5 −3 lib/vendor/swiftmailer/preferences.php
  137. +10 −4 lib/vendor/swiftmailer/swift_init.php
  138. +8 −6 lib/vendor/swiftmailer/swift_required.php
  139. +7 −2 lib/vendor/swiftmailer/swift_required_pear.php
  140. +2 −2 lib/widget/sfWidget.class.php
  141. +2 −2 lib/widget/sfWidgetForm.class.php
  142. +44 −1 test/unit/form/sfFormTest.php
  143. +4 −3 test/unit/request/sfWebRequestTest.php
  144. +2 −1 test/unit/widget/sfWidgetFormTest.php
  145. +2 −1 test/unit/widget/sfWidgetTest.php
View
@@ -1,6 +1,23 @@
CHANGELOG
=========
+11/25/12: Versions 1.4.20
+-------------------------
+
+ * [33598] fixed the possibility to fake a file upload
+ * [33545] fixed sfPDOSessionStorage for Oracle (closes #10022)
+ * [33544] fixed sfWebRequest::splitHttpAcceptHeader incorrect result order (closes #10069, patch by Keri Henare)
+ * [33539] fixed exception format when using the PHP 5.4 built-in server (closes #10067, based on a patch from jgskin)
+ * [33486] fixed sfPDODatabase::call() method (closes #10044)
+
+10/09/12: Versions 1.4.19
+-------------------------
+
+ * [33545] fixed sfPDOSessionStorage for Oracle (closes #10022)
+ * [33544] fixed sfWebRequest::splitHttpAcceptHeader incorrect result order (closes #10069, patch by Keri Henare)
+ * [33539] fixed exception format when using the PHP 5.4 built-in server (closes #10067, based on a patch from jgskin)
+ * [33486] fixed sfPDODatabase::call() method (closes #10044)
+
05/30/12: Versions 1.4.18
-------------------------
@@ -14,7 +14,7 @@
* @package symfony
* @subpackage autoload
* @author Kris Wallsmith <kris.wallsmith@symfony-project.com>
- * @version SVN: $Id: sfAutoloadAgain.class.php 22248 2009-09-22 17:15:16Z fabien $
+ * @version SVN: $Id: sfAutoloadAgain.class.php 33561 2012-10-18 11:42:28Z fabien $
*/
class sfAutoloadAgain
{
@@ -69,7 +69,7 @@ public function autoload($class)
{
foreach ($autoloads as $position => $autoload)
{
- if ($this === $autoload[0])
+ if (is_array($autoload) && $this === $autoload[0])
{
break;
}
@@ -11,7 +11,7 @@
/**
* The current symfony version.
*/
-define('SYMFONY_VERSION', '1.4.18');
+define('SYMFONY_VERSION', '1.4.20');
/**
* sfCoreAutoload class.
@@ -16,7 +16,7 @@
* @subpackage controller
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Sean Kerr <sean@code-box.org>
- * @version SVN: $Id: sfController.class.php 30912 2010-09-15 11:10:46Z fabien $
+ * @version SVN: $Id: sfController.class.php 33539 2012-09-19 05:36:02Z fabien $
*/
abstract class sfController
{
@@ -489,7 +489,7 @@ public function setRenderMode($mode)
*/
public function inCLI()
{
- return 0 == strncasecmp(PHP_SAPI, 'cli', 3);
+ return 'cli' == PHP_SAPI;
}
/**
@@ -18,7 +18,7 @@
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Sean Kerr <sean@code-box.org>
* @author Dustin Whittle <dustin.whittle@symfony-project.com>
- * @version SVN: $Id: sfPDODatabase.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ * @version SVN: $Id: sfPDODatabase.class.php 33486 2012-07-09 08:57:29Z fabien $
*/
class sfPDODatabase extends sfDatabase
{
@@ -109,6 +109,6 @@ public function shutdown()
*/
public function __call($method, $arguments)
{
- return $this->getConnection()->$method($arguments);
+ return call_user_func_array(array($this->getConnection(), $method), $arguments);
}
}
@@ -14,7 +14,7 @@
* @package symfony
* @subpackage util
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
- * @version SVN: $Id: sfTimerManager.class.php 13339 2008-11-25 14:58:05Z fabien $
+ * @version SVN: $Id: sfTimerManager.class.php 33570 2012-10-25 09:44:55Z fabien $
*/
class sfTimerManager
{
@@ -29,14 +29,16 @@ class sfTimerManager
*
* @return sfTimer The timer instance
*/
- public static function getTimer($name)
+ public static function getTimer($name,$reset=true)
{
if (!isset(self::$timers[$name]))
{
self::$timers[$name] = new sfTimer($name);
}
- self::$timers[$name]->startTimer();
+ if($reset){
+ self::$timers[$name]->startTimer();
+ }
return self::$timers[$name];
}
@@ -18,7 +18,7 @@
* @subpackage exception
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Sean Kerr <sean@code-box.org>
- * @version SVN: $Id: sfException.class.php 33214 2011-11-19 13:47:24Z fabien $
+ * @version SVN: $Id: sfException.class.php 33539 2012-09-19 05:36:02Z fabien $
*/
class sfException extends Exception
{
@@ -195,8 +195,9 @@ static protected function outputStackTrace(Exception $exception)
}
}
- // when using CLI, we force the format to be TXT
- if (0 == strncasecmp(PHP_SAPI, 'cli', 3))
+ // when using CLI, we force the format to be TXT. Compare exactly to
+ // the string 'cli' because the php 5.4 server is identified by 'cli-server'
+ if ('cli' == PHP_SAPI)
{
$format = 'txt';
}
View
@@ -23,7 +23,7 @@
* @package symfony
* @subpackage form
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
- * @version SVN: $Id: sfForm.class.php 29678 2010-05-30 14:38:42Z Kris.Wallsmith $
+ * @version SVN: $Id: sfForm.class.php 33598 2012-11-25 09:57:29Z fabien $
*/
class sfForm implements ArrayAccess, Iterator, Countable
{
@@ -222,6 +222,8 @@ public function bind(array $taintedValues = null, array $taintedFiles = null)
$this->taintedFiles = array();
}
+ $this->checkTaintedValues($this->taintedValues);
+
try
{
$this->doBind(self::deepArrayUnion($this->taintedValues, self::convertFileInformation($this->taintedFiles)));
@@ -1336,4 +1338,24 @@ static protected function deepArrayUnion($array1, $array2)
return $array1;
}
+
+ /**
+ * Checks that the $_POST values do not contain something that
+ * looks like a file upload (coming from $_FILE).
+ */
+ protected function checkTaintedValues($values)
+ {
+ foreach ($values as $name => $value)
+ {
+ if (!is_array($value)) {
+ continue;
+ }
+
+ if (isset($value['tmp_name'])) {
+ throw new InvalidArgumentException('Do not try to fake a file upload.');
+ }
+
+ $this->checkTaintedValues($value);
+ }
+ }
}
@@ -6,7 +6,7 @@
* @package sfDoctrinePlugin
* @subpackage database
* @author Kris Wallsmith <kris.wallsmith@symfony-project.com>
- * @version SVN: $Id: sfDoctrineConnectionProfiler.class.php 20157 2009-07-13 17:00:12Z Kris.Wallsmith $
+ * @version SVN: $Id: sfDoctrineConnectionProfiler.class.php 33570 2012-10-25 09:44:55Z fabien $
*/
class sfDoctrineConnectionProfiler extends Doctrine_Connection_Profiler
{
@@ -82,7 +82,7 @@ public function preQuery(Doctrine_Event $event)
*/
public function postQuery(Doctrine_Event $event)
{
- sfTimerManager::getTimer('Database (Doctrine)')->addTime();
+ sfTimerManager::getTimer('Database (Doctrine)',false)->addTime();
$args = func_get_args();
$this->__call(__FUNCTION__, $args);
@@ -118,7 +118,7 @@ public function preExec(Doctrine_Event $event)
*/
public function postExec(Doctrine_Event $event)
{
- sfTimerManager::getTimer('Database (Doctrine)')->addTime();
+ sfTimerManager::getTimer('Database (Doctrine)',false)->addTime();
$args = func_get_args();
$this->__call(__FUNCTION__, $args);
@@ -154,7 +154,7 @@ public function preStmtExecute(Doctrine_Event $event)
*/
public function postStmtExecute(Doctrine_Event $event)
{
- sfTimerManager::getTimer('Database (Doctrine)')->addTime();
+ sfTimerManager::getTimer('Database (Doctrine)',false)->addTime();
$args = func_get_args();
$this->__call(__FUNCTION__, $args);
@@ -18,7 +18,7 @@
* @subpackage request
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Sean Kerr <sean@code-box.org>
- * @version SVN: $Id: sfWebRequest.class.php 32729 2011-07-05 15:23:04Z www-data $
+ * @version SVN: $Id: sfWebRequest.class.php 33544 2012-10-05 10:42:42Z fabien $
*/
class sfWebRequest extends sfRequest
{
@@ -633,28 +633,34 @@ public function setRelativeUrlRoot($value)
public function splitHttpAcceptHeader($header)
{
$values = array();
+ $groups = array();
foreach (array_filter(explode(',', $header)) as $value)
{
// Cut off any q-value that might come after a semi-colon
if ($pos = strpos($value, ';'))
{
- $q = (float) trim(substr($value, strpos($value, '=') + 1));
+ $q = trim(substr($value, strpos($value, '=') + 1));
$value = substr($value, 0, $pos);
}
else
{
$q = 1;
}
- if (0 < $q)
- {
- $values[trim($value)] = $q;
- }
+ $groups[$q][] = $value;
}
- arsort($values);
+ krsort($groups);
+
+ foreach ($groups as $q => $items) {
+ if (0 < $q) {
+ foreach ($items as $value) {
+ $values[] = trim($value);
+ }
+ }
+ }
- return array_keys($values);
+ return $values;
}
/**
@@ -19,7 +19,7 @@
* @author Mathew Toth <developer@poetryleague.com>
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Sean Kerr <sean@code-box.org>
- * @version SVN: $Id: sfPDOSessionStorage.class.php 13143 2008-11-18 22:22:01Z FabianLange $
+ * @version SVN: $Id: sfPDOSessionStorage.class.php 33545 2012-10-05 10:49:45Z fabien $
*/
class sfPDOSessionStorage extends sfDatabaseSessionStorage
{
@@ -115,7 +115,7 @@ public function sessionRead($id)
$sessionRows = $stmt->fetchAll(PDO::FETCH_NUM);
if (count($sessionRows) == 1)
{
- return $sessionRows[0][0];
+ return is_resource($sessionRows[0][0]) ? stream_get_contents($sessionRows[0][0]) : $sessionRows[0][0];
}
else
{
@@ -18,8 +18,11 @@
abstract class Swift
{
+ static $initialized = false;
+ static $initPath;
+
/** Swift Mailer Version number generated during dist release process */
- const VERSION = '4.1.0-DEV';
+ const VERSION = '4.1.8';
/**
* Internal autoloader for spl_autoload_register().
@@ -29,28 +32,37 @@
public static function autoload($class)
{
//Don't interfere with other autoloaders
- if (0 !== strpos($class, 'Swift'))
+ if (0 !== strpos($class, 'Swift_'))
{
- return false;
+ return;
}
$path = dirname(__FILE__).'/'.str_replace('_', '/', $class).'.php';
if (!file_exists($path))
{
- return false;
+ return;
+ }
+
+ if (self::$initPath && !self::$initialized)
+ {
+ self::$initialized = true;
+ require self::$initPath;
}
- require_once $path;
+ require $path;
}
/**
* Configure autoloading using Swift Mailer.
*
* This is designed to play nicely with other autoloaders.
+ *
+ * @param string $initPath The init script to load when autoloading the first Swift class
*/
- public static function registerAutoload()
+ public static function registerAutoload($initPath = null)
{
+ self::$initPath = $initPath;
spl_autoload_register(array('Swift', 'autoload'));
}
@@ -8,9 +8,6 @@
* file that was distributed with this source code.
*/
-//@require 'Swift/Mime/Attachment.php';
-//@require 'Swift/ByteStream/FileByteStream.php';
-//@require 'Swift/DependencyContainer.php';
/**
* Attachment class for attaching files to a {@link Swift_Mime_Message}.
@@ -8,9 +8,6 @@
* file that was distributed with this source code.
*/
-//@require 'Swift/InputByteStream.php';
-//@require 'Swift/Filterable.php';
-//@require 'Swift/StreamFilter.php';
/**
* Provides the base functionality for an InputStream supporting filters.
@@ -23,7 +20,7 @@
{
/** Write sequence */
- private $_sequence = 0;
+ protected $_sequence = 0;
/** StreamFilters */
private $_filters = array();
@@ -8,8 +8,6 @@
* file that was distributed with this source code.
*/
-//@require 'Swift/InputByteStream.php';
-//@require 'Swift/OutputByteStream.php';
/**
* Allows reading and writing of bytes to and from an array.
Oops, something went wrong.

0 comments on commit 07b3161

Please sign in to comment.