', addslashes($reactivate_url)); w3_activate_error(sprintf('%s
then %s.', $e->getMessage(), $reactivate_button)); } /** * W3 writable error * * @param string $path * @return string */ function w3_writable_error($path) { $reactivate_url = wp_nonce_url('plugins.php?action=activate&plugin=' . W3TC_FILE, 'activate-plugin_' . W3TC_FILE); $reactivate_button = sprintf('', addslashes($reactivate_url)); try { w3_throw_on_write_error($path); } catch (Exception $e) { w3_activation_error_on_exception($e); } } /** * W3 error on read * * @param string $path * @throws FileOperationException */ function w3_throw_on_read_error($path) { w3_require_once(W3TC_INC_DIR . '/functions/file.php'); if (w3_check_open_basedir($path)) { $error = sprintf('%s could not be read, please run following ' . 'command:
chmod 777 %s', $path, (file_exists($path) ? $path : dirname($path))); } else { $error = sprintf('%s could not be read, open_basedir' . ' restriction in effect, please check your php.ini settings:
' . 'open_basedir = "%s"', $path, ini_get('open_basedir')); } throw new FileOperationException($error, 'read', 'file', $path); } /** * W3 writable error * * @param string $path * @param string[] $chmod_dirs Directories that should be chmod 777 inorder to write * @throws FileOperationException */ function w3_throw_on_write_error($path, $chmod_dirs = array()) { w3_require_once(W3TC_INC_DIR . '/functions/file.php'); $chmods = ''; if ($chmod_dirs) { $chmods = '