Skip to content

Instantly share code, notes, and snippets.

@doctrinebot
Created December 13, 2015 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doctrinebot/a3536a7ea96e6f0746bc to your computer and use it in GitHub Desktop.
Save doctrinebot/a3536a7ea96e6f0746bc to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DBAL-166 - https://github.com/doctrine/dbal/issues/1324
#!/usr/bin/php
<?php
/**
* Doctrine DBAL Patch
* fix table creation query encode
* (c) _Nicolay
*/
system ('cp ./vendor/doctrine-dbal/lib/Doctrine/DBAL/Schema/Schema.php ./vendor/doctrine-dbal/lib/Doctrine/DBAL/Schema/Schema.php.Orig');
$data = file_get_contents('./vendor/doctrine-dbal/lib/Doctrine/DBAL/Schema/Schema.php');
$data = str_replace("new Table(\$tableName);",
"new Table(\$tableName,array(),array(),array(),0,array('charset'=>'utf8','collate'=>'utf8_general_ci'));",
$data);
file_put_contents('./vendor/doctrine-dbal/lib/Doctrine/DBAL/Schema/Schema.php', $data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment