NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Improvement for opening files from commandline


Joined: 16 Apr 2007
Posts: 3
Reply with quote
In my company we are using a debugging feature that places links to templates / controllers next to their output on the actual website.
We are then using a commandline script to make those links open the specified file in phped.

This works just fine right now by just calling "phped file".

Now the actual suggestion for improvement:

- When the file is already open in phped, a new tab is created instead of just activating the existing tab.
This can become quite confusing when working with lots of files.

I guess it shouldn't be to hard to check the list of opened files before creating a new tab?

- It would be great if a line number could be specified along with the filename.
For example: phped file 500 would open the file and directly jump to line 500
(with suggestion #1 implemented it would first check if the file is already open and just activate that tab and jump to the specified line)
View user's profileFind all posts by TharitSend private message


Joined: 23 Apr 2008
Posts: 1
Location: Dernbach, Germany
Reply with quote
I totally support this feature request.

We use a tool to generate translation tables for different languages. Sometimes it is important to jump to the excact line in the PHP-source file. Our tool lets us start PHPEd with the PHP-file opened, but there is no way to set a line-number in the command line to start PHPEd.

> Examples/Suggestions
Code:
phped -l305 filename.php
phped filename.php:305


Also it would be nice, if PHPEd would only open a file once.

_________________
GK
View user's profileFind all posts by gkitzingSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8256
Reply with quote
Tharit, does it mean that you're using shell verbs or something like that in your front-end application?

Quote:
When the file is already open in phped, a new tab is created instead of just activating the existing tab.

it is supposed to work as you requested. If it doesn't, please create a testcase and submit to support.

Quote:
- It would be great if a line number could be specified along with the filename.
For example: phped file 500 would open the file and directly jump to line 500

I'll check, but first I need to make sure I got it right how you run phped and make it loading the files.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Veteran

Joined: 30 Aug 2006
Posts: 116
Reply with quote
May I ask what the URL looks like for opening up a file from a webpage? We're looking at doing something like this (except in our scenario we're hoping to show all the templates involved in a page at the footer of the page).
View user's profileFind all posts by rudderSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8256
Reply with quote
Quote:
May I ask what the URL looks like for opening up a file from a webpage?

web server itself is not supposed to do this.
You need either FTP, or SFTP, or WEBDAV services running on your server.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Bringing light to the dark ;-)


Joined: 20 May 2008
Posts: 1
Reply with quote
Hi there,
I'm a work mate of Tharit that created that click-in-website-open-in-PHPEd script.
It's in no way perfect but works.

Since our portal consists mostly of small controller-template parts rendered hierarchically
into bigger templates it's only logical you want to know which class/template file is responsible
for each these parts. So starting pages with a debug parameter, each 'box' in this page will
be rendered clickable and in the upcoming popup there's the php-link to open the corresponding
file in PHPEd or the editor of your choice.


Example just for Windows Systems:

create whatever.reg and fill it with something like:
---------------------------------------------------------------------------
REGEDIT4

[HKEY_CLASSES_ROOT\phped_protocol]
@="URL:phpedProtocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\phped_protocol\shell]

[HKEY_CLASSES_ROOT\phped_protocol\shell\open]

[HKEY_CLASSES_ROOT\phped_protocol\shell\open\command]
@="\"C:\\phped_protocol.bat\" \"%1\""
---------------------------------------------------------------------------

Instead of phped_protocol.bat you can use any other scripts.

Now you are able to push anything to the script using phped_protocol://anyParameterYouWantTo in your favorite browser.

We are using this to call PHPEd per CLI like C:\Programme\nusphere\phped\phped.exe %modifiedFilename%

If you do this twice, PHPEd opens the file in 2 different tabs.


------ 2-----------
When you encounter an error in the page, it would be perfect to jump to the 'Notice/Warning: ... in file XXX ... on line 1567 ... ' directly.
That's why something like /path/to/nusphere/phped.binary /own/path/prefix/XXX@1567 would be so cool for us.


Thanks in advance for your help
We're all loving your piece of software, guys, by the way, very well done!

Stefan
View user's profileFind all posts by stefanSend private message


Joined: 20 Feb 2011
Posts: 1
Reply with quote
gkitzing wrote:
I totally support this feature request.
> Examples/Suggestions
Code:
phped -l305 filename.php
phped filename.php:305



what is the "jump to line number" phped commandline parameter?

"phped -l305 filename.php" and phped "filename.php:305" does not working.
View user's profileFind all posts by gassanSend private message


Joined: 27 Apr 2007
Posts: 72
Reply with quote
phped.exe "file.php" --line=30
View user's profileFind all posts by sirjardaSend private message
Improvement for opening files from commandline
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