Porting to SQL Server

177 views
Skip to first unread message

manowar

unread,
Jun 13, 2010, 7:33:31 AM6/13/10
to Joomla! CMS Development
Hi to all!

I need a CMS for a User Group website, and I found that Joomla is
simply exactly what I need. Unfortunately it doesn't work on SQL
Server so one month ago I started to study Joomla and PHP (I've been
developing app since '97 using first ASP and now ASP.NET/C#), in order
to port it to SQL Server.

The last week I've reached the point where I was able to install
completely Joomla 1.5 on SQL Server 2008. That attempt was nothing
more than a Proof-Of-Concept and now that I feel confortable with the
idea that is feasible I'd like to do more seriously.

I've already downloaded Joomla 1.6 Beta2 + the "database" branch and
I've started to work on it (I'm developing on Windows, using Eclipse
and PHP 5.3. IIS 7.5 is my web server). Of course a lot of changes
needs to be done to the database.php class and derived classes.

Since database.php is a core part of Joomla, there is anything that
has to be discussed/planned before?

In the meantime, as soon I'll have completed all the changes need to
make the installation work on SQL Server 2008 I'll post a patch.

Since I'm completely new to Joomla, PHP and seriuos open source
projects, please give me any advice you think may be useful :)

Sam Moffatt

unread,
Jun 13, 2010, 12:17:55 PM6/13/10
to joomla-...@googlegroups.com
Hi there,

On Sun, Jun 13, 2010 at 4:33 AM, manowar <davide...@gmail.com> wrote:
> I've already downloaded Joomla 1.6 Beta2 + the "database" branch and
> I've started to work on it (I'm developing on Windows, using Eclipse
> and PHP 5.3. IIS 7.5 is my web server). Of course a lot of changes
> needs to be done to the database.php class and derived classes.

Can you elaborate on what you mean by "lot of changes"?

>
> Since database.php is a core part of Joomla, there is anything that
> has to be discussed/planned before?
>
> In the meantime, as soon I'll have completed all the changes need to
> make the installation work on SQL Server 2008 I'll post a patch.

That would be good, I was planning on having a look at this tomorrow.

>
> Since I'm completely new to Joomla, PHP and seriuos open source
> projects, please give me any advice you think may be useful :)

Sign up to JoomlaCode and we will get you branch commit access to work
on these things. The database branch might be a bit out of date, I was
planning on creating a new branch for SQL Server to get things up and
running.

Sam Moffatt
http://pasamio.id.au

Ofer Cohen

unread,
Jun 13, 2010, 12:36:04 PM6/13/10
to joomla-...@googlegroups.com
I try it in the past. There are some problems to port Joomla into sql
server, cause the core using some of unique MySQL functions (like
concat_ws, char_length, case else, etc). How did you manage to fix that?

Ofer Cohen

Artyom Bisyarin

unread,
Jun 13, 2010, 12:44:08 PM6/13/10
to joomla-...@googlegroups.com
Hello.

That's nice, I think.

Do you want to build some kind of abstraction level for any DB or just to
patch Joomla! for MSSQL?


--
Artyom

Artyom Bisyarin

unread,
Jun 13, 2010, 1:05:06 PM6/13/10
to joomla-...@googlegroups.com
Or you want to create new mssql driver in
"libraries/joomla/database/database",
parse SQL in it and translate all MySQL specifics to MSSQL?

That's also great.

On Sun, 13 Jun 2010 19:44:08 +0300, Artyom Bisyarin <art...@ukr.net>
wrote:

Sam Moffatt

unread,
Jun 13, 2010, 1:25:16 PM6/13/10
to joomla-...@googlegroups.com
We have two SQL Server compatible drivers, the Sybase one and the
SQLSRV one. Both should work. The drivers shouldn't be translating
SQL, JDatabaseQuery or a descendent should be doing it to ensure
portability.

Cheers,

Sam Moffatt
http://pasamio.id.au

> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! CMS Development" group.
> To post to this group, send an email to joomla-...@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-cm...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-cms?hl=en-GB.
>
>

Sam Moffatt

