propelorm/PropelBundle — Issue #72: propel:build-model crashes due to missing Pdo_mysqlPlatform
Author: kaisellgren
Created: 2011-11-11 07:36:14+00:00
State: open

I encountered a problem when running propel:build-model. Apparently Pdo_mysqlPlatform does not exist anymore:

> propel > om-template:
>
> [propel-om] Loading XML schema files...
> [PHP Error] include_once(**platform\Pdo_mysqlPlatform.php**): failed to open stream: No such file or directory [line 1060 of C:\www\outotec.ofil_plant\vendor\phing\classes\phing\Phing.php]
> Execution of target "om" failed for the following reason: C:\www\outotec.ofil_plant\vendor\propel\generator\build-propel.xml:525:22: Execution of the target buildfile failed. Aborting.
> [phing] C:\www\outotec.ofil_plant\vendor\propel\generator\build-propel.xml:525:22: Execution of the target buildfile failed. Aborting.

**I fixed this problem temporarily in a very ugly way.**

```Phing::__import()``` function, modiftied from

```
$ret = include_once($path);
```

to

```
if (preg_match('#Pdo_mysqlPlatform.php#i', $path)) {
$ret = include_once('platform/mysqlPlatform.php');
} else {
$ret = include_once($path);
}
```

and ```GeneratorConfig::getConfiguredPlatform()``` modified to have this line before ```new $clazz```:

```
$clazz = str_replace('Pdo_', '', $clazz);
```

I am hoping to see official patches that fix the problem the real way. I have no time and not enough knowledge to fix this a more proper way than this.