Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion sync/libremail
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,18 @@ define('BASEPATH', __DIR__);
date_default_timezone_set('UTC');

// Load the vendor libraries
require BASEPATH.'/vendor/autoload.php';
if (file_exists($a = getcwd() . '/vendor/autoload.php')) {
require $a;
} elseif (file_exists($a = __DIR__ . '/../../../autoload.php')) {
require $a;
} elseif (file_exists($a = __DIR__ . '/../vendor/autoload.php')) {
require $a;
} elseif (file_exists($a = BASEPATH.'/vendor/autoload.php')) {
require $a;
} else {
fwrite(STDERR, 'Cannot locate autoloader; please run "composer install"' . PHP_EOL);
exit(1);
}

// Load configuration files and parse the CLI arguments
$constants = parse_ini_file(BASEPATH.'/config/constants.ini', false);
Expand Down
13 changes: 12 additions & 1 deletion sync/server
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,18 @@ define('BASEPATH', __DIR__);
date_default_timezone_set('UTC');

// Load the vendor libraries
require BASEPATH.'/vendor/autoload.php';
if (file_exists($a = getcwd() . '/vendor/autoload.php')) {
require $a;
} elseif (file_exists($a = __DIR__ . '/../../../autoload.php')) {
require $a;
} elseif (file_exists($a = __DIR__ . '/../vendor/autoload.php')) {
require $a;
} elseif (file_exists($a = BASEPATH.'/vendor/autoload.php')) {
require $a;
} else {
fwrite(STDERR, 'Cannot locate autoloader; please run "composer install"' . PHP_EOL);
exit(1);
}

// Load configuration files and parse the CLI arguments
$constants = parse_ini_file(BASEPATH.'/config/constants.ini', false);
Expand Down
13 changes: 12 additions & 1 deletion sync/sync
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,18 @@ ini_set('mysql.connect_timeout', $config['sql']['timeout']);
ini_set('default_socket_timeout', $config['sql']['timeout']);

// Load the vendor libraries
require BASEPATH.'/vendor/autoload.php';
if (file_exists($a = getcwd() . '/vendor/autoload.php')) {
require $a;
} elseif (file_exists($a = __DIR__ . '/../../../autoload.php')) {
require $a;
} elseif (file_exists($a = __DIR__ . '/../vendor/autoload.php')) {
require $a;
} elseif (file_exists($a = BASEPATH.'/vendor/autoload.php')) {
require $a;
} else {
fwrite(STDERR, 'Cannot locate autoloader; please run "composer install"' . PHP_EOL);
exit(1);
}

// Process constants
Constants::process($constants);
Expand Down