public static function generate($file)
    {
        $filePointer = fopen($file, 'rb');

        $names = '';
        $extensions = '';

        $header = true;
        while (($row = fgetcsv($filePointer))) {
            if ($header) {
                $header = false;
                continue;
            }

            $mime = trim($row[0]);
            $name = trim(addslashes($row[1]));
            $extension = trim($row[2]);

            $extensions .= "\t\t'$mime' => '$extension',\n";
            $names .= "\t\t'$mime' => '$name',\n";
        }

        $class = '';
        $class .= self::getHeader();
        $class .= self::getFunctions();
        $class .= self::getPropertyMimesHeader();
        $class .= $extensions;
        $class .= self::getPropertyMimesFooter();
        $class .= self::getPropertyNamesHeader();
        $class .= $names;
        $class .= self::getPropertyNamesFooter();
        $class .= self::getFooter();

        file_put_contents(__DIR__ . '/FileMimes.php', $class);
    }
public static function generate($file)
    {
        $filePointer = fopen($file, 'rb');

        $names = '';
        $extensions = '';

        $header = true;
        while (($row = fgetcsv($filePointer))) {
            if ($header) {
                $header = false;
                continue;
            }

            $mime = trim($row[0]);
            $name = trim(addslashes($row[1]));
            $extension = trim($row[2]);

            $extensions .= "\t\t'$mime' => '$extension',\n";
            $names .= "\t\t'$mime' => '$name',\n";
        }

        $class = '';
        $class .= self::getHeader();
        $class .= self::getFunctions();
        $class .= self::getPropertyMimesHeader();
        $class .= $extensions;
        $class .= self::getPropertyMimesFooter();
        $class .= self::getPropertyNamesHeader();
        $class .= $names;
        $class .= self::getPropertyNamesFooter();
        $class .= self::getFooter();

        file_put_contents(__DIR__ . '/FileMimes.php', $class);
    }
public static function generate ( $ file ) { $ filePointer = fopen ( $ file , 'rb' ) ; $ names = '' ; $ extensions = '' ; $ header = true ; while ( ( $ row = fgetcsv ( $ filePointer ) ) ) { if ( $ header ) { $ header = false ; continue ; } $ mime = trim ( $ row [ 0 ] ) ; $ name = trim ( addslashes ( $ row [ 1 ] ) ) ; $ extension = trim ( $ row [ 2 ] ) ; $ extensions .= "\t\t'$mime' => '$extension',\n" ; $ names .= "\t\t'$mime' => '$name',\n" ; } $ class = '' ; $ class .= self :: getHeader ( ) ; $ class .= self :: getFunctions ( ) ; $ class .= self :: getPropertyMimesHeader ( ) ; $ class .= $ extensions ; $ class .= self :: getPropertyMimesFooter ( ) ; $ class .= self :: getPropertyNamesHeader ( ) ; $ class .= $ names ; $ class .= self :: getPropertyNamesFooter ( ) ; $ class .= self :: getFooter ( ) ; file_put_contents ( __DIR__ . '/FileMimes.php' , $ class ) ; }
Generate FileMimes class.

@param $file
Generate FileMimes class .