I'm trying to extract a .tar archive by means of PHP. I'm using such a code:
$phar = new PharData('test.tar');
$phar->extractTo('/home/user/newtest');
It works fine, but if my archive contains en empty directory it is not extracted by the mentioned code. So, if my .tar file has this structure:
user@computer:~/test$ tar -tvf test.tar
drwxrwxr-x user/user 0 2012-12-07 22:35 dir1/
-rw-rw-r-- user/user 798 2012-10-28 23:41 dir1/articles.txt
drwxrwxr-x user/user 0 2012-12-07 22:35 emptyDir/
-rw-rw-r-- user/user 834 2012-09-15 22:47 main.html
I get after unpacking:
user@computer:~/newtest$ ls -l
drwxrwxr-x 2 user user 4096 Dec. 7 22:35 dir1
-rw-rw-r-- 1 user user 834 Sep. 15 22:47 main.html
So, the empty 'emptyDir' is not extracted.
Does anyone know how to fix it?
Thank you in advance for any assistance!