Writing Components/Modules/Mabots/Plugins for ALL versions. ( start 1.0.12 )

A meet-and-greet for our aspiring developers looking for like minded souls to share inspiring ideas and concepts related to Joomla! development. Discuss your apps, gather your team, and get ready to code!

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
jalil
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 128
Joined: Wed Jul 04, 2007 4:54 am
Location: Kuala Lumpur, Malaysia
Contact:

Writing Components/Modules/Mabots/Plugins for ALL versions. ( start 1.0.12 )

Post by jalil » Sun Aug 19, 2007 9:42 pm

would it be possible and wise to do such a thing ? to write a component say, that would work for all versions.
a simple initial test to check which version of joomla is currently running would be enuf to separate the codes.

User avatar
AmyStephen
Joomla! Guru
Joomla! Guru
Posts: 579
Joined: Wed Nov 22, 2006 3:35 pm
Location: Nebraska
Contact:

Re: Writing Components/Modules/Mabots/Plugins for ALL versions. ( start 1.0.12 )

Post by AmyStephen » Mon Aug 20, 2007 12:23 am

Personally, I think we should focus exclusively on v 1.5 and beyond. But, that's just my opinion!

Thanks!
Amy :)
~*~ Joomla!'s Queen of the Blues - Jennifer Marriott ~*~
http://OpenSourceCommunity.org/node/1719/

User avatar
bascherz
Joomla! Intern
Joomla! Intern
Posts: 86
Joined: Mon Jan 16, 2006 1:33 am
Location: Vienna, VA
Contact:

Re: Writing Components/Modules/Mabots/Plugins for ALL versions. ( start 1.0.12 )

Post by bascherz » Mon Aug 20, 2007 12:55 am

Funny, someone was just asking me about this the other day. I believe it is possible, but only because PHP is a scripting language that does not get compiled. I would think it should work, however, a large extension would seem a challenge. But in order to do this, there would have to be a common method of checking the version of Joomla that is running regardless whether it is 1.0.x or 1.5 or later. In version 1.0.x there was a class called joomlaVersion (version.php) that had methods that returned the version of Joomla. Unfortunately, this class does not exist in v1.5. In 1.0.x the version information was hard-coded as default values for class properties.

Maybe someone else has figured out a common way to do this. Maybe the core team can tell us.
__________________
Bruce Scherzinger

User avatar
seadap
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Mon Dec 04, 2006 12:22 am
Contact:

Re: Writing Components/Modules/Mabots/Plugins for ALL versions. ( start 1.0.12 )

Post by seadap » Mon Aug 20, 2007 4:36 am

Well, I'm not sure I like the idea of double coding things depending on the version but if it's desired, it shouldn't be too difficult to subclass JObject and look for specific files or changes between versions.  I'm sure there's something in the data tables that identify which version is currently running.

On the upside though, if we built components that required a certain version of J! then the same logic would apply.  For example, if a  component depends on the latest changes to 1.5.x then it would be able to check for it before installing.
Knowledge is realizing that the street is one-way, wisdom is looking both directions anyway.

User avatar
Chris Davenport
Joomla! Intern
Joomla! Intern
Posts: 95
Joined: Thu Aug 18, 2005 8:57 am
Location: Shrewsbury, Shropshire, United Kingdom

Re: Writing Components/Modules/Mabots/Plugins for ALL versions. ( start 1.0.12 )

Post by Chris Davenport » Tue Aug 21, 2007 12:07 pm

bascherz wrote:But in order to do this, there would have to be a common method of checking the version of Joomla that is running regardless whether it is 1.0.x or 1.5 or later. In version 1.0.x there was a class called joomlaVersion (version.php) that had methods that returned the version of Joomla. Unfortunately, this class does not exist in v1.5. In 1.0.x the version information was hard-coded as default values for class properties.


1.5 has the JVersion class:
http://dev.joomla.org/component/option,com_jd-wiki/Itemid,/id,references:joomla.framework:jversion/

Regards,
Chris.
Joomla! Core Team Member | Documentation Working Group Coordinator

"Reality is merely an illusion, although a very persistent one" - Albert Einstein
"We are suspended in language such that we don't know what is up and what is down" - Niels Bohr

soup a loignon y crouton
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Tue Aug 21, 2007 12:38 am

Re: Writing Components/Modules/Mabots/Plugins for ALL versions. ( start 1.0.12 )

Post by soup a loignon y crouton » Wed Aug 22, 2007 1:22 am

it might be a large undertaking to try to code both for 1.0 and 1.5.

with the new mvc framework in 1.5, you would have to create a huge class library just to insure the compatibility

but is it really worth the effort ? php 4.0 supports ends at the end of the year per the php project. thus more than likely, reputable hosting companies will switch to php 5 or above if they have not done so already and go to registration globals off at the same time.

thus if you can use a more object oriented architecture why would you keep compatibility with procedural code ?

since Joomla is GPL with no commercial clients , it does not have to support any legacy system and thus not try to support 2 development architectures.

i think procedural code had its time with php 4 and it is time now for a more elegant architecture.
Joomla : so easy , a CEO can do it.

User avatar
bascherz
Joomla! Intern
Joomla! Intern
Posts: 86
Joined: Mon Jan 16, 2006 1:33 am
Location: Vienna, VA
Contact:

Re: Writing Components/Modules/Mabots/Plugins for ALL versions. ( start 1.0.12 )

Post by bascherz » Wed Aug 22, 2007 1:49 am

Surely, if one wishes to write a brand new extension the MVC paradigm should be followed. That only makes sense. But the steps prescribed for making an existing 1.0.x extension run in 1.5 native mode seem simple enough, and that could make existing, popular components work until they get completely rewritten. I know I am not particularly anxious to rewrite my extensions. My guess is that will be the case for many of them. And then there are those popular ones that nobody supports anymore. I think we can get some mileage out of doing this for cases where implementing compatibility makes sense to ease existing sites into the 1.5 world. I personally have a site that uses about 18 1.0.x extensions (including several CB extensions). I am sure those are not all going to get rewritten in the next 6 months. Perhaps the sensible thing to do is to just keep 1.0.x running on that site despite lack of team support?
__________________
Bruce Scherzinger


Post Reply