Blame tests/p_php/php-test.sh
|
Christoph Galuschka |
63ebd1 |
#!/bin/sh
|
|
Christoph Galuschka |
63ebd1 |
# Author: Athmane Madjoudj <athmanem@gmail.com>
|
|
Christoph Galuschka |
63ebd1 |
# Author: Christoph Galuschka <christoph.galuschka@chello.at>
|
|
Christoph Galuschka |
63ebd1 |
|
|
Karanbir Singh |
4dde09 |
t_Log "Running $0 - php can detect correct hostname."
|
|
Christoph Galuschka |
63ebd1 |
|
|
Christoph Galuschka |
63ebd1 |
# Comparing hostname with output of phpinfo()
|
|
Christoph Galuschka |
63ebd1 |
HOST=$(hostname)
|
|
Christoph Galuschka |
63ebd1 |
FILE='/var/tmp/php-test.php'
|
|
Christoph Galuschka |
63ebd1 |
|
|
Christoph Galuschka |
63ebd1 |
cat > $FILE <
|
|
Christoph Galuschka |
63ebd1 |
|
|
Christoph Galuschka |
63ebd1 |
phpinfo();
|
|
Christoph Galuschka |
63ebd1 |
?>
|
|
Christoph Galuschka |
63ebd1 |
EOF
|
|
Christoph Galuschka |
63ebd1 |
|
|
Christoph Galuschka |
63ebd1 |
# setting timezone for phpinfo
|
|
Christoph Galuschka |
63ebd1 |
sed -i 's/\;date\.timezone\ \=/date\.timezone = \"Europe\/Berlin\"/' /etc/php.ini
|
|
Christoph Galuschka |
63ebd1 |
|
|
Christoph Galuschka |
63ebd1 |
php $FILE | grep -cq 'HOSTNAME => '$HOST
|
|
Christoph Galuschka |
63ebd1 |
|
|
Christoph Galuschka |
63ebd1 |
t_CheckExitStatus $?
|
|
Christoph Galuschka |
63ebd1 |
|
|
Christoph Galuschka |
63ebd1 |
#reversing changes
|
|
Christoph Galuschka |
63ebd1 |
/bin/rm $FILE
|
|
Christoph Galuschka |
63ebd1 |
sed -i 's/\date\.timezone\ \=\ \"Europe\/Berlin\"/\;date\.timezone\ \=/' /etc/php.ini
|