DS Directory Separator in Joomla 3.

After installing Joomla 3 Beta and installing a Joomla 2.5 component I have found a few things that has changed between J Versions 1.5-2.5 and 3. Specifically, I have found that the popular Directory separator is missing.

As a Joomla Extension developer, I am accustom to creating DIRECTORY_SEPARATOR using the constant DS to represent “/” .

At the moment, I don’t know if it it will be included in the J3 upgrades or ifI am simply missing them at the moment, but you can solve your dilemma with the following methods.

1. Create your own constant

Assuming you have an extension and you would like to skip finding and replacing your DS with slashes, then you can create a constant in your extension root  file.

define(“DS”,”/”);

 

B4uCode

I am a passionate PHP user with a love for Open Source systems. With a few years of programming these technologies, I am fortunate to be able to share my thoughts. Joomla and WordPress are my favorite systems to develop. That's enough for now.

You may also like...

4 Responses

  1. Ydrohoos1980 says:

    Thank you for this information,is very important to me. Can you please tell me how can i do this?

  2. Devendra says:

    sir i have an error one of my site which is live nd when i download the file of that live sit and run on local hostStrict standards: Non-static method JLoader::import()
    should not be called statically in
    C:wampwwwbmhlibrariesjoomlaimport.php on line 29 this type of error comes… ple help me to resilve this problem and nothig will be shown on my page

  3. Robert Went says:

    DS does not represent / it represents DIRECTORY_SEPARATOR which can be either / or depending on your hosting environment.
    Why not just check to see if it is defined and if not define it as DIRECTORY_SEPARATOR?

    if (!defined(‘DS’)) {

    define(‘DS’, DIRECTORY_SEPARATOR);

    }

Leave a Reply

Your email address will not be published.