Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
 1: <?php
 2: 
 3: /*
 4:  * This file is part of SwiftMailer.
 5:  * (c) 2004-2009 Chris Corbyn
 6:  *
 7:  * For the full copyright and license information, please view the LICENSE
 8:  * file that was distributed with this source code.
 9:  */
10: 
11: /**
12:  * Processes bytes as they pass through a buffer and replaces sequences in it.
13:  * @package Swift
14:  * @author Chris Corbyn
15:  */
16: class Swift_StreamFilters_StringReplacementFilter implements Swift_StreamFilter
17: {
18:     /** The needle(s) to search for */
19:     private $_search;
20: 
21:     /** The replacement(s) to make */
22:     private $_replace;
23: 
24:     /**
25:      * Create a new StringReplacementFilter with $search and $replace.
26:      * @param string|array $search
27:      * @param string|array $replace
28:      */
29:     public function __construct($search, $replace)
30:     {
31:         $this->_search = $search;
32:         $this->_replace = $replace;
33:     }
34: 
35:     /**
36:      * Returns true if based on the buffer passed more bytes should be buffered.
37:      * @param  string  $buffer
38:      * @return boolean
39:      */
40:     public function shouldBuffer($buffer)
41:     {
42:         $endOfBuffer = substr($buffer, -1);
43:         foreach ((array) $this->_search as $needle) {
44:             if (false !== strpos($needle, $endOfBuffer)) {
45:                 return true;
46:             }
47:         }
48: 
49:         return false;
50:     }
51: 
52:     /**
53:      * Perform the actual replacements on $buffer and return the result.
54:      * @param  string $buffer
55:      * @return string
56:      */
57:     public function filter($buffer)
58:     {
59:         return str_replace($this->_search, $this->_replace, $buffer);
60:     }
61: }
62: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen