App\Http\Streamers\Streamer::__construct PHP Метод

__construct() публичный Метод

BaseStreamer constructor.
public __construct ( Song $song )
$song app\models\Song Song
    public function __construct(Song $song)
    {
        $this->song = $song;
        abort_unless($this->song->s3_params || file_exists($this->song->path), 404);
        // Hard code the content type instead of relying on PHP's fileinfo()
        // or even Symfony's MIMETypeGuesser, since they appear to be wrong sometimes.
        $this->contentType = 'audio/' . pathinfo($this->song->path, PATHINFO_EXTENSION);
        // Turn off error reporting to make sure our stream isn't interfered.
        @error_reporting(0);
    }

Usage Example

Пример #1
0
 public function __construct(Song $song)
 {
     parent::__construct($song);
 }
All Usage Examples Of App\Http\Streamers\Streamer::__construct
Streamer