57#define Z_FINFO_P(zv) php_finfo_fetch_object(Z_OBJ_P((zv)))
59#define FILEINFO_FROM_OBJECT(finfo, object) \
61 finfo_object *obj = Z_FINFO_P(object); \
64 zend_throw_error(NULL, "Invalid finfo object"); \
88 intern = zend_object_alloc(
sizeof(
finfo_object), class_type);
97#define FINFO_SET_OPTION(magic, options) \
98 if (magic_setflags(magic, options) == -1) { \
99 php_error_docref(NULL, E_WARNING, "Failed to set option '" ZEND_LONG_FMT "' %d:%s", \
100 options, magic_errno(magic), magic_error(magic)); \
115 finfo_object_handlers.free_obj = finfo_objects_free;
116 finfo_object_handlers.clone_obj =
NULL;
118 register_fileinfo_symbols(module_number);
139#ifdef COMPILE_DL_FILEINFO
178 if (finfo_obj->
ptr) {
207 file = resolved_path;
286#define FILEINFO_MODE_BUFFER 0
287#define FILEINFO_MODE_STREAM 1
288#define FILEINFO_MODE_FILE 2
298 char mime_directory[] =
"directory";
377 int buffer_param_num = (mimetype_emu ? 1 : 2);
395 if (ssb.
sb.st_mode & S_IFDIR) {
396 ret_val = mime_directory;
410 if (ssb.
sb.st_mode & S_IFDIR) {
411 ret_val = mime_directory;
file(string $filename, int $flags=0, $context=null)
zend_module_entry fileinfo_module_entry
#define FILEINFO_MODE_BUFFER
struct _php_fileinfo php_fileinfo
struct _finfo_object finfo_object
zend_class_entry * finfo_class_entry
#define FILEINFO_MODE_FILE
#define FILEINFO_MODE_STREAM
#define FINFO_SET_OPTION(magic, options)
#define FILEINFO_FROM_OBJECT(finfo, object)
PHP_FILEINFO_API zend_object * finfo_objects_new(zend_class_entry *class_type)
finfo_close(finfo $finfo)
finfo_buffer(finfo $finfo, string $string, int $flags=FILEINFO_NONE, $context=null)
finfo_open(int $flags=FILEINFO_NONE, ?string $magic_database=null)
finfo_file(finfo $finfo, string $filename, int $flags=FILEINFO_NONE, $context=null)
finfo_set_flags(finfo $finfo, int $flags)
mime_content_type($filename)
PHPAPI char * expand_filepath_with_mode(const char *filepath, char *real_path, const char *relative_to, size_t relative_to_len, int realpath_mode)
PHPAPI int php_check_open_basedir(const char *path)
file_public int magic_version(void)
file_public int magic_load(struct magic_set *ms, const char *magicfile)
file_public const char * magic_stream(struct magic_set *ms, php_stream *stream)
file_public int magic_errno(struct magic_set *ms)
file_public const char * magic_error(struct magic_set *ms)
file_public const char * magic_buffer(struct magic_set *ms, const void *buf, size_t nb)
file_public void magic_close(struct magic_set *ms)
file_public struct magic_set * magic_open(int flags)
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
php_info_print_table_start()
php_info_print_table_row(2, "PDO Driver for Firebird", "enabled")
php_info_print_table_end()
#define PHP_MINIT_FUNCTION
#define PHP_MINFO_FUNCTION
#define PHP_FILEINFO_VERSION
PHP_JSON_API size_t int options
#define php_stream_context_from_zval(zcontext, nocontext)
struct _php_stream php_stream
struct _php_stream_context php_stream_context
#define php_stream_stat_path_ex(path, flags, ssb, context)
#define php_stream_seek(stream, offset, whence)
#define php_stream_open_wrapper_ex(path, mode, options, opened, context)
#define php_stream_close(stream)
#define php_stream_tell(stream)
#define php_stream_stat(stream, ssb)
#define php_stream_from_zval_no_verify(xstr, pzval)
struct _php_stream_wrapper php_stream_wrapper
PHPAPI php_stream_wrapper * php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options)
struct _php_stream_statbuf php_stream_statbuf
#define INTERNAL_FUNCTION_PARAMETERS
ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current)
ZEND_API void zend_restore_error_handling(zend_error_handling *saved)
#define INTERNAL_FUNCTION_PARAM_PASSTHRU
ZEND_API const char * zend_zval_value_name(const zval *arg)
ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec,...)
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type)
ZEND_API ZEND_COLD void zend_argument_must_not_be_empty_error(uint32_t arg_num)
ZEND_API zend_result zend_parse_method_parameters(uint32_t num_args, zval *this_ptr, const char *type_spec,...)
ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format,...)
#define CHECK_NULL_PATH(p, l)
#define ZEND_GET_MODULE(name)
ZEND_API ZEND_COLD zend_object * zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code)
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
#define STANDARD_MODULE_HEADER
struct _zend_module_entry zend_module_entry
#define STANDARD_MODULE_PROPERTIES
ZEND_API const zend_object_handlers std_object_handlers
ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce)
ZEND_API void zend_object_std_dtor(zend_object *object)
#define XtOffsetOf(s_type, field)
#define EMPTY_SWITCH_DEFAULT_CASE()
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
#define Z_STRVAL_P(zval_p)
#define Z_STRLEN_P(zval_p)
struct _zend_object_handlers zend_object_handlers