- CI V3
- Make sure CodeIgniter config
$config['composer_autoload'] = true;
- In directory
/application
do:composer require Studio-42/elFinder
,composer require barryvdh/elfinder-flysystem-driver
composer require league/flysystem-aws-s3-v3
- If prompted: "No composer.json in current directory..." pres "n"
- In root, write following code in .htaccess :
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]
-
Don't forget to include:
use Aws\S3\S3Client; use League\Flysystem\AwsS3v3\AwsS3Adapter; use League\Flysystem\Filesystem;
-
Create controller at /application/controllers/elfinder_lib.php, follow function inside this repo.
manager()
is just the "bridge" of "connector" and "view" ( frontend ) stuffconnector()
is the main connector which will connect elFinder (frontend) with the S3 driver, you can connect this from another frontend part which has another elFinder frontend.
-
Important notes about
connector()
- The only thing you need to put for AWS config is at variable
$aws_config
- Inside
preCheck()
method, you can adjust max files upload individually and max volume of whole S3 path to have.
- The only thing you need to put for AWS config is at variable
Notes: Just demo, if you only need controller for another frontend part, you don't need this. Having connector()
in your controller is enough
- Ensure
$config['base_url']
is set properly. This repo using following technique:$config['base_url'] = ''; $config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http"); $config['base_url'] .= "://" . $_SERVER['HTTP_HOST']; $config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), "", $_SERVER['SCRIPT_NAME']);
- Copy from this repo file at /views/elfinder.php
- Coppy /biq-assets from this repo, it is contain app.js as the main frontend setup, elFinder frontend stuff. And some other required JS & CSS libs.