Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum
Welcome, Guest

__DIR__ instead of dirname(__FILE__) from PHP 5.3
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: __DIR__ instead of dirname(__FILE__) from PHP 5.3

__DIR__ instead of dirname(__FILE__) from PHP 5.3 12 years, 3 months ago #7655

  • SA Developer
The traditional way of getting the directory the current file is in with PHP is to use dirname(__FILE__). From PHP 5.3 there is a new magic constant__DIR__ which is the equivilent of this function call.

__DIR__ magic constant

The __DIR__ magic constant is a "magic constant" which changes depending where it is used. It contains the directory of the file it is in. If the file is an include, it is the directory that include file is in. If it is the main script it is the directory that script is in.

__DIR__ is available from PHP 5.3 only. If prior versions a notice will be issued if it is used and the value will be __DIR__ and not the actual directory.

Example error if a version prior to PHP 5.3 is used:
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in ...


Unless your application requires the use of PHP 5.3 or greater, stick with the traditional use of:
dirname(__FILE__);
The topic has been locked.

Re: __DIR__ instead of dirname(__FILE__) from PHP 5.3 12 years, 2 months ago #8056

My PHP version is 5.2.11, I have another version.

Is there some way to run this version? It's urgent.

In reading the specifications, before buying the template, did not say anywhere that you had to use a higher version of php, other than using joomla 2.5. Otherwise I will have to claim the money to pay for the template.
I await your response.

Thanks!
The topic has been locked.

Re: __DIR__ instead of dirname(__FILE__) from PHP 5.3 12 years, 2 months ago #8062

  • loitt
  • OFFLINE
  • Platinum Boarder
  • Posts: 2222
  • Karma: 48
Dear Lucia Garcia,

With your host, please try to replace __DIR__ with dirname(__FILE__) in some files.

Thanks
Ticket System | Join our Clubs to download our extensions and templates
The topic has been locked.
The following user(s) said Thank You: xlife
  • Page:
  • 1
Time to create page: 0.21 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Home Pricing
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
SearchSupport
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes