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 File
 4:  *
 5:  * @package    Smarty
 6:  * @subpackage TemplateResources
 7:  * @author     Uwe Tews
 8:  * @author     Rodney Rehm
 9:  */
10: 
11: /**
12:  * Smarty Internal Plugin Resource File
13:  * Implements the file system as resource for Smarty templates
14:  *
15:  * @package    Smarty
16:  * @subpackage TemplateResources
17:  */
18: class Smarty_Internal_Resource_File extends Smarty_Resource
19: {
20:     /**
21:      * populate Source Object with meta data from Resource
22:      *
23:      * @param Smarty_Template_Source   $source    source object
24:      * @param Smarty_Internal_Template $_template template object
25:      */
26:     public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
27:     {
28:         $source->filepath = $this->buildFilepath($source, $_template);
29: 
30:         if ($source->filepath !== false) {
31:             if (is_object($source->smarty->security_policy)) {
32:                 $source->smarty->security_policy->isTrustedResourceDir($source->filepath);
33:             }
34: 
35:             $source->uid = sha1(realpath($source->filepath));
36:             if ($source->smarty->compile_check && !isset($source->timestamp)) {
37:                 $source->timestamp = @filemtime($source->filepath);
38:                 $source->exists = !!$source->timestamp;
39:             }
40:         }
41:     }
42: 
43:     /**
44:      * populate Source Object with timestamp and exists from Resource
45:      *
46:      * @param Smarty_Template_Source $source source object
47:      */
48:     public function populateTimestamp(Smarty_Template_Source $source)
49:     {
50:         $source->timestamp = @filemtime($source->filepath);
51:         $source->exists = !!$source->timestamp;
52:     }
53: 
54:     /**
55:      * Load template's source from file into current template object
56:      *
57:      * @param  Smarty_Template_Source $source source object
58:      *
59:      * @return string                 template source
60:      * @throws SmartyException        if source cannot be loaded
61:      */
62:     public function getContent(Smarty_Template_Source $source)
63:     {
64:         if ($source->timestamp) {
65:             return file_get_contents($source->filepath);
66:         }
67:         if ($source instanceof Smarty_Config_Source) {
68:             throw new SmartyException("Unable to read config {$source->type} '{$source->name}'");
69:         }
70:         throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
71:     }
72: 
73:     /**
74:      * Determine basename for compiled filename
75:      *
76:      * @param  Smarty_Template_Source $source source object
77:      *
78:      * @return string                 resource's basename
79:      */
80:     public function getBasename(Smarty_Template_Source $source)
81:     {
82:         $_file = $source->name;
83:         if (($_pos = strpos($_file, ']')) !== false) {
84:             $_file = substr($_file, $_pos + 1);
85:         }
86: 
87:         return basename($_file);
88:     }
89: }
90: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen