I have a plain PHP project which used composer to install packages but the composer.json file doesn’t exist anymore. The vendor folder contains all the currently used packages and the autoload.php file.
Now I need to install and use aws package but once I run the composer require command, all old packages get removed from the vendor. And when I restore them from a backup, they don’t work. The app doesn’t recognize them anymore.
How to use the aws package or any other package in such a situation?
Here’s the app/init.php file of the project (not all of it)
define('ROOT_PATH', realpath(__DIR__ . '/..') . '/');
const APP_PATH = ROOT_PATH . 'app/';
const PLUGINS_PATH = ROOT_PATH . 'plugins/';
const THEME_PATH = ROOT_PATH . 'themes/altum/';
......
OTHER LOGIC AND CONSTANTS HERE
......
require_once APP_PATH . 'helpers/Affiliate.php';
/* Autoload for vendor */
require_once ROOT_PATH . 'vendor/autoload.php';
I tried to download the folder of aws and copy it to the vendor folder then in the PHP file:
use AltumMiddlewaresCsrf;
use AltumTitle;
use AwsS3S3Client;
But I get an error
PHP Fatal error: Uncaught Error: Class 'AltumControllersAwsS3S3Client' not found