Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Plane model to use curl rather than file_get_contents #11

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions application/models/Plane.php
Original file line number Diff line number Diff line change
@@ -13,10 +13,20 @@ public function __construct () {

// Returns all planes from json format from server
public function all () {
$page = "http://wacky.jlparry.com/info/airplanes";
$json_planes = file_get_contents ($page);

$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'http://wacky.jlparry.com/info/airplanes');
$result = curl_exec($ch);
curl_close($ch);

// $page = "http://wacky.jlparry.com/info/airplanes";
// $json_planes = file_get_contents ($page);

return $json_planes;
// return $json_planes;

return $result;
}

}
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased] - YR
### Changed
- Updated Planes Model to use Curl as fopen is not enabled with url

## [Unreleased] - YR
### Added
- Planes Model