This commit is contained in:
2026-05-01 23:40:14 +08:00
commit b8f599a617
3867 changed files with 478663 additions and 0 deletions
@@ -0,0 +1,8 @@
<?php
namespace Illuminate\Database\Events;
class ConnectionEstablished extends ConnectionEvent
{
//
}
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace Illuminate\Database\Events;
abstract class ConnectionEvent
{
/**
* The name of the connection.
*
* @var string
*/
public $connectionName;
/**
* The database connection instance.
*
* @var \Illuminate\Database\Connection
*/
public $connection;
/**
* Create a new event instance.
*
* @param \Illuminate\Database\Connection $connection
*/
public function __construct($connection)
{
$this->connection = $connection;
$this->connectionName = $connection->getName();
}
}
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace Illuminate\Database\Events;
class DatabaseBusy
{
/**
* Create a new event instance.
*
* @param string $connectionName The database connection name.
* @param int $connections The number of open connections.
*/
public function __construct(
public $connectionName,
public $connections,
) {
}
}
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace Illuminate\Database\Events;
use Illuminate\Contracts\Database\Events\MigrationEvent as MigrationEventContract;
class DatabaseRefreshed implements MigrationEventContract
{
/**
* Create a new event instance.
*
* @param string|null $database
* @param bool $seeding
*/
public function __construct(
public ?string $database = null,
public bool $seeding = false,
) {
}
}
+8
View File
@@ -0,0 +1,8 @@
<?php
namespace Illuminate\Database\Events;
class MigrationEnded extends MigrationEvent
{
//
}
+35
View File
@@ -0,0 +1,35 @@
<?php
namespace Illuminate\Database\Events;
use Illuminate\Contracts\Database\Events\MigrationEvent as MigrationEventContract;
use Illuminate\Database\Migrations\Migration;
abstract class MigrationEvent implements MigrationEventContract
{
/**
* A migration instance.
*
* @var \Illuminate\Database\Migrations\Migration
*/
public $migration;
/**
* The migration method that was called.
*
* @var string
*/
public $method;
/**
* Create a new event instance.
*
* @param \Illuminate\Database\Migrations\Migration $migration
* @param string $method
*/
public function __construct(Migration $migration, $method)
{
$this->method = $method;
$this->migration = $migration;
}
}
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace Illuminate\Database\Events;
use Illuminate\Contracts\Database\Events\MigrationEvent;
class MigrationSkipped implements MigrationEvent
{
/**
* Create a new event instance.
*
* @param string $migrationName The name of the migration that was skipped.
*/
public function __construct(
public $migrationName,
) {
}
}
@@ -0,0 +1,8 @@
<?php
namespace Illuminate\Database\Events;
class MigrationStarted extends MigrationEvent
{
//
}
+8
View File
@@ -0,0 +1,8 @@
<?php
namespace Illuminate\Database\Events;
class MigrationsEnded extends MigrationsEvent
{
//
}
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace Illuminate\Database\Events;
use Illuminate\Contracts\Database\Events\MigrationEvent as MigrationEventContract;
abstract class MigrationsEvent implements MigrationEventContract
{
/**
* Create a new event instance.
*
* @param string $method The migration method that was invoked.
* @param array<string, mixed> $options The options provided when the migration method was invoked.
*/
public function __construct(
public $method,
public array $options = [],
) {
}
}
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace Illuminate\Database\Events;
use Illuminate\Database\Connection;
class MigrationsPruned
{
/**
* The database connection instance.
*
* @var \Illuminate\Database\Connection
*/
public $connection;
/**
* The database connection name.
*
* @var string|null
*/
public $connectionName;
/**
* The path to the directory where migrations were pruned.
*
* @var string
*/
public $path;
/**
* Create a new event instance.
*
* @param \Illuminate\Database\Connection $connection
* @param string $path
*/
public function __construct(Connection $connection, string $path)
{
$this->connection = $connection;
$this->connectionName = $connection->getName();
$this->path = $path;
}
}
@@ -0,0 +1,8 @@
<?php
namespace Illuminate\Database\Events;
class MigrationsStarted extends MigrationsEvent
{
//
}
@@ -0,0 +1,16 @@
<?php
namespace Illuminate\Database\Events;
class ModelPruningFinished
{
/**
* Create a new event instance.
*
* @param array<class-string> $models The class names of the models that were pruned.
*/
public function __construct(
public $models,
) {
}
}
@@ -0,0 +1,16 @@
<?php
namespace Illuminate\Database\Events;
class ModelPruningStarting
{
/**
* Create a new event instance.
*
* @param array<class-string> $models The class names of the models that will be pruned.
*/
public function __construct(
public $models,
) {
}
}
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace Illuminate\Database\Events;
class ModelsPruned
{
/**
* Create a new event instance.
*
* @param string $model The class name of the model that was pruned.
* @param int $count The number of pruned records.
*/
public function __construct(
public $model,
public $count,
) {
}
}
@@ -0,0 +1,18 @@
<?php
namespace Illuminate\Database\Events;
use Illuminate\Contracts\Database\Events\MigrationEvent;
class NoPendingMigrations implements MigrationEvent
{
/**
* Create a new event instance.
*
* @param string $method The migration method that was called.
*/
public function __construct(
public $method,
) {
}
}
+80
View File
@@ -0,0 +1,80 @@
<?php
namespace Illuminate\Database\Events;
class QueryExecuted
{
/**
* The SQL query that was executed.
*
* @var string
*/
public $sql;
/**
* The array of query bindings.
*
* @var array
*/
public $bindings;
/**
* The number of milliseconds it took to execute the query.
*
* @var float
*/
public $time;
/**
* The database connection instance.
*
* @var \Illuminate\Database\Connection
*/
public $connection;
/**
* The database connection name.
*
* @var string
*/
public $connectionName;
/**
* The PDO read / write type for the executed query.
*
* @var null|'read'|'write'
*/
public $readWriteType;
/**
* Create a new event instance.
*
* @param string $sql
* @param array $bindings
* @param float|null $time
* @param \Illuminate\Database\Connection $connection
* @param null|'read'|'write' $readWriteType
*/
public function __construct($sql, $bindings, $time, $connection, $readWriteType = null)
{
$this->sql = $sql;
$this->time = $time;
$this->bindings = $bindings;
$this->connection = $connection;
$this->connectionName = $connection->getName();
$this->readWriteType = $readWriteType;
}
/**
* Get the raw SQL representation of the query with embedded bindings.
*
* @return string
*/
public function toRawSql()
{
return $this->connection
->query()
->getGrammar()
->substituteBindingsIntoRawSql($this->sql, $this->connection->prepareBindings($this->bindings));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Illuminate\Database\Events;
class SchemaDumped
{
/**
* The database connection instance.
*
* @var \Illuminate\Database\Connection
*/
public $connection;
/**
* The database connection name.
*
* @var string
*/
public $connectionName;
/**
* The path to the schema dump.
*
* @var string
*/
public $path;
/**
* Create a new event instance.
*
* @param \Illuminate\Database\Connection $connection
* @param string $path
*/
public function __construct($connection, $path)
{
$this->connection = $connection;
$this->connectionName = $connection->getName();
$this->path = $path;
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Illuminate\Database\Events;
class SchemaLoaded
{
/**
* The database connection instance.
*
* @var \Illuminate\Database\Connection
*/
public $connection;
/**
* The database connection name.
*
* @var string
*/
public $connectionName;
/**
* The path to the schema dump.
*
* @var string
*/
public $path;
/**
* Create a new event instance.
*
* @param \Illuminate\Database\Connection $connection
* @param string $path
*/
public function __construct($connection, $path)
{
$this->connection = $connection;
$this->connectionName = $connection->getName();
$this->path = $path;
}
}
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace Illuminate\Database\Events;
class StatementPrepared
{
/**
* Create a new event instance.
*
* @param \Illuminate\Database\Connection $connection The database connection instance.
* @param \PDOStatement $statement The PDO statement.
*/
public function __construct(
public $connection,
public $statement,
) {
}
}
@@ -0,0 +1,8 @@
<?php
namespace Illuminate\Database\Events;
class TransactionBeginning extends ConnectionEvent
{
//
}
@@ -0,0 +1,8 @@
<?php
namespace Illuminate\Database\Events;
class TransactionCommitted extends ConnectionEvent
{
//
}
@@ -0,0 +1,8 @@
<?php
namespace Illuminate\Database\Events;
class TransactionCommitting extends ConnectionEvent
{
//
}
@@ -0,0 +1,8 @@
<?php
namespace Illuminate\Database\Events;
class TransactionRolledBack extends ConnectionEvent
{
//
}