Merge pull request #35 from hakito/master

Samples missing vendor folder in error because it cannot locate the autoload.php
This commit is contained in:
Jay
2014-09-24 14:53:01 -05:00

View File

@@ -1,17 +1,20 @@
<?php <?php
/* /*
* Sample bootstrap file. * Sample bootstrap file.
*/ */
// Include the composer autoloader // Include the composer autoloader
if(!file_exists(__DIR__ .'/vendor/autoload.php')) { $composerAutoload = dirname(dirname(dirname(__DIR__))) . '/autoload.php';
echo "The 'vendor' folder is missing. You must run 'composer update --no-dev' to resolve application dependencies.\nPlease see the README for more information.\n"; if (!file_exists($composerAutoload))
{
$composerAutoload = __DIR__ .'/vendor/autoload.php';
if(!file_exists(__DIR__ .'/vendor/autoload.php')) {
echo "The 'vendor' folder is missing. You must run 'composer update' to resolve application dependencies.\nPlease see the README for more information.\n";
exit(1); exit(1);
}
} }
require $composerAutoload;
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/common.php'; require __DIR__ . '/common.php';
use PayPal\Rest\ApiContext; use PayPal\Rest\ApiContext;