#48031 [NEW]: Per-directory configuration files completely override master configuration file

2009-04-20 Thread hyponiq at gmail dot com
From: hyponiq at gmail dot com
Operating system: Windows Vista/IIS 7.0
PHP version:  5.2.9
PHP Bug Type: *Configuration Issues
Bug description:  Per-directory configuration files completely override master 
configuration file

Description:

When using per-directory or per-host php.ini files, none of the master
file's configuration settings are read (i.e. from
"C:\Server\PHP\PHP5\php.ini").  PHP requires that all settings that are
needed to have a value be set per-directory/per-host.  In my mind, PHP
should load the default configuration file (i.e.
C:\Server\PHP\PHP5\php.ini) as well as the per-directory/per-host config
file (i.e. C:\Server\Sites\Framework\php.ini), load the directives from the
master file, and then override/replace the values for those directives from
the child config file.

Reproduce code:
---
master php.ini:
cgi.force_redirect = 0
doc_root =
extension_dir = "C:/Server/PHP/PHP5/ext"

Host php.ini:
doc_root = "C:\Server\Sites\Framework"

Expected result:

when phpinfo() executed:
System Information
-
Loaded Configuration File(s): C:\Server\Sites\Framework\php.ini;
C:\Server\PHP\PHP5\php.ini

Directive Values
-
cgi.force_redirect: Local: 0; Master: 0;
doc_root: Local: C:\Server\Sites\Framework; Master: no value;
extension_dir: Local: C:/Server/PHP/PHP5/ext; Master:
C:/Server/PHP/PHP5/ext


Actual result:
--
when phpinfo() executed:
System Information
-
Loaded Configuration File: C:\Server\Sites\Framework\php.ini

Directive Values
-
cgi.force_redirect: Local: no value; Master: no value
doc_root: Local: C:\Server\Sites\Framework; Master:
C:\Server\Sites\Framework
extension_dir: Local: no value; Master: no value

-- 
Edit bug report at http://bugs.php.net/?id=48031&edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48031&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48031&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48031&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48031&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48031&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48031&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=48031&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=48031&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=48031&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=48031&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=48031&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=48031&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=48031&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48031&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=48031&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=48031&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=48031&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=48031&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=48031&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=48031&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=48031&r=mysqlcfg



[PHP-BUG] Req #55852 [NEW]: Feature Request: __cast magic function

2011-10-05 Thread hyponiq at gmail dot com
From: 
Operating system: Windows 7 Ultimate
PHP version:  5.3.8
Package:  Class/Object related
Bug Type: Feature/Change Request
Bug description:Feature Request: __cast magic function

Description:

I think it'd be a useful tool to add a __cast($to) magic function to the
Classes and Objects category of PHP syntax. What said function would do is
allow the programmer to specify the return values of casting a user-land
object into one of the built-in data types. I.E. using (int) MyObject would
invoke the __cast() method passing it the 'int' type. In such a case, the
programmer could then specify what is returned when cast to, per se,
int's.

myValue = $value;
}

public function __cast($to = 'string') {
switch ($to) {
case 'string':
return 'The value of myValue is: ' . (string)
$this->myValue;
case 'int':
return strlen($this->myValue);
}
}
}

$myObject = new MyObject('I am a string');
print (int) $myObject; // Output: 13
?>


-- 
Edit bug report at https://bugs.php.net/bug.php?id=55852&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55852&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55852&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=55852&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55852&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55852&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55852&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=55852&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=55852&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=55852&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=55852&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=55852&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=55852&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=55852&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55852&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=55852&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=55852&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=55852&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=55852&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=55852&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=55852&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=55852&r=mysqlcfg