option to use libraries in php via init file (without composer)
madanpraba opened this issue · 2 comments
madanpraba commented
Please provide a option to use the libraries via init file instead of depending on the composer.
bshaffer commented
Could you please provide more information for what you need? We are not familiar with init files.
vishwarajanand commented
@madanpraba Like @bshaffer suggested above, I don't think we support this scenario. What you can do is download the package beforehand and place them in a specific path. Then replace all dependencies with that specific path. Its tedious work though.
// Path to the directory where you've placed the google-cloud-php files
$googleCloudPhpPath = __DIR__ . '/path/to/google-cloud-php';
// Include the necessary files
require_once $googleCloudPhpPath . '/vendor/autoload.php';
// Now you can use the Google Cloud PHP library in your script
use Google\Cloud\Storage\StorageClient;
// Your code here...
// Example: Instantiate a StorageClient, can be any client here
$storage = new StorageClient();