Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 43f075397f7b726e6113891cb488113b > files > 43

php-apc-3.1.15-4.6.mga4.x86_64.rpm

--TEST--
APC: APCIterator file + apc_delete_file() (php 5.4)
--SKIPIF--
<?php
    require_once(dirname(__FILE__) . '/skipif.inc'); 
    if (PHP_MAJOR_VERSION < 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4)) {
		die('skip PHP 5.4+ only');
	}
--FILE--
<?php
include "server_test.inc";

$file = <<<FL
\$fl = dirname(__FILE__) . '/file.php';
file_put_contents(\$fl, '<?php echo "hello";');

apc_compile_file(\$fl);

\$it = new APCIterator('file', ',file\.*,');
foreach (\$it as \$i) {
	var_dump(apc_delete_file(\$i['filename']));
}
FL;

$args = array(
	'apc.cache_by_default=On',
	'apc.canonicalize=On',
	'apc.coredump_unmap=Off',
	'apc.enable_cli=On',
	'apc.enabled=On',
	'apc.file_md5=Off',
	'apc.file_update_protection=0',
	'apc.filters=no',
	'apc.gc_ttl=3600',
	'apc.include_once_override=Off',
	'apc.lazy_classes=Off',
	'apc.lazy_functions=Off',
	'apc.max_file_size=1M',
	'apc.mmap_file_mask=no',
	'apc.num_files_hint=1000',
	'apc.preload_path=no',
	'apc.report_autofilter=Off',
	'apc.rfc1867=Off',
	'apc.rfc1867_freq=0',
	'apc.rfc1867_name=APC_UPLOAD_PROGRESS',
	'apc.rfc1867_prefix=upload_',
	'apc.rfc1867_ttl=3600',
	'apc.serializer=default',
	'apc.shm_segments=1',
	'apc.shm_size=128M',
	'apc.shm_strings_buffer=4M',
	'apc.slam_defense=On',
	'apc.stat=On',
	'apc.stat_ctime=Off',
	'apc.ttl=0',
	'apc.use_request_time=On',
	'apc.user_entries_hint=4096',
	'apc.user_ttl=0',
	'apc.write_lock=On',
);

server_start($file, $args);

for ($i = 0; $i < 10; $i++) {
	run_test_simple();
}
echo 'done';
--CLEAN--
unlink(dirname(__FILE__) . '/file.php');
--EXPECT--
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
done