Skip to content

Commit 162343f

Browse files
committed
checking if vendor/autoload.php is readable.
1 parent c3917ce commit 162343f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

index.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
<?php
2+
// Check Auto-Loader
3+
if ( !is_dir(__DIR__.'/vendor') || !is_readable(__DIR__.'/vendor/autoload.php')) {
4+
die('vendor/autoload.php could not be read');
5+
}
6+
7+
// Apply Auto-Loader
28
require_once __DIR__.'/vendor/autoload.php';
39
use Google\CloudFunctions\FunctionsFramework;
410

5-
// Register the function with Functions Framework.
11+
// Register functions with the Functions Framework.
612
// https://console.cloud.google.com/functions/list
7-
FunctionsFramework::http( "on_https", "Quickstart\\CloudFunctions::on_https");
8-
FunctionsFramework::cloudEvent( "on_pubsub", "Quickstart\\CloudFunctions::on_pubsub");
9-
FunctionsFramework::cloudEvent( "on_gcs", "Quickstart\\CloudFunctions::on_gcs");
13+
FunctionsFramework::http( 'on_https', 'Quickstart\\CloudFunctions::on_https');
14+
FunctionsFramework::cloudEvent( 'on_pubsub', 'Quickstart\\CloudFunctions::on_pubsub');
15+
FunctionsFramework::cloudEvent( 'on_gcs', 'Quickstart\\CloudFunctions::on_gcs');
16+

0 commit comments

Comments
 (0)