Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
$worked = file_put_contents("/".$this->filepath #227
Hi, great platform.
I encountered this bug in the last standalone plugin from 2013. I had to update that file, and am surprised it's still here.
$worked = file_put_contents("/".$this->filepath
I had to add the / path, as it was trying to write from the relative path!
I am using PHP 7, fresh installed. Maybe it's a php5 -> 7 thing?
Anyway, fixing this let me install. CHEERS.
I was already confused about this in general, as I've never encountered this issue after the thousands of deployments I've done myself. But now to see that it's happening on multiple OS platforms...
I think it's time to revisit. Off the cuff, one potential solution comes to mind, but it would probably be a breaking change for prior installs. Need to test and consider more options.
Ok, so I've had a quick look - is there a reason why you are using 'trim' instead of 'rtrim' on line 46 on fields_map.php?
$this->filepath = trim(str_replace('mu-plugins/wp-db-abstraction/translations/sqlsrv', '', strtr(dirname(__FILE__), '\\', '/')), '/') . $loc . '/fields_map.parsed_types.php';
If you change it to 'rtrim' then the problem goes away, and shouldn't affect other OSs or installs.