> I read the
> http://dev.joomla.org/index.php?option=com_jd-wiki&Itemid=31&id=guidelines:utf-8
> and found a bit strange that the tags used are:
>
> <install>
> <sql>
> <mysql-4.1.2>install.utf.sql</mysql-4.1.2>
> <mysql-3.2.0>install.nonutf.sql</mysql-3.2.0>
> </sql>
> </install>
...
> <install>
> <sql>
> <utf8>install.utf.sql</utf8>
> <nonutf8>install.nonutf.sql</nonutf8>
> </sql>
> </install>
I think he's kinda on the right track though. Should we look at
something like this:
<install>
<sql>
<queryfile driver="mysqli" version="4.1.2"
charset="utf8">install.utf.sql</sqlscript>
<queryfile driver="mysql" version="4.1.2"
charset="utf8">install.utf.sql</sqlscript>
<queryfile driver="mysql" version="3.2.0"
charset="latin1">install.nonutf.sql</sqlscript>
</sql>
</install>
That could be a little more scalable and future proof? A description
attribute I think could also be useful.
Andrew
Sam
Definitely a better solution not only allows solving the charset
problem but also allows for extendibility to other systems, provides
more information to the developer. So until someone takes the summer of
code challenge and does some deep research and prototyping I think this
solution is better than the previous one.
-Dan
I have changed the syntax and implementation of selecting the appropriate
sql file during component installation. The reason we need 2 files (each for
install and uninstall) is the utf backward compatibilty issue. There is only
one db and driver possibilty in 1.5 (after driver is selected during Joomla
installation).
As for the future - the modified syntax will lend itself to having multiple
sql files for multiple db's or drivers but on the other hand if we go for
xml db structure definition (and we will stop backward compatibilty of
nonutf db's) - then only one tag will be needed.
This is what I implemented:
Cheers,
David
----------------------------------------
...
<install>
<sql>
<file version="4.1.2">install.utf.sql</file>
<file version="3.2.0">install.nonutf.sql</file>
</sql>
</install>
<uninstall>
<sql>
<file version="4.1.2">uninstall.utf.sql</file>
<file version="3.2.0">uninstall.nonutf.sql</file>
</sql>
</uninstall>
...
-----------------------------------------------------------