DS removed?
Moderator: ooffick
Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
- starijiodvatre
- Joomla! Apprentice
- Posts: 40
- Joined: Mon Jun 02, 2008 11:32 am
DS removed?
Does anybody know why is DS constant removed from the platform, and used DIRECTORY_SEPARATORE instead?
And BTW, where can information like this be found? I've searched everywhere.
And BTW, where can information like this be found? I've searched everywhere.
- fmmarzoa
- Joomla! Enthusiast
- Posts: 123
- Joined: Sun Nov 11, 2007 1:15 pm
- Location: Spain
- Contact:
Re: DS removed?
Which version are you talking about? On my devel J1.7 site I didn't notice such thing...
“The media's the most powerful entity on earth. They have the power to make the innocent guilty and to make the guilty innocent, and that's power. Because they control the minds of the masses.” -- Malcolm X
- starijiodvatre
- Joomla! Apprentice
- Posts: 40
- Joined: Mon Jun 02, 2008 11:32 am
Re: DS removed?
I've seen this on github, e.g: https://github.com/joomla/joomla-platfo ... 8a6d51c3ee
I couldn't find any info about this. Sorry if this is not the right forum, I haven't found better, either.
I couldn't find any info about this. Sorry if this is not the right forum, I haven't found better, either.
-
- Joomla! Enthusiast
- Posts: 105
- Joined: Thu Aug 27, 2009 3:07 am
- Location: Troy, MI - USA
Re: DS removed?
It has been deprecate for a while. Not sure when that happened. Since Php handles '/' correctly on all OS no need for a constant.
Edit: you can usually find things like this by going thru the source code and/or using an IDE that can process phpdoc blocks.
Edit: you can usually find things like this by going thru the source code and/or using an IDE that can process phpdoc blocks.
- starijiodvatre
- Joomla! Apprentice
- Posts: 40
- Joined: Mon Jun 02, 2008 11:32 am
Re: DS removed?
Thank you for your reply, Pocketss.
I usually do find info about stuff like this, but there's nothing about removing DS in phpdoc.
Thank you, once again.
I usually do find info about stuff like this, but there's nothing about removing DS in phpdoc.
Thank you, once again.
-
- Joomla! Guru
- Posts: 527
- Joined: Fri Aug 19, 2005 9:27 am
Re: DS removed?
Been awhile since I tested it but there were some php file operations that broke without the proper directory separator. I'll have to do some poking and testing to see if the problems still exist.Pocketss wrote:It has been deprecate for a while. Not sure when that happened. Since Php handles '/' correctly on all OS no need for a constant.
Edit: you can usually find things like this by going thru the source code and/or using an IDE that can process phpdoc blocks.
If you have code that uses DS, you can always do something like this:
Code: Select all
if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR);
Al Warren
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW
- starijiodvatre
- Joomla! Apprentice
- Posts: 40
- Joined: Mon Jun 02, 2008 11:32 am
Re: DS removed?
Thanks alwarren.
This is what bugs me about Joomla! platform. Why they made a change like this one?! So many backward incompatibilities...
This is what bugs me about Joomla! platform. Why they made a change like this one?! So many backward incompatibilities...
-
- Joomla! Guru
- Posts: 527
- Joined: Fri Aug 19, 2005 9:27 am
Re: DS removed?
It seems to be back. Top of index.php in 2.5.1
Al Warren
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW
-
- Joomla! Ace
- Posts: 1460
- Joined: Sat Jan 21, 2006 8:42 pm
Re: DS removed?
Was always there and I guess it`s there in 2.5 because of backward compatibilityalwarren wrote:It seems to be back. Top of index.php in 2.5.1
- starijiodvatre
- Joomla! Apprentice
- Posts: 40
- Joined: Mon Jun 02, 2008 11:32 am
Re: DS removed?
RedEye, could you please click the link I've posted earlier in this thread?
Was always there but it won't be, and that's what this thread is all about, broken backward compatibility...
Was always there but it won't be, and that's what this thread is all about, broken backward compatibility...
-
- Joomla! Explorer
- Posts: 428
- Joined: Fri May 21, 2010 11:43 am
- Location: Aachen, Germany
- Contact:
Re: DS removed?
The DS constant has been considered deprecated since Joomla 1.6. It's only needed in very rare circumstances and the real PHP constant DIRECTORY_SEPARATOR can be used.
This should have been marked in the source code, unfortunately in the 1.6 days this wasn't always done. The platform has a much better process for this.
Yes this is a backward compatible break, but you have plenty of time to adapt. Those following the dev mailing lists could have seen it back in the 1.6 days but even now it's still 7 months to remove DS from you core. Most likely we will also have a first alpha release in one to two months so extension developers can makes use their code continuous to work.
Joomla 3.0 (and Joomla Platform 12.1) are going to break backwards compatibility in a number of places. A huge amount of deprecated code has been removed (I'm certain more's to follow but the biggest chunk should be done) also the separation of platform and CMS may bring some minor issues with it (like changed file locations for starters). I started documenting those changes here: http://docs.joomla.org/Potential_backwa ... tform_12.1
I suggest all extension developers spend the time NOW to get off those APIs that are already removed in the current platform. I'm doing the same with the CMS and so far I've encountered no problem that couldn't be handled in the 2.5 series.
Most important change to extension devs is that the 1.5 style XML installation files will be no longer supported. Get off those as soon as you can, maybe after support for 1.5 is dropped in April would be a good time.
This should have been marked in the source code, unfortunately in the 1.6 days this wasn't always done. The platform has a much better process for this.
Yes this is a backward compatible break, but you have plenty of time to adapt. Those following the dev mailing lists could have seen it back in the 1.6 days but even now it's still 7 months to remove DS from you core. Most likely we will also have a first alpha release in one to two months so extension developers can makes use their code continuous to work.
Joomla 3.0 (and Joomla Platform 12.1) are going to break backwards compatibility in a number of places. A huge amount of deprecated code has been removed (I'm certain more's to follow but the biggest chunk should be done) also the separation of platform and CMS may bring some minor issues with it (like changed file locations for starters). I started documenting those changes here: http://docs.joomla.org/Potential_backwa ... tform_12.1
I suggest all extension developers spend the time NOW to get off those APIs that are already removed in the current platform. I'm doing the same with the CMS and so far I've encountered no problem that couldn't be handled in the 2.5 series.
Most important change to extension devs is that the 1.5 style XML installation files will be no longer supported. Get off those as soon as you can, maybe after support for 1.5 is dropped in April would be a good time.
-
- Joomla! Guru
- Posts: 527
- Joined: Fri Aug 19, 2005 9:27 am
Re: DS removed?
True enough DS is only used 16 times. And it's easy enough to refactor an extension to either add DS or use DIRECTORY_SEPARATOR. But we shouldn't overlook the fact that even though the path separator shouldn't be an issue, there are still PHP extensions that require a well formed path with the proper separator. Those of us who have been there and done that will understand why that's important.realityking wrote:The DS constant has been considered deprecated since Joomla 1.6. It's only needed in very rare circumstances
When in doubt, you can always use JPath::clean(). It's used 71 times in the core. I'm guessing there's a reason for that.
Al Warren
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW
-
- Joomla! Explorer
- Posts: 428
- Joined: Fri May 21, 2010 11:43 am
- Location: Aachen, Germany
- Contact:
Re: DS removed?
In 2.5.2 it won't be used at all Patch landed a couple of days ago.alwarren wrote: True enough DS is only used 16 times.
That's mostly needed for comparing paths. The reason we did the whole exercise is speed BTW, back in the 1.6 development someone did some benchmarks and there's a small but measurable improvement due to less string concatenation.alwarren wrote:When in doubt, you can always use JPath::clean(). It's used 71 times in the core. I'm guessing there's a reason for that.
-
- Joomla! Guru
- Posts: 527
- Joined: Fri Aug 19, 2005 9:27 am
Re: DS removed?
Hey, what can I say. All I know is I have spent hours fleshing out that "very rare" issue of an improper path separator breaking something. And, by the way, it had nothing to do with comparing paths (or PHP versions). It actually predates the 1.6 days. Considerably. There was a very specific reason for doing it. It solved those "very rare" circumstances where things broke. I don't know how or when the code made it into the core. But if it was introduced solely for performance reasons or for comparing paths then the end result of preventing other breakage was quite coincidental.realityking wrote:...That's mostly needed for comparing paths. The reason we did the whole exercise is speed BTW, back in the 1.6 development someone did some benchmarks and there's a small but measurable improvement due to less string concatenation.
Al Warren
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW
This ain't my first rodeo. Red Foreman says it best.
CQDX de WR5AW