type() public static method

Get the file type of a given file.
public static type ( string $path ) : string
$path string
return string
Example #1
0
 public static function isSameType(File $origin, $filename)
 {
     $extensions = explode('.', pathinfo($filename, PATHINFO_BASENAME));
     array_shift($extensions);
     return $origin->type() == array_shift($extensions);
 }
Example #2
0
 public function show($username, $name)
 {
     $path = public_path() . '/assets/' . $username . '/image/' . $name;
     $file = File::get($path);
     return Response::make($file, 200)->header('content-type', File::type($path));
 }
Example #3
0
 /**
  * {@inheritDoc}
  */
 public function type($path)
 {
     return \File::type($this->computePath($path));
 }