Tagged: 

Viewing 4 reply threads
  • Author
    Posts
    • #144

      Hi!

      I’m testing piklist on a windows 7 dev machine and I found a problem: nothing appears in wp-admin (as if the plugin wasn’t activated).

      I traced the problem back to includes/class-piklist.php:86 (PikList::load), the line which initializes the plugin path:

      self::$paths['plugin'] = rtrim(substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/includes')), '/');

      On windows the directory_separator is backslash. As we’re looking for ‘/includes’, it can’t work.

      A simple workaround would be:
      … strpos(dirname(__FILE__), DIRECTORY_SEPARATOR. 'includes') …

      But thinking again, I think that a simpler line like this would do the job:
      self::$paths['plugin'] = dirname(dirname(__FILE__));
      (tested on windows and debian, but only with php5.4).

      Thanks for this promising framework!

      Cheers,

      Daniel

    • #147

      Another one:

      In PikList::render(), you’re testing for an absolute path by checking if the first char is ‘/’ (line 125 in class-piklist.php).
      $_file = (substr($view, 0, 1) == '/' ? $view : self::$paths[$_display] . '/parts/' . $view) . (strstr($view, '.php') ? '' : '.php');
      It can’t work on windows: an absolute path can be \xxx ou X:\xxx and so on.

      I think you need an isAbsolutePath() function like this one which is from symfony: http://svn.symfony-project.com/components/templating/trunk/lib/sfTemplateLoaderFilesystem.php (at the end of file).

      The code would become:
      $_file = (self::isAbsolutePath($view) ? $view : self::$paths[$_display] . '/parts/' . $view) . (strstr($view, '.php') ? '' : '.php');

      With that, it seems that PikList is happy on windows! Didn’t do extensive tests, but I’m able to play with the demos!

      Keep on the good work,

      Daniel

    • #148
      Steve
      Keymaster

      @Daniel– Thank you for bringing this to our attention, and for identifying the issues and solutions. We will look into this, let you know what we find and update Piklist as soon as possible. Thanks again… you’ve really helped make Piklist better!

    • #151
      Steve
      Keymaster

      @Daniel– We just uploaded our latest version to trunk. Can you please download and test? It should fix your Windows issue: http://downloads.wordpress.org/plugin/piklist.zip

      Also, we found a WordPress function, instead of using symfony: path_is_absolute

      Let us know.

    • #160
      Steve
      Keymaster

      @Daniel– Thanks for the email, and letting us know the fix worked.

      I’m closing this ticket.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.