public static function setUpBeforeClass() { parent::setUpBeforeClass(); $tmpDir = __DIR__ . '/tmp'; if (defined('PHP_WINDOWS_VERSION_BUILD')) { $command = 'rmdir /q /s ' . escapeshellarg($tmpDir); } else { $command = 'rmdir -Rf ' . escapeshellarg($tmpDir); } $process = new \Symfony\Component\Process\Process($command); $process->run(); if (!is_dir($tmpDir)) { mkdir($tmpDir); } self::$tmpDir = $tmpDir . '/exiftool_reader'; if (!is_dir(self::$tmpDir)) { mkdir(self::$tmpDir); } copy(__DIR__ . '/../../../files/ExifTool.jpg', self::$tmpDir . '/test2.jpg'); copy(__DIR__ . '/../../../files/ExifTool.jpg', self::$tmpDir . '/test.jpg'); if (!is_dir(self::$tmpDir . '/dir')) { mkdir(self::$tmpDir . '/dir'); } if (!is_dir(self::$tmpDir . '/usr')) { mkdir(self::$tmpDir . '/usr'); } $tmpDir2 = $tmpDir . '/exiftool_reader2'; if (!is_dir($tmpDir2)) { mkdir($tmpDir2); } copy(__DIR__ . '/../../../files/ExifTool.jpg', $tmpDir2 . '/test2.jpg'); if (defined('PHP_WINDOWS_VERSION_BUILD')) { self::$disableSymLinkTest = true; } elseif (!is_link(self::$tmpDir . '/symlink')) { if (!@symlink($tmpDir2, self::$tmpDir . '/symlink')) { self::$disableSymLinkTest = true; } } copy(__DIR__ . '/../../../files/plop/CanonRaw.cr2', self::$tmpDir . '/dir/CanonRaw.cr2'); $tmpDir3 = $tmpDir . '/exiftool_reader3'; if (!is_dir($tmpDir3)) { mkdir($tmpDir3); } if (!is_dir($tmpDir3 . '/.svn')) { mkdir($tmpDir3 . '/.svn'); } if (!is_dir($tmpDir3 . '/.roro')) { mkdir($tmpDir3 . '/.roro'); } if (!is_dir($tmpDir3 . '/.git')) { mkdir($tmpDir3 . '/.git'); } touch($tmpDir3 . '/.git/config'); touch($tmpDir3 . '/.roro/.roro.tmp'); copy(__DIR__ . '/../../../files/ExifTool.jpg', $tmpDir3 . '/.exiftool.jpg'); }
public static function setUpBeforeClass() { parent::setUpBeforeClass(); $tmpDir = __DIR__ . '/tmp'; if (defined('PHP_WINDOWS_VERSION_BUILD')) { $command = 'rmdir /q /s ' . escapeshellarg($tmpDir); } else { $command = 'rmdir -Rf ' . escapeshellarg($tmpDir); } $process = new \Symfony\Component\Process\Process($command); $process->run(); if (!is_dir($tmpDir)) { mkdir($tmpDir); } self::$tmpDir = $tmpDir . '/exiftool_reader'; if (!is_dir(self::$tmpDir)) { mkdir(self::$tmpDir); } file_put_contents(self::$tmpDir . '/hello.world', 'Hello'); file_put_contents(self::$tmpDir . '/hello.exiftool', 'Hello'); if (!is_dir(self::$tmpDir . '/dir')) { mkdir(self::$tmpDir . '/dir'); } if (!is_dir(self::$tmpDir . '/usr')) { mkdir(self::$tmpDir . '/usr'); } $tmpDir2 = $tmpDir . '/exiftool_reader2'; if (!is_dir($tmpDir2)) { mkdir($tmpDir2); } file_put_contents($tmpDir2 . '/hello2.world', 'Hello'); if (defined('PHP_WINDOWS_VERSION_BUILD')) { self::$disableSymLinkTest = true; } elseif (!is_link(self::$tmpDir . '/symlink')) { if (!@symlink($tmpDir2, self::$tmpDir . '/symlink')) { self::$disableSymLinkTest = true; } } file_put_contents(self::$tmpDir . '/dir/newfile.txt', 'Hello'); $tmpDir3 = $tmpDir . '/exiftool_reader3'; if (!is_dir($tmpDir3)) { mkdir($tmpDir3); } if (!is_dir($tmpDir3 . '/.svn')) { mkdir($tmpDir3 . '/.svn'); } if (!is_dir($tmpDir3 . '/.roro')) { mkdir($tmpDir3 . '/.roro'); } if (!is_dir($tmpDir3 . '/.git')) { mkdir($tmpDir3 . '/.git'); } touch($tmpDir3 . '/.git/config'); touch($tmpDir3 . '/.roro/.roro.tmp'); touch($tmpDir3 . '/.phrasea.xml'); }