this is my php project dir structure
My_Project
->cache
->config
->lib
TestClass.php
my TestClass.php contains method cacheSet(), it creates file within the cache/ dir. so my question is how I set path to CACHE_DIR within that method.
class TestClass{
.....
public function cacheSet($filename, $data)
{
$filename = CACHE_DIR . '/' . $filename. '.cache';
$file = fopen($filename, 'w');
fwrite($file, serialize($data));
fclose($file);
}
}