unread,
Jun 13, 2010, 1:25:56 PM6/13/10
to joomla-...@googlegroups.com
I should clarify work in the sense they should be able to connect to a
database, run queries and return the results. Not necessarily run
Joomla!.

Sam Moffatt
http://pasamio.id.au

manowar

unread,
Jun 14, 2010, 5:27:16 AM6/14/10
to Joomla! CMS Development
> Can you elaborate on what you mean by "lot of changes"?

For example, just to make the installation work, I had to add a few
methods to the JDatabase class, in order to pull out all the specific
SQL code from

> That would be good, I was planning on having a look at this tomorrow.
>

I just finished the first attempt to have installation working on SQL
Server yesterday. I'll post the patch right today or tomorrow at
maximum.

> Sign up to JoomlaCode and we will get you branch commit access to work
> on these things. The database branch might be a bit out of date, I was
> planning on creating a new branch for SQL Server to get things up and
> running.
>

Done :-) I've signed up to JoomlaCode (manowar). The current database
branch is actually somehow out of date, but it was a good starting
point :)

manowar

unread,
Jun 14, 2010, 5:29:20 AM6/14/10
to Joomla! CMS Development
> I try it in the past. There are some problems to port Joomla into sql
> server, cause the core using some of unique MySQL functions (like
> concat_ws, char_length, case else, etc). How did you manage to fix that?

Yeah, I noticed it. The idea is to have only the DAL classes
(JDatabase and derived) handle SQL, without having it all around the
code.

In 1.6 I saw the JDatabaseQuery class that already moves in that
direction.

manowar

unread,
Jun 14, 2010, 5:30:33 AM6/14/10
to Joomla! CMS Development
> Hello.
>
> That's nice, I think.
>
> Do you want to build some kind of abstraction level for any DB or just to
> patch Joomla! for MSSQL?
>

The second option (some kind of abstraction level) is the way I'd like
to go. Just patching Joomla for SQL Server means that each time a fix
or a new version is release all the patching works needs to be done
again. I would like to avoid it if possible :)

manowar

unread,
Jun 14, 2010, 5:32:05 AM6/14/10
to Joomla! CMS Development


> SQLSRV one. Both should work. The drivers shouldn't be translating
> SQL, JDatabaseQuery or a descendent should be doing it to ensure
> portability.

Exactly. Doing on-the-fly translation would be very very difficult
IMHO, and it will suck a lot of CPU power.....

Ofer Cohen

