public static function getGoogleAPITools() { if (!file_exists(__DIR__ . "/../Google")) { $dl_location = __DIR__ . "/../client.zip"; $dl_url = "https://github.com/google/google-api-php-client/archive/master.zip"; $za = new ZipArchive(); if ($za->open(Utility::getFileFromURL($dl_url, $dl_location))) { $za->extractTo(__DIR__ . "/../temp"); shell_exec("mv ../temp/google-api-php-client-master/src/Google ../Google"); shell_exec("rm -rf ../temp/"); shell_exec("rm ../client.zip"); } } }
<?php /** * Created by PhpStorm. * User: simle * Date: 9/15/2015 * Time: 1:17 PM */ error_reporting(E_ALL & ~E_NOTICE); \GBAPIS\Utility::getGoogleAPITools(); require_once __DIR__ . "/../classes/GBAPIS/autoloader.php"; require_once __DIR__ . "/../classes/Google/autoload.php"; $dbh = new \GBAPIS\Database\MySQL(); $api = new \GBAPIS\API_Scraper($dbh); $api->makeCall("Fiction");