I use Elfinder and I want to integrate it. I use the namespace and elfinder return me this error below. I need to create a dynamic link depending host site.
Thak you
Invalid backend response.
Data is not JSON. <br /> <b>Notice</b>: Undefined variable: OSCOM in <b>/home/www//boutique/includes/Core/Conf/ElFinderConfig.php</b> on line <b>11</b><br /> <br /> <b>Fatal error</b>: Uncaught Error:
Call to a member function getConfig() on null in /home/www//boutique/includes/Core/Conf/ElFinderConfig.php:11 Stack trace: #0 /home/www/boutique/ext/elfinder_2x/php/connector.minimal.php(71): require() #1 {main} thrown in /home/www/boutique/includes/Core/Conf/ElFinderConfig.php on line 11
In
minimal.connector.php
I inserted inside minimal.connector.php
these elements and
the require
called DIR_FS_CATALOG_IMAGES
and DIR_WS_CATALOG_IMAGES
require('../../../includes/Core/Conf/ElFinderConfig.php');
// Documentation for connector options: // https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options
$opts = array(
'debug' => true, //see a new menu in filefinder with all informations
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
//'path' => '../files/', // path to files (REQUIRED)
// 'path' => '../../../sources/image/', // path to files (REQUIRED)
// 'URL' => '../../../../boutique/sources/image/', // URL to files (REQUIRED)
'path' => DIR_FS_CATALOG_IMAGES, // path to files (REQUIRED)
'URL' => DIR_WS_CATALOG_IMAGES, // URL to files (REQUIRED)
...
I changed this
'path' => '../../../sources/image/', // path to files (REQUIRED)
'URL' => '../../../../boutique/sources/image/', // URL to files (REQUIRED)
by this
'path' => DIR_FS_CATALOG_IMAGES, // path to files (REQUIRED)
'URL' => DIR_WS_CATALOG_IMAGES, // URL to files (REQUIRED)
and ElFinderConfig.php is write like this
<?php
use ClicShopping\OM\OSCOM;
define('DIR_FS_CATALOG_IMAGES', OSCOM->getConfig('dir_root', 'Shop') . 'sources/image/'); // path to files (REQUIRED)
define('DIR_WS_CATALOG_IMAGES', OSCOM::getConfig('http_path', 'Shop')); // path to files (REQUIRED)