Skip to content

Instantly share code, notes, and snippets.

@jadwigo
Last active December 6, 2016 11:32
Show Gist options
  • Select an option

  • Save jadwigo/5de01028f067c7f0da50b8803668a50b to your computer and use it in GitHub Desktop.

Select an option

Save jadwigo/5de01028f067c7f0da50b8803668a50b to your computer and use it in GitHub Desktop.
<?php
guesstimate_file_location($boltforms_location, $public_location) {
$tested = false;
$formfilename = $boltforms_location . '/testfile.txt';
$publicfilename = $public_location . '/testfile.txt';
$timestamp = microtime();
if(file_put_contents ( $formfilename , $timestamp )) {
$tested = file_get_contents ( $publicfilename );
}
if ($tested == $timestamp) {
return true;
}
return false;
}
<?php
guesstimate_by_realpath($formlocation, $filelocation) {
if(realpath($formlocation) == realpath($filelocation)) {
return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment