test
This commit is contained in:
commit
ec5c74c29f
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
vendor/*
|
28
README.md
Normal file
28
README.md
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# php-getting-started
|
||||||
|
|
||||||
|
A barebones PHP app that makes use of the [Silex](http://silex.sensiolabs.org/) web framework, which can easily be deployed to Heroku.
|
||||||
|
|
||||||
|
This application supports the [Getting Started with PHP on Heroku](https://devcenter.heroku.com/articles/getting-started-with-php) article - check it out.
|
||||||
|
|
||||||
|
## Deploying
|
||||||
|
|
||||||
|
Install the [Heroku Toolbelt](https://toolbelt.heroku.com/).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ git clone git@github.com:heroku/php-getting-started.git # or clone your own fork
|
||||||
|
$ cd php-getting-started
|
||||||
|
$ heroku create
|
||||||
|
$ git push heroku master
|
||||||
|
$ heroku open
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
[](https://heroku.com/deploy)
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
For more information about using PHP on Heroku, see these Dev Center articles:
|
||||||
|
|
||||||
|
- [Getting Started with PHP on Heroku](https://devcenter.heroku.com/articles/getting-started-with-php)
|
||||||
|
- [PHP on Heroku](https://devcenter.heroku.com/categories/php)
|
6
app.json
Normal file
6
app.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "gsat-countdown",
|
||||||
|
"description": "test",
|
||||||
|
"repository": "https://github.com/t510599/gsat-countdown",
|
||||||
|
"addons": []
|
||||||
|
}
|
8
composer.json
Normal file
8
composer.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"require" : {
|
||||||
|
"ext-gd" : "*"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"heroku/heroku-buildpack-php": "*"
|
||||||
|
}
|
||||||
|
}
|
64
composer.lock
generated
Normal file
64
composer.lock
generated
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
{
|
||||||
|
"_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#composer-lock-the-lock-file",
|
||||||
|
"This file is @generated automatically"
|
||||||
|
],
|
||||||
|
"content-hash": "02271911e0b7644acb1e2da1a5c1aea0",
|
||||||
|
"packages": [],
|
||||||
|
"packages-dev": [
|
||||||
|
{
|
||||||
|
"name": "heroku/heroku-buildpack-php",
|
||||||
|
"version": "v164",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/heroku/heroku-buildpack-php.git",
|
||||||
|
"reference": "65bbee93ecc41f8a7d7f909e120c614763079167"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/65bbee93ecc41f8a7d7f909e120c614763079167",
|
||||||
|
"reference": "65bbee93ecc41f8a7d7f909e120c614763079167",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"bin/heroku-hhvm-apache2",
|
||||||
|
"bin/heroku-hhvm-nginx",
|
||||||
|
"bin/heroku-php-apache2",
|
||||||
|
"bin/heroku-php-nginx"
|
||||||
|
],
|
||||||
|
"type": "library",
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "David Zuelke",
|
||||||
|
"email": "dz@heroku.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP/HHVM and Apache2/Nginx as on Heroku",
|
||||||
|
"homepage": "https://github.com/heroku/heroku-buildpack-php",
|
||||||
|
"keywords": [
|
||||||
|
"apache",
|
||||||
|
"apache2",
|
||||||
|
"foreman",
|
||||||
|
"heroku",
|
||||||
|
"hhvm",
|
||||||
|
"nginx",
|
||||||
|
"php"
|
||||||
|
],
|
||||||
|
"time": "2019-10-24T16:05:31+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"aliases": [],
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"stability-flags": [],
|
||||||
|
"prefer-stable": false,
|
||||||
|
"prefer-lowest": false,
|
||||||
|
"platform": {
|
||||||
|
"ext-gd": "*"
|
||||||
|
},
|
||||||
|
"platform-dev": []
|
||||||
|
}
|
2
web/.htaccess
Normal file
2
web/.htaccess
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
RewriteEngine On
|
||||||
|
RewriteRule ^(.+)\.png$ $1.php [L]
|
36
web/exam.php
Normal file
36
web/exam.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
require('../vendor/autoload.php');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
header("Cache-Control: max-age=1");
|
||||||
|
header("Content-type: image/png");
|
||||||
|
|
||||||
|
$N=strtotime("now");
|
||||||
|
$dir=strtotime("2020-01-17 01:15:00");
|
||||||
|
$ds=$dir-$N;
|
||||||
|
$D=intval($ds/86400);
|
||||||
|
$H=intval(($ds%86400)/3600);
|
||||||
|
$M=intval(($ds%3600)/60);
|
||||||
|
$S=$ds%60;
|
||||||
|
|
||||||
|
$str=
|
||||||
|
str_pad($D,2,'0',STR_PAD_LEFT)."天".
|
||||||
|
str_pad($H,2,'0',STR_PAD_LEFT)."時".
|
||||||
|
str_pad($M,2,'0',STR_PAD_LEFT)."分".
|
||||||
|
str_pad($S,2,'0',STR_PAD_LEFT)."秒";
|
||||||
|
|
||||||
|
|
||||||
|
$font = dirname(__FILE__)."/font/Regular.ttf";
|
||||||
|
$img = imagecreatetruecolor(350, 75);
|
||||||
|
$white = imagecolorallocate($img, 220, 220, 220);
|
||||||
|
$blue = imagecolorallocate($img, 51, 150, 255);
|
||||||
|
$blue2 = imagecolorallocate($img, 0, 0, 136);
|
||||||
|
$black = imagecolorallocate($img, 0, 0, 0);
|
||||||
|
imagefill($img, 0, 0, $white);
|
||||||
|
imagettftext($img, 20, 0, 5, 25, $blue2, $font, "距109學測還剩:");
|
||||||
|
imagettftext($img, 30, 0, 5, 65, $blue, $font, $str);
|
||||||
|
//size,,x,y
|
||||||
|
imagepng($img);
|
||||||
|
imagedestroy($img);
|
||||||
|
?>'
|
BIN
web/font/Regular.ttf
Normal file
BIN
web/font/Regular.ttf
Normal file
Binary file not shown.
3
web/index.php
Normal file
3
web/index.php
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
echo "hello world";
|
Loading…
x
Reference in New Issue
Block a user