Domain: php.net
Stories and comments across the archive that link to php.net.
Comments · 1,658
-
custom php programming and web development scripts
php cannot be pike
and pike cannot be php -
Re:First impertinent post
GTK for OSX allows you to write CROSS PLATFORM software - write once in GTK, run on Windows, Numerous 'nixes, including Linux, and now, OSX.
That is, unless Apple has released Aqua for Windows/Linux/Unix?
I look forward to this, since I'm now committed to using PHP-GTK for a number of smallish applications, and loving it, but the missing piece right now is Mac...
-Ben -
Re:built for the web?
-
Re:Where is it?
'cause everyone knows the adress
;) -
Re:Most needed feature for newbies......
And for people unable to read a prototype yet, this too is documented here:
How to read a function definition (prototype) -
Re:consider running an opcode cache
"Ok, lets see, in the same thread there is a post about PHP not having an XML parser of any kind (the author mentions having to use regexp, insane as that sounds), I am assuming that means there is no HTML parser (or an equivalent of HTML::TreeBuilder at that) either.'
PHP has both SAX and DOM based XML parsers. It also has an xmltree function to instantly build you an object hierarchy from an XML document. There is also the most excellent phpxpath object available here
"What does PHP use in terms of a browser agent (a la LWP)?"
It supports fetching from URLs the same way as opening and fetching from files. The new version also has streams. Also it has hooks into CURL for more sophisticated stuff. There is also the excellent snoopy object.
"Is there really no support simple filebased db persistence? (by which I mean something along the lines of tieing a hash to BerkleyDB)"
There are hooks into berkley db if you want to sink to that level. If you want to sink even lower then any php variable, array or object can be turned into a string and saved to files or sent to other URLs or what have you.
"How well does it hook into the other stages of the Apache request handling pipeline?"
You don't have that much control over the pipeline but you can hook into auth and such. I never needed anything it did not provide.
"Oh and something I'm curious about (too lazy to look it up, I guess) what sort of exception handling does PHP have (ie it's equivalent of 'try {} catch {} finally {}')?"
PEAR has a pretty good error handling library. Otherwise you basically just test for errors manually. You call a function with @function which surpresses error messages but sets global error indicators which you can test for. Not great but gets the job done. Version five will have try catch. All in all error handling in php is better then perl and worse then java.
"What sort of logging modules are available? (log4PHP?)"
PEAR has a logging class. I know that there are others out there as well. PHP also hooks into syslog if you want that.
" I'd also be curious to know about how PHP's templating systems measure up, from someone who's had experience with this sort of thing..."
smarty is an outstanding templating engine with caching. I don't see how you could possibly do better. There are numerous others.
I hope this prevents you from further trolling. Now that you are armed with actual knowledge (which you could have gotten by simple searching) you no longer need to troll here.
-
Re:consider running an opcode cacheDon't wish to sound like a troll and by your other helpfull responses i presume you are not trolling. But how is it difficult to do xhtml in templates?
ie xhtml Transitional header.tpl
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transition al.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$title}</title>
<link rel="StyleSheet" href="{$screenCss}" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" media="print" href="{$printCss}" />
<script language="JavaScript" type="text/javascript" src="functions.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="pragma" content="no-cache" />
</head>
<br />
ie html Transitional header.tpl
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<title>{$title}</title>
<link rel="StyleSheet" href="{$screenCss}" type="text/css" media="screen">
<link rel="stylesheet" type="text/css" media="print" href="{$printCss}">
<script language="JavaScript" type="text/javascript" src="functions.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="pragma" content="no-cache">
</head>
<br>
oh if inteested my template engine of choice is Smarty http://smarty.php.net -
Re:built for the web?
The echo command is documented with a function prototype that looks like this:
echo ( string arg1 [, string argn...])
don't the parentheses signify a string well enough? For instance, supposing one wants interpolation, why should one have to useecho ("<a href=\"$foo\">$bar</a>");
or:echo ('<a href="' . $foo . '">' . $bar . '</a>');
or:echo <<<END
when
<a href="$foo">$bar</a>
END;echo (<a href="$foo">$bar</a>);
is so much cleaner? Everything between the parentheses is clearly a string, and should be interpolated. Strings between parentheses should work like a heredoc. Using quotes to signify interpolation is a bad choice for a language built to make Web documents, which [should] use quotes for attribute values.Right... need to be able to evaluate expressions...
echo ($foo * $bar);
Which do you use more when using echo -- string interpolation or expression evaluation?I concede that the above is a pointless argument as really string interpolation like what you see above doesn't actually belong in a script. It should be in a template instead. I use PHP from time to time, and I don't find it difficult to use at all. But this is one thing that has always annoyed me.
Just my $0.02
-
Re:consider running an opcode cache
>> What does PHP use in terms of a browser agent (a la LWP)?
>None. They've had a long time to do something.
Umm... http://php.net/curl (this is only one of several methods you can use)
>There's no treebuilder or concept of nodes or anything like that in PHP. They're still thinking in flat structures.
http://php.net/dom-xml (admittedly experimental, but it's been around for almost 3 years)
>> Is there really no support simple filebased db persistence? (by which I mean something along the lines of tieing a hash to BerkleyDB)
>It doesn't.
BerkelyDB? Who uses that thing anymore? :-) (http://www.php.net/manual/en/ref.dba.php)
>>Oh and something I'm curious about (too lazy to look it up, I guess) what sort of exception handling does PHP have (ie it's equivalent of 'try {} catch {} finally {}')? What sort of logging modules are available?
>Well it has that. It doesn't have /manual/en/ref.errorfunc.php [php.net] (in summary, it blows)
PHP5 will have try/catch/finally. Yes, these days it still blows.
>>I'd also be curious to know about how PHP's templating systems measure up, from someone who's had experience with this sort of thing...
>Well templating is quite well done. There's FastTemplate and Pear's one. It's difficult to do XHTML templates without XML support. I guess it's not easy.
There are quite a few good templating engines with PHP, including two which are PHP modules (compiled C code), providing good performance. -
Re:consider running an opcode cache
>> What does PHP use in terms of a browser agent (a la LWP)?
>None. They've had a long time to do something.
Umm... http://php.net/curl (this is only one of several methods you can use)
>There's no treebuilder or concept of nodes or anything like that in PHP. They're still thinking in flat structures.
http://php.net/dom-xml (admittedly experimental, but it's been around for almost 3 years)
>> Is there really no support simple filebased db persistence? (by which I mean something along the lines of tieing a hash to BerkleyDB)
>It doesn't.
BerkelyDB? Who uses that thing anymore? :-) (http://www.php.net/manual/en/ref.dba.php)
>>Oh and something I'm curious about (too lazy to look it up, I guess) what sort of exception handling does PHP have (ie it's equivalent of 'try {} catch {} finally {}')? What sort of logging modules are available?
>Well it has that. It doesn't have /manual/en/ref.errorfunc.php [php.net] (in summary, it blows)
PHP5 will have try/catch/finally. Yes, these days it still blows.
>>I'd also be curious to know about how PHP's templating systems measure up, from someone who's had experience with this sort of thing...
>Well templating is quite well done. There's FastTemplate and Pear's one. It's difficult to do XHTML templates without XML support. I guess it's not easy.
There are quite a few good templating engines with PHP, including two which are PHP modules (compiled C code), providing good performance. -
Re:consider running an opcode cache
>> What does PHP use in terms of a browser agent (a la LWP)?
>None. They've had a long time to do something.
Umm... http://php.net/curl (this is only one of several methods you can use)
>There's no treebuilder or concept of nodes or anything like that in PHP. They're still thinking in flat structures.
http://php.net/dom-xml (admittedly experimental, but it's been around for almost 3 years)
>> Is there really no support simple filebased db persistence? (by which I mean something along the lines of tieing a hash to BerkleyDB)
>It doesn't.
BerkelyDB? Who uses that thing anymore? :-) (http://www.php.net/manual/en/ref.dba.php)
>>Oh and something I'm curious about (too lazy to look it up, I guess) what sort of exception handling does PHP have (ie it's equivalent of 'try {} catch {} finally {}')? What sort of logging modules are available?
>Well it has that. It doesn't have /manual/en/ref.errorfunc.php [php.net] (in summary, it blows)
PHP5 will have try/catch/finally. Yes, these days it still blows.
>>I'd also be curious to know about how PHP's templating systems measure up, from someone who's had experience with this sort of thing...
>Well templating is quite well done. There's FastTemplate and Pear's one. It's difficult to do XHTML templates without XML support. I guess it's not easy.
There are quite a few good templating engines with PHP, including two which are PHP modules (compiled C code), providing good performance. -
Re:consider running an opcode cache
Ok, lets see, in the same thread there is a post about PHP not having an XML parser of any kind (the author mentions having to use regexp, insane as that sounds), I am assuming that means there is no HTML parser (or an equivalent of HTML::TreeBuilder at that) either.
There's no treebuilder or concept of nodes or anything like that in PHP. They're still thinking in flat structures.
Call this "informative-flame" bait, but I am trying to figure out why people get upset when PHP isn't refered to as the greatest thing of all time. I personally haven't used it for a couple of years, so I don't know about many of these features.
Oh it's mediocre, as I soon found out :(
What does PHP use in terms of a browser agent (a la LWP)?
None. They've had a long time to do something.
Is there really no support simple filebased db persistence? (by which I mean something along the lines of tieing a hash to BerkleyDB)
It doesn't.
How well does it hook into the other stages of the Apache request handling pipeline?
It doesn't.
Oh and something I'm curious about (too lazy to look it up, I guess) what sort of exception handling does PHP have (ie it's equivalent of 'try {} catch {} finally {}')? What sort of logging modules are available?
Well it has that. It doesn't have /manual/en/ref.errorfunc.php (in summary, it blows)
I'd also be curious to know about how PHP's templating systems measure up, from someone who's had experience with this sort of thing...
Well templating is quite well done. There's FastTemplate and Pear's one. It's difficult to do XHTML templates without XML support. I guess it's not easy. -
Re:XML?
PHP has built in support for expat XML parser The parser has come with PHP since PHP 4.0 Beta 4.
There also is a nice wrapper called XML_parser in PEAR. That package is installed by default in PHP 4 I believe.
If you are going to deal with RSS and RDF stuff, then I definately recommend you check out the PEAR XML_RSS package
I see nothing lacking with PHPs XML support. -
Re:XML?
PHP has built in support for expat XML parser The parser has come with PHP since PHP 4.0 Beta 4.
There also is a nice wrapper called XML_parser in PEAR. That package is installed by default in PHP 4 I believe.
If you are going to deal with RSS and RDF stuff, then I definately recommend you check out the PEAR XML_RSS package
I see nothing lacking with PHPs XML support. -
Re:XML?
PHP has built in support for expat XML parser The parser has come with PHP since PHP 4.0 Beta 4.
There also is a nice wrapper called XML_parser in PEAR. That package is installed by default in PHP 4 I believe.
If you are going to deal with RSS and RDF stuff, then I definately recommend you check out the PEAR XML_RSS package
I see nothing lacking with PHPs XML support. -
Re:never mind
Well, of course 4.3.0 is more "optimized" for Apache 2 than the previous version, but as said before it is still marked as experimental. Just look at the PHP 4.3.0 release notes.
-
Re:I'm waiting for php.NET
it looks like it already is, php.net , where else would you download it from?
:) -
Apache 2.0 friendly
If I'm not mistaken, this is the first ".0" release optimized for the new Apache server.
-
Best New Feature
Is the friendly error messages , they point you back to the PHP Documentation. Being a regular in #PHP IRC channels, this is going to save me a lot of headaches
:) Praise the lord, the newbies have fully automated RTFM messaging!! -
Best New Feature
Is the friendly error messages , they point you back to the PHP Documentation. Being a regular in #PHP IRC channels, this is going to save me a lot of headaches
:) Praise the lord, the newbies have fully automated RTFM messaging!! -
Re:No you didn't!That is the most ridiculous claim I have ever heard. It is impossible to do.
-
What to doSorry, some of the other replies you have recieved don't seem to be very helpful. Now, when you installed Mandrake, I hope you chose to install "Database Server" (MySQL) and "Web Server" (Apache). What you need to do:
- Pick an Editor
My personal favourite is KATE (K Advanced Text Editor). It has PHP highlighting built in (Easier on the eyes), it can have multiple documents open at the same time, and has some advanced features in comparison to WordPad. - Save it to server directory
This is located at /var/www/html/ - Pick a browser
Mandrake comes with several browsers (Start->Networking->WWW) but my personal favourite is Phoenix. - Test it in the browser
Say you saved you PHP script to
/var/www/html/myscript.php
then you would be able to access it by typing in the address
http://localhost/myscript.php
This should work fine. - Configuration
I found the default configuration fine, but I needed to set up users for mysql. To do this I used Webmin, it should be on your Install CD if it isn't installed already. Once you have Webmin installed, in your browser visit:
https://localhost:10000/
Log in using your root (Admin) name and password. Then click servers, then click mysql, and there you go. For a frontend to mysql, i would suggest using PHPMyAdmin - Learning PHP
For learning PHP, I would suggest buying a book (I used "PHP A Beginners's Guide", published by osborne see here If you just want to use online resources, I personally think PHP's online manual (Just search The PHP Website. I also find PHP Freaks a good site, with lots of tutorials, examples, free scripts and a friendly forum, if you get stuck - Hopefully that's enough
If you need more help, feel free to email me. People will also be happy to help you at MandrakeExpert.com and for specific PHP needs, go to the above mentioned PHP Freaks. Hope I was able to help!
Just a quick note, the PHP Freaks site seems to be down now, but hopefully it'll come back up soon, it is a really good site.
Jason O'Neil - Pick an Editor
-
Re:This book is great
Actually you can acces serial ports through php, thanks to its FOPEN function, or it's other socket functions. Check this php.net manual entry for info. (do a search for "SERIAL PORT" on the page, its somewhere near the middle of the user comments).
-
Re:Port?
Uh, have you looked at the PHP downloads website? Listed right under the source code tarballs are Windows binaries in both Zip files and Windows Installer Packages (MSI's) that configure Apache, IIS, and a couple other Windows webservers.
If you scroll down a bit further, you'll also notice Windows binaries back to 3.0.17
So, yes. They have ported PHP to Windows. -
Re:PHP is good but TAL is the next generation of S
TAL looks interesting, but it does get tiring reading people say over and over things like this:
"Yet all these SSI technologies have in common that they still don't manage to really split Design from content."
Any web scripting language worth its salt has at least one templating system available for it. For PHP I prefer smarty. -
Re:PHP Website
http://www.php.net/download-docs.php
Download the extended chm version, it has user notes included. -
Re:PHP Website
Then they should download the downloadable documentation.
Having never previously used PHP, the documentation here was actually more useful to me than the previous Wrox book, "Professional PHP Programming." But it's best as a reference, if you haven't done dynamic web programming before, you'd do quite well to invest in a wrox book, as I find them to be well geared at bringing you up to speed on a subject, and then serving as a good reference book. -
So extend PHP
You can write your own extension (in C for instance) to interface with the hardware - and provide the PHP functions you want.
See here for details... -
Who needs a book?
I've been using PHP quite heavily for a few years now; I never picked up a PHP book, not once.. Why? Simply because the community support, the IRC channel, the Online Documentation and even places like devshed simply have so much to offer! I have not even once printed or purchased even a mere shred of dead tree painted over with ink that describes or outlines PHP in any way whatsoever.
-
Re:Using PHP on a professional site
PHP stands for "PHP: Hypertext Preproccessor". Not "Personal Home Page". It hasn't meant that for years.
-
Re:This book is great
You could write the serial control mechanism in perl (or C, or whatever), then use system() (or related) calls from php to poke it / read the output. Not elegant perhaps, but... The other option, since reading and writing to serial ports isn't exactly rocket science or a new thing, would be to grab some C source to do said, and wrap it into a PHP extension (which seems like a semi-easy process from what little I looked at it, if it were truly difficult there wouldn't be bazillions of php extensions). Honestly though, if you start doing hardware access to vital resources from php PLEASE FOR THE LOVE OF GOD make the server machine accessible only on the local lan. In other words, you might want JoeBob the store manager in the back office to be able to have a real-time web interface to moniter the sales line, but you wouldn't want to expose that interface to Dieter the 13 year old German 1337 h4X0r.
;-) -
Re:I'm unimpressed
Half of this simply shows that you don't really know PHP very well. Sure, PHP takes a bit of time to learn, but not nearly as much time as it takes to learn Perl from C.
Nope, instead we have a whole set of mysql_* functions for MySql and another whole set of pg_* functions for Postgre.
You can do this yourself if you want. There is something in PHP called "variable functions" that lets you execute variable contents as functions. Look here.
Regexes use functions ... this is extremely annoying and there are at least two (three?) different regex sets, plus functions that duplicate what regexes can do!
I personally think this is less confusing than regexes not using functions, but maybe that's because I learned PHP before Perl. The functions that duplicate things that regexes can do are probably a lot faster.
Other annoyances (mostly my opinion): Three ways to read variables from a form but still hard to make a program that can accept GET or POST method with the same variable names.
Hello! $GLOBALS or use registered globals.
Global variables, again my opinion but I would rather declare my varibles local rather than having to declare them global. It wouldn't be so bad if I could declare my global variables once at the top of the program but no .. i have to redeclare them global in each function I'm going to use them in.
I'd rather have variables automatically local, because that way i don't have to worry about accidental globals. IMHO writing "my" so many times in Perl is incredibly annoying.
CPAN -- for all of Perl's faults it got CPAN right. PHP needs a standard way of adding modules to its installation (so they can be used system wide) and a good place to store them. You don't know how difficult it is to write a MIME complient message in PHP.
I agree with you here - it's a lot easier to find code snippets for Perl via CPAN than find various PHP libraries strewn all over the web.
Finally I think PHP backwards... PHP is a language designed so that the data defines the program. Easy to slap together but difficult to maintain and very difficult to reuse code (I have to make tons of changes to the HTML page). I prefer to program so that my code defines my data. And I can give it new data to achieve new things or looks for a page or whatever ... PHP can do that its just not a simple to do as it is in other languages.
I completely disagree with you here. In PHP, you can write exactly the same code you'd write with Perl or C++; about the only major differences are the way filehandles work and the differences with Perl's regex. PHP can be used like any other language, and there are so many aliases for functions that you can pretty much guess what a function means. Also, unlike Perl, the documentation is designed for accessibility, not slapped together in a ton of POD files and man pages. -
would be funny
would be funny to redirect the URL to www.php.net ;o) -
Not Cold Fusion
I have been working on a medical application using OSX, PHP, Apache, Mysql. What does this have to do with Cold Fusion? well the application was written originally in cold fusion. What I have found is that CF is great for rapid application development and proof of concept however is it not a deployment solution. If you are with a microsoft partner as you claim
.. stay with their products ... otherwise all the people saying open source are correct. Also one should think twice about asking about MS products here it is essentially the same as asking people to flame you. -
Open Source Digital Asset Management
How hard would it be to write one? Depending on the size PHP and mySQL would work fine. Or how about looking on Sourceforge and doing a search for "Asset" This turned up a number of mature projects that do what you seem to need.
-
Re:Seems like a silly move...
I thought I read somewhere that you can do pass by refrence in PHP but I haven't been able to find that link.
Well typing "search by reference" into the search box on php.net gives this. The excellent PHP documentation is a great benefit.
I've worked on large sites with companies that use either Java or PHP. For rapid development and pure web play apps PHP is simply amazing. I have a low end box here serving up over 900 web driven DB backed sites (around 100GB/month) and it's rock solid. The idea of using PHP for a complex app gives me the shivers though. For instance if you try and access a variable that doesn't exist, eg mis-typing a variable name, it just passes on a null value and carries on as though nothing has happened.
I think both Java and PHP are very well designed for their jobs. If it's a web app, I wouldn't hesitate to use PHP. If it's 90%+ web, then it's worth looking at using PHP and interfacing it to the remaining 10% written in another language. For complex apps Java appears to be the way to go. Even if it requires expensive hardware to run on, a £20k server is only the same price as paying for an extra programmer needed to maintain a mass of sphagetti PHP code.
Phillip. -
Re:Why is PHP so bad?It is generally a good idea to know what you are talking about before talking about it.
1. Lack of seperation between content and logic. Embedded logic code inside presentation can lead to a bewildering jungle of death for anyone who tries to maintain the code. Also, repeated logic must be maintained across all pages, instead of changing it in one place. (this goes for all ASP, PHP, perl type scripts)
There are a number of template solutions that you can use to avoid this problem. I work almost exclusively with PHPLIB's template class.
2. Performance problems with interpreted languages
Strictly speaking, PHP is not interpreted. PHP files are compiled before being run, and are cached for a while. This gives you a combination of great performance, much like a compiled language, with the write & immediate play of an interpreted language.
3. Can't take advantage of OO goodness. php is a flat procedural-like language, you can't do the robust object modeling, or any of the other spiffy OO things you can do with c++, java, (maybe .net) etc.
Did you pay attention to my answer to point #1 above? That bit about a class? Yeah, a class. PHP supports OO, in a clear, intuitive manner. Oh, and '.net' isn't a language.
4. HTML lock in. Your code will forever live in HTML, if you want a different display format (unlikely) you're stuck. ie. what if you want to have a propriatary client instead of html on your plam, you have to rewrite all the logic.
Only with very poor planning. You do plan your development before you start, right? There are plenty of template solutions you can choose. You can intersperse HTML for that quick 20 minute hack, use template objects for large projects that must scale.
5. Fancy features availible in Java (maybe .net) first. Oracle Objects, native DB connectors, will probably be written for Java before anyone tries to implement them (if ever) in PHP. You might not need these features of a small site, so its not that big of a deal.
As Yoda once said: "Hard to see the future is." - so I can't comment. But, did you know:
-
- PHP is not web-only. I do large amounts of system administration and database manipulation in PHP. Its string handling abilities are concise, consistent, and powerful.
- PHP is the most frequently installed Apache module. (As of a few months back, I couldn't locate current statistics)
- PHP has bindings for GTK. That's right. You can write GUI applications using PHP if you like.
- Using the Zend Optimizer, you can compile PHP scripts to binary code that can be distributed without revealing your sources.
- PHP will be bundled with Netware.
- A full featured Webserver has been written in PHP. Yes, the webserver itself. Features include HTTP/1.1, CGI support, name-based virtual hosts, server side includes, authentication, gzip content encoding support, Apache combined format and MySQL logging. Look out, Apache!
Not that I'm a fanatic, or anything... but PHP is a powerful, fast, flexible language that's easy to learn, and easy to read.
I can read somebody else's code almost immediately, unlike Perl or to a lesser extent, c, and the built-in functions for string handling allow me to get insane amounts of work done in a staggeringly short development cycle.
Only people who don't know bitch about PHP.
-
-
Re:These aren't really problems.
It's also pretty annoying when you don't read the manual - and this one is NOT obscure to find. Section 8 - "Variables"
OK. I thought I looked at that page. I guess I only looked at the one about superglobal arrays, though. But you don't have to be a jerk about it. And it still doesn't explain why that is done, aside from saying that you need the slashes when doing database queries. Most of the time you're not doing database queries. It seems rather arbitrary to add slashes to user-inputted strings but nothing else. Why not add slashes when you read a line from a file, too? And I realise that you can turn this behavior off in the configuration, but then your scripts won't be portable, since it is the default behavior.
/* ...This is very inefficient. */Then design a better language yourself that has nifty things like variable variables (echo $$b[0]->foo;) and is still faster than most other languages
What's that got to do with re-parsing pages? Python can use variable variable names, and it always compiles included files.
Or just get a host that will use one of the many caching products available (zend, ioncube, etc)
If PHP itself was little more clever about caching compiled scripts, I wouldn't need to do that. Although I agree that this isn't really a problem in that you can't do it as much as because you have to do extra work.
/* 3) It's a real pain to include scripts that are in different directories which include other scripts, because they will try to open them relative to the location of the original page. */Seems pretty damn logical to me. Of course, PHP will also look for files in the 'include_path' which is set in the php.ini file, so it's really looking in multiple places. And it wouldn't kill you to just use a predefined constant like DOCUMENT_ROOT and include files relative to that so your scripts would be portable and a bit easier to move around internally if you need to.
That's almost exactly what I do, but as I said, it seems like a hack. There should be a way to include files relative to the current file.
Anyway, whether you think these are really problems or not, they are annoyances for me (along with other issues such as no real pass by reference), and they didn't need to be there.
-
Re:Why is PHP so bad?
1. Lack of seperation between content and logic. Embedded logic code inside presentation can lead to a bewildering jungle of death for anyone who tries to maintain the code. Also, repeated logic must be maintained across all pages, instead of changing it in one place. (this goes for all ASP, PHP, perl type scripts)
Try require() and include()
2. Performance problems with interpreted languages
Ask these guys about compiling PHP scripts. Alternatively talk to these guys about caching your interpreted, 'compiled' code.
3. Can't take advantage of OO goodness. php is a flat procedural-like language, you can't do the robust object modeling, or any of the other spiffy OO things you can do with c++, java, (maybe .net) etc.
Ok one point... I give you that...
4. HTML lock in. Your code will forever live in HTML, if you want a different display format (unlikely) you're stuck. ie. what if you want to have a propriatary client instead of html on your plam, you have to rewrite all the logic.
This is total bullshit.
PHP fully supports ncurses for direct input.
Also, I personally have written quite a few small daemons with PHP which had their own UI. Example code to write your own can be found under this section of the PHP manual.
5. Fancy features availible in Java (maybe .net) first. Oracle Objects, native DB connectors, will probably be written for Java before anyone tries to implement them (if ever) in PHP. You might not need these features of a small site, so its not that big of a deal.
PHP supports many, if not most of the standard (and non-standard) databases available.
Not to flame, but I think you needed to be shown a little more of the world, it doesn't end at printf("Hello
Before you flame, the parse error was intentional... -
Re:Why is PHP so bad?
1. Lack of seperation between content and logic. Embedded logic code inside presentation can lead to a bewildering jungle of death for anyone who tries to maintain the code. Also, repeated logic must be maintained across all pages, instead of changing it in one place. (this goes for all ASP, PHP, perl type scripts)
Try require() and include()
2. Performance problems with interpreted languages
Ask these guys about compiling PHP scripts. Alternatively talk to these guys about caching your interpreted, 'compiled' code.
3. Can't take advantage of OO goodness. php is a flat procedural-like language, you can't do the robust object modeling, or any of the other spiffy OO things you can do with c++, java, (maybe .net) etc.
Ok one point... I give you that...
4. HTML lock in. Your code will forever live in HTML, if you want a different display format (unlikely) you're stuck. ie. what if you want to have a propriatary client instead of html on your plam, you have to rewrite all the logic.
This is total bullshit.
PHP fully supports ncurses for direct input.
Also, I personally have written quite a few small daemons with PHP which had their own UI. Example code to write your own can be found under this section of the PHP manual.
5. Fancy features availible in Java (maybe .net) first. Oracle Objects, native DB connectors, will probably be written for Java before anyone tries to implement them (if ever) in PHP. You might not need these features of a small site, so its not that big of a deal.
PHP supports many, if not most of the standard (and non-standard) databases available.
Not to flame, but I think you needed to be shown a little more of the world, it doesn't end at printf("Hello
Before you flame, the parse error was intentional... -
Re:Why is PHP so bad?
1. Lack of seperation between content and logic. Embedded logic code inside presentation can lead to a bewildering jungle of death for anyone who tries to maintain the code. Also, repeated logic must be maintained across all pages, instead of changing it in one place. (this goes for all ASP, PHP, perl type scripts)
Try require() and include()
2. Performance problems with interpreted languages
Ask these guys about compiling PHP scripts. Alternatively talk to these guys about caching your interpreted, 'compiled' code.
3. Can't take advantage of OO goodness. php is a flat procedural-like language, you can't do the robust object modeling, or any of the other spiffy OO things you can do with c++, java, (maybe .net) etc.
Ok one point... I give you that...
4. HTML lock in. Your code will forever live in HTML, if you want a different display format (unlikely) you're stuck. ie. what if you want to have a propriatary client instead of html on your plam, you have to rewrite all the logic.
This is total bullshit.
PHP fully supports ncurses for direct input.
Also, I personally have written quite a few small daemons with PHP which had their own UI. Example code to write your own can be found under this section of the PHP manual.
5. Fancy features availible in Java (maybe .net) first. Oracle Objects, native DB connectors, will probably be written for Java before anyone tries to implement them (if ever) in PHP. You might not need these features of a small site, so its not that big of a deal.
PHP supports many, if not most of the standard (and non-standard) databases available.
Not to flame, but I think you needed to be shown a little more of the world, it doesn't end at printf("Hello
Before you flame, the parse error was intentional... -
Re:Honestly, why?
1) http://pear.php.net
2) http://pear.php.net/package-info.php?pacid=46
3) Your point being????
4) http://gtk.php.net -
Re:Honestly, why?
1) http://pear.php.net
2) http://pear.php.net/package-info.php?pacid=46
3) Your point being????
4) http://gtk.php.net -
Re:Honestly, why?
1) http://pear.php.net
2) http://pear.php.net/package-info.php?pacid=46
3) Your point being????
4) http://gtk.php.net -
Re:Lack of understand of how PHP works?
You fix that by having a nice templating language like smarty, for example.
Smarty outputs a value stored in foo: {$foo}
Smarty loops over an array of hashes:
{section loop=$foo name=var}
{$foo[var].baz}
{/section}
The downside is that your templates sometimes end up looking like an uglier version of some ColdFusion page written by a drunken 6 year old.
-
Re:Can one person be expert on all of these topics
Well, you can use PHP with GTK as well...
http://gtk.php.net -
Re:How very microsoftonian
-
Re:How very microsoftonian
One wonders if there is really a community of MS developers older than 13 years old who would give away thier software anyway.
Tell me about it. I'm searching for some code, mostly asp to do various database tasks including a message board and calendar. I've found several perl/php/linux/free solutions that work perfectly; but unfortunatly I'm restricted to using w2k and php is out because it's free and free!=secure. All the asp stuff I've found both costs money and isn't quite what I need. It's really frustrating, because it means I need to start from scratch in a language that I don't know. Speaking of which I find the MS support/tutorials/documentation on the web to suck. They're not complete, not helpful, and most often out dated. 9 times out of 10 I can't even find a tutorial for what I want to do, when I do; it doesn't do a good job of teaching me. Try the documentation at http://www.php.net - that's so real documentation. -
Researching this further...
Hmm. I found a thread at http://www.php.net/manual/en/security.apache.php
which seems to validate your claim. However, one of the writes that one can use apache2's perchild mpm module. This seems like a pretty good solution to me. There's also mention of open_basedir.
Sound better to you? -
Re:Article Lacked Useful Tips or Code
You can use Apache's mod_rewrite module, or aliases. The PHP website uses a smart PHP 404 script that redirects http://php.net/somefunctionname to the correct manual page. Neat idea. They have details on their website: here