Hello,
I look at plugin code just for fun..
I found a pb on win32 system: DIRECTORY_SEPARATOR is \ and not /
On this system, glob function adds \ (and also ls function) and joinPath too.
It is ok to handle file system but in plugin management, the results are used in <a> tag for url or compared to string with / inside.
For exmeple, in loadPlugins function in custom.php, $file is compared to "api/".
In my system, $file contains "api\" that is not equal to "api/" so "api\" appears in menu plugins !
After, the joinPath is used and a url to api plugin is added. The url is "http://localhost/nexty/\plugins/\api/" !
In ls function there is also a / in the last part of function in "$folder/$this_folder". Peharps, it is better to use DIRECTORY_SEPARATOR.
Don't know why api url is build with $config['site_absolute_path'] and not $config['site_relative_path']...
There are 2 cases:
1) path for file system (require, ...)
2) path for url
For 1), DIRECTORY_SEPARATOR is ok but php understand also / even in WIN32 system. So all DIRECTORY_SEPARATOR could be replaced by / (be carreful, some function as glob use DIRECTORY_SEPARATOR !).
For 2), if DIRECTORY_SEPARATOR, a str_replace function must be called or special function like joinUrl (for exemple instead of joinPath) must be used.
bye
Vicnet
Plugin and win32
(2 posts) (2 voices)-
Posted 3 years ago #
-
Hmm - I'll try to fix the ls() functions problem. As soon as I get a hold of a windows system.Posted 3 years ago #
Reply
You must log in to post.