CakePHP3では、DBスキーマの更新管理にPhinxを使ったMigrationsというプラグインを使います。(Migrationsはデフォルトで入っています。) 使い方をざっくり説明します。 既存のテーブルからマイグレーションファイルを作る 1から書いてもいいのですがけっこう大変なので、最初はテーブルを作成してからマイグレーションファイルをbakeするのが簡単です。
「サイボウズ・アドベントカレンダー」の2日目です(これまでの記事一覧)。 こんにちは。Garoonのメンテナンスチームの横田です。 JavaScriptだなんだと言っていますが、今日はPHPのバージョンアップの話です。 以前話題になっていた記事やコメントをみると、恐ろしすぎてついていけないです。しかし、いつかはPHPのサポートが切れて、PHP5.4への移行をしなくてはいけません。gkbrモノですよね!特段すごいことでないと前置きしておきますが、できるだけコードを触らずにPHP5.4で動かすためには、どうしたらいいのかをちょちょいと説明しちゃいます! PHP5.4対策 まずは、php.iniファイルのE_STRICTを切ります。PHP5.4ではデフォルトでONになりますので、明示的に切りましょう。 Call-time pass-by-reference(関数呼び出し時の参照渡し)がPHPの機
EC2とVPCの違い とりあえずお試しでEC2を使っている人が、業務的な都合によりVPCに移行したいという場合、どうすればいいか調べることってあると思います。そこで、ここでは相違点や考慮点を挙げたいと思います。 EC2インスタンスを移行する 移行することができます。まずはじめにEC2内のインスタンスのスナップショットを作成します。次にこのスナップショットを基にVPCのインスタンスを作成します。この際に気をつける事は、内部IPアドレスが変わります。外部IPアドレスは付きません。EC2インスタンスは、起動時に外部IPアドレス、DNS名、内部IPアドレス、内部DNS名が自動で付与されますが、VPCインスタンスは、起動時に内部IPアドレスのみ付与され、しかも、IPアドレスを自分で指定することができます。気をつける事は、今のところVPC内でt1.microインスタンスを起動することはできません。 E
手順の概要は下図のようになります。 注意事項 コピー元は実稼働しているインスタンスを利用するのではなく、インスタンスのコピー(スナップショット)を作成し、これで作業するようにしましょう。 作業に失敗したりした場合、インスタンスを破壊する可能性があります。 作成するVolumeとInstanceのAvailability Zone は併せましょう。 ap-northeast-1a/1c が混在するとアタッチできなくて作業のやり直しが増えます ( 経験者談 )。 PV に grub をインストールする 移行元の t1.microインスタンス (以下 コピー元インスタンス) に grub をインストールします。 $ sudo yum install grub コピー元インスタンスのスナップショットを取得する awsのマネジメントコンソールから、EC2に移動します。 メニューから [ ELASTI
初期のPHP5にはいくつものバグがあり、安定度も低かったため、PHP4からの移行がなかなか進みませんでした。 「PHP4とPHP5では全く互換性がない」 「PHP5はバグだらけだ」 「PHP5は動作速度が遅い」 そんな風に思われてしまいました。 自分も最初はPHP5に対してあまり良い印象は受けていませんでしたが、約1年前に安定度・処理速度が改善されたPHP5.1系をインストールしてみて印象はガラッと変わりました。(PHP5.1については、【PHPウォッチ】第22回 PHP 5.1ついにリリース,大幅な高速化を実現し重大なセキュリティ問題も修正:ITpro参照) 今では、もうPHP4には戻りたくないくらいです。 PHPについて、「バージョンが変われば別言語」(404 Blog Not Found:そろそろPHPに関して一言いっとくかより)と言っている人もいましたので、PHP4からPHP5移行
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く