コード例 #1
0
ファイル: Table.php プロジェクト: cheevauva/trash
 public function __construct($table)
 {
     $tables = Metadata::getInstance()->get('tables');
     if (empty($tables[$table])) {
         throw new \Yabcms\Exception(sprintf('table "%s" not defined in metadata', $table));
     }
     $this->table = $tables[$table];
     $this->pdo = Database::getInstance()->getConnection($this->table['connection']);
     $this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME);
 }
コード例 #2
0
ファイル: index.php プロジェクト: cheevauva/trash
<?php

require_once 'bootstrap.php';
$user = new Yabcms\Module\User();
var_dump($user, \Yabcms\Metadata::getInstance()->get('tables'));
コード例 #3
0
ファイル: bootstrap.php プロジェクト: cheevauva/trash
<?php

set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__);
require 'vendor/autoload.php';
$config = \Yabcms\Config::getInstance();
$config->setConfig(__DIR__ . DIRECTORY_SEPARATOR . 'config.php');
$metadata = \Yabcms\Metadata::getInstance();
コード例 #4
0
ファイル: Util.php プロジェクト: cheevauva/trash
 public function __construct()
 {
     $this->metadata = \Yabcms\Metadata::getInstance();
 }