1--TEST-- 2Test file_get_contents() function : variation - linked files 3--CREDITS-- 4Dave Kelsey <d_kelsey@uk.ibm.com> 5--SKIPIF-- 6<?php 7if(substr(PHP_OS, 0, 3) == "WIN") 8 die("skip Do not run on Windows"); 9?> 10--FILE-- 11<?php 12echo "*** Testing file_get_contents() : variation ***\n"; 13$filename = __DIR__.'/fileGetContentsVar9.tmp'; 14$softlink = __DIR__.'/fileGetContentsVar9.SoftLink'; 15$hardlink = __DIR__.'/fileGetContentsVar9.HardLink'; 16$chainlink = __DIR__.'/fileGetContentsVar9.ChainLink'; 17 18// create file 19$h = fopen($filename,"w"); 20//Data should be more than the size of a link. 21for ($i = 1; $i <= 10; $i++) { 22 fwrite($h, "Here is a repeated amount of data"); 23} 24fclose($h); 25 26// link files 27link($filename, $hardlink); 28symlink($filename, $softlink); 29symlink($softlink, $chainlink); 30 31// perform tests 32var_dump(file_get_contents($chainlink)); 33var_dump(file_get_contents($softlink)); 34var_dump(file_get_contents($hardlink)); 35 36echo "\n*** Done ***\n"; 37?> 38--CLEAN-- 39<?php 40$filename = __DIR__.'/fileGetContentsVar9.tmp'; 41$softlink = __DIR__.'/fileGetContentsVar9.SoftLink'; 42$hardlink = __DIR__.'/fileGetContentsVar9.HardLink'; 43$chainlink = __DIR__.'/fileGetContentsVar9.ChainLink'; 44unlink($chainlink); 45unlink($softlink); 46unlink($hardlink); 47unlink($filename); 48?> 49--EXPECT-- 50*** Testing file_get_contents() : variation *** 51string(330) "Here is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of data" 52string(330) "Here is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of data" 53string(330) "Here is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of data" 54 55*** Done *** 56