PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.20
Booking for Appointments and Events Calendar – Amelia v1.2.20
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / razorpay / razorpay / Razorpay.php
ameliabooking / vendor / razorpay / razorpay Last commit date
.github 2 years ago documents 2 years ago non_composer_tests 4 years ago src 2 years ago tests 2 years ago .editorconfig 4 years ago .travis.yml 4 years ago CHANGELOG.md 2 years ago LICENSE 4 years ago README.md 2 years ago Razorpay.php 2 years ago composer.json 2 years ago doc.md 4 years ago phpunit.xml.dist 2 years ago release.txt 4 years ago
Razorpay.php
55 lines
1 <?php
2
3 // Include Requests only if not already defined
4 if (class_exists('Requests') === false)
5 {
6 require_once __DIR__.'/libs/Requests-1.8.0/library/Requests.php';
7 }
8
9 try
10 {
11 Requests::register_autoloader();
12
13 if (version_compare(Requests::VERSION, '1.6.0') === -1)
14 {
15 throw new Exception('Requests class found but did not match');
16 }
17 }
18 catch (\Exception $e)
19 {
20 throw new Exception('Requests class found but did not match');
21 }
22
23 spl_autoload_register(function ($class)
24 {
25 // project-specific namespace prefix
26 $prefix = 'Razorpay\Api';
27
28 // base directory for the namespace prefix
29 $base_dir = __DIR__ . '/src/';
30
31 // does the class use the namespace prefix?
32 $len = strlen($prefix);
33
34 if (strncmp($prefix, $class, $len) !== 0)
35 {
36 // no, move to the next registered autoloader
37 return;
38 }
39
40 // get the relative class name
41 $relative_class = substr($class, $len);
42
43 //
44 // replace the namespace prefix with the base directory,
45 // replace namespace separators with directory separators
46 // in the relative class name, append with .php
47 //
48 $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
49
50 // if the file exists, require it
51 if (file_exists($file))
52 {
53 require $file;
54 }
55 });