commit
581d65afba
4 changed files with 103 additions and 0 deletions
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
{ |
||||
"name": "digitalocean-apps/sample-php", |
||||
"description": "Sample PHP application for App Platform", |
||||
"type": "project", |
||||
"require": { |
||||
"alrik11es/cowsayphp": "^1.2" |
||||
}, |
||||
"authors": [ |
||||
{ |
||||
"name": "Kamal Nasser", |
||||
"email": "kamal@digitalocean.com" |
||||
} |
||||
] |
||||
} |
||||
@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
|
||||
{ |
||||
"_readme": [ |
||||
"This file locks the dependencies of your project to a known state", |
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", |
||||
"This file is @generated automatically" |
||||
], |
||||
"content-hash": "16e03395d34a6908d884db19ef1396b5", |
||||
"packages": [ |
||||
{ |
||||
"name": "alrik11es/cowsayphp", |
||||
"version": "1.2.0", |
||||
"source": { |
||||
"type": "git", |
||||
"url": "https://github.com/alrik11es/cowsayphp.git", |
||||
"reference": "080dc10c8f5420fef35163569293601f17124eeb" |
||||
}, |
||||
"dist": { |
||||
"type": "zip", |
||||
"url": "https://api.github.com/repos/alrik11es/cowsayphp/zipball/080dc10c8f5420fef35163569293601f17124eeb", |
||||
"reference": "080dc10c8f5420fef35163569293601f17124eeb", |
||||
"shasum": "" |
||||
}, |
||||
"require": { |
||||
"php": ">=5.6.0" |
||||
}, |
||||
"require-dev": { |
||||
"phpunit/phpunit": "5.*", |
||||
"scrutinizer/ocular": "~1.1" |
||||
}, |
||||
"bin": [ |
||||
"bin/cowsayphp" |
||||
], |
||||
"type": "library", |
||||
"extra": { |
||||
"branch-alias": { |
||||
"dev-master": "1.0-dev" |
||||
} |
||||
}, |
||||
"autoload": { |
||||
"psr-4": { |
||||
"Cowsayphp\\": "src" |
||||
} |
||||
}, |
||||
"notification-url": "https://packagist.org/downloads/", |
||||
"license": [ |
||||
"MIT" |
||||
], |
||||
"authors": [ |
||||
{ |
||||
"name": "Marcos Sigueros", |
||||
"email": "alrik11es@gmail.com", |
||||
"homepage": "https://github.com/alrik11es", |
||||
"role": "Developer" |
||||
} |
||||
], |
||||
"description": "Cowsay port in PHP", |
||||
"homepage": "https://github.com/alrik11es/cowsayphp", |
||||
"keywords": [ |
||||
"cowsay" |
||||
], |
||||
"time": "2016-08-25T07:53:44+00:00" |
||||
} |
||||
], |
||||
"packages-dev": [], |
||||
"aliases": [], |
||||
"minimum-stability": "stable", |
||||
"stability-flags": [], |
||||
"prefer-stable": false, |
||||
"prefer-lowest": false, |
||||
"platform": [], |
||||
"platform-dev": [], |
||||
"plugin-api-version": "1.1.0" |
||||
} |
||||
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
<?php |
||||
require __DIR__ . '/vendor/autoload.php'; |
||||
|
||||
use Cowsayphp\Farm; |
||||
|
||||
header('Content-Type: text/plain'); |
||||
|
||||
$text = "Set a message by adding ?message=<message here> to the URL"; |
||||
if(isset($_GET['message']) && $_GET['message'] != '') { |
||||
$text = $_GET['message']; |
||||
} |
||||
|
||||
$cow = Farm::create(\Cowsayphp\Farm\Cow::class); |
||||
echo $cow->say($text); |
||||
Loading…
Reference in new issue