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.
Writing Components/Modules/Mabots/Plugins for ALL versions. ( start 1.0.12 )
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
- AmyStephen
- 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 )
Personally, I think we should focus exclusively on v 1.5 and beyond. But, that's just my opinion!
Thanks!
Amy
Thanks!
Amy
~*~ Joomla!'s Queen of the Blues - Jennifer Marriott ~*~
http://OpenSourceCommunity.org/node/1719/
http://OpenSourceCommunity.org/node/1719/
Re: Writing Components/Modules/Mabots/Plugins for ALL versions. ( start 1.0.12 )
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.
Maybe someone else has figured out a common way to do this. Maybe the core team can tell us.
__________________
Bruce Scherzinger
Bruce Scherzinger
Re: Writing Components/Modules/Mabots/Plugins for ALL versions. ( start 1.0.12 )
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.
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.
- Chris Davenport
- 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 )
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
"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
-
- 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 )
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.
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.
Re: Writing Components/Modules/Mabots/Plugins for ALL versions. ( start 1.0.12 )
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
Bruce Scherzinger