[TYPO3-50-general] typo3 5.0 on windows

Bastian Waidelich waidelich at network-publishing.de
Tue Nov 13 11:22:29 CET 2007


Mathias R. Wulff wrote:

 > I downloaded the php6, made it run with apache [...]
 > But no...
 > Fatal error: Class 'T3_Framework_Component_Manager' not found in 
C:\!Mathias\$MRW\$www\typo350\TYPO3\Packages\Framework\Classes\T3_Framework.php 
on line 69

Hi Mathias,

I had the same experience and found out that the problem is that 
spl_autoload_register doesn't seem to work in the current PHP6 version 
for windows. I got it working by adding a few lines to the Resource 
Manager (see end of post for unified diff).

But I would strongly recommend to install TYPO3 5.0 on a virtual machine 
running a unix based system until PHP 6 is more stable on windows.
Here's a good TYPO3 5.0 installation tutorial: 
http://www.yeebase.com/blog/post/typo3-50-installieren-fuer-nicht-programmierer/948/ 
(sorry, german language)

BTW: There are rumors that TYPO3 5.0 will soon run with PHP 5.2! See 
http://www.5-0.dev.typo3.org/trac/TYPO3/changeset/377

Below the patch (It's really nasty and by no means professional, just 
wanted to get in running *g)

All the best
Basti

Index: 
Packages/Framework/Classes/Resource/T3_Framework_Resource_ClassLoader.php
===================================================================
--- 
Packages/Framework/Classes/Resource/T3_Framework_Resource_ClassLoader.php 
(revision 376)
+++ 
Packages/Framework/Classes/Resource/T3_Framework_Resource_ClassLoader.php 
(working copy)
@@ -57,18 +57,20 @@
       * @return    void
       * @author    Robert Lemke <robert at typo3.org>
       */
-    public function loadClass($className) {
-        if (isset($this->specialClassNamesAndPaths[$className])) {
+    public function loadClass($className) {
+        if (isset($this->specialClassNamesAndPaths[$className])) {
              $classFilePathAndName = 
$this->specialClassNamesAndPaths[$className];
          } else {
              $classNameParts = explode('_', $className);
              if (is_array($classNameParts) && $classNameParts[0] == 
'T3') {
                  $classFilePathAndName = $this->packagesDirectory . 
$classNameParts[1] . '/' . T3_Framework_Package_Package::DIRECTORY_CLASSES;
                  $classFilePathAndName .= 
implode(array_slice($classNameParts, 2, -1), '/') . '/';
-                $classFilePathAndName .= $className . '.php';
+                $classFilePathAndName .= $className . '.php';
+                #echo $classFilePathAndName.'<br>';
              }
          }
-        if (isset($classFilePathAndName) && 
file_exists($classFilePathAndName)) require_once ($classFilePathAndName);
+        if (isset($classFilePathAndName) && 
file_exists($classFilePathAndName)) require_once ($classFilePathAndName);
+        else 
require_once('C:/wamp/www/TYPO3/FileCache/Private/Framework/AOP/ProxyCache/'.$className.'.php');
      }

      /**
Index: Packages/Framework/Classes/Resource/T3_Framework_Resource_Manager.php
===================================================================
--- 
Packages/Framework/Classes/Resource/T3_Framework_Resource_Manager.php 
(revision 376)
+++ 
Packages/Framework/Classes/Resource/T3_Framework_Resource_Manager.php 
(working copy)
@@ -20,7 +20,7 @@
   * The Resource Manager - Daniel's playground.
   *
   * @package        Framework
- * @version     $Id: $
+ * @version     $Id$
   * @copyright    Copyright belongs to the respective authors
   * @license        http://opensource.org/licenses/gpl-license.php GNU 
Public License, version 2
   */
@@ -37,8 +37,9 @@
       * @return void
       */
      public function __construct() {
-        $this->classLoader = new 
T3_Framework_Resource_ClassLoader(TYPO3_PATH_PACKAGES);
-        spl_autoload_register(array($this->classLoader, 'loadClass'));
+        $GLOBALS['classLoader'] = new 
T3_Framework_Resource_ClassLoader(TYPO3_PATH_PACKAGES);
+        $classLoader = $GLOBALS['classLoader'];
+        #spl_autoload_register(array($this->classLoader, 'loadClass'));
      }

      /**
@@ -55,6 +56,14 @@
      public function registerClassFile($className, $classFilePathAndName) {
          if (!is_string($className)) throw new 
InvalidArgumentException('Class name must be a valid string.', 1187009929);
          if (!file_exists($classFilePathAndName)) throw new 
T3_Framework_Resource_Exception_FileDoesNotExist('The specified class 
file does not exist.', 1187009987);
-        $this->classLoader->setSpecialClassNameAndPath($className, 
$classFilePathAndName);
+        $GLOBALS['classLoader']->setSpecialClassNameAndPath($className, 
$classFilePathAndName);
      }
+}
+
+$classLoader = NULL;
+
+function __autoload($className) {
+    if ($GLOBALS['classLoader'] != NULL) {
+        $GLOBALS['classLoader']->loadClass($className);
+    }
  }
\ No newline at end of file


More information about the TYPO3-project-5_0-general mailing list