Process defines and php constants

Let us know what you would like to see in the next version of this software

Moderator: kfury77

Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.

  • Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
  • Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
  • Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".

Please note that we DO READ all suggestions, even if a reply is not posted. Thanks!

Process defines and php constants

Postby Tecktron » Thu Aug 22, 2013 8:03 pm

Here is my case and idea:

I define a constant
Code: Select all
define('INCDIR','/includes');

Then, includes are used as such:
Code: Select all
include(INCDIR.DIRECTORY_SEPARATOR."myinclude.php");

In the code explorer I can't open the file (listed under Includes) because it says my include is :
INCDIR.DIRECTORY_SEPARATOR."myinclude.php"
which cannot be opened.

I would like it if the php constants (EG: DIRECTORY_SEPARATOR) as well as my defines were to be processed so it would build a proper links to those files.

At least as a first step without having to backtrace code, it would only show a string or variable name.
EG:
in the case above, you would see:
Code: Select all
/includes/myinclude.php

However if I use $includefile variable instead of a sting value as part of the name, I'd get this:
Code: Select all
/includes/$includefile

which, of course, I wouldn't expect to be able to open since backtracing that $variable means a whole other thing.

It would also be nice to use this as a tool tip over them in code to quickly see their definition as well.

Thanks!
Tecktron
 
Posts: 27
Joined: Wed Apr 10, 2013 5:17 am

Re: Process defines and php constants

Postby Aivars » Fri Aug 23, 2013 8:51 am

We would basically have to interpret the script for this and I don't think that's feasible. Yes, there could be special cases like processing defines only but would that be enough for most projects? We'll think about it.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2456
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Process defines and php constants

Postby Tecktron » Fri Aug 23, 2013 3:51 pm

My thought was that you're already pulling some information from the text based on the finding of includes and outputting them in the code explorer.

You are correct in that it would be a special case only for defines and the predefined PHP constants.

I'm guessing you can search the text for 'define' the same way you search for 'include'. Then processing them, would be a split at the comma, remove the quotes (if any), then when producing the includes in the code explorer, it would just be a search and replace on all strings processed until there are 0 replacements made, this way even if a predefined constant is redefined, it would still get replaced.

As I mentions I wouldn't expect you to try and parse any variables, just print them as if they were also strings.
I know this is not a complete or perfect solution, but feel it will still help, more so than the current system.

I hope that clarifies things a little.

Thanks for your consideration!
Tecktron
 
Posts: 27
Joined: Wed Apr 10, 2013 5:17 am


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Feature Requests

Who is online

Users browsing this forum: No registered users and 14 guests

cron