Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block d8ahazard

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
d8ahazard / index.php
Last active Dec 26, 2018
View index.php
$files = glob("./profiles/*.xml");
$profiles = [];
$types = [];
$names = [];
foreach($files as $file) {
$data = new SimpleXMLElement(file_get_contents($file));
$flat = json_decode(json_encode($data), true);
$name = $flat['@attributes']['name'];
$dpTypes = [];
d8ahazard / swagger2Php.php
Last active Oct 11, 2018
Auto-generate PHP class from swagger documentation...
View swagger2Php.php
// You need to have guzzleHttp installed, and require the vendor path here...
$url = $_GET['url'];
$swaggerApi = json_decode(file_get_contents("$url"), true);
$outFile = pathinfo($url)['filename'] . ".php";
$paths = $swaggerApi['paths'];
$defs = $swaggerApi['definitions'];
You can’t perform that action at this time.