Hi, I have a problem with the composer when I automatically download the configuration file.
In my composer.json I create
{
"require": {"monolog/monolog": "1.7.*@dev"},
"autoload":{
"files": ["config/application.config.php"]
}
}
I want to autoload my configuration file, and in my test.php file I will put:
require 'vendor/autoload.php';
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\FirePHPHandler;
$logger = new Logger('my_logger');
$logger->pushHandler(new StreamHandler(__DIR__.'/data/logs/log.log', Logger::DEBUG));
$logger->pushHandler(new FirePHPHandler());
$logger->addInfo('test message');
echo $config['logs_dir'];
My application.config.php file contains
$config['cache_dir'] = 'data/cache';
$config['logs_dir'] = 'data/logs';
I get a notification when I try to print a value in my call to test.php echo $ config ['logs_dir']. The file was uploaded successfully by the composer, but notice that I get
Note: Undefined variable: $ config in D: \ xampp \ htdocs \ MCF3 \ index.php on line 18
source
share