WordPress.org

Support

Support » Plugins and Hacks » Tribulant Snow Storm » [Resolved] Plugin breaks on Windows due to PHP's DIRECTORY_SEPARATOR constant.

[Resolved] Plugin breaks on Windows due to PHP's DIRECTORY_SEPARATOR constant.

  • On windows vista, this plugin does not work since the JS path generated in the snow_storm() function is not correct – missing directory separator slash in the path.

    This is because the DIRECTORY_SEPARATOR PHP constant returns null/empty on Windows Vista with XAMPP (PHP 5.4). I fixed by using ‘/’ instead of DIRECTORY_SEPARATOR.

    In snow-storm.php, replace this line at the top –

    if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); }

    with

    if (!defined('DS')) { define('DS', '/'); }

    This will work on Windows as well as Linux.

Viewing 1 replies (of 1 total)
  • Thank you for your post.

    I’m glad that you got the problem resolved by changing it to a forward slash.

    The PHP DIRECTORY_SEPARATOR constant should always be defined in PHP. It is a predefined PHP constant http://php.net/manual/en/dir.constants.php

    If it’s not defined, you could define it in your wp-config.php file in case some other plugins might want to use it as well.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Plugin breaks on Windows due to PHP's DIRECTORY_SEPARATOR constant.’ is closed to new replies.
Skip to toolbar