back

Looks like Doctrine 1.2 (in Symfony 1.4) doesn't like loading blobs in fixtures. You can base64_encode them, but that kind of defeats the purpose of having a blob, now does it!


The closest I came to a fix is something useful that can load blobs and integrates well into the symfony workflow. It can also do other kinds of data generation that can be cumbersome with standard doctrine fixtures (as in: genenerate 1000 lines of yml, wait for it to convert to 1000 lines of dql and sql, then wait for hours for it to complete). Behold, the data-modify task:



addOptions(array( new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'), new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'), )); $this->namespace = 'doctrine'; $this->name = 'data-modify'; $this->briefDescription = 'Modify loaded fixture data'; $this->detailedDescription = <<configuration); $connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection(); // Include modifications to fixtures that can't be done with standard // doctrine fixtures, e.g. generate or load blobs foreach (glob(sfConfig::get('sf_data_dir').'/fixture-mods/*.mod.php') as $mod) { include $mod; } } }


We should be using this, now shouldn't we?