Welcome Guest, Not a member yet? Register   Sign In
[Solved] Printed config value log_file_permissions equal to 420?
#1

(This post was last modified: 03-28-2017, 11:57 AM by raknjak.)

Hello

when I run the code below the output is 420, while my permissions are 0644 in config.php.

PHP Code:
print $this->config->item('log_file_permissions'); 

I looked through the code but can't get to understand how this works.

Context: I'm creating an ini file to save my config settings there and I just encountered this. When I change to 0700 for example it outputs 448. I need to save it as 0644. I'm convinced there's just something I don't know about or understand.

Thank you
Reply
#2

(This post was last modified: 03-28-2017, 11:18 AM by dave friend.)

The leading 0 causes PHP to interpret the value as an octal number.
0700 octal is 448 decimal
0644 octal is 420 decimal
Reply
#3

(This post was last modified: 03-28-2017, 11:23 AM by Narf.)

0644 is simply written using octal notation.
420 is the same value, only presented as decimal.

It doesn't matter which one you write, unless you're saving it as a string (which would be wrong to begin with).

https://secure.php.net/integer
Reply
#4

Great thanks, I used decoct() to make it visually correct.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB