the beginning of the idiots
This commit is contained in:
0
qwen/hack/src/.gitkeep
Normal file
0
qwen/hack/src/.gitkeep
Normal file
27
qwen/hack/src/Controllers/AuthController.php
Normal file
27
qwen/hack/src/Controllers/AuthController.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?hh // strict
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
class AuthController
|
||||
{
|
||||
public function login(Request $request, Response $response): Response
|
||||
{
|
||||
$response->getBody()->write(json_encode(['message' => 'Login endpoint']));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
public function logout(Request $request, Response $response): Response
|
||||
{
|
||||
$response->getBody()->write(json_encode(['message' => 'Logout endpoint']));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
public function register(Request $request, Response $response): Response
|
||||
{
|
||||
$response->getBody()->write(json_encode(['message' => 'Register endpoint']));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
}
|
||||
15
qwen/hack/src/Controllers/HomeController.php
Normal file
15
qwen/hack/src/Controllers/HomeController.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?hh // strict
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
class HomeController
|
||||
{
|
||||
public function index(Request $request, Response $response): Response
|
||||
{
|
||||
$response->getBody()->write('<h1>Welcome to MerchantsOfHope.org</h1>');
|
||||
return $response->withHeader('Content-Type', 'text/html');
|
||||
}
|
||||
}
|
||||
48
qwen/hack/src/Controllers/JobController.php
Normal file
48
qwen/hack/src/Controllers/JobController.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?hh // strict
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
class JobController
|
||||
{
|
||||
public function listJobs(Request $request, Response $response): Response
|
||||
{
|
||||
$response->getBody()->write(json_encode(['message' => 'List jobs endpoint']));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
public function getJob(Request $request, Response $response, array $args): Response
|
||||
{
|
||||
$jobId = $args['id'];
|
||||
$response->getBody()->write(json_encode(['message' => 'Get job endpoint', 'id' => $jobId]));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
public function myJobs(Request $request, Response $response): Response
|
||||
{
|
||||
$response->getBody()->write(json_encode(['message' => 'My jobs endpoint']));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
public function createJob(Request $request, Response $response): Response
|
||||
{
|
||||
$response->getBody()->write(json_encode(['message' => 'Create job endpoint']));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
public function updateJob(Request $request, Response $response, array $args): Response
|
||||
{
|
||||
$jobId = $args['id'];
|
||||
$response->getBody()->write(json_encode(['message' => 'Update job endpoint', 'id' => $jobId]));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
public function deleteJob(Request $request, Response $response, array $args): Response
|
||||
{
|
||||
$jobId = $args['id'];
|
||||
$response->getBody()->write(json_encode(['message' => 'Delete job endpoint', 'id' => $jobId]));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
}
|
||||
}
|
||||
32
qwen/hack/src/bootstrap.php
Normal file
32
qwen/hack/src/bootstrap.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?hh // strict
|
||||
|
||||
use function DI\{create, get, add};
|
||||
|
||||
/**
|
||||
* Bootstrap file for the MerchantsOfHope application
|
||||
*/
|
||||
|
||||
// Enable error reporting
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
// Load environment variables
|
||||
if (file_exists(__DIR__ . '/../.env')) {
|
||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../');
|
||||
$dotenv->load();
|
||||
}
|
||||
|
||||
// Define application constants
|
||||
defined('APP_NAME') or define('APP_NAME', $_ENV['APP_NAME'] ?? 'MerchantsOfHope');
|
||||
defined('APP_VERSION') or define('APP_VERSION', $_ENV['APP_VERSION'] ?? '0.1.0');
|
||||
defined('APP_ENV') or define('APP_ENV', $_ENV['APP_ENV'] ?? 'development');
|
||||
defined('DEBUG') or define('DEBUG', filter_var($_ENV['DEBUG'] ?? false, FILTER_VALIDATE_BOOLEAN));
|
||||
|
||||
// Set timezone
|
||||
date_default_timezone_set($_ENV['TIMEZONE'] ?? 'UTC');
|
||||
|
||||
// Initialize autoloader
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
// Initialize dependency injection container
|
||||
$container = DI\Container::build();
|
||||
Reference in New Issue
Block a user