I'm using PHP's CLI for creating a program. There's a folder named /compile
which holds all of the compiled files after it's CLI call, this folder gets the constant __COMPILE__
. I'm using this function and using the constant to use as the location: (Location: C:\Users\Jeklin\Documents\GitHub\spitfire-engine\compiled):
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65488 bytes) in C:\Users\Jeklin\Documents\GitHub\spitfire-engine\sys\compiler\Launcher.compiler.php on line 66
This is the function I'm using:
/*59*/ public function p_sweep_compile_dir()
/*60*/ { $dir = __COMPILE__;
/*61*/ if (is_dir($dir)) {
/*62*/ $objects = scandir($dir);
/*63*/ foreach ($objects as $object) {
/*64*/ if ($object != "." && $object != "..") {
/*65*/ if (filetype($dir."/".$object) == "dir")
/*66*/ $this->p_sweep_compile_dir($dir."/".$object);
/*67*/ else unlink ($dir."/".$object);
/*68*/ }
/*69*/ }
/*70*/ reset($objects);
/*71*/ rmdir($dir);
/*72*/ } else die('tried to delete a non-folder from p_sweep_compile_dir');
/*73*/ }
I can see that on line 66 that includes the recursion method to try to get deeper into the file structure, although the structure is very shallow, this is the __COMPILE__
directories setup:
|--compiled
|---app
|---public
|---sys
|index.html