OSDN Git Service

- bug fixes (handling smarty plugins dir)
authorfujimoto <fujimoto@2ef88817-412d-0410-a32c-8029a115e976>
Wed, 1 Dec 2004 15:30:02 +0000 (15:30 +0000)
committerfujimoto <fujimoto@2ef88817-412d-0410-a32c-8029a115e976>
Wed, 1 Dec 2004 15:30:02 +0000 (15:30 +0000)
class/Ethna_Controller.php

index 6f5e076..051675c 100644 (file)
@@ -51,7 +51,7 @@ class Ethna_Controller
                'etc'                   => 'etc',
                'locale'                => 'locale',
                'log'                   => 'log',
-               'plugins'               => array('plugins'),
+               'plugins'               => array(),
                'template'              => 'template',
                'template_c'    => 'tmp',
                'tmp'                   => 'tmp',
@@ -206,8 +206,19 @@ class Ethna_Controller
                $this->base = BASE;
 
                foreach ($this->directory as $key => $value) {
-                       if ($value[0] != '/') {
-                               $this->directory[$key] = $this->base . (empty($this->base) ? '' : '/') . $value;
+                       if ($key == 'plugins') {
+                               // Smarty¥×¥é¥°¥¤¥ó¥Ç¥£¥ì¥¯¥È¥ê¤ÏÇÛÎó¤Ç»ØÄꤹ¤ë
+                               $tmp = array(SMARTY_DIR . 'plugins');
+                               foreach (to_array($value) as $elt) {
+                                       if ($elt{0} != '/') {
+                                               $tmp[] = $this->base . (empty($this->base) ? '' : '/') . $elt;
+                                       }
+                               }
+                               $this->directory[$key] = $tmp;
+                       } else {
+                               if ($value{0} != '/') {
+                                       $this->directory[$key] = $this->base . (empty($this->base) ? '' : '/') . $value;
+                               }
                        }
                }
                $this->i18n =& new Ethna_I18N($this->getDirectory('locale'), $this->getAppId());
@@ -531,6 +542,7 @@ class Ethna_Controller
                        mkdir($smarty->compile_dir, 0755);
                }
                $smarty->plugins_dir = $this->getDirectory('plugins');
+               var_dump($smarty->plugins_dir);
 
                // default modifiers
                $smarty->register_modifier('number_format', 'smarty_modifier_number_format');