summaryrefslogtreecommitdiff
path: root/libs/sysplugins/smarty_internal_method_loadplugin.php
diff options
context:
space:
mode:
authoruwetews <uwe.tews@googlemail.com>2016-02-09 01:27:15 +0100
committeruwetews <uwe.tews@googlemail.com>2016-02-09 01:27:15 +0100
commitb04486a091558a2b1280e3ee7fb90758e9a32230 (patch)
treeddb15a12dba78e6873a348acd25f872429e210d2 /libs/sysplugins/smarty_internal_method_loadplugin.php
parentc59ca44b9ff62a7f54e30409514834a8529780ca (diff)
downloadsmarty-b04486a091558a2b1280e3ee7fb90758e9a32230.tar.gz
smarty-b04486a091558a2b1280e3ee7fb90758e9a32230.tar.bz2
smarty-b04486a091558a2b1280e3ee7fb90758e9a32230.zip
- reformat all code for unique style
Diffstat (limited to 'libs/sysplugins/smarty_internal_method_loadplugin.php')
-rw-r--r--libs/sysplugins/smarty_internal_method_loadplugin.php32
1 files changed, 16 insertions, 16 deletions
diff --git a/libs/sysplugins/smarty_internal_method_loadplugin.php b/libs/sysplugins/smarty_internal_method_loadplugin.php
index c153f55f..50f3bfc2 100644
--- a/libs/sysplugins/smarty_internal_method_loadplugin.php
+++ b/libs/sysplugins/smarty_internal_method_loadplugin.php
@@ -39,21 +39,21 @@ class Smarty_Internal_Method_LoadPlugin
if (!preg_match('#^smarty_((internal)|([^_]+))_(.+)$#i', $plugin_name, $match)) {
throw new SmartyException("plugin {$plugin_name} is not a valid name format");
}
- if (!empty($match[2])) {
+ if (!empty($match[ 2 ])) {
$file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php';
- if (isset($this->plugin_files[$file])) {
- if ($this->plugin_files[$file] !== false) {
- return $this->plugin_files[$file];
+ if (isset($this->plugin_files[ $file ])) {
+ if ($this->plugin_files[ $file ] !== false) {
+ return $this->plugin_files[ $file ];
} else {
return false;
}
} else {
if (is_file($file)) {
- $this->plugin_files[$file] = $file;
+ $this->plugin_files[ $file ] = $file;
require_once($file);
return $file;
} else {
- $this->plugin_files[$file] = false;
+ $this->plugin_files[ $file ] = false;
return false;
}
}
@@ -62,16 +62,16 @@ class Smarty_Internal_Method_LoadPlugin
$_plugin_filename = "{$match[1]}.{$match[4]}.php";
$_lower_filename = strtolower($_plugin_filename);
if (isset($this->plugin_files)) {
- if (isset($this->plugin_files['plugins_dir'][$_lower_filename])) {
- if (!$smarty->use_include_path || $this->plugin_files['plugins_dir'][$_lower_filename] !== false) {
- return $this->plugin_files['plugins_dir'][$_lower_filename];
+ if (isset($this->plugin_files[ 'plugins_dir' ][ $_lower_filename ])) {
+ if (!$smarty->use_include_path || $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ] !== false) {
+ return $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ];
}
}
if (!$smarty->use_include_path || $smarty->ext->_getIncludePath->isNewIncludePath($smarty)) {
- unset($this->plugin_files['include_path']);
+ unset($this->plugin_files[ 'include_path' ]);
} else {
- if (isset($this->plugin_files['include_path'][$_lower_filename])) {
- return $this->plugin_files['include_path'][$_lower_filename];
+ if (isset($this->plugin_files[ 'include_path' ][ $_lower_filename ])) {
+ return $this->plugin_files[ 'include_path' ][ $_lower_filename ];
}
}
}
@@ -80,17 +80,17 @@ class Smarty_Internal_Method_LoadPlugin
$_file_names[] = $_lower_filename;
}
$_p_dirs = $smarty->getPluginsDir();
- if (!isset($this->plugin_files['plugins_dir'][$_lower_filename])) {
+ if (!isset($this->plugin_files[ 'plugins_dir' ][ $_lower_filename ])) {
// loop through plugin dirs and find the plugin
foreach ($_p_dirs as $_plugin_dir) {
foreach ($_file_names as $name) {
$file = $_plugin_dir . $name;
if (is_file($file)) {
- $this->plugin_files['plugins_dir'][$_lower_filename] = $file;
+ $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ] = $file;
require_once($file);
return $file;
}
- $this->plugin_files['plugins_dir'][$_lower_filename] = false;
+ $this->plugin_files[ 'plugins_dir' ][ $_lower_filename ] = false;
}
}
}
@@ -98,7 +98,7 @@ class Smarty_Internal_Method_LoadPlugin
foreach ($_file_names as $_file_name) {
// try PHP include_path
$file = $smarty->ext->_getIncludePath->getIncludePath($_p_dirs, $_file_name, $smarty);
- $this->plugin_files['include_path'][$_lower_filename] = $file;
+ $this->plugin_files[ 'include_path' ][ $_lower_filename ] = $file;
if ($file !== false) {
require_once($file);
return $file;