Add php extension (geoip.so) to Zend Studio for code validation - zend-studio

just have a short question here. I've just installed new php extension (geoip.so) using pecl to /usr/local/zend/lib/php_extensions/ and added the extension to the php.ini.
Run the code and it works just fine. But Zend Studio is giving warning of undefined geoip function.
Try to add the directory path above to the include path of Zend Studio, still the warning exists.
Any clue how to remove this warning?
Thank you in advance!!
/Agustinus

You can add functions to Studio by putting PHP files with stub function descriptions into special directory. Find this directory in filesystem in a following way: write something like gmdate(), select the name and press F3. You will be taken to one of the prototype files. Note the directory where this file resides (shown on the top and if you hover over the tab). Now you need to create stubs for functions you are missing just like the one you're looking at. You can put them into any file, generally, but I suggest putting them into separate file - like geoip.php - and put this file into that directory.
You may also want to do right-click/Show In/PHP Explorer and browse other prototype files if you need examples of how to do it right.

Related

VsCode include Path errors are impossible to solve

The other answers i've seen proved to be ineffective.
I'm using c++ and it gives me error(red squiggle) when i include vector or string.
It tells me that my include path is not updated so i click on the lightbulb and try to edit intellisense configurations.
In this window there's an include path section, inside the box there's this string: ${workspaceFolder}/**.
So is this string the problem?
I've tried to put in this box the following path as well:
/usr/local/include but it doesn't change anything...
Please what should i change about this include path??
What is there supposed to be in it?
Press Ctrl+Shift+P to open the Command Palette
Start typing "C/C++" and then choose Edit Configurations (UI) from the list of suggestions. This opens the C/C++ Configurations page. When you make changes here, VS Code writes them to a file called c_cpp_properties.json in the .vscode folder.
Find the Compiler path setting. VS Code will attempt to populate it with a default compiler based on what it finds on your system. For Clang on macOS, the path should look like this: /usr/bin/clang.
The Compiler path setting is the most important setting in your configuration. The extension uses it to infer the path to the C++ standard library header files. When the extension knows where to find those files, it can provide lots of useful information to you as you write code.
Set IntelliSense mode to ${default}, which on macOS is clang-x64.
You only need to modify the Include path setting if your program includes header files that are not in your workspace or in the standard library path.
On macOS, you must set the macFrameworkPath to point to the system header files.
Visual Studio code places these settings in .vscode/c_cpp_properties.json.
Original documentation here!

WCF Service - Relate Code File to Code Behind File

I am manually reconstructing a WCF service from pieces. I add a MyService.svc file MyService.svc.cs file.
How the heck do I now make the latter the code-behind of the former? It's not just a matter of editing the project file to add the dependency and editing the svc file to point to the code behind file. Neither of those, nor the combination, works for me.
I also tried right click remove from project then include, which I seem to recall used to work for asp.net pages in one or another version of Visual Studio.
I just got it to work. Remove from project and then include in project actually does work. The trick is to make sure the files have the same names, except for the extensions. Although I called them both MyService in the question, in fact they had different names which was why it wasn't working.
So:
Make sure the roots are the same name.
You don't need to edit the project file or the markup file to point to the code behind.
Right click and exclude from the project.
Ensure Show All Files is active (top of solution explorer)
Ctrl-click to select both files.
Right click and select include in project.
They will be associated as markup and code behind.

Visual Studio Express - Simple build configuration error

I've switched to a new computer but copied all my project files to it. I am getting this error when I try to run:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(806,5): error MSB3191: Unable to create directory "C:\Users\MyUser\StarFall\StarFall_build\CMakeFiles\". Access to the path 'C:\Users\MyUser\StarFall\StarFall_build\CMakeFiles\' is denied.
The path has changed, but I don't know where I can change this setting. I realise that this may be specific to what my project settings are, but if you need more details I will post them!
Like Arun mentioned, this kind of an error happens when there is a macro in your project which is pointing to a wrong location. You shouldn't change the microsoft.cppbuild.targets file. Instead, go to your project properties and change the directory paths that are erroneous.
You can see macro expansions when you click on the dropdown arrow beside a macro, click edit and click Macros>>
From your message, I guess, it is defined in file:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets
at line 806,column 5

How can I include .pdf files when I publish but not in a search and replace in visual studio?

More specifically my problem is if I include a pdf in my project and set its build action to content so it gets copied to the server when I publish, is there a way to exclude it from visual studios search and replace feature. Would a post build action be a solution to this? I just don't want anybody to do a global search and replace in my project and mess up the pdfs...
I know I just said a mouth full so let me know if you need clarification. Thanks!!!
If you look in the section headed "Find options" in the find dialog, there is an option titled "Look at these file types". If you qualify the type as *.cs, it will only look in files with that extension. You can also enter multiple file extensions. As long as you don't include pdf files in that filter, it will not apply to them. An alternative is to define a folder set to search in by clicking the ... next to the folder combo. Put your PDF files into a sub-directory of your project and exclude that folder from the folder set.
Additionally, as you have said, not including them in the project and using a post-build event to copy them to the output would also work.
I would qualify though that you are trying to solve a problem that shouldn't really be a problem. The onus is on the developer doing a find and replace to take care in doing so, and to not replace the contents of files they don't intend to change in the first place. Find an replace can be a dangerous tool.

Export Visual Studio Template error: "Unable to read an exported file"

When exporting a Visual Studio project to a Template (File/Export Template...) I get the following error upon clicking the Finish button:
Unable to read an exported file for the following
reason: The file cannot be opened with the selected
editor. Please choose another editor.
Screenshot http://img687.yfrog.com/img687/1756/templateerror.png
A Google search for this error has only led to several dead ends. There aren't any unusual file types in this project. Any ideas what could be going on?
By laborious trial and error (start with an empty project, add a folder, try to export template) I was able to narrow this down to a single Javascript file. As it happens, it's one of the language definitions for prettify.js (which is used on this site for code coloring). The file in question is lang-hs.js, and for some reason Windows on my machine treats this file differently from other Javascript files: It opens in Notepad, when I have the .js extension mapped to Visual Studio.
I'm not sure what the underlying explanation is, but I've already wasted enough time on this and I believe I can live without Haskell code coloring (!) so I'm just deleting this file and moving on.
It seems ".cur" files are often a culprit in this error. I have removed them from my project and now the exportation works correctly.
Microsoft staff suggest looking at log files (../windows/system32/compmgmt.msc) but this error does not spawn an entry into the Application EventLog.

Resources