ITの隊長のブログ

ITの隊長のブログです。Rubyを使って仕事しています。最近も色々やっているお(^ω^ = ^ω^)

ComposerでGithubからソースをダウンロードしようとしたら、トークン(?)を求められた

???

Could not fetch https://api.github.com/repos/Guzzle3/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c, please create a GitHub OAuth token to go over the API rate limit
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+user.local+2015-09-15+0000
to retrieve a token. It will be stored in "/Users/user/.composer/auth.json" for future use by Composer.
Token (hidden): 

匿名で何度もアクセスすると、制限がかけられるらしい。

待つのが面倒なら、ログインしてくれってお(^ω^ワカッタオ

ここにアクセス

https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+<servername>+2015-06-26+0933

ログインしたら、チェックボックスが沢山あるので、よくわからないけど、私は「repo」だけにチェックしてトークンを発行しました。

そして作成したトークンをコピーして、下記コマンドを実行

$ composer config --global github-oauth.github.com ${ACCESS_TOKEN}

そしたら、次でcomposerが使えると思います!

【CakePHP】php.iniでtimezoneを設定したのに./Console/cakeで出力されるPHP Warning: strtotime()

長いタイトルやね。

PHP Warning:  strtotime(): It is not safe to rely on the system's timezone settings.

こんなエラーがでたらphp.iniに設定しないといけないんだけど、渡しの場合はすでに設定済み。

つまり、Webのアクセスからはエラーはでないが、./Console/cakeCakeShellを実行すると出力される。

ので、Config/core.phpに設定を追加した。

<?php
// ~ 省略 ~
/**
 * Uncomment this line and correct your server timezone to fix
 * any date & time related errors.
 */
    date_default_timezone_set('Asia/Tokyo');

これでおk