[TYPO3-dev] mkdir and mkdir_deep

Oliver Salzburg oliver.salzburg at googlemail.com
Mon Feb 20 13:06:29 CET 2012


I wanted to write a small patch for a TYPO3 issue. I need to create a
folder hierarchy on the file system to solve that issue. Obviously, I
looked to TYPO3 built-in helpers to solve this.

I found t3lib_div.mkdir and t3lib_div.mkdir_deep and I don't get how to
use either one.

What I want is perfectly available to me using the PHP mkdir with
recursive set to true. But I assume there is a reason to use
t3lib_div.mkdir so that all rights are set as expected etc.

So t3lib_div.mkdir doesn't seem to provide recursive folder generation
at all. So that is out of the question. t3lib_div.mkdir_deep sounds
exactly like what I need.

But why do I need to supply 2 directories? And the first directory is
the "base" and it *has* to exist? So I need to split up the path that I
want, make sure the first part of that split is already existing and
then pass both parts to mkdir_deep()? That can't be right.

Cheers
Oliver



More information about the TYPO3-dev mailing list