Announcement

Symphony's issue tracker has been moved to Github.

Issues are displayed here for reference only and cannot be created or edited.

Browse

Closed#155: rmdirr function

In class.general.php the function rmdirr cannot possibly work as it references $f which is never declared.

It would be nice to rewrite the function to make use of deleteFile so that it can be used in extensions etc.

I’ve used this one in the past: function deleteDirectory($dir) { if (!file_exists($dir)) return true; if (!is_dir($dir)) return unlink($dir);

        foreach (scandir($dir) as $item) {
            if ($item == '.' || $item == '..') continue;
            if (!$this->deleteDirectory($dir.DIRECTORY_SEPARATOR.$item)) return false;
        }
        return rmdir($dir);
    }

Which I guess could be rewritten as the following to make use of deleteFile

    function rmdirr($dir) {
        if (!file_exists($dir)) return true;
        if (!is_dir($dir)) return $this->deleteFile($dir);

        foreach (scandir($dir) as $item) {
            if ($item == '.' || $item == '..') continue;
            if (!$this->rmdirr($dir.DIRECTORY_SEPARATOR.$item)) return false;
        }
        return rmdir($dir);
    }

heh. well spotted. Interestingly, General::rmdirr() is not used anywhere in Symphony’s core. I would suggest we remove it.

One more mystery was revealed. The smiley face already has gone! :P

This issue is closed.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details