Skip to content

Commit 8a8d3a1

Browse files
committed
Issue #34 - Checking multiple paths for composer generated autoloader.
1 parent 1b9e69a commit 8a8d3a1

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

bin/phue-authenticate

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require_once __DIR__ . '/../vendor/autoload.php';
4+
if (is_file(__DIR__ . '/../vendor/autoload.php')) {
5+
require_once __DIR__ . '/../vendor/autoload.php';
6+
} else {
7+
require_once __DIR__ . '/../../../autoload.php';
8+
}
59

610
// Show usage if host and username not passed
711
if (!isset($argv[1], $argv[2])) {

bin/phue-bridge-finder

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require_once __DIR__ . '/../vendor/autoload.php';
4+
if (is_file(__DIR__ . '/../vendor/autoload.php')) {
5+
require_once __DIR__ . '/../vendor/autoload.php';
6+
} else {
7+
require_once __DIR__ . '/../../../autoload.php';
8+
}
59

610
echo "Philips Hue Bridge Finder", "\n\n";
711

bin/phue-light-finder

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require_once __DIR__ . '/../vendor/autoload.php';
4+
if (is_file(__DIR__ . '/../vendor/autoload.php')) {
5+
require_once __DIR__ . '/../vendor/autoload.php';
6+
} else {
7+
require_once __DIR__ . '/../../../autoload.php';
8+
}
59

610
// Show usage if host and username not passed
711
if (!isset($argv[1], $argv[2])) {

bin/phue-list-lights

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require_once __DIR__ . '/../vendor/autoload.php';
4+
if (is_file(__DIR__ . '/../vendor/autoload.php')) {
5+
require_once __DIR__ . '/../vendor/autoload.php';
6+
} else {
7+
require_once __DIR__ . '/../../../autoload.php';
8+
}
59

610
// Show usage if host and username not passed
711
if (!isset($argv[1], $argv[2])) {

0 commit comments

Comments
 (0)