Last active
December 6, 2016 11:32
-
-
Save jadwigo/5de01028f067c7f0da50b8803668a50b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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