-
-
Save pascallaliberte/21d3eb14ec6e5a8dec9a to your computer and use it in GitHub Desktop.
Reproducing the file_get_contents error while retrieving a waxlrs XML configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$configuration_url = 'https://uomedtest.waxlrs.com/lti?u=https://uomedtest.waxlrs.com/embed/mostpopular'; | |
$opts = array( | |
'http' => array( | |
'header' => "Accept: application/xml\r\n" | |
) | |
); | |
$context = stream_context_create($opts); | |
$config_string = file_get_contents($configuration_url, false, $context); | |
/* | |
file_get_contents produces this error: | |
Warning: file_get_contents(https://uomedtest.waxlrs.com/lti?u=https://uomedtest.waxlrs.com/embed/mostpopular): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/html/test.php on line 12 | |
*/ | |
$config = simplexml_load_string($config_string); | |
$launch_url = (string) $config->children('blti', true)->launch_url; | |
echo $launch_url; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment