Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed vendor/swift, replace with a proper submodule

  • Loading branch information...
commit 48b2e3a24f7fe07733cec3c8f6b4a8dd6d7e1d86 1 parent fffda8e
@shadowhand shadowhand authored
Showing with 0 additions and 17,112 deletions.
  1. +0 −77 vendor/swift/classes/Swift.php
  2. +0 −85 vendor/swift/classes/Swift/Attachment.php
  3. +0 −188 vendor/swift/classes/Swift/ByteStream/AbstractFilterableInputStream.php
  4. +0 −197 vendor/swift/classes/Swift/ByteStream/ArrayByteStream.php
  5. +0 −187 vendor/swift/classes/Swift/ByteStream/FileByteStream.php
  6. +0 −49 vendor/swift/classes/Swift/CharacterReader.php
  7. +0 −76 vendor/swift/classes/Swift/CharacterReader/GenericFixedWidthReader.php
  8. +0 −64 vendor/swift/classes/Swift/CharacterReader/UsAsciiReader.php
  9. +0 −84 vendor/swift/classes/Swift/CharacterReader/Utf8Reader.php
  10. +0 −39 vendor/swift/classes/Swift/CharacterReaderFactory.php
  11. +0 −129 vendor/swift/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php
  12. +0 −96 vendor/swift/classes/Swift/CharacterStream.php
  13. +0 −329 vendor/swift/classes/Swift/CharacterStream/ArrayCharacterStream.php
  14. +0 −359 vendor/swift/classes/Swift/DependencyContainer.php
  15. +0 −40 vendor/swift/classes/Swift/DependencyException.php
  16. +0 −83 vendor/swift/classes/Swift/EmbeddedFile.php
  17. +0 −42 vendor/swift/classes/Swift/Encoder.php
  18. +0 −73 vendor/swift/classes/Swift/Encoder/Base64Encoder.php
  19. +0 −273 vendor/swift/classes/Swift/Encoder/QpEncoder.php
  20. +0 −100 vendor/swift/classes/Swift/Encoder/Rfc2231Encoder.php
  21. +0 −80 vendor/swift/classes/Swift/Encoding.php
  22. +0 −77 vendor/swift/classes/Swift/Events/CommandEvent.php
  23. +0 −39 vendor/swift/classes/Swift/Events/CommandListener.php
  24. +0 −50 vendor/swift/classes/Swift/Events/Event.php
  25. +0 −91 vendor/swift/classes/Swift/Events/EventDispatcher.php
  26. +0 −30 vendor/swift/classes/Swift/Events/EventListener.php
  27. +0 −76 vendor/swift/classes/Swift/Events/EventObject.php
  28. +0 −75 vendor/swift/classes/Swift/Events/ResponseEvent.php
  29. +0 −39 vendor/swift/classes/Swift/Events/ResponseListener.php
  30. +0 −137 vendor/swift/classes/Swift/Events/SendEvent.php
  31. +0 −45 vendor/swift/classes/Swift/Events/SendListener.php
  32. +0 −185 vendor/swift/classes/Swift/Events/SimpleEventDispatcher.php
  33. +0 −41 vendor/swift/classes/Swift/Events/TransportChangeEvent.php
  34. +0 −63 vendor/swift/classes/Swift/Events/TransportChangeListener.php
  35. +0 −60 vendor/swift/classes/Swift/Events/TransportExceptionEvent.php
  36. +0 −40 vendor/swift/classes/Swift/Events/TransportExceptionListener.php
  37. +0 −58 vendor/swift/classes/Swift/FailoverTransport.php
  38. +0 −38 vendor/swift/classes/Swift/FileStream.php
  39. +0 −44 vendor/swift/classes/Swift/Filterable.php
  40. +0 −72 vendor/swift/classes/Swift/Image.php
  41. +0 −82 vendor/swift/classes/Swift/InputByteStream.php
  42. +0 −40 vendor/swift/classes/Swift/IoException.php
  43. +0 −109 vendor/swift/classes/Swift/KeyCache.php
  44. +0 −219 vendor/swift/classes/Swift/KeyCache/ArrayKeyCache.php
  45. +0 −326 vendor/swift/classes/Swift/KeyCache/DiskKeyCache.php
  46. +0 −63 vendor/swift/classes/Swift/KeyCache/KeyCacheInputStream.php
  47. +0 −120 vendor/swift/classes/Swift/KeyCache/NullKeyCache.php
  48. +0 −141 vendor/swift/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php
  49. +0 −58 vendor/swift/classes/Swift/LoadBalancedTransport.php
  50. +0 −58 vendor/swift/classes/Swift/MailTransport.php
  51. +0 −183 vendor/swift/classes/Swift/Mailer.php
  52. +0 −69 vendor/swift/classes/Swift/Mailer/ArrayRecipientIterator.php
  53. +0 −45 vendor/swift/classes/Swift/Mailer/RecipientIterator.php
  54. +0 −92 vendor/swift/classes/Swift/Message.php
  55. +0 −153 vendor/swift/classes/Swift/Mime/Attachment.php
  56. +0 −36 vendor/swift/classes/Swift/Mime/CharsetObserver.php
  57. +0 −51 vendor/swift/classes/Swift/Mime/ContentEncoder.php
  58. +0 −91 vendor/swift/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php
  59. +0 −185 vendor/swift/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php
  60. +0 −127 vendor/swift/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php
  61. +0 −61 vendor/swift/classes/Swift/Mime/EmbeddedFile.php
  62. +0 −38 vendor/swift/classes/Swift/Mime/EncodingObserver.php
  63. +0 −96 vendor/swift/classes/Swift/Mime/Header.php
  64. +0 −38 vendor/swift/classes/Swift/Mime/HeaderEncoder.php
  65. +0 −46 vendor/swift/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php
  66. +0 −109 vendor/swift/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php
  67. +0 −82 vendor/swift/classes/Swift/Mime/HeaderFactory.php
  68. +0 −180 vendor/swift/classes/Swift/Mime/HeaderSet.php
  69. +0 −594 vendor/swift/classes/Swift/Mime/Headers/AbstractHeader.php
  70. +0 −128 vendor/swift/classes/Swift/Mime/Headers/DateHeader.php
  71. +0 −171 vendor/swift/classes/Swift/Mime/Headers/IdentificationHeader.php
  72. +0 −326 vendor/swift/classes/Swift/Mime/Headers/MailboxHeader.php
  73. +0 −284 vendor/swift/classes/Swift/Mime/Headers/ParameterizedHeader.php
  74. +0 −136 vendor/swift/classes/Swift/Mime/Headers/PathHeader.php
  75. +0 −118 vendor/swift/classes/Swift/Mime/Headers/UnstructuredHeader.php
  76. +0 −240 vendor/swift/classes/Swift/Mime/Message.php
  77. +0 −118 vendor/swift/classes/Swift/Mime/MimeEntity.php
  78. +0 −206 vendor/swift/classes/Swift/Mime/MimePart.php
  79. +0 −45 vendor/swift/classes/Swift/Mime/ParameterizedHeader.php
  80. +0 −197 vendor/swift/classes/Swift/Mime/SimpleHeaderFactory.php
  81. +0 −394 vendor/swift/classes/Swift/Mime/SimpleHeaderSet.php
  82. +0 −607 vendor/swift/classes/Swift/Mime/SimpleMessage.php
  83. +0 −791 vendor/swift/classes/Swift/Mime/SimpleMimeEntity.php
  84. +0 −75 vendor/swift/classes/Swift/MimePart.php
  85. +0 −52 vendor/swift/classes/Swift/OutputByteStream.php
  86. +0 −157 vendor/swift/classes/Swift/Plugins/AntiFloodPlugin.php
  87. +0 −183 vendor/swift/classes/Swift/Plugins/BandwidthMonitorPlugin.php
  88. +0 −46 vendor/swift/classes/Swift/Plugins/Decorator/Replacements.php
  89. +0 −211 vendor/swift/classes/Swift/Plugins/DecoratorPlugin.php
  90. +0 −47 vendor/swift/classes/Swift/Plugins/Logger.php
  91. +0 −170 vendor/swift/classes/Swift/Plugins/LoggerPlugin.php
  92. +0 −83 vendor/swift/classes/Swift/Plugins/Loggers/ArrayLogger.php
  93. +0 −74 vendor/swift/classes/Swift/Plugins/Loggers/EchoLogger.php
  94. +0 −47 vendor/swift/classes/Swift/Plugins/Pop/Pop3Connection.php
  95. +0 −44 vendor/swift/classes/Swift/Plugins/Pop/Pop3Exception.php
  96. +0 −298 vendor/swift/classes/Swift/Plugins/PopBeforeSmtpPlugin.php
  97. +0 −46 vendor/swift/classes/Swift/Plugins/Reporter.php
  98. +0 −92 vendor/swift/classes/Swift/Plugins/ReporterPlugin.php
  99. +0 −73 vendor/swift/classes/Swift/Plugins/Reporters/HitReporter.php
  100. +0 −57 vendor/swift/classes/Swift/Plugins/Reporters/HtmlReporter.php
  101. +0 −37 vendor/swift/classes/Swift/Plugins/Sleeper.php
  102. +0 −198 vendor/swift/classes/Swift/Plugins/ThrottlerPlugin.php
  103. +0 −37 vendor/swift/classes/Swift/Plugins/Timer.php
  104. +0 −86 vendor/swift/classes/Swift/Preferences.php
  105. +0 −38 vendor/swift/classes/Swift/ReplacementFilterFactory.php
  106. +0 −40 vendor/swift/classes/Swift/RfcComplianceException.php
  107. +0 −58 vendor/swift/classes/Swift/SendmailTransport.php
  108. +0 −66 vendor/swift/classes/Swift/SmtpTransport.php
  109. +0 −44 vendor/swift/classes/Swift/StreamFilter.php
  110. +0 −198 vendor/swift/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php
  111. +0 −76 vendor/swift/classes/Swift/StreamFilters/StringReplacementFilter.php
  112. +0 −63 vendor/swift/classes/Swift/StreamFilters/StringReplacementFilterFactory.php
  113. +0 −39 vendor/swift/classes/Swift/SwiftException.php
  114. +0 −70 vendor/swift/classes/Swift/Transport.php
  115. +0 −553 vendor/swift/classes/Swift/Transport/AbstractSmtpTransport.php
  116. +0 −98 vendor/swift/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php
  117. +0 −68 vendor/swift/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php
  118. +0 −67 vendor/swift/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php
  119. +0 −222 vendor/swift/classes/Swift/Transport/Esmtp/AuthHandler.php
  120. +0 −48 vendor/swift/classes/Swift/Transport/Esmtp/Authenticator.php
  121. +0 −92 vendor/swift/classes/Swift/Transport/EsmtpHandler.php
  122. +0 −349 vendor/swift/classes/Swift/Transport/EsmtpTransport.php
  123. +0 −107 vendor/swift/classes/Swift/Transport/FailoverTransport.php
  124. +0 −75 vendor/swift/classes/Swift/Transport/IoBuffer.php
  125. +0 −198 vendor/swift/classes/Swift/Transport/LoadBalancedTransport.php
  126. +0 −46 vendor/swift/classes/Swift/Transport/MailInvoker.php
  127. +0 −252 vendor/swift/classes/Swift/Transport/MailTransport.php
  128. +0 −183 vendor/swift/classes/Swift/Transport/SendmailTransport.php
  129. +0 −58 vendor/swift/classes/Swift/Transport/SimpleMailInvoker.php
  130. +0 −46 vendor/swift/classes/Swift/Transport/SmtpAgent.php
  131. +0 −286 vendor/swift/classes/Swift/Transport/StreamBuffer.php
  132. +0 −41 vendor/swift/classes/Swift/TransportException.php
  133. +0 −25 vendor/swift/dependency_maps/cache_deps.php
  134. +0 −97 vendor/swift/dependency_maps/mime_deps.php
  135. +0 −62 vendor/swift/dependency_maps/transport_deps.php
  136. +0 −82 vendor/swift/mime_types.php
  137. +0 −20 vendor/swift/preferences.php
  138. +0 −34 vendor/swift/swift_init.php
  139. +0 −35 vendor/swift/swift_required.php
