NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Validating PHP Files


Joined: 25 May 2011
Posts: 1
Reply with quote
Hi,

I'm currently trying out the evaluation version of PhpEd, and I have a question related to the validation of PHP files.

Background: I have a workspace with three projects in it. Two map to the normal (http) and secure (https) parts of my website, and the third is a holder of common code (called 'code', strangely enough). The local file structure is as it is on the server. Ie, all three 'projects' are in adjacent sub directories of the same parent directory. I've set PhpEd up to upload each project to the correct folders and everything seems to be working fine. (It can locate any included file in the directory structure regardless of project, etc.)

Now, one of the primary features I am looking for in a PHP editor is the ability to validate *all* files in my projects in real time. For example, if I change the signature of a function in a PHP file in my code project, I would like all places where that function is called from in any of the three projects to be flagged as having an error. If PhpEd cannot do this, then at the very least I would like the equivalent of a build button which performs such validation of all files in all projects.

So, my questions are:

Does PhpEd support such a validation feature? (Because I haven't found one so far...)
If not, will it in the future? (And if so, when?)
If it does, how do I enable/use it?

An additional question that just occurred to me on the same subject:

Can PhpEd track how variables are used and flag incorrect usage as errors. Eg, if I assign an integer to a variable, and then attempt to use that variable as an argument to a function expecting a database server connection, will that be flagged as an error?


Cheers,
James
View user's profileFind all posts by CrazyDefSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
PhpED 5.9.5 does not provide a validation feature and does not provide the ability to track usage. I'm hoping PhpED 6.0 will provide some features to assist in these areas.

Whilst it might not be a total help at the moment, you can provide code hints to variable types, which will provide design time assistance, some run-time checking and if PhpED starts supporting design time type checking then you will hopefully then find that then also works.

For example:

Code:
// This will raise a clear PHP run-time error to indicate a wrong argument type was used
test(1234);
/**
*
* @param my_object_class $x
*/
function test(my_object_class $x){
  echo $x;
}


I'm also a .NET programmer and I like using that with strict typing (so everything has to be cast if there is a data type change). When I started using PHP, I thought I would miss strict typing, but surprisingly enough I haven't found it too big an issue. However, PhpED really needs to provide some basic type checking at design time and I'm hoping PhpED 6.0 will.

Seeing as how you are just trying PhpED at the moment, something I can promise you is that it has the best debug module. It is much better than Xdebug or Zend Debugger.
View user's profileFind all posts by plugnplaySend private message
Validating PHP Files
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic