I've created a project using openshift and php (i use fillezila for server transfers etc.. not git)
As part of my project i want to upload files to my google drive,
google API state that i should install the Google Client Library with composer.
I couldn't find a simple beginners guide on how to use the composer in openshift and what should i do with it. I am a complete beginner in php and composer use.
Bottom line i want a simple way to upload file to google drive without authentication every time. (for example PHPMailer let you send mail without authentication every time my PHPMailer script sends email to gmail, my password and user name are part of the script).
If I must use google drive API.
Please explain how to use composer on openshift for google drive to install the library using composer and upload a file to the drive.
Related
Can we upload image files to a GCP running compute engine directly using PHP?
I know that it can be done using the backend ssh on GCP.
I have a solution that works in my local system to upload files but does not work on GCP.
Based on initial research it appears that GCP does not allow file upload directly.
Need confirmation though or if there is a way in which file upload can work, please enlighten.
I do not think it can be done directly through php, through ssh yes.
You can upload files with PHP.
If you want to upload to the server local disk, things become a bit simpler. Just ensure you have PHP configured for upload: PHP File Upload
If you want to upload to Google Storage, say to a bucket, you'd need to authenticate and get access there. Google Cloud SDK can provide this. Then you can install API Client Libraries for PHP and optional Cloud SDK components. That way you might call gcloud shell command or use API. Cloud SDK will provide transparent connection and authentication for you so that you can upload to the Google Storage.
Please see:
Cloud SDK
Google API Client Libraries
After hours of work I am stuck with using google calendar php api, I need the basic functionality, reading and adding events (updating and removing later), any advice? I need the solution that works with the recent version of the api and is relatively simple.
Everything you need is well documented on Google Developers website. You will need composer to be running in your project and a Google Account.
On Google Developers page listed above, click Enable the Google Calendar API, select existing project or create a new one and click next. You will get your Client ID and unique Client Secret. You can manage this credentials in API Dashboard. Download these credentials.json and put them in your workdir.
Then you can setup composer for Google Client Library
composer require google/apiclient:^2.0
Now you can set up the sample. Create a file named quickstart.php and put there this code. You can run the sample using php quickstart.php.
Would you like to share your code with us, so we will be able to support you with more relevant answers?
I need to use the Gmail service in my project in Symfony2. I installed the Google Suite via composer but I noticed that it is really too much for what I do. I need only the services and Gmail API. Is there a way to just download the Service Gmail and not all of Google ever via composer?
Thanks for the possible response.
I need to use the Gmail service in my project in Symfony2.
I'd suggest using an existing package:
fourlabs/gmail-doctrine-bundle or
adevait/gmail-wrapper
Both packages use google/apiclient interally to access the Google API.
I installed the Google Suite via composer but I noticed that it is really too much for what I do.
What is Google Suite? Which package are you referring to?
I need only the services and Gmail API. Is there a way to just download the Service Gmail and not all of Google ever via composer?
Composer fetches development dependencies. That doesn't mean that you have to ship all of the fetched stuff. You can reduce the size of your project by deleting unnecessary parts (before you package for deployment).
I an building and Android application store for my academic project. I would like to implement a feature that would allow the user to browse on their PC and remotely initiate downloads (and preferably installs of APK too) onto their android device - this service is already available with Google Play. Which android functions do I need to implement this?
You can use Google Cloud Messaging to create an interface using which you can talk to your app from the server. So basically send a simple message from the server which maybe tells the url of the hosted apk file (or any other relevant info). You can then download it to your android device.
After downloading maybe this could help you out : Android: install .apk programmatically
Or :
Intent promptInstall = new Intent(Intent.ACTION_VIEW)
.setDataAndType(Uri.parse("file:///path/to/your.apk"),
"application/vnd.android.package-archive");
startActivity(promptInstall);
The user will still have to give permissions explicitly to install.
You can install .apk files using android intents.
Intent promptInstall = new Intent(Intent.ACTION_VIEW)
.setDataAndType(Uri.parse("file:///path/to/your.apk"),
"application/vnd.android.package-archive");
startActivity(promptInstall);
So you would have to develop and application that listens to your php webservice and downloads and installs application accordingly.
Good luck!
I am trying to use this simple library for using amazon email service.
the library is here The example shown requires ses.php but I can not find where the ses.php is. I have also tried on the author's website which is here. But still got no idea where this comes from. Is it some standard file to be downloaded from amazon AWS sdk ?
Any help would be apprecaited.
The developer daniel-zahariev has now resolved the issue in the repo after I sent him my inquiry. instead of using ses.php need to include following files
require_once('SimpleEmailService.php');
require_once('SimpleEmailServiceMessage.php');
require_once('SimpleEmailServiceRequest.php');