unread,
Jun 14, 2010, 7:35:22 AM6/14/10
to joomla-...@googlegroups.com
I think there are some plans in 1.7 to move up and make Joomla works on
other DBs out-of-the-box.
I think it's good start for the next major release of Joomla. This
change would make Joomla more widely used.
About the JDatabaseQuery object - it's not implement in all the core, so
a lot of changes need to be done. Additionally we should do a bridge
JDatabaseQuery to JDatabaseQueryMySQL, JDatabaseQuerySqlSrv, etc, likt
the JDatabase itself so the core would be more comfortable with unique
functions. The cause is each database implement functions differently.
Even MySQL implements non-ansi-sql function (CONCAT_WS, CHAR_LENGTH,
CASE, IF, ELSE, etc) and common phrases (LIMIT isn't part of ANSI-SQL).
For more info, see the next article: http://troels.arvin.dk/db/rdbms/.

Ofer Cohen

Sam Moffatt

unread,
Jun 14, 2010, 12:00:14 PM6/14/10
to joomla-...@googlegroups.com
I started a new branch called mssql
(http://joomlacode.org/svn/joomla/development/branches/mssql/) to put
any custom install scripts. I've given you commit access, it'll take
around half an hour or so to come through. I created it off trunk and
copied the sqlsrv driver out of the database branch so it is a later
version of trunk that is being used.

I'm probably a few hours away from starting work on this, is it
possible to mail through a quick patch or commit onto the branch?

And JDatabaseQuery is going to have to be expanded to do what we need
of it for the portability. JDatabase and the relevant adapters should
only need to speak their native SQL dialect, JDatabaseQuery should be
advanced enough to handle what ever querying we need to do.

Sam Moffatt
http://pasamio.id.au

Matt Thomas

unread,
Jun 14, 2010, 12:05:04 PM6/14/10
to joomla-...@googlegroups.com
This is very cool. I'm excited to see Joomla becoming more flexible in it's implementation. Keep it up!

Best,

Matt

Matt Thomas
Founder - betweenbrain
web • print • identity • creative
www.betweenbrain.com

betweenbrain at The Joomla! Resources Directory™ - http://betweenbra.in/resources

Joomla! 1.6 Nightly Build http://betweenbra.in/x/7
Joomla! 1.6 Issue Tracker http://betweenbra.in/x/5

Ofer Cohen

unread,
Jun 14, 2010, 12:08:15 PM6/14/10
to joomla-...@googlegroups.com
Sam, who did you mean?

Ofer Cohen

Sam Moffatt

unread,
Jun 14, 2010, 12:18:20 PM6/14/10
to joomla-...@googlegroups.com
manowar. If you've got an JoomlaCode account and want branch commit
access I can give you access as well.

Sam Moffatt
http://pasamio.id.au

Ofer Cohen

unread,
Jun 14, 2010, 12:22:37 PM6/14/10
to joomla-...@googlegroups.com
Yep. My user name is oc666.

Thanks

Ofer Cohen

Sam Moffatt

unread,
Jun 14, 2010, 12:26:44 PM6/14/10
to joomla-...@googlegroups.com
Give it about 45 minutes or so and you should have access to the branch.

Cheers,

Sam Moffatt
http://pasamio.id.au

On Mon, Jun 14, 2010 at 9:22 AM, Ofer Cohen <oc...@netvision.net.il> wrote:
> oc666

Davide Mauri

unread,
Jun 15, 2010, 1:36:05 AM6/15/10
to Joomla! CMS Development
On Jun 14, 6:00 pm, Sam Moffatt <pasa...@gmail.com> wrote:
> I started a new branch called mssql
> (http://joomlacode.org/svn/joomla/development/branches/mssql/) to put
> any custom install scripts. I've given you commit access, it'll take
> around half an hour or so to come through. I created it off trunk and
> copied the sqlsrv driver out of the database branch so it is a later
> version of trunk that is being used.

Cool! I'll apply the patch I generated yesterday :)

>
> I'm probably a few hours away from starting work on this, is it
> possible to mail through a quick patch or commit onto the branch?
>

Sure! I'll send to you right now :)

Davide (I switch to use my real name since everyone here is doing
so :))

sid

unread,
Jun 13, 2010, 9:29:19 AM6/13/10
to joomla-...@googlegroups.com
Hi Davide,
It is definitely possible to completely port Joomla to other databases. We are working with the community to build the capabilities to core joomla 1.6 and later to support additional databases. In 1.5, we had supported Oracle database. Continuing the effort into 1.6 we are already working on a branch. What I would like to propose is whether this porting effort can be a collective effort? Because to make Joomla work seamlessly on multiple databases - we have to improve the Query Builder library class. Many have already contributed/have been contributing to this effort and we just need to extend it to make multiple database support on Joomla a reality.

Thanks
Sudhi


--
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To post to this group, send an email to joomla-...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.




--
Thanks & Regards
Sudhi
Founder & Chief Architect
Hooduku Inc
Plexicloud
1.888.262.8389
http://www.hooduku.com
http://www.plexicloud.com



Sam Moffatt

unread,
Jun 15, 2010, 11:45:03 PM6/15/10
to joomla-...@googlegroups.com
Did you commit that patch or just apply it?

Cheers,

Sam Moffatt
http://pasamio.id.au

Davide Mauri

unread,
Jun 16, 2010, 1:52:14 AM6/16/10
to Joomla! CMS Development
Hi Sam

I've just the patch to you via email.

I've tried to apply the patch to the mssql branch but I get alot on
unmatched text. I'll try to work on it and apply it to the mssql
branch asap.

Davide

Davide Mauri

unread,
Jun 16, 2010, 1:55:41 AM6/16/10
to Joomla! CMS Development
> What I would like to propose is whether this porting effort can be a
> collective effort? Because to make Joomla work seamlessly on multiple

Sure :-)

Do you have already something you're working on or you can start to
work on the mssql branch? despite the name the branch will make joomla
able to support multi-databse. It's called mssql just because this is
the rdbms I know better and I'll focus on that. But it will not be a
simply "porting" to mssql: the idea is to create a proper DAL the
abstracts all business logic access from database so that one can
choose/implement the database support he prefer.

Davide

Davide Mauri

unread,
Jun 17, 2010, 2:48:53 AM6/17/10
to Joomla! CMS Development
Sam, the branch has been made from Joomal 1.6 beta 2 or beta 3?

Thanks

Davide

Sam Moffatt

unread,
Jun 17, 2010, 2:56:02 AM6/17/10
to joomla-dev-cms
It was from what ever trunk was at the time which is probably closer
to beta 3. The idea of putting it into a branch is that we should be
able to track and merge back into other branches as required at a
later date.

Sam Moffatt
http://pasamio.id.au

Davide Mauri

unread,
Jun 17, 2010, 7:50:29 AM6/17/10
to Joomla! CMS Development
Thanks.

I've been able to patch the mssql branch with the changes need to
support SQL Server installation, I'll do the commit this evening.

Davide

Sam Moffatt

unread,
Jun 17, 2010, 7:51:30 AM6/17/10
to joomla-...@googlegroups.com
Great news!

Sam Moffatt
http://pasamio.id.au

Davide Mauri

unread,
Jun 17, 2010, 4:49:16 PM6/17/10
to Joomla! CMS Development
Hi Sam

I tried to Commit my changes to mssql branch, but each time try to do
it I get this error:

org.tigris.subversion.javahl.ClientException: RA layer request failed
svn: Commit failed (details follow):
svn: Server sent unexpected return value (403 Forbidden) in response
to MKACTIVITY request for '/svn/joomla/!svn/act/54937603-f325-
ca4e-937d-e177403dda77'

I'm using Eclipse, do you have any idea how to solve it?

Thanks

Davide

On Jun 17, 1:51 pm, Sam Moffatt <pasa...@gmail.com> wrote:
> Great news!
>
> Sam Moffatthttp://pasamio.id.au
>
>
>
> On Thu, Jun 17, 2010 at 4:50 AM, Davide Mauri <davide.ma...@gmail.com> wrote:
> > Thanks.
>
> > I've been able to patch the mssql branch with the changes need to
> > support SQL Server installation, I'll do the commit this evening.
>
> > Davide
>
> > --
> > You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
> > To post to this group, send an email to joomla-...@googlegroups.com.
> > To unsubscribe from this group, send email to joomla-dev-cm...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/joomla-dev-cms?hl=en-GB.- Hide quoted text -
>
> - Show quoted text -

sid

unread,
Jun 17, 2010, 5:22:22 PM6/17/10
to joomla-...@googlegroups.com
I had similar problem. I think the reason is when you check out you did not provide the credentials. When you try to check in - it thinks anonymous checkin.
Clear your cache in eclipse and it should work fine. I was using tortoise svn and on right click -> properties have the option to clear cache.
not sure in eclipse  how you could clear cache .

thanks
sudhi



For more options, visit this group at http://groups.google.com/group/joomla-dev-cms?hl=en-GB.

Sam Moffatt

unread,
Jun 18, 2010, 1:02:34 AM6/18/10
to joomla-dev-cms
I haven't looked at the server to double check that there isn't
anything there but presuming that you're doing a check out and check
in as an authenticated user you should have no issues. Check-ins as
anonymous would obviously not work but I have on my list to double
check that the permissions have been set up properly.

Cheers,

Sam Moffatt
http://pasamio.id.au

Davide Mauri

unread,
Jun 18, 2010, 3:21:15 AM6/18/10
to Joomla! CMS Development
> I had similar problem. I think the reason is when you check out you did not
> provide the credentials. When you try to check in - it thinks anonymous
> checkin.
> Clear your cache in eclipse and it should work fine. I was using tortoise
> svn and on right click -> properties have the option to clear cache.
> not sure in eclipse how you could clear cache .

Ahhh thanks! That's it!

I've just checked in succesfully :)

Davide
Reply all
Reply to author
Forward
0 new messages