View
77 vendor/swift/classes/Swift.php
@@ -1,77 +0,0 @@
-<?php
-
-/*
- General utility class from Swift Mailer.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-/**
- * General utility class in Swift Mailer, not to be instantiated.
- *
- * @package Swift
- *
- * @author Chris Corbyn
- */
-abstract class Swift
-{
-
- /** Swift Mailer Version number generated during dist release process */
- const VERSION = '4.0.4';
-
- /**
- * Internal autoloader for spl_autoload_register().
- *
- * @param string $class
- */
- public static function autoload($class)
- {
- //Don't interfere with other autoloaders
- if (substr($class, 0, strlen(__CLASS__)) != __CLASS__)
- {
- return;
- }
-
- $path = SWIFT_CLASS_DIRECTORY . '/' . str_replace('_', '/', $class) . '.php';
-
- if (file_exists($path))
- {
- require_once $path;
- }
- }
-
- /**
- * Configure autoloading using Swift Mailer.
- *
- * This is designed to play nicely with other autoloaders.
- */
- public static function registerAutoload()
- {
- if (!$callbacks = spl_autoload_functions())
- {
- $callbacks = array();
- }
- foreach ($callbacks as $callback)
- {
- spl_autoload_unregister($callback);
- }
- spl_autoload_register(array('Swift', 'autoload'));
- foreach ($callbacks as $callback)
- {
- spl_autoload_register($callback);
- }
- }
-
-}
View
85 vendor/swift/classes/Swift/Attachment.php
@@ -1,85 +0,0 @@
-<?php
-
-/*
- Attachment wrapper class in Swift Mailer.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@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}.
- * @package Swift
- * @subpackage Mime
- * @author Chris Corbyn
- */
-class Swift_Attachment extends Swift_Mime_Attachment
-{
-
- /**
- * Create a new Attachment.
- * Details may be optionally provided to the constructor.
- * @param string|Swift_OutputByteStream $data
- * @param string $filename
- * @param string $contentType
- */
- public function __construct($data = null, $filename = null,
- $contentType = null)
- {
- call_user_func_array(
- array($this, 'Swift_Mime_Attachment::__construct'),
- Swift_DependencyContainer::getInstance()
- ->createDependenciesFor('mime.attachment')
- );
-
- $this->setBody($data);
- $this->setFilename($filename);
- if ($contentType)
- {
- $this->setContentType($contentType);
- }
- }
-
- /**
- * Create a new Attachment.
- * @param string|Swift_OutputByteStream $data
- * @param string $filename
- * @param string $contentType
- * @return Swift_Mime_Attachment
- */
- public static function newInstance($data = null, $filename = null,
- $contentType = null)
- {
- return new self($data, $filename, $contentType);
- }
-
- /**
- * Create a new Attachment from a filesystem path.
- * @param string $path
- * @param string $contentType optional
- * @return Swift_Mime_Attachment
- */
- public static function fromPath($path, $contentType = null)
- {
- return self::newInstance()->setFile(
- new Swift_ByteStream_FileByteStream($path),
- $contentType
- );
- }
-
-}
View
188 vendor/swift/classes/Swift/ByteStream/AbstractFilterableInputStream.php
@@ -1,188 +0,0 @@
-<?php
-
-/*
- Bi-Directional FileStream in Swift Mailer.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@require 'Swift/InputByteStream.php';
-//@require 'Swift/Filterable.php';
-//@require 'Swift/StreamFilter.php';
-
-/**
- * Provides the base functionality for an InputStream supporting filters.
- * @package Swift
- * @subpackage ByteStream
- * @author Chris Corbyn
- */
-abstract class Swift_ByteStream_AbstractFilterableInputStream
- implements Swift_InputByteStream, Swift_Filterable
-{
-
- /** Write sequence */
- private $_sequence = 0;
-
- /** StreamFilters */
- private $_filters = array();
-
- /** A buffer for writing */
- private $_writeBuffer = '';
-
- /** Bound streams */
- private $_mirrors = array();
-
- /**
- * Commit the given bytes to the storage medium immediately.
- * @param string $bytes
- * @access protected
- */
- abstract protected function _commit($bytes);
-
- /**
- * Flush any buffers/content with immediate effect.
- * @access protected
- */
- abstract protected function _flush();
-
- /**
- * Add a StreamFilter to this InputByteStream.
- * @param Swift_StreamFilter $filter
- * @param string $key
- */
- public function addFilter(Swift_StreamFilter $filter, $key)
- {
- $this->_filters[$key] = $filter;
- }
-
- /**
- * Remove an already present StreamFilter based on its $key.
- * @param string $key
- */
- public function removeFilter($key)
- {
- unset($this->_filters[$key]);
- }
-
- /**
- * Writes $bytes to the end of the stream.
- * @param string $bytes
- * @throws Swift_IoException
- */
- public function write($bytes)
- {
- $this->_writeBuffer .= $bytes;
- foreach ($this->_filters as $filter)
- {
- if ($filter->shouldBuffer($this->_writeBuffer))
- {
- return;
- }
- }
- $this->_doWrite($this->_writeBuffer);
- return ++$this->_sequence;
- }
-
- /**
- * For any bytes that are currently buffered inside the stream, force them
- * off the buffer.
- *
- * @throws Swift_IoException
- */
- public function commit()
- {
- $this->_doWrite($this->_writeBuffer);
- }
-
- /**
- * Attach $is to this stream.
- * The stream acts as an observer, receiving all data that is written.
- * All {@link write()} and {@link flushBuffers()} operations will be mirrored.
- *
- * @param Swift_InputByteStream $is
- */
- public function bind(Swift_InputByteStream $is)
- {
- $this->_mirrors[] = $is;
- }
-
- /**
- * Remove an already bound stream.
- * If $is is not bound, no errors will be raised.
- * If the stream currently has any buffered data it will be written to $is
- * before unbinding occurs.
- *
- * @param Swift_InputByteStream $is
- */
- public function unbind(Swift_InputByteStream $is)
- {
- foreach ($this->_mirrors as $k => $stream)
- {
- if ($is === $stream)
- {
- if ($this->_writeBuffer !== '')
- {
- $stream->write($this->_filter($this->_writeBuffer));
- }
- unset($this->_mirrors[$k]);
- }
- }
- }
-
- /**
- * Flush the contents of the stream (empty it) and set the internal pointer
- * to the beginning.
- * @throws Swift_IoException
- */
- public function flushBuffers()
- {
- if ($this->_writeBuffer !== '')
- {
- $this->_doWrite($this->_writeBuffer);
- }
- $this->_flush();
-
- foreach ($this->_mirrors as $stream)
- {
- $stream->flushBuffers();
- }
- }
-
- // -- Private methods
-
- /** Run $bytes through all filters */
- private function _filter($bytes)
- {
- foreach ($this->_filters as $filter)
- {
- $bytes = $filter->filter($bytes);
- }
- return $bytes;
- }
-
- /** Just write the bytes to the stream */
- private function _doWrite($bytes)
- {
- $this->_commit($this->_filter($bytes));
-
- foreach ($this->_mirrors as $stream)
- {
- $stream->write($bytes);
- }
-
- $this->_writeBuffer = '';
- }
-
-}
View
197 vendor/swift/classes/Swift/ByteStream/ArrayByteStream.php
@@ -1,197 +0,0 @@
-<?php
-
-/*
- Bi-Directional ByteStream using an array in Swift Mailer.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@require 'Swift/InputByteStream.php';
-//@require 'Swift/OutputByteStream.php';
-
-/**
- * Allows reading and writing of bytes to and from an array.
- * @package Swift
- * @subpackage ByteStream
- * @author Chris Corbyn
- */
-class Swift_ByteStream_ArrayByteStream
- implements Swift_InputByteStream, Swift_OutputByteStream
-{
-
- /**
- * The internal stack of bytes.
- * @var string[]
- * @access private
- */
- private $_array = array();
-
- /**
- * The size of the stack
- * @var int
- * @access private
- */
- private $_arraySize = 0;
-
- /**
- * The internal pointer offset.
- * @var int
- * @access private
- */
- private $_offset = 0;
-
- /** Bound streams */
- private $_mirrors = array();
-
- /**
- * Create a new ArrayByteStream.
- * If $stack is given the stream will be populated with the bytes it contains.
- * @param mixed $stack of bytes in string or array form, optional
- */
- public function __construct($stack = null)
- {
- if (is_array($stack))
- {
- $this->_array = $stack;
- $this->_arraySize = count($stack);
- }
- elseif (is_string($stack))
- {
- $this->write($stack);
- }
- else
- {
- $this->_array = array();
- }
- }
-
- /**
- * Reads $length bytes from the stream into a string and moves the pointer
- * through the stream by $length. If less bytes exist than are requested the
- * remaining bytes are given instead. If no bytes are remaining at all, boolean
- * false is returned.
- * @param int $length
- * @return string
- */
- public function read($length)
- {
- if ($this->_offset == $this->_arraySize)
- {
- return false;
- }
-
- // Don't use array slice
- $end = $length + $this->_offset;
- $end = $this->_arraySize<$end
- ?$this->_arraySize
- :$end;
- $ret = '';
- for (; $this->_offset < $end; ++$this->_offset)
- {
- $ret .= $this->_array[$this->_offset];
- }
- return $ret;
- }
-
- /**
- * Writes $bytes to the end of the stream.
- * @param string $bytes
- */
- public function write($bytes)
- {
- $to_add = str_split($bytes);
- array_unshift($to_add, &$this->_array);
- $this->_arraySize = call_user_func_array('array_push', $to_add);
-
- foreach ($this->_mirrors as $stream)
- {
- $stream->write($bytes);
- }
- }
-
- /**
- * Not used.
- */
- public function commit()
- {
- }
-
- /**
- * Attach $is to this stream.
- * The stream acts as an observer, receiving all data that is written.
- * All {@link write()} and {@link flushBuffers()} operations will be mirrored.
- *
- * @param Swift_InputByteStream $is
- */
- public function bind(Swift_InputByteStream $is)
- {
- $this->_mirrors[] = $is;
- }
-
- /**
- * Remove an already bound stream.
- * If $is is not bound, no errors will be raised.
- * If the stream currently has any buffered data it will be written to $is
- * before unbinding occurs.
- *
- * @param Swift_InputByteStream $is
- */
- public function unbind(Swift_InputByteStream $is)
- {
- foreach ($this->_mirrors as $k => $stream)
- {
- if ($is === $stream)
- {
- unset($this->_mirrors[$k]);
- }
- }
- }
-
- /**
- * Move the internal read pointer to $byteOffset in the stream.
- * @param int $byteOffset
- * @return boolean
- */
- public function setReadPointer($byteOffset)
- {
- if ($byteOffset > $this->_arraySize)
- {
- $byteOffset = $this->_arraySize;
- }
- elseif ($byteOffset < 0)
- {
- $byteOffset = 0;
- }
-
- $this->_offset = $byteOffset;
- }
-
- /**
- * Flush the contents of the stream (empty it) and set the internal pointer
- * to the beginning.
- */
- public function flushBuffers()
- {
- $this->_offset = 0;
- $this->_array = array();
- $this->_arraySize = 0;
-
- foreach ($this->_mirrors as $stream)
- {
- $stream->flushBuffers();
- }
- }
-
-}
View
187 vendor/swift/classes/Swift/ByteStream/FileByteStream.php
@@ -1,187 +0,0 @@
-<?php
-
-/*
- Bi-Directional FileStream in Swift Mailer.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@require 'Swift/ByteStream/AbstractFilterableInputStream.php';
-//@require 'Swift/InputByteStream.php';
-//@require 'Swift/FileStream.php';
-//@require 'Swift/IoException.php';
-
-/**
- * Allows reading and writing of bytes to and from a file.
- * @package Swift
- * @subpackage ByteStream
- * @author Chris Corbyn
- */
-class Swift_ByteStream_FileByteStream
- extends Swift_ByteStream_AbstractFilterableInputStream
- implements Swift_FileStream
-{
-
- /** The internal pointer offset */
- private $_offset = 0;
-
- /** The path to the file */
- private $_path;
-
- /** The mode this file is opened in for writing */
- private $_mode;
-
- /** A lazy-loaded resource handle for reading the file */
- private $_reader;
-
- /** A lazy-loaded resource handle for writing the file */
- private $_writer;
-
- /** If magic_quotes_runtime is on, this will be true */
- private $_quotes = false;
-
- /**
- * Create a new FileByteStream for $path.
- * @param string $path
- * @param string $writable if true
- */
- public function __construct($path, $writable = false)
- {
- $this->_path = $path;
- $this->_mode = $writable ? 'w+b' : 'rb';
- $this->_quotes = get_magic_quotes_runtime();
- }
-
- /**
- * Get the complete path to the file.
- * @return string
- */
- public function getPath()
- {
- return $this->_path;
- }
-
- /**
- * Reads $length bytes from the stream into a string and moves the pointer
- * through the stream by $length. If less bytes exist than are requested the
- * remaining bytes are given instead. If no bytes are remaining at all, boolean
- * false is returned.
- * @param int $length
- * @return string
- * @throws Swift_IoException
- */
- public function read($length)
- {
- $fp = $this->_getReadHandle();
- if (!feof($fp))
- {
- if ($this->_quotes)
- {
- set_magic_quotes_runtime(0);
- }
- $bytes = fread($fp, $length);
- if ($this->_quotes)
- {
- set_magic_quotes_runtime(1);
- }
- $this->_offset = ftell($fp);
- return $bytes;
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Move the internal read pointer to $byteOffset in the stream.
- * @param int $byteOffset
- * @return boolean
- */
- public function setReadPointer($byteOffset)
- {
- if (isset($this->_reader))
- {
- fseek($this->_reader, $byteOffset, SEEK_SET);
- }
- $this->_offset = $byteOffset;
- }
-
- // -- Private methods
-
- /** Just write the bytes to the file */
- protected function _commit($bytes)
- {
- fwrite($this->_getWriteHandle(), $bytes);
- $this->_resetReadHandle();
- }
-
- /** Not used */
- protected function _flush()
- {
- }
-
- /** Get the resource for reading */
- private function _getReadHandle()
- {
- if (!isset($this->_reader))
- {
- if (!$this->_reader = fopen($this->_path, 'rb'))
- {
- throw new Swift_IoException(
- 'Unable to open file for reading [' . $this->_path . ']'
- );
- }
- fseek($this->_reader, $this->_offset, SEEK_SET);
- }
- return $this->_reader;
- }
-
- /** Get the resource for writing */
- private function _getWriteHandle()
- {
- if (!isset($this->_writer))
- {
- if (!$this->_writer = fopen($this->_path, $this->_mode))
- {
- throw new Swift_IoException(
- 'Unable to open file for writing [' . $this->_path . ']'
- );
- }
- }
- return $this->_writer;
- }
-
- /** Force a reload of the resource for writing */
- private function _resetWriteHandle()
- {
- if (isset($this->_writer))
- {
- fclose($this->_writer);
- $this->_writer = null;
- }
- }
-
- /** Force a reload of the resource for reading */
- private function _resetReadHandle()
- {
- if (isset($this->_reader))
- {
- fclose($this->_reader);
- $this->_reader = null;
- }
- }
-
-}
View
49 vendor/swift/classes/Swift/CharacterReader.php
@@ -1,49 +0,0 @@
-<?php
-
-/*
- Analyzes characters for a specific character set.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-/**
- * Analyzes characters for a specific character set.
- * @package Swift
- * @subpackage Encoder
- * @author Chris Corbyn
- */
-interface Swift_CharacterReader
-{
-
- /**
- * Returns an integer which specifies how many more bytes to read.
- * A positive integer indicates the number of more bytes to fetch before invoking
- * this method again.
- * A value of zero means this is already a valid character.
- * A value of -1 means this cannot possibly be a valid character.
- * @param int[] $bytes
- * @return int
- */
- public function validateByteSequence($bytes, $size);
-
- /**
- * Returns the number of bytes which should be read to start each character.
- * For fixed width character sets this should be the number of
- * octets-per-character. For multibyte character sets this will probably be 1.
- * @return int
- */
- public function getInitialByteSize();
-
-}
View
76 vendor/swift/classes/Swift/CharacterReader/GenericFixedWidthReader.php
@@ -1,76 +0,0 @@
-<?php
-
-/*
- Provides fixed-width byte sizes for reading fixed-width character sets.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@require 'Swift/CharacterReader.php';
-
-/**
- * Provides fixed-width byte sizes for reading fixed-width character sets.
- * @package Swift
- * @subpackage Encoder
- * @author Chris Corbyn
- */
-class Swift_CharacterReader_GenericFixedWidthReader
- implements Swift_CharacterReader
-{
-
- /**
- * The number of bytes in a single character.
- * @var int
- * @access private
- */
- private $_width;
-
- /**
- * Creates a new GenericFixedWidthReader using $width bytes per character.
- * @param int $width
- */
- public function __construct($width)
- {
- $this->_width = $width;
- }
-
- /**
- * Returns an integer which specifies how many more bytes to read.
- * A positive integer indicates the number of more bytes to fetch before invoking
- * this method again.
- * A value of zero means this is already a valid character.
- * A value of -1 means this cannot possibly be a valid character.
- * @param string $bytes
- * @return int
- */
- public function validateByteSequence($bytes, $size)
- {
- $needed = $this->_width - $size;
- return ($needed > -1)
- ? $needed
- : -1
- ;
- }
-
- /**
- * Returns the number of bytes which should be read to start each character.
- * @return int
- */
- public function getInitialByteSize()
- {
- return $this->_width;
- }
-
-}
View
64 vendor/swift/classes/Swift/CharacterReader/UsAsciiReader.php
@@ -1,64 +0,0 @@
-<?php
-
-/*
- Analyzes US-ASCII characters.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@require 'Swift/CharacterReader.php';
-
-/**
- * Analyzes US-ASCII characters.
- * @package Swift
- * @subpackage Encoder
- * @author Chris Corbyn
- */
-class Swift_CharacterReader_UsAsciiReader
- implements Swift_CharacterReader
-{
-
- /**
- * Returns an integer which specifies how many more bytes to read.
- * A positive integer indicates the number of more bytes to fetch before invoking
- * this method again.
- * A value of zero means this is already a valid character.
- * A value of -1 means this cannot possibly be a valid character.
- * @param string $bytes
- * @return int
- */
- public function validateByteSequence($bytes, $size)
- {
- $byte = reset($bytes);
- if (1 == count($bytes) && $byte >= 0x00 && $byte <= 0x7F)
- {
- return 0;
- }
- else
- {
- return -1;
- }
- }
-
- /**
- * Returns the number of bytes which should be read to start each character.
- * @return int
- */
- public function getInitialByteSize()
- {
- return 1;
- }
-
-}
View
84 vendor/swift/classes/Swift/CharacterReader/Utf8Reader.php
@@ -1,84 +0,0 @@
-<?php
-
-/*
- Analyzes UTF-8 characters.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@require 'Swift/CharacterReader.php';
-
-/**
- * Analyzes UTF-8 characters.
- * @package Swift
- * @subpackage Encoder
- * @author Chris Corbyn
- */
-class Swift_CharacterReader_Utf8Reader
- implements Swift_CharacterReader
-{
-
- /** Pre-computed for optimization */
- private static $length_map=array(
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x0N
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x1N
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x2N
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x3N
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x4N
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x5N
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x6N
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, //0x7N
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //0x8N
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //0x9N
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //0xAN
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //0xBN
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, //0xCN
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, //0xDN
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, //0xEN
- 4,4,4,4,4,4,4,4,5,5,5,5,6,6,0,0 //0xFN
- );
-
-
- /**
- * Returns an integer which specifies how many more bytes to read.
- * A positive integer indicates the number of more bytes to fetch before invoking
- * this method again.
- * A value of zero means this is already a valid character.
- * A value of -1 means this cannot possibly be a valid character.
- * @param string $bytes
- * @return int
- */
- public function validateByteSequence($bytes, $size)
- {
- if ($size<1){
- return -1;
- }
- $needed = self::$length_map[$bytes[0]] - $size;
- return ($needed > -1)
- ? $needed
- : -1
- ;
- }
-
- /**
- * Returns the number of bytes which should be read to start each character.
- * @return int
- */
- public function getInitialByteSize()
- {
- return 1;
- }
-
-}
View
39 vendor/swift/classes/Swift/CharacterReaderFactory.php
@@ -1,39 +0,0 @@
-<?php
-
-/*
- A factory for creating CharacterReaders.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@require 'Swift/CharacterReader.php';
-
-/**
- * A factory for creating CharacterReaders.
- * @package Swift
- * @subpackage Encoder
- * @author Chris Corbyn
- */
-interface Swift_CharacterReaderFactory
-{
-
- /**
- * Returns a CharacterReader suitable for the charset applied.
- * @param string $charset
- * @return Swift_CharacterReader
- */
- public function getReaderFor($charset);
-
-}
View
129 vendor/swift/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php
@@ -1,129 +0,0 @@
-<?php
-
-/*
- The standard factory for creating CharacterReaders in Swift Mailer.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@require 'Swift/CharacterReaderFactory.php';
-
-/**
- * Standard factory for creating CharacterReaders.
- * @package Swift
- * @subpackage Encoder
- * @author Chris Corbyn
- */
-class Swift_CharacterReaderFactory_SimpleCharacterReaderFactory
- implements Swift_CharacterReaderFactory
-{
-
- /**
- * A map of charset patterns to their implementation classes.
- * @var array
- * @access private
- */
- private $_map = array();
-
- /**
- * Factories which have already been loaded.
- * @var Swift_CharacterReaderFactory[]
- * @access private
- */
- private $_loaded = array();
-
- /**
- * Creates a new CharacterReaderFactory.
- */
- public function __construct()
- {
- $prefix = 'Swift_CharacterReader_';
-
- $singleByte = array(
- 'class' => $prefix . 'GenericFixedWidthReader',
- 'constructor' => array(1)
- );
-
- $doubleByte = array(
- 'class' => $prefix . 'GenericFixedWidthReader',
- 'constructor' => array(2)
- );
-
- $fourBytes = array(
- 'class' => $prefix . 'GenericFixedWidthReader',
- 'constructor' => array(4)
- );
-
- //Utf-8
- $this->_map['utf-?8'] = array(
- 'class' => $prefix . 'Utf8Reader',
- 'constructor' => array()
- );
-
- //7-8 bit charsets
- $this->_map['(us-)?ascii'] = $singleByte;
- $this->_map['(iso|iec)-?8859-?[0-9]+'] = $singleByte;
- $this->_map['windows-?125[0-9]'] = $singleByte;
- $this->_map['cp-?[0-9]+'] = $singleByte;
- $this->_map['ansi'] = $singleByte;
- $this->_map['macintosh'] = $singleByte;
- $this->_map['koi-?7'] = $singleByte;
- $this->_map['koi-?8-?.+'] = $singleByte;
- $this->_map['mik'] = $singleByte;
- $this->_map['(cork|t1)'] = $singleByte;
- $this->_map['v?iscii'] = $singleByte;
-
- //16 bits
- $this->_map['(ucs-?2|utf-?16)'] = $doubleByte;
-
- //32 bits
- $this->_map['(ucs-?4|utf-?32)'] = $fourBytes;
-
- //Fallback
- $this->_map['.*'] = $singleByte;
- }
-
- /**
- * Returns a CharacterReader suitable for the charset applied.
- * @param string $charset
- * @return Swift_CharacterReader
- */
- public function getReaderFor($charset)
- {
- $charset = trim(strtolower($charset));
- foreach ($this->_map as $pattern => $spec)
- {
- $re = '/^' . $pattern . '$/D';
- if (preg_match($re, $charset))
- {
- if (!array_key_exists($pattern, $this->_loaded))
- {
- $reflector = new ReflectionClass($spec['class']);
- if ($reflector->getConstructor())
- {
- $reader = $reflector->newInstanceArgs($spec['constructor']);
- }
- else
- {
- $reader = $reflector->newInstance();
- }
- $this->_loaded[$pattern] = $reader;
- }
- return $this->_loaded[$pattern];
- }
- }
- }
-
-}
View
96 vendor/swift/classes/Swift/CharacterStream.php
@@ -1,96 +0,0 @@
-<?php
-
-/*
- Bi-Directional CharacterStream in Swift Mailer.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-require_once dirname(__FILE__) . '/OutputByteStream.php';
-require_once dirname(__FILE__) . '/CharacterReaderFactory.php';
-
-
-/**
- * An abstract means of reading and writing data in terms of characters as opposed
- * to bytes.
- * Classes implementing this interface may use a subsystem which requires less
- * memory than working with large strings of data.
- * @package Swift
- * @subpackage CharacterStream
- * @author Chris Corbyn
- */
-interface Swift_CharacterStream
-{
-
- /**
- * Set the character set used in this CharacterStream.
- * @param string $charset
- */
- public function setCharacterSet($charset);
-
- /**
- * Set the CharacterReaderFactory for multi charset support.
- * @param Swift_CharacterReaderFactory $factory
- */
- public function setCharacterReaderFactory(
- Swift_CharacterReaderFactory $factory);
-
- /**
- * Overwrite this character stream using the byte sequence in the byte stream.
- * @param Swift_OutputByteStream $os output stream to read from
- */
- public function importByteStream(Swift_OutputByteStream $os);
-
- /**
- * Import a string a bytes into this CharacterStream, overwriting any existing
- * data in the stream.
- * @param string $string
- */
- public function importString($string);
-
- /**
- * Read $length characters from the stream and move the internal pointer
- * $length further into the stream.
- * @param int $length
- * @return string
- */
- public function read($length);
-
- /**
- * Read $length characters from the stream and return a 1-dimensional array
- * containing there octet values.
- * @param int $length
- * @return int[]
- */
- public function readBytes($length);
-
- /**
- * Write $chars to the end of the stream.
- * @param string $chars
- */
- public function write($chars);
-
- /**
- * Move the internal pointer to $charOffset in the stream.
- * @param int $charOffset
- */
- public function setPointer($charOffset);
-
- /**
- * Empty the stream and reset the internal pointer.
- */
- public function flushContents();
-
-}
View
329 vendor/swift/classes/Swift/CharacterStream/ArrayCharacterStream.php
@@ -1,329 +0,0 @@
-<?php
-
-/*
- CharacterStream implementation using an array in Swift Mailer.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@require 'Swift/CharacterStream.php';
-//@require 'Swift/OutputByteStream.php';
-
-
-/**
- * A CharacterStream implementation which stores characters in an internal array.
- * @package Swift
- * @subpackage CharacterStream
- * @author Chris Corbyn
- */
-class Swift_CharacterStream_ArrayCharacterStream
- implements Swift_CharacterStream
-{
-
- /** A map of byte values and their respective characters */
- private static $_charMap;
-
- /** A map of characters and their derivative byte values */
- private static $_byteMap;
-
- /** The char reader (lazy-loaded) for the current charset */
- private $_charReader;
-
- /** A factory for creatiing CharacterReader instances */
- private $_charReaderFactory;
-
- /** The character set this stream is using */
- private $_charset;
-
- /** Array of characters */
- private $_array = array();
-
- /** Size of the array of character */
- private $_array_size = array();
-
- /** The current character offset in the stream */
- private $_offset = 0;
-
- /**
- * Create a new CharacterStream with the given $chars, if set.
- * @param Swift_CharacterReaderFactory $factory for loading validators
- * @param string $charset used in the stream
- */
- public function __construct(Swift_CharacterReaderFactory $factory,
- $charset)
- {
- self::_initializeMaps();
- $this->setCharacterReaderFactory($factory);
- $this->setCharacterSet($charset);
- }
-
- /**
- * Set the character set used in this CharacterStream.
- * @param string $charset
- */
- public function setCharacterSet($charset)
- {
- $this->_charset = $charset;
- $this->_charReader = null;
- }
-
- /**
- * Set the CharacterReaderFactory for multi charset support.
- * @param Swift_CharacterReaderFactory $factory
- */
- public function setCharacterReaderFactory(
- Swift_CharacterReaderFactory $factory)
- {
- $this->_charReaderFactory = $factory;
- }
-
- /**
- * Overwrite this character stream using the byte sequence in the byte stream.
- * @param Swift_OutputByteStream $os output stream to read from
- */
- public function importByteStream(Swift_OutputByteStream $os)
- {
- if (!isset($this->_charReader))
- {
- $this->_charReader = $this->_charReaderFactory
- ->getReaderFor($this->_charset);
- }
-
- $startLength = $this->_charReader->getInitialByteSize();
- while (false !== $bytes = $os->read($startLength))
- {
- $c = array();
- for ($i = 0, $len = strlen($bytes); $i < $len; ++$i)
- {
- $c[] = self::$_byteMap[$bytes[$i]];
- }
- $size = count($c);
- $need = $this->_charReader
- ->validateByteSequence($c, $size);
- if ($need > 0 &&
- false !== $bytes = $os->read($need))
- {
- for ($i = 0, $len = strlen($bytes); $i < $len; ++$i)
- {
- $c[] = self::$_byteMap[$bytes[$i]];
- }
- }
- $this->_array[] = $c;
- ++$this->_array_size;
- }
- }
-
- /**
- * Import a string a bytes into this CharacterStream, overwriting any existing
- * data in the stream.
- * @param string $string
- */
- public function importString($string)
- {
- $this->flushContents();
- $this->write($string);
- }
-
- /**
- * Read $length characters from the stream and move the internal pointer
- * $length further into the stream.
- * @param int $length
- * @return string
- */
- public function read($length)
- {
- if ($this->_offset == $this->_array_size)
- {
- return false;
- }
-
- // Don't use array slice
- $arrays = array();
- $end = $length + $this->_offset;
- for ($i = $this->_offset; $i < $end; ++$i)
- {
- if (!isset($this->_array[$i]))
- {
- break;
- }
- $arrays[] = $this->_array[$i];
- }
- $this->_offset += $i - $this->_offset; // Limit function calls
- $chars = false;
- foreach ($arrays as $array)
- {
- $chars .= implode('', array_map('chr', $array));
- }
- return $chars;
- }
-
- /**
- * Read $length characters from the stream and return a 1-dimensional array
- * containing there octet values.
- * @param int $length
- * @return int[]
- */
- public function readBytes($length)
- {
- if ($this->_offset == $this->_array_size)
- {
- return false;
- }
- $arrays = array();
- $end = $length + $this->_offset;
- for ($i = $this->_offset; $i < $end; ++$i)
- {
- if (!isset($this->_array[$i]))
- {
- break;
- }
- $arrays[] = $this->_array[$i];
- }
- $this->_offset += ($i - $this->_offset); // Limit function calls
- return call_user_func_array('array_merge', $arrays);
- }
-
- /**
- * Write $chars to the end of the stream.
- * @param string $chars
- */
- public function write($chars)
- {
- if (!isset($this->_charReader))
- {
- $this->_charReader = $this->_charReaderFactory->getReaderFor(
- $this->_charset);
- }
-
- $startLength = $this->_charReader->getInitialByteSize();
-
- $fp = fopen('php://memory', 'w+b');
- fwrite($fp, $chars);
- unset($chars);
- fseek($fp, 0, SEEK_SET);
-
- $buffer = array(0);
- $buf_pos = 1;
- $buf_len = 1;
- $has_datas = true;
- do
- {
- $bytes = array();
- // Buffer Filing
- if ($buf_len - $buf_pos < $startLength)
- {
- $buf = array_splice($buffer, $buf_pos);
- $new = $this->_reloadBuffer($fp, 100);
- if ($new)
- {
- $buffer = array_merge($buf, $new);
- $buf_len = count($buffer);
- $buf_pos = 0;
- }
- else
- {
- $has_datas = false;
- }
- }
- if ($buf_len - $buf_pos > 0)
- {
- $size = 0;
- for ($i = 0; $i < $startLength && isset($buffer[$buf_pos]); ++$i)
- {
- ++$size;
- $bytes[] = $buffer[$buf_pos++];
- }
- $need = $this->_charReader->validateByteSequence(
- $bytes, $size);
- if ($need > 0)
- {
- if ($buf_len - $buf_pos < $need)
- {
- $new = $this->_reloadBuffer($fp, $need);
-
- if ($new)
- {
- $buffer = array_merge($buffer, $new);
- $buf_len = count($buffer);
- }
- }
- for ($i = 0; $i < $need && isset($buffer[$buf_pos]); ++$i)
- {
- $bytes[] = $buffer[$buf_pos++];
- }
- }
- $this->_array[] = $bytes;
- ++$this->_array_size;
- }
- }
- while ($has_datas);
-
- fclose($fp);
- }
-
- /**
- * Move the internal pointer to $charOffset in the stream.
- * @param int $charOffset
- */
- public function setPointer($charOffset)
- {
- if ($charOffset > $this->_array_size)
- {
- $charOffset = $this->_array_size;
- }
- elseif ($charOffset < 0)
- {
- $charOffset = 0;
- }
- $this->_offset = $charOffset;
- }
-
- /**
- * Empty the stream and reset the internal pointer.
- */
- public function flushContents()
- {
- $this->_offset = 0;
- $this->_array = array();
- $this->_array_size = 0;
- }
-
- private function _reloadBuffer($fp, $len)
- {
- if (!feof($fp) && ($bytes = fread($fp, $len)) !== false)
- {
- $buf = array();
- for ($i = 0, $len = strlen($bytes); $i < $len; ++$i)
- {
- $buf[] = self::$_byteMap[$bytes[$i]];
- }
- return $buf;
- }
- return false;
- }
-
- private static function _initializeMaps()
- {
- if (!isset(self::$_charMap))
- {
- self::$_charMap = array();
- for ($byte = 0; $byte < 256; ++$byte)
- {
- self::$_charMap[$byte] = chr($byte);
- }
- self::$_byteMap = array_flip(self::$_charMap);
- }
- }
-}
View
359 vendor/swift/classes/Swift/DependencyContainer.php
@@ -1,359 +0,0 @@
-<?php
-
-/*
- Dependency Injection container class Swift Mailer.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@require 'Swift/DependencyException.php';
-
-/**
- * Dependency Injection container.
- * @package Swift
- * @author Chris Corbyn
- */
-class Swift_DependencyContainer
-{
-
- /** Constant for literal value types */
- const TYPE_VALUE = 0x0001;
-
- /** Constant for new instance types */
- const TYPE_INSTANCE = 0x0010;
-
- /** Constant for shared instance types */
- const TYPE_SHARED = 0x0100;
-
- /** Constant for aliases */
- const TYPE_ALIAS = 0x1000;
-
- /** Singleton instance */
- private static $_instance = null;
-
- /** The data container */
- private $_store = array();
-
- /** The current endpoint in the data container */
- private $_endPoint;
-
- /**
- * Constructor should not be used.
- * Use {@link getInstance()} instead.
- */
- public function __construct() { }
-
- /**
- * Returns a singleton of the DependencyContainer.
- * @return Swift_DependencyContainer
- */
- public static function getInstance()
- {
- if (!isset(self::$_instance))
- {
- self::$_instance = new self();
- }
- return self::$_instance;
- }
-
- /**
- * List the names of all items stored in the Container.
- * @return array
- */
- public function listItems()
- {
- return array_keys($this->_store);
- }
-
- /**
- * Test if an item is registered in this container with the given name.
- * @param string $itemName
- * @return boolean
- * @see register()
- */
- public function has($itemName)
- {
- return array_key_exists($itemName, $this->_store)
- && isset($this->_store[$itemName]['lookupType']);
- }
-
- /**
- * Lookup the item with the given $itemName.
- * @param string $itemName
- * @return mixed
- * @throws Swift_DependencyException If the dependency is not found
- * @see register()
- */
- public function lookup($itemName)
- {
- if (!$this->has($itemName))
- {
- throw new Swift_DependencyException(
- 'Cannot lookup dependency "' . $itemName . '" since it is not registered.'
- );
- }
-
- switch ($this->_store[$itemName]['lookupType'])
- {
- case self::TYPE_ALIAS:
- return $this->_createAlias($itemName);
- case self::TYPE_VALUE:
- return $this->_getValue($itemName);
- case self::TYPE_INSTANCE:
- return $this->_createNewInstance($itemName);
- case self::TYPE_SHARED:
- return $this->_createSharedInstance($itemName);
- }
- }
-
- /**
- * Create an array of arguments passed to the constructor of $itemName.
- * @param string $itemName
- * @return array
- */
- public function createDependenciesFor($itemName)
- {
- $args = array();
- if (isset($this->_store[$itemName]['args']))
- {
- $args = $this->_resolveArgs($this->_store[$itemName]['args']);
- }
- return $args;
- }
-
- /**
- * Register a new dependency with $itemName.
- * This method returns the current DependencyContainer instance because it
- * requires the use of the fluid interface to set the specific details for the
- * dependency.
- *
- * @param string $itemName
- * @return Swift_DependencyContainer
- * @see asNewInstanceOf(), asSharedInstanceOf(), asValue()
- */
- public function register($itemName)
- {
- $this->_store[$itemName] = array();
- $this->_endPoint =& $this->_store[$itemName];
- return $this;
- }
-
- /**
- * Specify the previously registered item as a literal value.
- * {@link register()} must be called before this will work.
- *
- * @param mixed $value
- * @return Swift_DependencyContainer
- */
- public function asValue($value)
- {
- $endPoint =& $this->_getEndPoint();
- $endPoint['lookupType'] = self::TYPE_VALUE;
- $endPoint['value'] = $value;
- return $this;
- }
-
- /**
- * Specify the previously registered item as an alias of another item.
- * @param string $lookup
- * @return Swift_DependencyContainer
- */
- public function asAliasOf($lookup)
- {
- $endPoint =& $this->_getEndPoint();
- $endPoint['lookupType'] = self::TYPE_ALIAS;
- $endPoint['ref'] = $lookup;
- return $this;
- }
-
- /**
- * Specify the previously registered item as a new instance of $className.
- * {@link register()} must be called before this will work.
- * Any arguments can be set with {@link withDependencies()},
- * {@link addConstructorValue()} or {@link addConstructorLookup()}.
- *
- * @param string $className
- * @return Swift_DependencyContainer
- * @see withDependencies(), addConstructorValue(), addConstructorLookup()
- */
- public function asNewInstanceOf($className)
- {
- $endPoint =& $this->_getEndPoint();
- $endPoint['lookupType'] = self::TYPE_INSTANCE;
- $endPoint['className'] = $className;
- return $this;
- }
-
- /**
- * Specify the previously registered item as a shared instance of $className.
- * {@link register()} must be called before this will work.
- * @param string $className
- * @return Swift_DependencyContainer
- */
- public function asSharedInstanceOf($className)
- {
- $endPoint =& $this->_getEndPoint();
- $endPoint['lookupType'] = self::TYPE_SHARED;
- $endPoint['className'] = $className;
- return $this;
- }
-
- /**
- * Specify a list of injected dependencies for the previously registered item.
- * This method takes an array of lookup names.
- *
- * @param array $lookups
- * @return Swift_DependencyContainer
- * @see addConstructorValue(), addConstructorLookup()
- */
- public function withDependencies(array $lookups)
- {
- $endPoint =& $this->_getEndPoint();
- $endPoint['args'] = array();
- foreach ($lookups as $lookup)
- {
- $this->addConstructorLookup($lookup);
- }
- return $this;
- }
-
- /**
- * Specify a literal (non looked up) value for the constructor of the
- * previously registered item.
- *
- * @param mixed $value
- * @return Swift_DependencyContainer
- * @see withDependencies(), addConstructorLookup()
- */
- public function addConstructorValue($value)
- {
- $endPoint =& $this->_getEndPoint();
- if (!isset($endPoint['args']))
- {
- $endPoint['args'] = array();
- }
- $endPoint['args'][] = array('type' => 'value', 'item' => $value);
- return $this;
- }
-
- /**
- * Specify a dependency lookup for the constructor of the previously
- * registered item.
- *
- * @param string $lookup
- * @return Swift_DependencyContainer
- * @see withDependencies(), addConstructorValue()
- */
- public function addConstructorLookup($lookup)
- {
- $endPoint =& $this->_getEndPoint();
- if (!isset($this->_endPoint['args']))
- {
- $endPoint['args'] = array();
- }
- $endPoint['args'][] = array('type' => 'lookup', 'item' => $lookup);
- return $this;
- }
-
- // -- Private methods
-
- /** Get the literal value with $itemName */
- private function _getValue($itemName)
- {
- return $this->_store[$itemName]['value'];
- }
-
- /** Resolve an alias to another item */
- private function _createAlias($itemName)
- {
- return $this->lookup($this->_store[$itemName]['ref']);
- }
-
- /** Create a fresh instance of $itemName */
- private function _createNewInstance($itemName)
- {
- $reflector = new ReflectionClass($this->_store[$itemName]['className']);
- if ($reflector->getConstructor())
- {
- return $reflector->newInstanceArgs(
- $this->createDependenciesFor($itemName)
- );
- }
- else
- {
- return $reflector->newInstance();
- }
- }
-
- /** Create and register a shared instance of $itemName */
- private function _createSharedInstance($itemName)
- {
- if (!isset($this->_store[$itemName]['instance']))
- {
- $this->_store[$itemName]['instance'] = $this->_createNewInstance($itemName);
- }
- return $this->_store[$itemName]['instance'];
- }
-
- /** Get the current endpoint in the store */
- private function &_getEndPoint()
- {
- if (!isset($this->_endPoint))
- {
- throw new BadMethodCallException(
- 'Component must first be registered by calling register()'
- );
- }
- return $this->_endPoint;
- }
-
- /** Get an argument list with dependencies resolved */
- private function _resolveArgs(array $args)
- {
- $resolved = array();
- foreach ($args as $argDefinition)
- {
- switch ($argDefinition['type'])
- {
- case 'lookup':
- $resolved[] = $this->_lookupRecursive($argDefinition['item']);
- break;
- case 'value':
- $resolved[] = $argDefinition['item'];
- break;
- }
- }
- return $resolved;
- }
-
- /** Resolve a single dependency with an collections */
- private function _lookupRecursive($item)
- {
- if (is_array($item))
- {
- $collection = array();
- foreach ($item as $k => $v)
- {
- $collection[$k] = $this->_lookupRecursive($v);
- }
- return $collection;
- }
- else
- {
- return $this->lookup($item);
- }
- }
-
-}
View
40 vendor/swift/classes/Swift/DependencyException.php
@@ -1,40 +0,0 @@
-<?php
-
-/*
- DependencyException from Swift Mailer.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@require 'Swift/SwiftException.php';
-
-/**
- * DependencyException thrown when a requested dependeny is missing.
- * @package Swift
- * @author Chris Corbyn
- */
-class Swift_DependencyException extends Swift_SwiftException
-{
-
- /**
- * Create a new DependencyException with $message.
- * @param string $message
- */
- public function __construct($message)
- {
- parent::__construct($message);
- }
-
-}
View
83 vendor/swift/classes/Swift/EmbeddedFile.php
<
@@ -1,83 +0,0 @@
-<?php
-
-/*
- EmbeddedFile wrapper class in Swift Mailer.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- */
-
-//@require 'Swift/Mime/Attachment.php';
-//@require 'Swift/DependencyContainer.php';
-//@require 'Swift/ByteStream/FileByteStream.php';
-
-/**
- * An embedded file, in a multipart message.
- * @package Swift