Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Test filegroup() function: usage variations - links --CREDITS-- Dave Kelsey <d_ke..

Decoded Output download

--TEST--
Test filegroup() function: usage variations - links
--CREDITS--
Dave Kelsey <[email protected]>
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
    die('skip Do not run on Windows');
}
--FILE--
<?php
/* Creating soft and hard links to a file and applying filegroup() on links */

$file_path = __DIR__;
fclose( fopen($file_path."/filegroup_variation1.tmp", "w") );

echo "*** Testing filegroup() with links ***
";
/* With symlink */
symlink($file_path."/filegroup_variation1.tmp", $file_path."/filegroup_variation1_symlink.tmp");
var_dump( filegroup($file_path."/filegroup_variation1_symlink.tmp") ); //expected true
clearstatcache();

/* With hardlink */
link($file_path."/filegroup_variation1.tmp", $file_path."/filegroup_variation1_link.tmp");
var_dump( filegroup($file_path."/filegroup_variation1_link.tmp") );  // expected: true
clearstatcache();

echo "
*** Done ***";
?>
--CLEAN--
<?php
$file_path = __DIR__;
unlink($file_path."/filegroup_variation1_symlink.tmp");
unlink($file_path."/filegroup_variation1_link.tmp");
unlink($file_path."/filegroup_variation1.tmp");
?>
--EXPECTF--
*** Testing filegroup() with links ***
int(%d)
int(%d)

*** Done ***

Did this file decode correctly?

Original Code

--TEST--
Test filegroup() function: usage variations - links
--CREDITS--
Dave Kelsey <[email protected]>
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
    die('skip Do not run on Windows');
}
--FILE--
<?php
/* Creating soft and hard links to a file and applying filegroup() on links */

$file_path = __DIR__;
fclose( fopen($file_path."/filegroup_variation1.tmp", "w") );

echo "*** Testing filegroup() with links ***\n";
/* With symlink */
symlink($file_path."/filegroup_variation1.tmp", $file_path."/filegroup_variation1_symlink.tmp");
var_dump( filegroup($file_path."/filegroup_variation1_symlink.tmp") ); //expected true
clearstatcache();

/* With hardlink */
link($file_path."/filegroup_variation1.tmp", $file_path."/filegroup_variation1_link.tmp");
var_dump( filegroup($file_path."/filegroup_variation1_link.tmp") );  // expected: true
clearstatcache();

echo "\n*** Done ***";
?>
--CLEAN--
<?php
$file_path = __DIR__;
unlink($file_path."/filegroup_variation1_symlink.tmp");
unlink($file_path."/filegroup_variation1_link.tmp");
unlink($file_path."/filegroup_variation1.tmp");
?>
--EXPECTF--
*** Testing filegroup() with links ***
int(%d)
int(%d)

*** Done ***

Function Calls

None

Variables

None

Stats

MD5 6b51c335bbbd46f465e7befe04a6f0e9
Eval Count 0
Decode Time 81 ms