当前位置: 首页>>代码示例>>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;未经允许,请勿转载。