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:  * Smarty Internal Plugin Resource Stream
 4:  * Implements the streams as resource for Smarty template
 5:  *
 6:  * @package    Smarty
 7:  * @subpackage TemplateResources
 8:  * @author     Uwe Tews
 9:  * @author     Rodney Rehm
10:  */
11: 
12: /**
13:  * Smarty Internal Plugin Resource Stream
14:  * Implements the streams as resource for Smarty template
15:  *
16:  * @link       http://php.net/streams
17:  * @package    Smarty
18:  * @subpackage TemplateResources
19:  */
20: class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled
21: {
22:     /**
23:      * populate Source Object with meta data from Resource
24:      *
25:      * @param Smarty_Template_Source   $source    source object
26:      * @param Smarty_Internal_Template $_template template object
27:      *
28:      * @return void
29:      */
30:     public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
31:     {
32:         if (strpos($source->resource, '://') !== false) {
33:             $source->filepath = $source->resource;
34:         } else {
35:             $source->filepath = str_replace(':', '://', $source->resource);
36:         }
37:         $source->uid = false;
38:         $source->content = $this->getContent($source);
39:         $source->timestamp = false;
40:         $source->exists = !!$source->content;
41:     }
42: 
43:     /**
44:      * Load template's source from stream into current template object
45:      *
46:      * @param Smarty_Template_Source $source source object
47:      *
48:      * @return string template source
49:      * @throws SmartyException if source cannot be loaded
50:      */
51:     public function getContent(Smarty_Template_Source $source)
52:     {
53:         $t = '';
54:         // the availability of the stream has already been checked in Smarty_Resource::fetch()
55:         $fp = fopen($source->filepath, 'r+');
56:         if ($fp) {
57:             while (!feof($fp) && ($current_line = fgets($fp)) !== false) {
58:                 $t .= $current_line;
59:             }
60:             fclose($fp);
61: 
62:             return $t;
63:         } else {
64:             return false;
65:         }
66:     }
67: 
68:     /**
69:      * modify resource_name according to resource handlers specifications
70:      *
71:      * @param Smarty   $smarty        Smarty instance
72:      * @param string   $resource_name resource_name to make unique
73:      * @param  boolean $is_config     flag for config resource
74:      *
75:      * @return string unique resource name
76:      */
77:     protected function buildUniqueResourceName(Smarty $smarty, $resource_name, $is_config = false)
78:     {
79:         return get_class($this) . '#' . $resource_name;
80:     }
81: }
82: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen