mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 18:04:08 +02:00
upload framework
This commit is contained in:
parent
754b1ce108
commit
a1a9504f11
30 changed files with 1578 additions and 155 deletions
26
src/upload.php
Normal file
26
src/upload.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php namespace Demostf\API;
|
||||
|
||||
require_once __DIR__ . '/init.php';
|
||||
|
||||
$connectionParams = array(
|
||||
'dbname' => getenv('DB_DATABASE'),
|
||||
'user' => getenv('DB_USERNAME'),
|
||||
'password' => getenv('DB_PASSWORD'),
|
||||
'host' => getenv('DB_HOST'),
|
||||
'driver' => getenv('DB_TYPE'),
|
||||
);
|
||||
if ($connectionParams['driver'] === 'pgsql') {
|
||||
$connectionParams['driver'] = 'pdo_pgsql';
|
||||
}
|
||||
$db = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
|
||||
$host = getenv('BASE_HOST');
|
||||
$storeRoot = getenv('DEMO_ROOT');
|
||||
|
||||
$demoProvider = new Providers\DemoProvider($db);
|
||||
|
||||
$factory = new \RandomLib\Factory;
|
||||
$generator = $factory->getMediumStrengthGenerator();
|
||||
$userProvider = new Providers\UserProvider($db, $generator);
|
||||
$store = new Demo\DemoStore($storeRoot, 'static.' . $host);
|
||||
$uploadController = new Controllers\UploadController($demoProvider, $userProvider, new Demo\Parser(), $store);
|
||||
$uploadController->upload();
|
||||
Loading…
Add table
Add a link
Reference in a new issue