Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm having a a pain in the head using the ABSPATH constant in Windows.
Addressing files and folders in Windows is usually done using the \ (forward-slash) character while for Linux the character would be / (backslash).
Unfortunately the ABSPATH in Wordpress is defined with only Linux in mind (putting a / at the end of it).
I wonder if I can over-ride it's definition since in wp-config.php it's defined under an if clause which indicates it can be defined elsewhere.

Problem detalis:

  1. I'm running on localhost
  2. The problem is with the statpress-visitors internal addressing.

This is how it addresses the files:

ABSPATH . 'wp-content/plugins/' . dirname(plugin_basename(__FILE__)) . '/def/os.dat'

And this is what I get as output:

C:\wamp\www\wp/wp-content/plugins/statpress-visitors/def/os.dat
share|improve this question
    
Could you elaborate some more on 2 ? Can it be narrowed down to specific place / function in plugin that fails? –  Rarst Feb 7 '12 at 11:35

1 Answer 1

up vote 1 down vote accepted

Windows does support both styles of slashes in path.

I am not sure if ABSPATH definition is safe to edit:

  • pro it's in wp-config.php
  • con it's says to not edit following above it

Myself I just use it as is, or replace slashes to make them uniform when putting path together. If that doesn't work for you please provide specific examples where this causes issues.

share|improve this answer
    
Thanks, I updated the question. –  Hamed Momeni Feb 7 '12 at 11:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.