Tagged: windows
- This topic has 4 replies, 2 voices, and was last updated 9 years, 5 months ago by
Steve.
-
AuthorPosts
-
-
August 2, 2012 at 9:36 am #144
Daniel MénardMemberHi!
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
-
August 2, 2012 at 10:17 am #147
Daniel MénardMemberAnother 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
-
August 2, 2012 at 4:25 pm #148
-
August 3, 2012 at 3:38 pm #151
SteveKeymaster@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.
-
August 21, 2012 at 10:18 am #160
-
-
AuthorPosts
- You must be logged in to reply to this topic.