Skip to content

Instantly share code, notes, and snippets.

@ichikaway
Created February 10, 2011 08:07
Show Gist options
  • Save ichikaway/820117 to your computer and use it in GitHub Desktop.
Save ichikaway/820117 to your computer and use it in GitHub Desktop.
Kioskの超シンプル版 Mongo編
<?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