Skip to content

Commit

Permalink
Fixed http_build_url missing function error
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardo993 authored Jan 18, 2018
1 parent 43281c6 commit 5f6a62c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"autoload": {
"psr-4": {
"riccardo993\\mainstreamingtv\\": "src/"
}
},
"files": ["src/helpers.php"]
},
"prefer-stable": true,
"minimum-stability": "dev"
Expand Down
17 changes: 17 additions & 0 deletions src/helpers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
if(! function_exists('http_build_url'))
{
function http_build_url($parsed_url) {
$scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
$host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
$port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
$user = isset($parsed_url['user']) ? $parsed_url['user'] : '';
$pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : '';
$pass = ($user || $pass) ? "$pass@" : '';
$path = isset($parsed_url['path']) ? $parsed_url['path'] : '';
$query = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
$fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';
return "$scheme$user$pass$host$port$path$query$fragment";
}
}
?>

0 comments on commit 5f6a62c

Please sign in to comment.