Subject: Warning to plugin writers about data folder and subfolder name

Posted on: 19/02/14 09:23am
By: ::Ben

Just a warning for plugin writers:
For your plugins, do not store any data under the data folder in a folder name like your plugin. This folder will be delete during your plugin upgrade and plugin upload Frown

PHP Formatted Code
// Extract the tarball to data so we can get the $pi_name name from admin/install.php
            $archive->unpack($_CONF['path'] . 'data/',
                             array($dirname . '/admin/install.php'));
            $plugin_inst = $_CONF['path'] . 'data/' . $dirname . '/admin/install.php';
            $fdata = '';
            $fhandle = @fopen($plugin_inst, 'r');
            if ($fhandle) {
                $fdata = fread($fhandle, filesize($plugin_inst));

            // Remove the plugin from data/
            require_once 'System.php';
            @System::rm('-rf ' . $_CONF['path'] . 'data/' . $dirname);

Geeklog - Forum