File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / general_functions / putenv_error1.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:04 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_3_10, HEAD
php

--TEST--
putenv() - usage in safe mode with safe_mode_allowed_env_vars set
--CREDITS--
Brian DeShong <brian@deshong.net>
--INI--
safe_mode=1
safe_mode_allowed_env_vars=TESTING_
--FILE--
<?php
putenv('FOO=bar');
putenv('BAZ=bop');
$set = putenv('TESTING_FOO=bar');
print ($set ? 'it worked' : 'boo') . "\n";
$set = putenv('TESTING_BAR=baz');
print ($set ? 'it worked' : 'boo') . "\n";
?>
==DONE==
--EXPECTF--
Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0

Warning: putenv(): Safe Mode warning: Cannot set environment variable 'FOO' - it's not in the allowed list in %s on line %d

Warning: putenv(): Safe Mode warning: Cannot set environment variable 'BAZ' - it's not in the allowed list in %s on line %d
it worked
it worked
==DONE==

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>