php-general Digest 26 Aug 2006 11:50:01 -0000 Issue 4314
Topics (messages 241124 through 241127):
Re: Recommendations for PHP debuggers?
241124 by: Larry Garfield
241125 by: Colin Guthrie
Re: functions classes
241126 by: Alex Turner
Brain Death - [PHP] functions classes
241127 by: Alex Turner
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On Tuesday 22 August 2006 03:33, Colin Guthrie wrote:
> Larry Garfield wrote:
> >> http://www.zend.com/phpide/
> >
> > I just tried to install the modular version for my existing Eclipse
> > install. It insists it won't install without feaure org.eclipse.emf
> > (2.2.0). Since it provides no indication of how to get such feature, I
> > haven't been able to give it a serious look. :-)
>
> Yeah it took me a while to find all the dependancies myself hense why I
> said the tarball was easier for takign it for a whirl, but seeing as my
> own stubornness meant I found all the necessary updates I figured I'd
> post them ;)
Thanks, but even with that list it didn't work. I kept getting "could not
find" errors while trying to install most of those extra components.
So, I downloaded the all-in-one tarball to give it a try. Turns out that it's
Eclipse 3.2 while I have 3.1 (which is the latest in Debian Sid). Not sure
if that was the problem with the piecemeal approach.
Anyway, in short, PHP IDE is Zend Studio partially ported to Eclipse.
Unfortunately, it is lacking all of the things about Zend Studio that I like;
the fast response time (to be fair, my work computer is substantially faster
than my home computer), the near-instant code assistance (it was still barely
there), the syntax highlighting (it has it, but it's broken and gets confused
by variables inside strings. Oops), the simple project setup (Eclpise
projects are so damned heavy!)... Yeah, nothing to see here.
Moreover, I couldn't get it to hook up to an external include path. That
meant I couldn't get PEAR to link up to my project at all. It was listed in
the include paths, but somehow that fact never made it to the built in code
runner. Even after I manually added it in-code with set_include_path(), it
couldn't connect to my database. The DB works, and the exact same code run
on the command line works fine, but it wouldn't talk to the database.
My guess is that the included PHP executable doesn't have MySQL installed.
So, I tried hooking it up to my existing /usr/bin/php. After eventually
figuring out how to do that (it's a bit screwy), I tried running the program
and got no output at all, in any of the various output or console or debug
screens. Score! (And yes, the program should have been generating lots of
output.)
I remember hearing that Zend was planning on making their next version of ZDE
Eclipse-based. If that's the case and this is the early release of it, well,
it's been nice knowing you Zend. All the bad parts of Eclipse with none of
the good parts of ZDE. And I didn't even get to the debugger yet.
So unless someone has a better idea, I'm back to Kate and a terminal
window. :-)
--
Larry Garfield AIM: LOLG42
[EMAIL PROTECTED] ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson
--- End Message ---
--- Begin Message ---
Larry Garfield wrote:
On Tuesday 22 August 2006 03:33, Colin Guthrie wrote:
Larry Garfield wrote:
http://www.zend.com/phpide/
I just tried to install the modular version for my existing Eclipse
install. It insists it won't install without feaure org.eclipse.emf
(2.2.0). Since it provides no indication of how to get such feature, I
haven't been able to give it a serious look. :-)
Yeah it took me a while to find all the dependancies myself hense why I
said the tarball was easier for takign it for a whirl, but seeing as my
own stubornness meant I found all the necessary updates I figured I'd
post them ;)
Thanks, but even with that list it didn't work. I kept getting "could not
find" errors while trying to install most of those extra components.
snip
I remember hearing that Zend was planning on making their next version of ZDE
Eclipse-based. If that's the case and this is the early release of it, well,
it's been nice knowing you Zend. All the bad parts of Eclipse with none of
the good parts of ZDE. And I didn't even get to the debugger yet.
Thanks for such a detailed response. I've not used ZDE so I can't really
compare it to how things work with the Eclipse side of things. It really
helped me, so thanks.
So unless someone has a better idea, I'm back to Kate and a terminal
window. :-)
That's the setup I always seem to revert to too!! Can't help but love
Kate, if only it had some sort of code completion I'd be a happy camper...
Col.
--- End Message ---
--- Begin Message ---
Larry,
I have hit similar global names space issues in the past and it is a
pain in the behind!
One remedial method that can get it stable enough to start to work on is
to stick the whole messy lot into classes (NOT OBJECTS!) and then the
global name space becomes the local namespace (ie $MyVar becomes
$GarbageCode::MyVar).
Once you have done this, you can put accessors functions around the
class local variables. This means that all new code calls the accessors.
$newVar=GarbageCode::GetMyVar();
Thus, if you improve the internal representation of the garbage code,
code outside the old garbage code will no longer be impacted by the change.
From an FN point of view, you are reducing the access to the variable
to a single function point rather than many function points distributed
throughout the code base.
Cheers
AJ
PS - if you knew all this before hand - please accept my apologies :-)
Larry Garfield wrote:
On Friday 25 August 2006 04:39, Bigmark wrote:
Can anyone tell me if it is relatively an easy process for an experienced
coder (not me) to convert a php script to mainly functions/classes.
I have my own script that i would like to make more streamlined as it is
becoming very difficult to work with.
That really depends on the nature of the code. I've some code I have to work
with now that is built around dumping all kinds of stuff into the global
namespace, even from functions. If I ever manage convince the author what an
insanely bad idea that is, it will still be hell to fix because of the way
it's built.
Most code probably isn't quite that bad, though. Your code could already
break down into functions quite nicely, or it could be easier to just start
from scratch. No way to tell without seeing the code.
--
www.deployview.com
www.nerds-central.com
www.project-network.com
--- End Message ---
--- Begin Message ---
I don't know what I was on when I wrote the previous post!
In php you cannot create static class variables in this way (doh) or at
least I never have managed. So when faced the this problem I replace
what in C++ would be a class variable with a class function
comme ca:
class MyClass
{
function MyVar($val = null)
{
static $datum;
if(is_null($val))
{
return $datum;
}
$dataum=$val;
}
}
I definitely need more coffee!
AJ
Alex Turner wrote:
Larry,
I have hit similar global names space issues in the past and it is a
pain in the behind!
One remedial method that can get it stable enough to start to work on is
to stick the whole messy lot into classes (NOT OBJECTS!) and then the
global name space becomes the local namespace (ie $MyVar becomes
$GarbageCode::MyVar).
Once you have done this, you can put accessors functions around the
class local variables. This means that all new code calls the accessors.
$newVar=GarbageCode::GetMyVar();
Thus, if you improve the internal representation of the garbage code,
code outside the old garbage code will no longer be impacted by the change.
From an FN point of view, you are reducing the access to the variable
to a single function point rather than many function points distributed
throughout the code base.
Cheers
AJ
PS - if you knew all this before hand - please accept my apologies :-)
Larry Garfield wrote:
On Friday 25 August 2006 04:39, Bigmark wrote:
Can anyone tell me if it is relatively an easy process for an
experienced
coder (not me) to convert a php script to mainly functions/classes.
I have my own script that i would like to make more streamlined as it is
becoming very difficult to work with.
That really depends on the nature of the code. I've some code I have
to work with now that is built around dumping all kinds of stuff into
the global namespace, even from functions. If I ever manage convince
the author what an insanely bad idea that is, it will still be hell to
fix because of the way it's built.
Most code probably isn't quite that bad, though. Your code could
already break down into functions quite nicely, or it could be easier
to just start from scratch. No way to tell without seeing the code.
--
www.deployview.com
www.nerds-central.com
www.project-network.com
--- End Message ---