當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Database\MySqlConnection類代碼示例

本文整理匯總了PHP中Illuminate\Database\MySqlConnection的典型用法代碼示例。如果您正苦於以下問題:PHP MySqlConnection類的具體用法?PHP MySqlConnection怎麽用?PHP MySqlConnection使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了MySqlConnection類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: withTablePrefix

 /**
  * Set the table prefix and return the grammar.
  *
  * @param \Illuminate\Database\Grammar $grammar
  * @return \Illuminate\Database\Grammar 
  * @static 
  */
 public static function withTablePrefix($grammar)
 {
     //Method inherited from \Illuminate\Database\Connection
     return \Illuminate\Database\MySqlConnection::withTablePrefix($grammar);
 }
開發者ID:tvad911,項目名稱:biquyetmuasam.com,代碼行數:12,代碼來源:_ide_helper.php

示例2: PDO

<?php

use BapCat\Persist\Drivers\Local\LocalDriver;
use BapCat\Phi\Phi;
use BapCat\Remodel\Registry;
use BapCat\Remodel\EntityDefinition;
use BapCat\Session\DatabaseSessionServiceProvider;
use BapCat\Session\SessionManager;
use Illuminate\Database\ConnectionInterface;
use Illuminate\Database\MySqlConnection;
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/DoItUserAuthorizer.php';
$pdo = new PDO('mysql:host=localhost;dbname=test', 'root', '');
$connection = new MySqlConnection($pdo, 'test');
$connection->setFetchMode(PDO::FETCH_ASSOC);
$ioc = Phi::instance();
$ioc->bind(ConnectionInterface::class, $connection);
// Grab filesystem directories
$persist = new LocalDriver(__DIR__ . '/..');
$cache = $persist->getDirectory('/cache');
$registry = new Registry($ioc, $cache);
$sp = new DatabaseSessionServiceProvider($ioc, $registry);
$sp->register();
$sp->boot();
$session = $ioc->make(SessionManager::class);
$session->open();
$auth = new DoItUserAuthorizer($session);
開發者ID:BapCat,項目名稱:Auth,代碼行數:27,代碼來源:init.php

示例3: getSchemaBuilder

 public function getSchemaBuilder()
 {
     $schemaBuilder = parent::getSchemaBuilder();
     $schemaBuilder->blueprintResolver(function ($table, $callback) {
         return new Blueprint($table, $callback);
     });
     return $schemaBuilder;
 }
開發者ID:linhntaim,項目名稱:katniss,代碼行數:8,代碼來源:MySqlConnection.php

示例4: getSchemaBuilder

 /**
  * Get a schema builder instance for the connection.
  *
  * @return \Illuminate\Database\Schema\MySqlBuilder
  */
 public function getSchemaBuilder()
 {
     $parentBuilder = parent::getSchemaBuilder();
     // add a blueprint resolver closure that returns the custom blueprint
     $parentBuilder->blueprintResolver(function ($table, $callback) {
         return new Blueprint($table, $callback);
     });
     return $parentBuilder;
 }
開發者ID:shiftonelabs,項目名稱:laravel-nomad,代碼行數:14,代碼來源:MySqlConnection.php

示例5: selectFromWriteConnection

 public function selectFromWriteConnection($query, $bindings = [])
 {
     return parent::select($query, $bindings, false);
 }
開發者ID:expresser,項目名稱:database,代碼行數:4,代碼來源:WpdbConnection.php


注:本文中的Illuminate\Database\MySqlConnection類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。