Sometimes, for any reason, we need to rename folder's name in PHP (like I do for system folder in EE.).
There is a function in php called <a href="http://php.net/manual/en/function.rename.php">rename</a>. This function works perfectly with files.
The problems (in my case) begin with folder's rename, when I want to do it, I'm using :
Now,when I'm using this, I have the next error :
Warning: rename(/myoldfolder,/mynewfolder) [function.rename]: Permission denied in /Applications/MAMP/htdocs/config_dev/configure.php on line 26
This is not a real permission problem around here because I have the right to do it.
But, how ?
The idea is to give an absolute link and not a relative link like this :
And, voila ! Everything should works perfectly (like in my place) !
This piece of code is going to give your current folder where the code is executed like this :
Hope it helps some of you !