4 class Tool_MIME_Type_PlainDetect extends \MIME_Type_PlainDetect
7 * Try to find the magic file copied by phing's build.xml into
10 * @return string path to the magic file
12 public static function getMagicFile()
14 $rootdir = __DIR__ . '/../../../../../';
15 $magicPath = $rootdir . '/lib/cweiske/mime_type_plaindetect/data/programming.magic';
16 if (!\Phar::running()) {
19 //magic file within a .phar does not work:
20 // https://bugs.php.net/bug.php?id=67556
22 $target = '/tmp/phorkie-programming.magic';
23 if (!file_exists($target)) {
24 copy($magicPath, $target);
28 return parent::getMagicFile();