1 | <?php |
||
37 | class SmartyFactory extends Factory |
||
38 | { |
||
39 | /** |
||
40 | * @var string version |
||
41 | */ |
||
42 | const VERSION = '2.1.12'; |
||
43 | |||
44 | /** @var Smarty $smarty */ |
||
45 | protected $smarty; |
||
46 | |||
47 | /** @var ConfigContract $config */ |
||
48 | protected $config; |
||
49 | |||
50 | /** @var array valid config keys */ |
||
51 | protected $configKeys = [ |
||
52 | 'auto_literal', |
||
53 | 'error_unassigned', |
||
54 | 'use_include_path', |
||
55 | 'joined_template_dir', |
||
56 | 'joined_config_dir', |
||
57 | 'default_template_handler_func', |
||
58 | 'default_config_handler_func', |
||
59 | 'default_plugin_handler_func', |
||
60 | 'force_compile', |
||
61 | 'compile_check', |
||
62 | 'use_sub_dirs', |
||
63 | 'allow_ambiguous_resources', |
||
64 | 'merge_compiled_includes', |
||
65 | 'inheritance_merge_compiled_includes', |
||
66 | 'force_cache', |
||
67 | 'left_delimiter', |
||
68 | 'right_delimiter', |
||
69 | 'security_class', |
||
70 | 'php_handling', |
||
71 | 'allow_php_templates', |
||
72 | 'direct_access_security', |
||
73 | 'debugging', |
||
74 | 'debugging_ctrl', |
||
75 | 'smarty_debug_id', |
||
76 | 'debug_tpl', |
||
77 | // 'error_reporting', added below with default value |
||
78 | 'get_used_tags', |
||
79 | 'config_overwrite', |
||
80 | 'config_booleanize', |
||
81 | 'config_read_hidden', |
||
82 | 'compile_locking', |
||
83 | 'cache_locking', |
||
84 | 'locking_timeout', |
||
85 | 'default_resource_type', |
||
86 | 'caching_type', |
||
87 | 'properties', |
||
88 | 'default_config_type', |
||
89 | 'source_objects', |
||
90 | 'template_objects', |
||
91 | 'resource_caching', |
||
92 | 'template_resource_caching', |
||
93 | 'cache_modified_check', |
||
94 | 'registered_plugins', |
||
95 | 'plugin_search_order', |
||
96 | 'registered_objects', |
||
97 | 'registered_classes', |
||
98 | 'registered_filters', |
||
99 | 'registered_resources', |
||
100 | '_resource_handlers', |
||
101 | 'registered_cache_resources', |
||
102 | '_cacheresource_handlers', |
||
103 | 'autoload_filters', |
||
104 | 'default_modifiers', |
||
105 | 'escape_html', |
||
106 | 'start_time', |
||
107 | '_file_perms', |
||
108 | '_dir_perms', |
||
109 | '_tag_stack', |
||
110 | '_current_file', |
||
111 | '_parserdebug', |
||
112 | '_is_file_cache', |
||
113 | 'cache_id', |
||
114 | 'compile_id', |
||
115 | 'caching', |
||
116 | 'cache_lifetime', |
||
117 | 'template_class', |
||
118 | 'tpl_vars', |
||
119 | 'parent', |
||
120 | 'config_vars', |
||
121 | ]; |
||
122 | |||
123 | /** @var array valid security policy config keys */ |
||
124 | protected $securityPolicyConfigKeys = [ |
||
125 | 'php_handling', |
||
126 | 'secure_dir', |
||
127 | 'trusted_dir', |
||
128 | 'trusted_uri', |
||
129 | 'trusted_constants', |
||
130 | 'static_classes', |
||
131 | 'trusted_static_methods', |
||
132 | 'trusted_static_properties', |
||
133 | 'php_functions', |
||
134 | 'php_modifiers', |
||
135 | 'allowed_tags', |
||
136 | 'disabled_tags', |
||
137 | 'allowed_modifiers', |
||
138 | 'disabled_modifiers', |
||
139 | 'disabled_special_smarty_vars', |
||
140 | 'streams', |
||
141 | 'allow_constants', |
||
142 | 'allow_super_globals', |
||
143 | 'max_template_nesting', |
||
144 | ]; |
||
145 | |||
146 | /** @var string smarty template file extension */ |
||
147 | protected $smartyFileExtension; |
||
148 | |||
149 | /** |
||
150 | * @param EngineResolver $engines |
||
151 | * @param ViewFinderInterface $finder |
||
152 | * @param DispatcherContract $events |
||
153 | * @param Smarty $smarty |
||
154 | * @param ConfigContract $config |
||
155 | */ |
||
156 | public function __construct( |
||
167 | |||
168 | /** |
||
169 | * @return Smarty |
||
170 | */ |
||
171 | public function getSmarty() |
||
175 | |||
176 | /** |
||
177 | * @return string |
||
178 | */ |
||
179 | public function getVersion() |
||
183 | |||
184 | /** |
||
185 | */ |
||
186 | public function resolveSmartyCache() |
||
191 | |||
192 | /** |
||
193 | * smarty configure |
||
194 | * |
||
195 | * @throws \SmartyException |
||
196 | */ |
||
197 | public function setSmartyConfigure() |
||
233 | |||
234 | /** |
||
235 | * @return string |
||
236 | */ |
||
237 | public function getSmartyFileExtension() |
||
241 | |||
242 | /** |
||
243 | * @param $name |
||
244 | * @param $arguments |
||
245 | * |
||
246 | * @throws MethodNotFoundException |
||
247 | * @return mixed |
||
248 | */ |
||
249 | public function __call($name, $arguments) |
||
258 | } |
||
259 |