When running:
cake migrate g from db
Fatal error: Class 'Yaml' not found in ... line 404
FYI, that line number WILL be different because I threw in a
quick "hack" fix; here's the full function _buildYaml:
function _buildYaml($tables)
{
if (!is_array($tables)) $tables = array($tables);
foreach ($tables as $table) {
$dbShema['UP']['create_table'][$table] = $this->__buildUpSchema($table);
$dbShema['DOWN']['drop_table'][] = $table;
}
if (count($dbShema['DOWN']['drop_table']) == 1) $dbShema['DOWN']['drop_table'] = $dbShema['DOWN']['drop_table'][0];
// print file header
$out = '#'."\n";
$out .= '# migration YAML file'."\n";
$out .= '#'."\n";
// Fix bug - can't load Yaml class
require_once(dirname(__FILE__).DS.'..'.DS.'Yaml.php');
return Yaml::Dump($dbShema);
}
You'll notice I just manually require_once'd the Yaml file.
There's probably a better way to do this, and I'll leave that
decision to you.
Same issue with: cake migrate
Fatal error: Class 'Yaml' not found in ... line 696
Again, I fixed it and that's why the line numbers are off
slightly. I simply did the exact same require statement prior to
Yaml::Load($yml);.
Please let me know if you need additional information as I'd be
happy to help.