PHPStorm can't resolve absolute include paths - path

I'm pretty new to PHPStorm, but I've ran into this problem where PHPStorm can't resolve the path which starts at the root of my project folder.
Like this:
PHPStorm can resolve the path when I put
dirname(__dir__)
in front of the name, but then I can't test my website using the run button.
When I use relative paths with ../.. PHPStorm recognizes the path as well, but again it doesn't work when testing the site, I also would rather not use relative paths.
PHPStorm is able to resolve the path from test.php which is in my root folder, but I'd like it to be able to resolve it from anywhere in my project.
Any help?

Go to File... -> Project Structure.
Choose Modules tab.
Mark 'Model' folder as 'Sources'.

Looks like your server know include path for your project folder, so relative paths like Model/Exposition.php work well. You can check include paths with get_include_path() function.
PHPStorm has its own list of include paths for project, which you can check and modify:
Open settings: File > Settings (or Ctrl+Alt+S)
In settings go to Language & Frameworks > PHP, and look at Include Path tab.
Of course you can add new record with full path to the root folder of your project
(which in your case will be like C:\Users\Ruben\Documents\Multec...\Server).
So finally PHPStorm will know where to find these files.

Related

In Unreal Engine editor, how to specify paths relative to the project folder root?

For a casual search in UE's docs I couldn't find environment variables that I could use in the settings within the Editor UI and would look like $PROJECT_ROOT. And my specified relative paths like path/to/my/subfolder seem to get resolved as relative to where the installed Unreal Engine is.
How should I specify the project root to be used by all relative paths filled in the project settings without hardcoding it?
There's no environmental variable. This is how to obtain the relative/full path of the project directory:
FString RelativePath = FPaths::GameContentDir();
FString FullPath = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*RelativePath);
source.
I'll answer myself after some research.
For my purposes, i.e., filling forms in the Editor, the realistic solution is to run Editor script such as via the Python Editor Script plugin, where you could query the project data using unreal.GeneralProjectSettings.

How to make Ctrl-click work in Visual Studio Code when paths in source code don't match paths in filesystem?

My access to the filesystem for our web server starts one folder deeper than the web server's root. So relative paths in our HTML look like this, for example:
<link href="/division/css/style.css" rel="stylesheet" />
But the path to that same file in my filesystem is:
s:\css\style.css
So whenever I CTRL-click on something in the editor I get an error because VScode is trying to open:
s:\division\css\style.css
But that doesn't exist. EDIT 1: my path does not include \division
I feel like I'm missing something obvious, but I've googled for hours and haven't found a solution to resolve this, such as a filter that strips "\division" from the filesystem paths or a mapping setting that tells VScode that relative path "/division" exists at S:.
EDIT 2: The division folder exists in the root of the share, and you can't map a drive to the root of a share ( \\server\, while allowed in explorer, isn't allowed in drive mappings). Neither would VScode allow me to open \\server\ as a folder. I tried creating a folder placeholder folder on my local drive containing another folder called division with a symlink inside that to \\server\division, while this looked like it worked in VScode, CTRL-Clicking on a link wouldn't work, it says the file doesn't exist. It looked like it wouldn't follow symlinks.

How to make permanent url to file in svn?

Good day, colleagues,
can you advice me, how to make permanent links to files in SVN?
If I make a link, now I get something like:
http://172.29.15.15/svn/OFFICE_WORK/Trainings/123.xlsx
but if I move file to other directory, I get a error (file not found).
I know that in Sharepoint I can assign unique IDs (aditional option in admin panel) to files, and I'll get a permanent URL to file, that doesn't depend on it's location.
Is there an opportunity in SVN to make permanent link to file, that not depend on it's location?
Thank you in advance!
I'm not sure if I'm understanding the question correctly when you say "permanent link". But try adding an external property to your checked out directory. Right click on the directory you wish to add the 123.xslx file to, go to TortoiseSVN > Properties > New > Externals.
Then click New..., give the local path to the file and URL to the file which you posted above
Example:
Local Path: 123.xlsx
URL: http://172.29.15.15/svn/OFFICE_WORK/Trainings/123.xlsx
Hit OK. OK, again. Then do an SVN Update on the folder. Your 123.xlsx file should be included.
Not sure what you're referring to by not depending on location though. In subversion, in order to pull a file, you have to have the URL to gather it from. There isn't any ID feature unfortunately. It seems your repositories are based off an IP address of some sort... Is there any way you can use a common domain name for your path? That would probably solve your issue as well.

