OSDN Git Service

- fixed bug "ethna i18n" command did not work on windows.
authormumumu-org <mumumu-org@2ef88817-412d-0410-a32c-8029a115e976>
Fri, 10 Oct 2008 15:33:59 +0000 (15:33 +0000)
committermumumu-org <mumumu-org@2ef88817-412d-0410-a32c-8029a115e976>
Fri, 10 Oct 2008 15:33:59 +0000 (15:33 +0000)
class/Plugin/Generator/Ethna_Plugin_Generator_I18n.php

index 0563ece..4316955 100644 (file)
@@ -264,7 +264,12 @@ class Ethna_Plugin_Generator_I18n extends Ethna_Plugin_Generator
         //  アクションスクリプト の場合は、
         //  ActionForm の $form メンバ解析
         $php_ext = $this->ctl->getExt('php');
-        if (preg_match("#$action_dir#", $file_path)
+        $action_dir_regex = $action_dir;
+        if (ETHNA_OS_WINDOWS) {
+            $action_dir_regex = str_replace('\\', '\\\\', $action_dir);
+            $action_dir_regex = str_replace('/', '\\\\', $action_dir_regex);
+        }
+        if (preg_match("#$action_dir_regex#", $file_path)
         && !preg_match("#.*Test\.${php_ext}$#", $file_path)) {
             $this->_analyzeActionForm($file_path); 
         }