import org.eclipse.jface.preference.IPreferenceStore;
/**
- * Expands a variable into the last opened PHP file
+ * Expands a variable into a localhost/documentRoot URL string
* <p>
* This class is not intended to be extended by clients.
* </p>
}
/**
- * Returns a string representation of the path to a file or directory
+ * Returns a string representation to a localhost/documentRoot URL
* for the given variable tag and value or <code>null</code>.
*
* @see IVariableTextExpander#getText(String, String, ExpandVariableContext)
IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
String localhostURL = path.toString();
String lowerCaseFileName = localhostURL.toLowerCase();
- // fileName = "http://localhost"+fileName.replaceAll("c:", "");
String documentRoot = store.getString(PHPeclipsePlugin.DOCUMENTROOT_PREF);
documentRoot = documentRoot.replace('\\', '/');
documentRoot = documentRoot.toLowerCase();
if (lowerCaseFileName.startsWith(documentRoot)) {
localhostURL = localhostURL.substring(documentRoot.length());
localhostURL = store.getString(PHPeclipsePlugin.LOCALHOST_PREF)+ localhostURL;
- System.out.println(localhostURL);
- // localhostURL = store.getString(PHPeclipsePlugin.LOCALHOST_PREF)+ localhostURL;// + localhostURL.replaceAll(documentRoot, "");
}
return localhostURL;
}