Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: ZIP plugin file requires archive subfolder, throws error otherwise.
etc wrote #340260:
in
abc_plugin2.zip/abc_pluginsubdirectory, but then how we know this subdirectory name?Additionally, the function is sensitive to the directory separator, so we’d have to test various
/and\combinations.
There seems to be an easy solution, with FL_NODIR flag, to locate manifest.json:
$zip = new ZipArchive;
if ($zip->open('path/to/abc_plugin.zip') === TRUE) {
$index = $zip->locateName('manifest.json', ZipArchive::FL_NODIR);
if ($index !== false) {
dmp($zip->getFromIndex($index));
} else {// apply defaults}
$zip->close();
}
Offline
Re: ZIP plugin file requires archive subfolder, throws error otherwise.
Nice find!
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: ZIP plugin file requires archive subfolder, throws error otherwise.
etc wrote #340260:
- at the root […] (that’s ok, but not how Windows works)
I beg to differ. The layout of a zip file is solely determined by the user who builds it. See exhibit. This is how I build on Windows, according to the zip layout requirements I learned in this thread.
The only relevant variable is your current pwd but not the O/S imho.
Offline
Re: ZIP plugin file requires archive subfolder, throws error otherwise.
Ok, let us say it’s not how me on Windows works. I develop plugins inside their folders and then compress the entire folder in Explorer, getting abc_plugin.zip/abc_plugin/manifest.json paths instead of abc_plugin.zip/manifest.json layout. The least effort..
Offline
Re: ZIP plugin file requires archive subfolder, throws error otherwise.
wet wrote #340251:
1 […] enmattification […].
Narrator: an Automattic-affiliated lawyer is heard stirring.
Offline
Re: ZIP plugin file requires archive subfolder, throws error otherwise.
Let’s get serious ;)
Offline