jerodsanto / wordpress-console

An interactive console for WordPress developers
MIT License
66 stars 9 forks source link

not working fine in Windows (apache) server #6

Closed matheuseduardo closed 12 years ago

matheuseduardo commented 12 years ago

in windows xammp server was not working, because the function 'plugin_basename( FILE )' return 'wordpress-console/wordpress-console.php', but the constant DIRECTORY_SEPARATOR it '\', so, explode (function) doesn't work properly. so I sugggest this modification.

any doubt, send me!

jerodsanto commented 12 years ago

Hi, thanks for helping out! I don't have a Windows install to test against, so I never know if I might break something there.

The problem with your solution is that it removes the functionality provided by the explode function (I did not write this part, but it was contributed by another developer) which allows you to use a symbolic link to link the plugin into WordPress's plugins directory.

I wouldn't want to sacrifice that functionality. Is there a way we can have both things work?

nevvermind commented 12 years ago

I bumped into the same problem today (XAMPP, WinXp). Test this on Linux, but it should work:

$parts = explode(DIRECTORY_SEPARATOR, dirname( __FILE__ ));
return array_pop($parts);
jerodsanto commented 12 years ago

@nevvermind that works on my machine. It fixes the problem on Windows? If so, I'll push up the change. Thanks.

nevvermind commented 12 years ago

Yes, it does fix the Win problem.