Skip to content

Commit 45ebc02

Browse files
author
Samuel Holt
authored
Merge pull request #121 from MindscapeHQ/sh/prep-for-release
Prep for v2 release
2 parents 3a37375 + 1f320eb commit 45ebc02

File tree

19 files changed

+572
-152
lines changed

19 files changed

+572
-152
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@
2020
*.PDF diff=astextplain
2121
*.rtf diff=astextplain
2222
*.RTF diff=astextplain
23+
24+
# Exclude from release
25+
sample-apps export-ignore

README.md

Lines changed: 178 additions & 141 deletions
Large diffs are not rendered by default.

UsageExampleV2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
## Usage
22

33
```php
4-
4+
<?php
55
require_once './vendor/autoload.php';
66

7-
$apiUrl = 'https://api.raygun.io';
7+
$apiUrl = 'https://api.raygun.com';
88
$proxy = 'some://proxy';
9-
$apiKey = 'your-api-key';
9+
$apiKey = 'INSERT_API_KEY_HERE';
1010

1111
$httpClient = new GuzzleHttp\Client([
1212
'base_uri' => $apiUrl,

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"exceptions",
99
"logging"
1010
],
11-
"homepage": "http://raygun.io",
11+
"homepage": "http://raygun.com",
1212
"license": "MIT",
1313
"authors": [
1414
{

sample-apps/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
debug.log
2+
config.php
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Setup instructions
2+
3+
1. Install composer dependencies
4+
2. Copy `config-sample.php` and rename to `config.php`
5+
3. Insert your API key from Raygun into the `API_KEY` field
6+
4. Submit the form with empty/zero values to trigger errors
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"require": {
3+
"mindscape/raygun4php": "2.x-dev",
4+
"monolog/monolog": "2.0.2"
5+
}
6+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
const API_KEY = 'INSERT_YOUR_API_KEY_HERE';
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
require_once 'raygunSetup.php';
3+
require_once 'viewData.php';
4+
5+
$viewData = new ViewData();
6+
?>
7+
8+
<!DOCTYPE html>
9+
<html lang="en">
10+
<head>
11+
<?php include 'partials/head.php' ?>
12+
</head>
13+
<body>
14+
15+
<div class="grid-container">
16+
<div class="grid-x">
17+
<h2>Runner's pace calculator</h2>
18+
<div class="cell">
19+
<form method="post" action="index.php">
20+
<div class="grid-x grid-margin-x">
21+
<div class="cell medium-6">
22+
<label for="time">Time (minutes)</label>
23+
<input id="time" name="time" type="number" value="<?php echo $viewData->getTime(); ?>"/>
24+
</div>
25+
<div class="cell medium-6 grid-margin-x">
26+
<label for="distance">Distance (km) <strong>DANGER: DO NOT SET TO ZERO!!!</strong></label>
27+
<input id="distance" name="distance" type="number" step="0.1" value="<?php echo $viewData->getDistance(); ?>"/>
28+
</div>
29+
</div>
30+
31+
<button type="submit" class="primary button">Calculate</button>
32+
</form>
33+
34+
<?php if ($viewData->hasSentData()) : ?>
35+
<div class="callout success">
36+
<p><strong>Average pace:</strong> <?php echo $viewData->getAveragePace(); ?>mins/km</p>
37+
<p><strong>Average speed:</strong> <?php echo $viewData->getAverageSpeed(); ?>km/hr</p>
38+
</div>
39+
<?php endif; ?>
40+
</div>
41+
</div>
42+
</div>
43+
44+
</body>
45+
</html>
46+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<meta charset="UTF-8">
2+
<title>Runner's pace calculator</title>
3+
4+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/foundation-sites@6.4.3/dist/css/foundation.min.css"
5+
integrity="sha256-GSio8qamaXapM8Fq9JYdGNTvk/dgs+cMLgPeevOYEx0= sha384-wAweiGTn38CY2DSwAaEffed6iMeflc0FMiuptanbN4J+ib+342gKGpvYRWubPd/+ sha512-QHEb6jOC8SaGTmYmGU19u2FhIfeG+t/hSacIWPpDzOp5yygnthL3JwnilM7LM1dOAbJv62R+/FICfsrKUqv4Gg=="
6+
crossorigin="anonymous">
7+
8+
<script
9+
src="https://code.jquery.com/jquery-3.4.1.min.js"
10+
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
11+
crossorigin="anonymous"></script>
12+
13+
<script src="https://cdn.jsdelivr.net/npm/foundation-sites@6.4.3/dist/js/foundation.min.js"
14+
integrity="sha256-mRYlCu5EG+ouD07WxLF8v4ZAZYCA6WrmdIXyn1Bv9Vk= sha384-KzKofw4qqetd3kvuQ5AdapWPqV1ZI+CnfyfEwZQgPk8poOLWaabfgJOfmW7uI+AV sha512-0gHfaMkY+Do568TgjJC2iMAV0dQlY4NqbeZ4pr9lVUTXQzKu8qceyd6wg/3Uql9qA2+3X5NHv3IMb05wb387rA=="
15+
crossorigin="anonymous"></script>

0 commit comments

Comments
 (0)