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 if (file_exists($rootdir . '/lib/PEAR.php')) {
16 if (!\Phar::running()) {
17 return $rootdir . '/lib/data/programming.magic';
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)) {
25 $rootdir . '/lib/data/programming.magic',
32 return parent::getMagicFile();