<?php namespace de\RaumZeitLabor\PartKeepr\Tests; declare(encoding = 'UTF-8'); use de\raumzeitlabor\PartKeepr\PartKeepr; include(dirname(__DIR__). "/src/de/RaumZeitLabor/PartKeepr/PartKeepr.php"); PartKeepr::initialize("test"); $tool = new \Doctrine\ORM\Tools\SchemaTool(PartKeepr::getEM()); $classes = PartKeepr::getClassMetaData(); $tool->dropSchema($classes); $tool->createSchema($classes); ?>
<?php use de\RaumZeitLabor\PartKeepr\Service\ServiceManager; use de\RaumZeitLabor\PartKeepr\PartKeepr; use Doctrine\Common\ClassLoader; include("src/de/RaumZeitLabor/PartKeepr/PartKeepr.php"); PartKeepr::initialize(""); $em = PartKeepr::getEM(); $classes = PartKeepr::getEntityClasses(); $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array( 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em) ));
use de\RaumZeitLabor\PartKeepr\Part\PartUnit; use de\RaumZeitLabor\PartKeepr\Category\Category; use de\RaumZeitLabor\PartKeepr\Part\Part; use de\RaumZeitLabor\PartKeepr\StorageLocation\StorageLocation; use de\RaumZeitLabor\PartKeepr\Stock\StockEntry; use de\RaumZeitLabor\PartKeepr\Category\CategoryManager; use de\RaumZeitLabor\PartKeepr\Category\CategoryManagerService; use de\RaumZeitLabor\PartKeepr\Manufacturer\ManufacturerICLogo; use de\RaumZeitLabor\PartKeepr\Manufacturer\Manufacturer; use de\RaumZeitLabor\PartKeepr\Distributor\Distributor; use de\RaumZeitLabor\PartKeepr\Part\PartDistributor; use de\RaumZeitLabor\PartKeepr\Part\PartManufacturer; PartKeepr::initialize(); echo "=)))==========================================\n"; echo "Actions performed by this script:\n"; echo "* Drop the old database INCLUDING ALL DATA\n"; echo "* Creates the schema\n"; echo "* Creates a test user (username/password test)\n"; echo "* Imports data from database partdb\n"; echo "=)))==========================================\n"; if (!($_SERVER["argc"] == 2 && $_SERVER["argv"][1] == "--yes")) { echo "\n\n"; echo "If you are sure you want to do this, type YES and hit return.\n"; $fp = fopen('php://stdin', 'r');