[Solar-svn] Revision 2995

pmjones at solarphp.com pmjones at solarphp.com
Wed Mar 12 08:58:29 CDT 2008


Solar_Cli_MakeModel: [FIX] Method _loadTempates() now properly prefixes PHP tags to the template text.  Thanks, neste1.


Modified: trunk/Solar/Cli/MakeModel.php
===================================================================
--- trunk/Solar/Cli/MakeModel.php	2008-03-12 01:57:52 UTC (rev 2994)
+++ trunk/Solar/Cli/MakeModel.php	2008-03-12 13:58:29 UTC (rev 2995)
@@ -169,16 +169,13 @@
         $dir = Solar_Dir::fix(dirname(__FILE__) . '/MakeModel/Data');
         $list = glob($dir . '*.php');
         foreach ($list as $file) {
-            $key = substr(basename($file), 0, -4);
-            if (substr($key, 0, 5) == 'class') {
-                // we need to add the php-open tag ourselves, instead of
-                // having it in the template file, becuase the PEAR packager
-                // complains about parsing the skeleton code.
-                $this->_tpl[$key] = "<\?php\n" . file_get_contents($file);
-            } else {
-                // no need for an opening tag on the method files
-                $this->_tpl[$key] = file_get_contents($file);
-            }
+            // strip .php off the end of the file name
+            $key = susbtr(basename($file), 0, -4);
+            
+            // we need to add the php-open tag ourselves, instead of
+            // having it in the template file, becuase the PEAR packager
+            // complains about parsing the skeleton code.
+            $this->_tpl[$key] = "<?php\n" . file_get_contents($file);
         }
     }
     




More information about the Solar-svn mailing list