#define O_RDONLY _O_RDONLY
#include "win32/param.h"
#include "win32/winutil.h"
+#include "win32/fnmatch.h"
#elif defined(NETWARE)
#include <sys/param.h>
#include <sys/select.h>
php_file_globals file_globals;
#endif
-#ifdef HAVE_FNMATCH
+#if defined(HAVE_FNMATCH) && !defined(PHP_WIN32)
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
Test fnmatch() function: Basic functionality
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) == 'WIN')
- die("skip do not run on Windows");
-
if (!function_exists('fnmatch'))
die("skip fnmatch() function is not available");
?>
echo "\n*** Done ***\n";
?>
---EXPECTF--
+--EXPECT--
*** Testing fnmatch() with file ***
bool(true)
bool(true)
Test fnmatch() function: Error conditions
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) == 'WIN')
- die("skip do not run on Windows");
-
if (!function_exists('fnmatch'))
die("skip fnmatch() function is not available");
?>
Test fnmatch() function: Variations
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) == 'WIN')
- die("skip do not run on Windows");
-
if (!function_exists('fnmatch'))
die("skip fnmatch() function is not available");
?>
echo "*** Testing fnmatch() with file and various patterns ***\n";
$file_name = dirname(__FILE__)."/match.tmp";
+/* avoid using \, it breaks the pattern */
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ $file_name = str_replace('\\','/', $file_name);
+}
+
fopen($file_name, "w");
$pattern_arr = array(
echo "\n*** Done ***\n";
?>
---EXPECTF--
+--EXPECT--
*** Testing fnmatch() with file and various patterns ***
-- Iteration 0 --
bool(true)