-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.php
More file actions
29 lines (22 loc) · 829 Bytes
/
index.php
File metadata and controls
29 lines (22 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require_once __DIR__ . '/vendor/autoload.php';
// Only use the Dotenv lib on development environments
if('production' !== getenv('NODE_ENV')) {
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
}
/**
* Client ID and Secret need to get set outside of the codebase, expecting environment var to store it
*/
$client_id = getenv('WEEBLY_CLIENT_ID') ? getenv('WEEBLY_CLIENT_ID') : null;
$client_secret = getenv('WEEBLY_CLIENT_SECRET') ? getenv('WEEBLY_CLIENT_SECRET') : null;
if($client_id === null || $client_secret === null) {
echo "Error: Env vars not set for application.";
exit();
}
// Create Application instance
$app = new PHPWebhookClient\Application($client_id, $client_secret, __DIR__, $_SERVER['REQUEST_URI']);
// remove vars from global scope
unset($client_id);
unset($client_secret);
$app->run();