PhpStorm does not recognize PHP - php

I saw many different questions here, but nothing was helpful to me.
I have no trouble with an interpreter, I tried to reset PhpStorm's cache.
It looks like file functions.php isn't accessible.
I really don't want to make a total reset. Maybe somebody has an idea how to solve it?

I'm not sure what I actually did and how to reproduce this issue again, but now it works well. I took previous version of PHPstorm. When I installed new one, the previous one was simply renamed to sth like 'phpstorm2'.
Here are my thoughts what actually happened:
As I understand for highlighting is responsible that part of application which is managed under Languages & Frameworks / PHP / PHP Runtime.
To reproduce this issue you may try to disable there "Core / Core" and try to write down in any place of your phpfile following:
\Exception::class();
And in your case this class will not be highlighted, as it presents in Core_c.php. In my case it is placed in
/opt/phpstorm/plugins/php/lib/php.jar!/stubs/Core/Core_c.php
I'm 100% sure that these libs were always enabled, but why I didn't saw this - that is the question.
So if I face this issue again my steps would be:
Try to verify Languages & Frameworks / PHP / PHP Runtime. The better way would be to enable ALL libs.
Check External Libraries in the project tree. Check read privileges for /opt/phpstorm/plugins/php/lib/php.jar and probably reinstall this plugin.
Try to find out function which I don't actually see in External Libraries.

Related

"Add as link" in Netbeans?

How can I (in the Netbeans IDE) add files as links, or point to existing files, kind of like a shortcut?
Visual Studio 2012 can do this, as shown in the following screenshot (found on Google Images - not mine).
I miss this feature in Netbeans. Copying my files over all the time is not an option, since I constantly improve my PHP library files, that are used across all other projects.
I am using the full version of Netbeans, and in this case, I am doing PHP development.
I am not sure that PHP is supposed to work like that, since its code is not compiled.
I could be completely wrong, and if I am, I'm sure someone else will educate us both.
What I've usually done is put the library in some directory and then add that directory to PHP's include path by adding this to php.ini:
include_path = "dir to your library"
And then I'd make sure that whatever class autoloader I was using was looking through the include path.
That said, I've more recently moved away from this, because a global library that changes often has caused me problems (a change would break something and similar issues).

Migrating php code from 5.2 to 5.3

I was asked to help getting a website that was running with 5.2 php code, to work on a 5.3 php server. The site is big, and I can't see the errors that would appear normally when a site isn't working.
I've tried to use the Search and replace function that Dream Weaver has, and simply use it all over the website. But the problem is that I only want to replace functions in PHP documents, and not in js files. When i use Search and replace, in Dreamweaver, it overwrites the js files aswell, and that would cause more errors. Because there's A LOT of files that i have to go through, it would take me a lot of time if i had to go through it manually.
I figured this must be a problem that a lot of firms experiance, so there must be ways to handle this without it being a bigger hassle.
Anybody out there who could help me out ? Any help is much appreciated!
Regards,
Mathias
Check out the official guide about Migrating from PHP 5.2.x to PHP 5.3.x
most existing PHP 5 code should work without changes, but make sure error-reporting is enabled to get some idea of what is going wrong .
I would recommend the use of sed from command line. It is most likely the fastest and most powerful find/replace utility available for LAMP developers.
http://www.grymoire.com/Unix/Sed.html
Dont worry about it! If your code works in php->5 for the most part it will work just fine. 5.3 offers a plethora of options but no doubt your not using them.

Using aptana to debug with easyphp +cakephp

I'm starting a new project, for this project, I need a great IDE, which allows me to debug. I thought to aptana after some search.
But this project is a little specific, it has to work with a specific version of php and has not common extension(e.g. php_ingres), so I think I cannot use the internal server of aptana, otherwise it will not find every ingres function.
I've an EasyPhp environnement installed and working.
I've created a new "Simple server" and a new web browser configuration using this webserver(and chrome). But now when I try to debug it, I cannot see my browser configuration, it looks like it display only internal servers here. So is this possible to use aptana with easyphp? If yes, how?
If not, which IDE provide some auto-completion, debugging and allows me to use my own server?
Thank you very much
I think Netbeans can do your job, check this guide :
http://wiki.netbeans.org/HowToConfigureXDebug
Netbeans is great and is free too. But it maybe hard to figure your way around in that for a 1st time user. If money ain't a problem i'd suggest using phpDesigner 7 - http://www.mpsoftware.dk/phpdesigner.php. Easy and simple, with word completion, debugging features and also allows you to setup up an FTP connection to your servers so you can edit your files on the fly.(This method of editing files on the fly however may not be ideal if its mission critical data. I'd suggest using version control platforms like git, read more here - http://progit.org/book/ch1-1.html )
I finally used code lobster, which is not the best editor but can use easyPhp and actually debug into it.

netbeans - php code completion not working anymore [duplicate]

Recently I started using NetBeans 6.7 beta for PHP development instead of Textmate and MacGDBp. I am rather amazed with it's feature set and most everything worked out of the box, or was easily configured to my liking.
I am having an issue with the code completion features though; they work for built-in functions, SPL and some of my code, but not all of my code, specifically, it never works for any methods in my classes, regardless of PHPDoc comments.
I can't seem to find any decent questions, let alone answers about this specific subject anywhere. It looks like everybody else who has problems with the code completion just hasn't enabled the auto-popup feature.
So the big question is:
Is there any way to influence the code completion cache, or something I have to add to my code to make it work? I'd really like to have code completion for the methods I write.
PS: I have tried several older versions of netbeans, they all exhibit the same problem.
edit: I've put a .zip up of my current test project. get it here. It's a very young project, think a day and a half.
edit2: Below is a screenshot of what i'm looking at. As you can see, it fails to complete pretty much anything, nor does it see the PHPDoc documentation.
I've tried opening your project, and the completion seems to be working just fine for me.
The only thing I can think of is to try to delete your entire NB cache, which should be located in $HOME/.netbeans/$VERSION/var/cache/. This is a wild guess
Create a backup first, I didn't try this!
If that fails, maybe you should try creating a new project, maybe that will kick NB in the butt.
Note that in NB 7.2 beta, the cache has moved to $HOME/.cache/netbeans/$VERSION.
What worked for me was deleting the old nbproject folder (that was created in windows) and recreating the PHP project from existing sources. This is on NB 7.0.1 Mac OS X. Clearing the cache did not work for me.
Be aware of #property something syntax. If object something does not exists in your code anymore, NetBeans might have problems with proper code completion. Consider example:
/** in main file: **/
use ABC as _ ;
/** in file ABC: **/
/**
* #property \Something $something
*/
If you do not use $something anymore, NetBeans will most likely generate an exception, thus failing to complete the code.
What worked for me was clearing the cache, then explicitly including some key subdirectories in the Global include path. Appears that for some reason NB 6.7 wasn't recursing the directories.
Including at project level also worked
Project->Properties->Include Path
Netbeans 7.01 + Windows 7
If, for instance, you open a php file with netbeans without being part of a project, code completion doesn't work at all. What you need to do is to create a project having that file in it.
Tested this on NetBeans 7.0.1

Existing alternate PHPDoctor doclets or styles?

We are about to start using PHPDoctor to auto-generate documentation for our PHP codebase at work. (It was the only one we've tried that could handle our very large codebase, and unlike PHPDocumentor, it's still being updated and supports PHP 5.3).
We'd like to try using different doclets and/or stylesheets than the default that come with it. I did some Googling but didn't see where anybody has posted any. Before we make our own, does anybody know a place where they can be found online?
If you do create your own, we'd love to see it and add it into the project if it's something other people would benefit from.

Categories