Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
-> This should fix it
  • Loading branch information
NaysKutzu committed Nov 24, 2024
1 parent eac6028 commit 9aaa7b6
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 6 deletions.
3 changes: 2 additions & 1 deletion backend/boot/kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
if (file_exists(APP_DIR . 'storage/packages')) {
require APP_DIR . 'storage/packages/autoload.php';
} else {
throw new Exception('Packages not installed');
throw new Exception('Packages not installed looked at this path: ' . APP_DIR . 'storage/packages');
}
} catch (Exception $e) {
echo $e->getMessage();
echo "\n";
exit;
}

Expand Down
10 changes: 8 additions & 2 deletions backend/mythicalclient
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<?php

use MythicalClient\Cli\App;
define("ENV_PATH", __DIR__ . "/storage/");
if (!empty($_SERVER['DOCUMENT_ROOT'])) {
define('APP_PUBLIC', $_SERVER['DOCUMENT_ROOT']);
} else {
define('APP_PUBLIC', __DIR__.'');
}

define("ENV_PATH", APP_PUBLIC."/../storage/");
define('APP_START', microtime(true));
define('APP_DIR', __DIR__ );
define('APP_DIR', APP_PUBLIC.'/');

require_once __DIR__ . "/boot/kernel.php";

Expand Down
34 changes: 34 additions & 0 deletions install.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# Set the right permissions
chown -R www-data:www-data ./
chmod -R 777 ./

# Install the dependencies
apt install sudo wget curl git zip unzip -y

# Install Docker if not installed
if ! [ -x "$(command -v docker)" ]; then
curl -sSL https://get.docker.com/ | CHANNEL=stable bash
sudo systemctl enable --now docker
fi

# Install Docker Compose if not installed
if ! [ -x "$(command -v docker-compose)" ]; then
apt install docker-compose -y
fi

# Start the build process
docker-compose --env-file ./backend/storage/.env up -d --build

# Set the right permissions
chown -R www-data:www-data ./
chmod -R 777 ./

# Migrations
docker exec mythicalclient_backend bash -c "php mythicalclient migrate"

# Create the first user
#docker exec mythicalclient_backend bash -c "php mythicalclient user:create"


12 changes: 9 additions & 3 deletions mythicalclient
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<?php

use MythicalClient\Cli\App;
define("ENV_PATH", __DIR__ . "/backend/storage/");
if (!empty($_SERVER['DOCUMENT_ROOT'])) {
define('APP_PUBLIC', $_SERVER['DOCUMENT_ROOT'].'/backend');
} else {
define('APP_PUBLIC', __DIR__.'/backend');
}

define("ENV_PATH", APP_PUBLIC."/storage/");
define('APP_START', microtime(true));
define('APP_DIR', __DIR__ . '/backend');
define('APP_DIR', APP_PUBLIC.'/');

require_once __DIR__ . "/backend/boot/kernel.php";
require_once APP_DIR . "/boot/kernel.php";

try {
$args = array_slice($argv, 1); // Exclude the command name and the first argument
Expand Down

0 comments on commit 9aaa7b6

Please sign in to comment.