Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs to install latest 2.x version #1491

Merged
merged 4 commits into from
Aug 10, 2018
Merged

Update docs to install latest 2.x version #1491

merged 4 commits into from
Aug 10, 2018

Conversation

siburny
Copy link
Contributor

@siburny siburny commented Aug 7, 2018

No description provided.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Aug 7, 2018
@siburny
Copy link
Contributor Author

siburny commented Aug 7, 2018

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Aug 7, 2018
@siburny
Copy link
Contributor Author

siburny commented Aug 7, 2018

The best way is not to specify version at all, so the latest could be installed.

@mattwhisenhunt
Copy link
Contributor

Hi @siburny 👋
Thanks for the suggestion and maybe it is superfluous but we want to have the context there that it is not versions 1 or 3.

@siburny
Copy link
Contributor Author

siburny commented Aug 9, 2018

I should've been more clear why I proposed this change. If you run the exact command from the docs

composer require google/apiclient:^2.0

composer will install version 2.0.0. However, the latest one is 2.2.2 (at the moment).

If you prefer not to specify the minor (.x) version in the docs, then we should use the following:

composer require google/apiclient:2.*

@siburny
Copy link
Contributor Author

siburny commented Aug 9, 2018

My php and composer versions

c:\Downloads\>php -v
PHP 7.2.8 (cli) (built: Jul 18 2018 10:03:02) ( NTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.7.0alpha1, Copyright (c) 2002-2018, by Derick Rethans

c:\Downloads\>composer -V
Composer version 1.7.1 2018-08-07 09:39:23

@mattwhisenhunt
Copy link
Contributor

Just so we are on the same page what does the following output?

mkdir testdir
cd testdir
..\composer require google/apiclient:^2.0
..\composer show

@siburny
Copy link
Contributor Author

siburny commented Aug 9, 2018

Of course. Here is the output on my dev machine:

c:\Downloads\testdir>composer require google/apiclient:^2.0
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 12 installs, 0 updates, 0 removals
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing guzzlehttp/psr7 (1.2.3): Loading from cache
  - Installing guzzlehttp/promises (v1.3.1): Loading from cache
  - Installing guzzlehttp/guzzle (6.2.0): Loading from cache
  - Installing phpseclib/phpseclib (2.0.11): Loading from cache
  - Installing psr/log (1.0.2): Loading from cache
  - Installing monolog/monolog (1.23.0): Loading from cache
  - Installing firebase/php-jwt (v3.0.0): Loading from cache
  - Installing google/apiclient-services (v0.64): Loading from cache
  - Installing psr/cache (1.0.1): Loading from cache
  - Installing google/auth (v0.8): Loading from cache
  - Installing google/apiclient (v2.0.0): Loading from cache
phpseclib/phpseclib suggests installing ext-libsodium (SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.)
phpseclib/phpseclib suggests installing ext-mcrypt (Install the Mcrypt extension in order to speed up a few other cryptographic operations.)
phpseclib/phpseclib suggests installing ext-gmp (Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
google/apiclient suggests installing tedivm/stash (For caching certs and tokens (using Google_Client::setCache))
Writing lock file
Generating autoload files

c:\Downloads\testdir>composer show
firebase/php-jwt          v3.0.0 A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should confor...
google/apiclient          v2.0.0 Client library for Google APIs
google/apiclient-services v0.64  Client library for Google APIs
google/auth               v0.8   Google Auth Library for PHP
guzzlehttp/guzzle         6.2.0  Guzzle is a PHP HTTP client library
guzzlehttp/promises       v1.3.1 Guzzle promises library
guzzlehttp/psr7           1.2.3  PSR-7 message implementation
monolog/monolog           1.23.0 Sends your logs to files, sockets, inboxes, databases and various web services
phpseclib/phpseclib       2.0.11 PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, S...
psr/cache                 1.0.1  Common interface for caching libraries
psr/http-message          1.0.1  Common interface for HTTP messages
psr/log                   1.0.2  Common interface for logging libraries

Also, here is the content of the created composer.json (notice the missing caret symbol):

{
    "require": {
        "google/apiclient": "2.0"
    }
}

@mattwhisenhunt
Copy link
Contributor

This just hit me this morning.

Let's change this to add a note that DOS users need to escape the escape character: composer require google/apiclient:^^2.0

@siburny
Copy link
Contributor Author

siburny commented Aug 10, 2018

Unfortunately, composer require google/apiclient:^^2.0 command produces the same results:

firebase/php-jwt          v3.0.0 A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should confor...
google/apiclient          v2.0.0 Client library for Google APIs
google/apiclient-services v0.64  Client library for Google APIs
google/auth               v0.8   Google Auth Library for PHP
guzzlehttp/guzzle         6.2.0  Guzzle is a PHP HTTP client library
guzzlehttp/promises       v1.3.1 Guzzle promises library
guzzlehttp/psr7           1.2.3  PSR-7 message implementation
monolog/monolog           1.23.0 Sends your logs to files, sockets, inboxes, databases and various web services
phpseclib/phpseclib       2.0.11 PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, S...
psr/cache                 1.0.1  Common interface for caching libraries
psr/http-message          1.0.1  Common interface for HTTP messages
psr/log                   1.0.2  Common interface for logging libraries

@siburny siburny changed the title Update docs to install 2.2 version Update docs to install latest 2.x version Aug 10, 2018
@siburny
Copy link
Contributor Author

siburny commented Aug 10, 2018

So after trial and error, I found the right command: you need to include "quotes" around version number

composer require google/apiclient:"^2.0"

which will produce correct results:

firebase/php-jwt          v5.0.0 A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should confor...
google/apiclient          v2.2.2 Client library for Google APIs
google/apiclient-services v0.64  Client library for Google APIs
google/auth               v1.3.2 Google Auth Library for PHP
guzzlehttp/guzzle         6.3.3  Guzzle is a PHP HTTP client library
guzzlehttp/promises       v1.3.1 Guzzle promises library
guzzlehttp/psr7           1.4.2  PSR-7 message implementation that also provides common utility methods
monolog/monolog           1.23.0 Sends your logs to files, sockets, inboxes, databases and various web services
phpseclib/phpseclib       2.0.11 PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, S...
psr/cache                 1.0.1  Common interface for caching libraries
psr/http-message          1.0.1  Common interface for HTTP messages
psr/log                   1.0.2  Common interface for logging libraries

Copy link
Contributor

@mattwhisenhunt mattwhisenhunt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better.

@mattwhisenhunt mattwhisenhunt merged commit 787d68d into googleapis:master Aug 10, 2018
@siburny siburny deleted the patch-1 branch August 10, 2018 18:10
@bshaffer bshaffer mentioned this pull request May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants