Welcome Guest, Not a member yet? Register   Sign In
Using numerically indexed arrays in .env file
#3

(This post was last modified: 02-03-2024, 06:43 AM by adrianovaroli. Edit Reason: Added code example )

(02-02-2024, 06:57 PM)kenjis Wrote: See https://codeigniter.com/user_guide/gener...s-for-data

Yes, I don't see anything in there that relates to my question. If you meant

Quote:"You cannot add a property that is not defined in the Config class, nor can you change it to an array if the value of the defined property is a scalar."

the property in the original *is* an array. I just want to define a different array in my .env file.

An example of what I'm trying to do:

app/Config/Logger.php contains
PHP Code:
public $threshold = [1234]; 
.env contains

PHP Code:
logger.threshold.0 1
logger
.threshold.1 2
logger
.threshold.2 3
logger
.threshold.3 4
logger
.threshold.4 


in a controller's method, I added

PHP Code:
log_message('error''test error');
log_message('debug''test debug'); 


and when that method is called, writable/logs/log-2024-02-02.log only shows
PHP Code:
ERROR 2024-02-02 18:21:31 --> test error 
Reply


Messages In This Thread
RE: Using numerically indexed arrays in .env file - by adrianovaroli - 02-03-2024, 06:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB