require_once 'Doctrine/lib/doctrine.php';
spl_autoload_register(array('Doctrine', 'autoload'));
$conn = Doctrine_Manager::connection('mysql://admin:password@localhost/slownik');
Doctrine::loadModels('./../lib');
$conn->setCollate('utf8_polish_ci');
$conn->setCharset('utf8');
require_once 'vh-array.inc.php';
$kolory = string2HArray(file_get_contents('dane/kolory.txt'));
shuffle($kolory['items']);
foreach ($kolory['items'] as $k) {
$kolor = new Kolor();
$kolor['en'] = $k[0];
$kolor['pl'] = $k[1];
$kolor->save();
}
$zwierzeta = string2HArray(file_get_contents('dane/zwierzeta.txt'));
shuffle($zwierzeta['items']);
foreach ($zwierzeta['items'] as $z) {
$zwierze = new Zwierze();
$zwierze['en'] = $z[0];
$zwierze['pl'] = $z[1];
$zwierze->save();
}