Absolute path for img and js excluding project folder name Visual Web Dev

I've this little but annoying issue in my project in Visual Web Developer 2010 Express. I'm developing a website with .aspx files located in a large folder structure i.e. www.domain.com/group1/type1/somefile.aspx, the root folder contains a "styles" (for css), "images" and "js" (for javascripts) folder. I've read a lot about base tag, absolute and relative path today. Finally I realized "absolute path" is the best choice for me.
The main problem is that when I preview (locally) my site in browser the absolute links for image, css, and js are not working, I'm using src="/js/gl.jquery.js" which I believe is correct and will work online.
The source code of the page for the javascript says http://localhost:61700/js/gl.jquery.js, when I switch to relative path script src="../../../js/gl.jquery.js" and preview the website, it works fine, and the source code for the javascript path says http://localhost:61700/ProjectName/js/gl.jquery.js (Notice Visual Studio added the ProjectName in the path) So I'm taking my guess that when the project goes online (on a main domain) it will work correctly, but right now I need to keep developing locally without this issue. Is there a way to fix this in Visual Web Developer? maybe some tag for the web.config file that I can remove when goes online, or some website property?
I know a quick solution will be develop with the relative path, and modify the code when goes online to absolute path, but I'm looking for some cleaner method, as aditional information I didn't choose base tag because I read cause troubles with anchors links (href=xx.html#question3) and I need to use them at some big files. And avoid the relative path because it's possible that the company ask me to move some files in the future and I don't wanna be updating relative paths.
Thanks a Lot!
Problem solved! This is the solution I found Thanks to ScottGu's Blog.
I quote the main thing:
when opened a web-site and run the project, VWD launch and run the built-in web-server using a virtual app path that equals the project’s root directory name. For example: if you have a project named “Foo”, it will launch and run in the built-in web-server as http://localhost:1234/Foo/Default.aspx.
One downside to this is that it makes it hard to fully qualify things like static CSS and image files within your site (for example: using root qualified paths like /images/myphoto.jpg or /css/mycss.css). Note that you can use the “~” app path trick for dynamic resources – but static resources still end up being a pain (js, css, images files.) (This was my issue)
Here is the guy entire post: Click Here
Here is the main solution:
1) Using the solution explorer within Visual Studio, select the web-site project node, (the one with the World icon)
2) There is a properties named "Virtual path" at the bottom. Change the "virtual path" setting it to / to run as a root web-site.
And that's it, setting up the / I can manage my files easily.

UNC build path in Team build (TFS)

I am pretty new to TFS so I have this problem when I want to set a destination directory to my build.
Every time I launch the build, it dramatically fails and says "couldn't find \xxxxxxx\yyyyy\zzzz".
I think that my UNC path is wrong.
Let's assume that my drop directory (destination directory) is "C:\Project\" and my computer name is "lemoos-PC", what would the equivalent of my path in UNC notation?
I've tried these :
\\lemoos-PC\C\Project\
\\lemoos-PC\C:\Project\
\\lemoos-PC\Project\
but they don't seem to work.
Thanks in advance .
In your case, you should be able to use the following as your UNC drop location:
\\lemoos-PC\C$\Project
C$ is a special 'administrative' share that is normally already available on your machine. The $ makes it a hidden share that prevents other people from browsing to \\lemoos-PC and seeing it listed. Other people can only access it if they both a) know the name of the share and b) have administrative access to the computer.
The UNC path is really a path to a shared network folder and it would have the format
\\computername\sharename\directory\in\share
so it would depend on what the name of your network share is, not necessarily what your local path is. If you for example share your C:\Project folder as Project, the path would be
\\lemoos-PC\Project\

Resources