Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17218 программистов и 1838 роботов. Сейчас ищут 1519 программистов ...

Advanced usage

Вернуться к: PHP_Compat

Advanced usage

Advanced usage – Describe techniques for advanced usage

In order to create portable code, it's best to assume all the native functions already exist. Littering a script with calls to PHP_Compat can become messy, and increase the work required to port the code.

To solve this there are a number of approaches. The first would be adding the load statements to a file which is included at the top of every document. The second, and preferred method is to make use of php_auto_append php.ini value. This can be set in a .htaccess file, and no modifications to the actual code are required.

If phpcompat.php was the name of the file, an example entry in a .htaccess could be php_value php_auto_append phpcompat.php. The phpcompat.php file would make use of either the loadVersion or loadFunction/loadConstant methods discussed in the next page.



Вернуться к: PHP_Compat

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware