Browse Source

sample-php

main
Kamal Nasser 6 years ago
commit
581d65afba
  1. 2
      .gitignore
  2. 14
      composer.json
  3. 73
      composer.lock
  4. 14
      index.php

2
.gitignore vendored

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
composer.phar
/vendor/

14
composer.json

@ -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"
}
]
}

73
composer.lock generated

@ -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"
}

14
index.php

@ -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…
Cancel
Save