Created
February 10, 2011 08:07
-
-
Save ichikaway/820117 to your computer and use it in GitHub Desktop.
Kioskの超シンプル版 Mongo編
This file contains hidden or 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
<?php | |
// https://github.com/basuke/kiosk | |
//いつものw | |
function pr($data) { | |
echo "<pre>"; | |
print_r($data); | |
echo "</pre>"; | |
} | |
require_once(__Dir__.'/../kiosk/Kiosk.php'); | |
//Postモデル | |
class Posts extends Kiosk { | |
} | |
/* これはMySQL用config | |
$dbconfig = array( | |
'type' => 'DB', | |
'driver' => 'mysql', | |
'user' => 'root', | |
'password' => '', | |
'db' => 'blog', | |
'host' => 'localhost', | |
); | |
*/ | |
$dbconfig = array( | |
'type' => 'Mongo', | |
'dbname' => 'blog', | |
); | |
$db = Posts::source('default', $dbconfig); | |
Posts::bind($db, array()); | |
$result = Posts::find(array()); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment