fopen_wrappers.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2016 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: Jim Winstead <jimw@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. #ifndef FOPEN_WRAPPERS_H
  20. #define FOPEN_WRAPPERS_H
  21. BEGIN_EXTERN_C()
  22. #include "php_globals.h"
  23. #include "php_ini.h"
  24. PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle TSRMLS_DC);
  25. PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC);
  26. PHPAPI char *expand_filepath_ex(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len TSRMLS_DC);
  27. PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int use_realpath TSRMLS_DC);
  28. PHPAPI int php_check_open_basedir(const char *path TSRMLS_DC);
  29. PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC);
  30. PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path TSRMLS_DC);
  31. /* {{{ OPENBASEDIR_CHECKPATH(filename) to ease merge between 6.x and 5.x */
  32. #if PHP_API_VERSION < 20100412
  33. # define OPENBASEDIR_CHECKPATH(filename) \
  34. (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)
  35. #else
  36. #define OPENBASEDIR_CHECKPATH(filename) \
  37. php_check_open_basedir(filename TSRMLS_CC)
  38. #endif
  39. /* }}} */
  40. PHPAPI int php_check_safe_mode_include_dir(const char *path TSRMLS_DC);
  41. PHPAPI char *php_resolve_path(const char *filename, int filename_len, const char *path TSRMLS_DC);
  42. PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, char **opened_path TSRMLS_DC);
  43. PHPAPI char *php_strip_url_passwd(char *path);
  44. PHPAPI ZEND_INI_MH(OnUpdateBaseDir);
  45. END_EXTERN_C()
  46. #endif
  47. /*
  48. * Local variables:
  49. * tab-width: 4
  50. * c-basic-offset: 4
  51. * End:
  52. */