Created
September 30, 2016 05:32
-
-
Save leedohyung-dba/ab26057330e9e59d3f15c1df270dac58 to your computer and use it in GitHub Desktop.
[PHP]薄くて簡単なORMを導入する場合、おすすめライブラリー「Idiorm」 ref: http://qiita.com/leedohyung-dba/items/b6ee3f744aa92cf83865
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"require": { | |
"j4mie/idiorm": "1.5.1" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_once './vendor/autoload.php'; | |
# データベース連携設定 | |
ORM::configure('mysql:host='.parent::HOSTNAME.';dbname='.parent::DBNAME); | |
ORM::configure('username', parent::USERNAME); | |
ORM::configure('password', parent::PASSWORD); | |
# ターミナルに日本語が正しく出力されるように設定 | |
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment