-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathglobal.inc.php
54 lines (41 loc) · 1.21 KB
/
global.inc.php
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
require_once __DIR__ . '/vendor/autoload.php';
if (!\defined('ENDPOINT')) {
\define('ENDPOINT', 'https://localhost/v1');
}
if (!\defined('PROJECT_ID')) {
\define('PROJECT_ID', '<Your Project ID />');
}
if (!\defined('API_KEY')) {
\define('API_KEY', '<Your Project Secret Api key />');
}
// Helper functions
/**
* Helper method to output debug data for all passed variables,
* uses `print_r()` for arrays and objects, `var_dump()` otherwise.
*/
function appwriteDebug()
{
echo "<pre>";
$args = \func_get_args();
$length = \count($args);
if ($length === 0) {
echo "ERROR: No arguments provided.<hr>";
} else {
foreach ($args as $i => $iValue) {
$arg = $iValue;
echo "<h2>Argument {$i} (" . \gettype($arg) . ")</h2>";
if (\is_array($arg) || \is_object($arg)) {
\print_r($arg);
} else {
\var_dump($arg);
}
echo "<hr>";
}
}
$backtrace = \debug_backtrace();
// output call location to help finding these debug outputs again
echo "appwriteDebug() called in {$backtrace[0]['file']} on line {$backtrace[0]['line']}";
echo "</pre>";
exit;
}