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 Resource Plugin
 4:  *
 5:  * @package    Smarty
 6:  * @subpackage TemplateResources
 7:  * @author     Rodney Rehm
 8:  */
 9: 
10: /**
11:  * Smarty Resource Plugin
12:  * Wrapper Implementation for custom resource plugins
13:  *
14:  * @package    Smarty
15:  * @subpackage TemplateResources
16:  */
17: abstract class Smarty_Resource_Custom extends Smarty_Resource
18: {
19:     /**
20:      * fetch template and its modification time from data source
21:      *
22:      * @param string  $name    template name
23:      * @param string  &$source template source
24:      * @param integer &$mtime  template modification timestamp (epoch)
25:      */
26:     abstract protected function fetch($name, &$source, &$mtime);
27: 
28:     /**
29:      * Fetch template's modification timestamp from data source
30:      * {@internal implementing this method is optional.
31:      *  Only implement it if modification times can be accessed faster than loading the complete template source.}}
32:      *
33:      * @param  string $name template name
34:      *
35:      * @return integer|boolean timestamp (epoch) the template was modified, or false if not found
36:      */
37:     protected function fetchTimestamp($name)
38:     {
39:         return null;
40:     }
41: 
42:     /**
43:      * populate Source Object with meta data from Resource
44:      *
45:      * @param Smarty_Template_Source   $source    source object
46:      * @param Smarty_Internal_Template $_template template object
47:      */
48:     public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
49:     {
50:         $source->filepath = $source->type . ':' . $source->name;
51:         $source->uid = sha1($source->type . ':' . $source->name);
52: 
53:         $mtime = $this->fetchTimestamp($source->name);
54:         if ($mtime !== null) {
55:             $source->timestamp = $mtime;
56:         } else {
57:             $this->fetch($source->name, $content, $timestamp);
58:             $source->timestamp = isset($timestamp) ? $timestamp : false;
59:             if (isset($content)) {
60:                 $source->content = $content;
61:             }
62:         }
63:         $source->exists = !!$source->timestamp;
64:     }
65: 
66:     /**
67:      * Load template's source into current template object
68:      *
69:      * @param  Smarty_Template_Source $source source object
70:      *
71:      * @return string                 template source
72:      * @throws SmartyException        if source cannot be loaded
73:      */
74:     public function getContent(Smarty_Template_Source $source)
75:     {
76:         $this->fetch($source->name, $content, $timestamp);
77:         if (isset($content)) {
78:             return $content;
79:         }
80: 
81:         throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
82:     }
83: 
84:     /**
85:      * Determine basename for compiled filename
86:      *
87:      * @param  Smarty_Template_Source $source source object
88:      *
89:      * @return string                 resource's basename
90:      */
91:     protected function getBasename(Smarty_Template_Source $source)
92:     {
93:         return basename($source->name);
94:     }
95: }
96: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen