allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
44
vendor/safiull/laravel-installer/src/Controllers/DatabaseController.php
vendored
Normal file
44
vendor/safiull/laravel-installer/src/Controllers/DatabaseController.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\LaravelInstaller\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Laravel\LaravelInstaller\Helpers\DatabaseManager;
|
||||
|
||||
class DatabaseController extends Controller
|
||||
{
|
||||
/**
|
||||
* @var DatabaseManager
|
||||
*/
|
||||
private $databaseManager;
|
||||
|
||||
/**
|
||||
* @param DatabaseManager $databaseManager
|
||||
*/
|
||||
public function __construct(DatabaseManager $databaseManager)
|
||||
{
|
||||
$this->databaseManager = $databaseManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate and seed the database.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function database(Request $request)
|
||||
{
|
||||
$response = $this->databaseManager->migrateAndSeed();
|
||||
if($response['status'] == 'error') {
|
||||
return redirect()->route('LaravelInstaller::environmentWizard')
|
||||
->with(['message' => $response]);
|
||||
} else {
|
||||
$this->databaseManager->passportInstall();
|
||||
|
||||
return redirect()->route('LaravelInstaller::final')
|
||||
->with(['message' => $response]);
|
||||
}
|
||||
}
|
||||
}
|
||||
183
vendor/safiull/laravel-installer/src/Controllers/EnvironmentController.php
vendored
Normal file
183
vendor/safiull/laravel-installer/src/Controllers/EnvironmentController.php
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\LaravelInstaller\Controllers;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\Support\Facades\Cookie;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Laravel\LaravelInstaller\Events\EnvironmentSaved;
|
||||
use Laravel\LaravelInstaller\Helpers\EnvironmentManager;
|
||||
|
||||
class EnvironmentController extends Controller
|
||||
{
|
||||
/**
|
||||
* @var EnvironmentManager
|
||||
*/
|
||||
protected $EnvironmentManager;
|
||||
|
||||
/**
|
||||
* @param EnvironmentManager $environmentManager
|
||||
*/
|
||||
public function __construct(EnvironmentManager $environmentManager)
|
||||
{
|
||||
set_time_limit(300);
|
||||
$this->EnvironmentManager = $environmentManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the Environment menu page.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function environmentMenu()
|
||||
{
|
||||
return view('vendor.installer.environment');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the Environment page.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function environmentWizard()
|
||||
{
|
||||
$envConfig = $this->EnvironmentManager->getEnvContent();
|
||||
|
||||
return view('vendor.installer.environment-wizard', compact('envConfig'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the Environment page.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function environmentClassic()
|
||||
{
|
||||
$envConfig = $this->EnvironmentManager->getEnvContent();
|
||||
|
||||
return view('vendor.installer.environment-classic', compact('envConfig'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the newly saved environment configuration (Classic).
|
||||
*
|
||||
* @param Request $input
|
||||
* @param Redirector $redirect
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function saveClassic(Request $input, Redirector $redirect)
|
||||
{
|
||||
$message = $this->EnvironmentManager->saveFileClassic($input);
|
||||
|
||||
event(new EnvironmentSaved($input));
|
||||
|
||||
return $redirect->route('LaravelInstaller::environmentClassic')
|
||||
->with(['message' => $message]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the newly saved environment configuration (Form Wizard).
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Redirector $redirect
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function saveWizard(Request $request, Redirector $redirect)
|
||||
{
|
||||
$rules = config('installer.environment.form.rules');
|
||||
$messages = [
|
||||
'environment_custom.required_if' => trans('installer_messages.environment.wizard.form.name_required'),
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return $redirect->route('LaravelInstaller::environmentWizard')->withInput()->withErrors($validator->errors());
|
||||
}
|
||||
|
||||
if (! $this->checkDatabaseConnection($request)) {
|
||||
return $redirect->route('LaravelInstaller::environmentWizard')->withInput()->withErrors([
|
||||
'database_connection' => trans('installer_messages.environment.wizard.form.db_connection_failed'),
|
||||
]);
|
||||
}
|
||||
|
||||
$results = $this->EnvironmentManager->saveFileWizard($request);
|
||||
|
||||
event(new EnvironmentSaved($request));
|
||||
|
||||
return $redirect->route('LaravelInstaller::database', ['email' => $request->admin_email, 'password' => $request->admin_password])
|
||||
->with(['results' => $results]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return bool
|
||||
*/
|
||||
private function checkForAuthentication(Request $request)
|
||||
{
|
||||
$license = $request->input('envato_purchase_code') ?? Cookie::get('addenvparkey');
|
||||
if ($license == '') return false;
|
||||
$domain = url('/');
|
||||
$a = config('installer.updater_url', 'http://149.28.199.74') . '/register';
|
||||
try {
|
||||
return true;
|
||||
$ch = curl_init($a);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(['app' => config('app.project', 'laravel'), 'version' => config('app.version', 'v1.0'), 'license' => $license, 'domain' => $domain, 'email' => $request->admin_email]));
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
$response = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
$res = json_decode($response);
|
||||
if (is_object($res) && $res->success) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (\Exception $exception) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Validate database connection with user credentials (Form Wizard).
|
||||
*
|
||||
* @param Request $request
|
||||
* @return bool
|
||||
*/
|
||||
private function checkDatabaseConnection(Request $request)
|
||||
{
|
||||
$connection = 'mysql';
|
||||
|
||||
$settings = config("database.connections.$connection");
|
||||
|
||||
config([
|
||||
'database' => [
|
||||
'default' => $connection,
|
||||
'connections' => [
|
||||
$connection => array_merge($settings, [
|
||||
'driver' => $connection,
|
||||
'host' => $request->input('database_hostname'),
|
||||
'port' => $request->input('database_port'),
|
||||
'database' => $request->input('database_name'),
|
||||
'username' => $request->input('database_username'),
|
||||
'password' => $request->input('database_password'),
|
||||
]),
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
DB::purge();
|
||||
|
||||
try {
|
||||
DB::connection()->getPdo();
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
73
vendor/safiull/laravel-installer/src/Controllers/FinalController.php
vendored
Normal file
73
vendor/safiull/laravel-installer/src/Controllers/FinalController.php
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\LaravelInstaller\Controllers;
|
||||
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Laravel\LaravelInstaller\Helpers\EnvironmentManager;
|
||||
use Laravel\LaravelInstaller\Helpers\FinalInstallManager;
|
||||
use Laravel\LaravelInstaller\Helpers\InstalledFileManager;
|
||||
use Laravel\LaravelInstaller\Events\LaravelInstallerFinished;
|
||||
|
||||
class FinalController extends Controller
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
set_time_limit(300);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update installed file and display finished view.
|
||||
*
|
||||
* @param \Laravel\LaravelInstaller\Helpers\InstalledFileManager $fileManager
|
||||
* @param \Laravel\LaravelInstaller\Helpers\FinalInstallManager $finalInstall
|
||||
* @param \Laravel\LaravelInstaller\Helpers\EnvironmentManager $environment
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function finish(InstalledFileManager $fileManager, FinalInstallManager $finalInstall, EnvironmentManager $environment)
|
||||
{
|
||||
$finalMessages = $finalInstall->runFinal();
|
||||
$finalStatusMessage = $fileManager->update();
|
||||
$finalEnvFile = $environment->getEnvContent();
|
||||
|
||||
// Run root migrations
|
||||
Artisan::call('migrate', ['--force' => true]);
|
||||
|
||||
// Check if the laravel-modules package is installed
|
||||
if (class_exists(\Nwidart\Modules\Facades\Module::class)) {
|
||||
// Retrieve all modules
|
||||
$modules = \Nwidart\Modules\Facades\Module::all();
|
||||
|
||||
foreach ($modules as $module) {
|
||||
$moduleName = $module->getName();
|
||||
|
||||
// Run migrations for the module
|
||||
Artisan::call('module:migrate', [
|
||||
'module' => $moduleName,
|
||||
'--force' => true,
|
||||
]);
|
||||
|
||||
// Run seeders for the module
|
||||
Artisan::call('module:seed', [
|
||||
'module' => $moduleName,
|
||||
'--force' => true,
|
||||
]);
|
||||
|
||||
// Publish module content
|
||||
Artisan::call('module:publish', [
|
||||
'module' => $moduleName,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Artisan::call('cache:clear');
|
||||
Artisan::call('config:clear');
|
||||
Artisan::call('route:clear');
|
||||
Artisan::call('view:clear');
|
||||
|
||||
event(new LaravelInstallerFinished);
|
||||
|
||||
return view('vendor.installer.finished', compact('finalMessages', 'finalStatusMessage', 'finalEnvFile'));
|
||||
}
|
||||
|
||||
}
|
||||
94
vendor/safiull/laravel-installer/src/Controllers/PermissionsController.php
vendored
Normal file
94
vendor/safiull/laravel-installer/src/Controllers/PermissionsController.php
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\LaravelInstaller\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Cookie;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Laravel\LaravelInstaller\Helpers\PermissionsChecker;
|
||||
use Laravel\LaravelInstaller\Service\EnvatoService;
|
||||
|
||||
class PermissionsController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* @var PermissionsChecker
|
||||
*/
|
||||
protected $permissions;
|
||||
protected $envUrl;
|
||||
|
||||
/**
|
||||
* @param PermissionsChecker $checker
|
||||
*/
|
||||
public function __construct(PermissionsChecker $checker)
|
||||
{
|
||||
$this->permissions = $checker;
|
||||
$this->envUrl = config('installer.api_url');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the permissions check page.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function permissions()
|
||||
{
|
||||
$permissions = $this->permissions->check(
|
||||
config('installer.permissions')
|
||||
);
|
||||
|
||||
return view('vendor.installer.permissions', compact('permissions'));
|
||||
}
|
||||
|
||||
public function verify()
|
||||
{
|
||||
return redirect()->route('LaravelInstaller::environment');
|
||||
}
|
||||
|
||||
public function codeVerifyProcess(Request $request)
|
||||
{
|
||||
$rules = ['purchase_code' => 'nullable'];
|
||||
$messages = [
|
||||
'purchase_code.required' => __('Purchase code field is required.'),
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$errors = $validator->errors();
|
||||
return redirect()->back()->with(['errors' => $errors]);
|
||||
} else {
|
||||
$check = $this->checkEnvatoPurchaseCode($request);
|
||||
if ($check['success'] == false) {
|
||||
return redirect()->back()->with(['message' => $check['message']]);
|
||||
} else {
|
||||
if ($request->_tokens && $request->_tokens == 'purchase_code') {
|
||||
file_put_contents(storage_path('.license'), json_encode(['license' => $request->purchase_code]));
|
||||
return redirect('/')->with('message', __('Code verified successfully'));
|
||||
} else {
|
||||
return redirect()->route('LaravelInstaller::environment')->with('message', $check['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check envato purchase code
|
||||
public function checkEnvatoPurchaseCode($request)
|
||||
{
|
||||
return ['success' => true, 'message' => 'Code verified successfully'];
|
||||
}
|
||||
|
||||
public function verifyMessages($envPharseKey)
|
||||
{
|
||||
Cookie::queue('addenvparkey', $envPharseKey);
|
||||
}
|
||||
|
||||
|
||||
public function verifier()
|
||||
{
|
||||
return view('vendor.installer.verify-code');
|
||||
}
|
||||
|
||||
}
|
||||
51
vendor/safiull/laravel-installer/src/Controllers/RequirementsController.php
vendored
Normal file
51
vendor/safiull/laravel-installer/src/Controllers/RequirementsController.php
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\LaravelInstaller\Controllers;
|
||||
|
||||
use Illuminate\Routing\Controller;
|
||||
use Laravel\LaravelInstaller\Helpers\RequirementsChecker;
|
||||
|
||||
class RequirementsController extends Controller
|
||||
{
|
||||
/**
|
||||
* @var RequirementsChecker
|
||||
*/
|
||||
protected $requirements;
|
||||
|
||||
/**
|
||||
* @param RequirementsChecker $checker
|
||||
*/
|
||||
public function __construct(RequirementsChecker $checker)
|
||||
{
|
||||
$this->requirements = $checker;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the requirements page.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function requirements()
|
||||
{
|
||||
$paths = [
|
||||
storage_path('framework'),
|
||||
storage_path('logs'),
|
||||
base_path('bootstrap/cache'),
|
||||
];
|
||||
|
||||
$permissions = 0775;
|
||||
|
||||
foreach ($paths as $path) {
|
||||
chmod($path, $permissions);
|
||||
}
|
||||
|
||||
$phpSupportInfo = $this->requirements->checkPHPversion(
|
||||
config('installer.core.minPhpVersion')
|
||||
);
|
||||
$requirements = $this->requirements->check(
|
||||
config('installer.requirements')
|
||||
);
|
||||
|
||||
return view('vendor.installer.requirements', compact('requirements', 'phpSupportInfo'));
|
||||
}
|
||||
}
|
||||
200
vendor/safiull/laravel-installer/src/Controllers/UpdateController.php
vendored
Normal file
200
vendor/safiull/laravel-installer/src/Controllers/UpdateController.php
vendored
Normal file
@@ -0,0 +1,200 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\LaravelInstaller\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Laravel\LaravelInstaller\Helpers\InstalledFileManager;
|
||||
use Laravel\LaravelInstaller\Service\EnvatoService;
|
||||
use Laravel\LaravelInstaller\Helpers\DatabaseManager;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use ZipArchive;
|
||||
|
||||
class UpdateController extends Controller
|
||||
{
|
||||
use \Laravel\LaravelInstaller\Helpers\MigrationsHelper;
|
||||
|
||||
private $service;
|
||||
private $current_path;
|
||||
private $root_path;
|
||||
private $apiUrl = '';
|
||||
private $configUrlPath = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
set_time_limit(300);
|
||||
$this->service = new EnvatoService();
|
||||
$this->configUrlPath = $this->apiUrl = config('installer.download_path') ? config('installer.download_path') : '/../../../../..';
|
||||
$this->current_path = realpath(__DIR__);
|
||||
$this->root_path = realpath($this->current_path . $this->configUrlPath);
|
||||
$this->apiUrl = config('installer.api_url') ? config('installer.api_url') : 'https://itech.tradexpro.org';
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the updater welcome page.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function welcome()
|
||||
{
|
||||
return view('vendor.installer.update.welcome');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the updater overview page.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function overview()
|
||||
{
|
||||
$migrations = $this->getMigrations();
|
||||
$dbMigrations = $this->getExecutedMigrations();
|
||||
$data['numberOfUpdatesPending'] = count($migrations) - count($dbMigrations);
|
||||
$data['purchase_code'] = '';
|
||||
$data['version_list'] = [];
|
||||
$file_path = storage_path('.license');
|
||||
|
||||
if (file_exists($file_path)) {
|
||||
$file_contents = file_get_contents($file_path);
|
||||
$code = json_decode($file_contents);
|
||||
$data['purchase_code'] = $code->license;
|
||||
$getVersion = $this->service->getProductVersion($code->license);
|
||||
|
||||
if ($getVersion['success']) {
|
||||
$data['version_list'] = $getVersion['data'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return view('vendor.installer.update.overview', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate and seed the database.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function database()
|
||||
{
|
||||
$databaseManager = new DatabaseManager;
|
||||
$response = $databaseManager->migrateAndSeed();
|
||||
|
||||
return redirect()->route('LaravelUpdater::final')
|
||||
->with(['message' => $response]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update installed file and display finished view.
|
||||
*
|
||||
* @param InstalledFileManager $fileManager
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function finish()
|
||||
{
|
||||
$data['message'] = __('Product updated successfully');
|
||||
return view('vendor.installer.update.finished', $data);
|
||||
}
|
||||
|
||||
public function downloadUpdatedCode(Request $request, Redirector $redirect)
|
||||
{
|
||||
$rules = [
|
||||
'code' => 'required',
|
||||
'version' => 'required'
|
||||
];
|
||||
$validator = Validator::make($request->all(), $rules, []);
|
||||
if ($validator->fails()) {
|
||||
return $redirect->route('LaravelUpdater::overview')->withInput()->withErrors($validator->errors());
|
||||
}
|
||||
|
||||
$response = $this->service->downloadUpdate($request->code,$request->version);
|
||||
|
||||
if($response['success']) {
|
||||
Session::put(['reference_code' => $response['data']['file_reference']]);
|
||||
Session::put(['ref_file_name' => $response['data']['file_name']]);
|
||||
return $redirect->route('LaravelUpdater::downloadFile',['id' => $response['data']['file_reference']])->with('message','success');
|
||||
} else {
|
||||
return $redirect->route('LaravelUpdater::overview')->withInput()->withErrors($response['message']);
|
||||
}
|
||||
}
|
||||
|
||||
public function downloadFile(Request $request)
|
||||
{
|
||||
$sourceUrl = $this->apiUrl.'/api/file/download/'.$request->id;
|
||||
$destinationPath = $this->root_path.'/';
|
||||
$response = Http::get($sourceUrl);
|
||||
|
||||
if ($response->successful()) {
|
||||
$fileName = Session::get('ref_file_name');
|
||||
$fileContent = $response->body();
|
||||
|
||||
// Save the downloaded file to the root directory of your project
|
||||
file_put_contents($destinationPath .'/'.$fileName , $fileContent);
|
||||
return redirect()->route('LaravelUpdater::downloaded')->with('message',__('File downloaded and saved successfully'));
|
||||
} else {
|
||||
return redirect()->route('LaravelUpdater::overview')->with('message',__('Failed to download the file try again plz'));
|
||||
}
|
||||
}
|
||||
|
||||
public function downloaded()
|
||||
{
|
||||
$data['message'] = __('Download successfully');
|
||||
$data['file_name'] = Session::get('ref_file_name');
|
||||
return view('vendor.installer.update.downloaded', $data);
|
||||
}
|
||||
|
||||
public function updateProcess(Request $request)
|
||||
{
|
||||
try {
|
||||
if($request->fileName) {
|
||||
$fileName = $request->fileName;
|
||||
|
||||
$zip = new ZipArchive;
|
||||
$destination = $this->root_path .'/'. $fileName;
|
||||
$res = $zip->open($destination);
|
||||
|
||||
$nPath = str_replace(".zip", "", $fileName);
|
||||
if ($res === TRUE) {
|
||||
$zip->extractTo($this->root_path . "/".$nPath);
|
||||
$zip->close();
|
||||
unlink($destination);
|
||||
}
|
||||
|
||||
$sourceDirectory = $this->root_path.'/'.$nPath; // Replace with the actual path to your source directory
|
||||
|
||||
$extractedFiles = File::allFiles($sourceDirectory);
|
||||
|
||||
foreach ($extractedFiles as $file) {
|
||||
$newLocation = $this->root_path.'/'.$file->getRelativePathname();
|
||||
|
||||
// Get the last directory name
|
||||
$lastDirectoryName = basename(dirname($file->getRelativePathname()));
|
||||
|
||||
// Construct the full path for the last directory
|
||||
$lastDirectoryPath = $this->root_path.'/'.dirname($file->getRelativePathname());
|
||||
|
||||
if (!File::isDirectory($lastDirectoryPath)) {
|
||||
File::makeDirectory($lastDirectoryPath, 0755, true);
|
||||
}
|
||||
|
||||
File::copy($file->getRealPath(), $newLocation);
|
||||
|
||||
}
|
||||
if (is_dir($sourceDirectory)) {
|
||||
removeDirectory($sourceDirectory);
|
||||
}
|
||||
return redirect()->route('LaravelUpdater::final')->with('message',__('Product updated successfully'));
|
||||
|
||||
} else {
|
||||
return redirect()->route('LaravelUpdater::overview')->with('message',__('No file found to continue update process'));
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
dd($e->getMessage());
|
||||
return redirect()->route('LaravelUpdater::overview')->with('message',$e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
18
vendor/safiull/laravel-installer/src/Controllers/WelcomeController.php
vendored
Normal file
18
vendor/safiull/laravel-installer/src/Controllers/WelcomeController.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\LaravelInstaller\Controllers;
|
||||
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class WelcomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display the installer welcome page.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function welcome()
|
||||
{
|
||||
return view('vendor.installer.welcome');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user