From Consult at CovenantEDesign.com Tue Mar 1 01:33:26 2005
From: Consult at CovenantEDesign.com (Edward)
Date: Tue, 1 Mar 2005 01:33:26 -0500
Subject: [nycphp-talk] XML & XSLT problem
References: <0MKyxe-1D5bp636wl-00016Z@mrelay.perfora.net><000b01c51dff$ef13b7c0$45896e41@ced>
Message-ID: <004d01c51e28$93e59930$45896e41@ced>
Adam,
I'm not following you?
Edward JS Prevost II
Me at EdwardPrevost.info
www.EdwardPrevost.info
----- Original Message -----
From: "Adam Maccabee Trachtenberg"
To: "NYPHP Talk"
Sent: Monday, February 28, 2005 8:54 PM
Subject: Re: [nycphp-talk] XML & XSLT problem
> On Mon, 28 Feb 2005, Edward wrote:
>
> >
'/hsphere/local/home/skoilnog/edwardprevost.info/PHPStuff/html_style.xsl' in
> > http://www.edwardprevost.info/PHPStuff/XMLMaker.inc on line 8
>
> html_style.xsl is not HTMLStyle.xsl.
>
> -adam
From Consult at CovenantEDesign.com Tue Mar 1 01:36:26 2005
From: Consult at CovenantEDesign.com (Edward)
Date: Tue, 1 Mar 2005 01:36:26 -0500
Subject: [nycphp-talk] XML & XSLT problem
References: <0MKyxe-1D5bp636wl-00016Z@mrelay.perfora.net><000b01c51dff$ef13b7c0$45896e41@ced>
Message-ID: <005101c51e28$ff0b8f80$45896e41@ced>
I'm getting this error:
http://www.edwardprevost.info/PHPStuff/nat.xml
Warning: Sablotron error on line 1: XML parser error 4: not well-formed
(invalid token) in http://www.edwardprevost.info/PHPStuff/XMLMaker.inc on
line 8
Unknown error building web page from XML & XSLT sources. The reason is that
XML parser error 4: not well-formed (invalid token) and the error code is 2
when I run www.edwardprevost.info/testing.php.
and this error:
nat.xml
Warning: Sablotron error on line 1: XML parser error 17: xml processing
instruction not at start of external entity in
http://www.edwardprevost.info/PHPStuff/XMLMaker.inc on line 8
Unknown error building web page from XML & XSLT sources. The reason is that
XML parser error 17: xml processing instruction not at start of external
entity and the error code is 2
When i run www.edwardprevost.info/PHPStuff/testing.php.
Thanks in advance for the help Adam. =D
Edward JS Prevost II
Me at EdwardPrevost.info
www.EdwardPrevost.info
----- Original Message -----
From: "Adam Maccabee Trachtenberg"
To: "NYPHP Talk"
Sent: Monday, February 28, 2005 8:54 PM
Subject: Re: [nycphp-talk] XML & XSLT problem
> On Mon, 28 Feb 2005, Edward wrote:
>
> >
'/hsphere/local/home/skoilnog/edwardprevost.info/PHPStuff/html_style.xsl' in
> > http://www.edwardprevost.info/PHPStuff/XMLMaker.inc on line 8
>
> html_style.xsl is not HTMLStyle.xsl.
>
> -adam
>
> --
> adam at trachtenberg.com | http://www.trachtenberg.com
> author of o'reilly's "upgrading to php 5" and "php cookbook"
> avoid the holiday rush, buy your copies today!
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From chsnyder at gmail.com Tue Mar 1 10:11:48 2005
From: chsnyder at gmail.com (csnyder)
Date: Tue, 1 Mar 2005 10:11:48 -0500
Subject: [nycphp-talk] XML & XSLT problem
In-Reply-To: <005101c51e28$ff0b8f80$45896e41@ced>
References: <0MKyxe-1D5bp636wl-00016Z@mrelay.perfora.net>
<000b01c51dff$ef13b7c0$45896e41@ced>
<005101c51e28$ff0b8f80$45896e41@ced>
Message-ID:
Have you looked at the file?
http://www.edwardprevost.info/PHPStuff/nat.xml
Does it seem to you like valid XML?
The first four lines are:
-
-
-
Note the leading hyphens.
The parser told you there is a problem:
"Warning: Sablotron error on line 1: XML parser error 4: not well-formed
(invalid token)"
Please check the obvious before posting for free assistance.
I apologize in advance for the rant.
From tgales at tgaconnect.com Tue Mar 1 10:29:21 2005
From: tgales at tgaconnect.com (Tim Gales)
Date: Tue, 1 Mar 2005 10:29:21 -0500
Subject: [nycphp-talk] XML & XSLT problem
In-Reply-To:
Message-ID: <000001c51e73$713ad300$d0893818@oberon1>
csnyder writes:
> Have you looked at the file?
> http://www.edwardprevost.info/PHPStuff/nat.xml
>
> Does it seem to you like valid XML?
>
The file is not well-formed...
Neither is the style sheet.
T. Gales & Associates
'Helping People Connect with Technology'
http://www.tgaconnect.com
From krook at us.ibm.com Tue Mar 1 10:54:24 2005
From: krook at us.ibm.com (Daniel Krook)
Date: Tue, 1 Mar 2005 10:54:24 -0500
Subject: [nycphp-talk] 32bit vs AMD 64 versions of Apache and shared objects
In-Reply-To: <0MKz5u-1D5loe0a0s-0001Nq@mrelay.perfora.net>
Message-ID:
>> how would I compile a 32-bit version of libphp5.so on AMD 64 so that
the
>> 32-bit version of IHS can use it?
> You basically need to compile against the 32bit libs, which it probably
is
> doing already, since you're not using PHP 5.1. But then, to get it to
> link for 32bit, I'm not sure - possibly try
--target=x86-unknown-linux-gnu
> in your ./configure.
> Would be interested to hear what happens :)
An update... I'm still working this one out. The --target flag didn't
seem to have any effect. I tried PHP 4.3.10, 5.0.3, and the latest 5.1
snapshot, all the same result. I'll post more information as I try some
more things later today.
Also, though it's material for another post, I was getting the same errors
w/ phpMyAdmin segfaulting as this post from a few months back, on both
SuSE and FC 3... If that confirms anything for the original poster.
http://lists.nyphp.org/pipermail/talk/2004-December/013311.html
Daniel Krook, Advisory IT Specialist - Application Development
WW Web Production Services North 2, ibm.com
1133 Westchester Avenue, White Plains, NY 10604
Personal: http://info.krook.org/
Persona: http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=9A9796897
From jayeshsh at ceruleansky.com Tue Mar 1 12:26:14 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Tue, 01 Mar 2005 12:26:14 -0500
Subject: [nycphp-talk] MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
Message-ID: <4224A5B6.5050802@ceruleansky.com>
Greetings fellow LAMPers and LAMPesses,
I came across an interesting article (or rather case study) about how
MySQL was able enter the formerly impenetrable database market.
It is called (somewhat obtusely) 'MySQL Open Source Database in 2004'.
It explores how MySQL, a once tiny company gained a foothold in the
database market by providing an open soure 'commodity' database. Since
this article is only available in 'protected electronic' or paper
format, I thought I would share this summary of it with this list, since
many people on this list use PHP and MySQL together.
There is a lot of focus on how MySQL has 'less features' than other
database providers (such as Oracle and IBM), yet how it managed to gain
a following among individuals and small businesses like itself. There
are the inevitable quotes from Oracle top brass; a typical sampling: "
Ken Jacobs, Oracle's VP of product strategy, saw MySQL as a complement
to Oracle's DBMS and believed it would take many years before MySQL
would be a true competitor. He formulated Oracle's official position: '
Technically, in terms of capabilities, MySQL is a decade or more behind
Oracle. For example, MySQL lacks the most basic relational database
features ... such as stored procedures, triggers and views. [...] MySQL
[has not been useful for] the more transaction processing and business
intelligence applications that constitute the majority of enterprise
database deployments."
This case study was published on June 1st, 2004. One can however find
some or all of these 'missing' features in MySQL 5 today. An excerpt
from the mysql.com site (
http://dev.mysql.com/doc/mysql/en/mysql-5-0-nutshell.html ): "New
development for MySQL is focused on the 5.0 release, featuring stored
procedures, views (including updatable views), rudimentary triggers, and
other new features."
This article also presents the other side of the story, with Zach
Urlocker of MySQL AB explaining that they "compete against
nonconsumption". In other words, people who would not otherwise have a
database installation use MySQL. In my experience, I often find MySQL's
(versions 3.23 and 4.0) features more than sufficient. The only thing
that I have really missed is enforced foreign key constraints and
transactional / rollback support, but those features are available if
one uses the InnoDB engine. The problem is that today, most hosting
companies only install MySQL with MyISAM engine support, and MyISAM
lacks these features. Then again, with careful error checking and coding
on the PHP end, I have been able to work around this issue. Granted, if
one is building a 500,000 user online banking system, then perhaps MySQL
4.0 may not be the best database to choose. For for more small business
Intranet use, or for small business e-commerce and informational
websites, it is more than sufficient, especially when combined with PHP
to retrieve and display its data.
The case study also mentions MySQL's alliance with (and investment from)
SAP in 2003. SAP had this aging, yet full-featured database called SAP
DB that was used by approximately 5% of its ERP customers. They
partnered with MySQL so that MySQL would continue maintenance and
support of this product, now renamed Max DB. MySQL would also continue
development of its own product line, with a view towards making it
'enterprise ready' / 'SAP ready' in the next three to four years. This
alliance seems to have been mutually beneficial: "Both MySQL revenues
and SAP DB's percentage share in SAP installations increased sharply
since the start of the alliance in June 2003".
Regarding MySQL's business model (a.ka. "how they make money"), the
article mentions their dual licensing scheme, where companies that want
to incorporate MySQL into their products can purchase a commercial
license and bypass the open source GPL license. The article (Exhibit 2)
quotes Josh Berkus of the PostgreSQL project as saying that MySQL is
really "shareware" and not open source. The article mentions that all
MySQL code has been written by MySQL employees, thus enabling them to
offer dual licensing. It then draws the conclusion that MySQL is
"proprietary" and not open source because it owns all the code, unlike
the case of Linux, where Red Hat, for example, does not own all the code
itself. The main stated business benefit of MySQL open availability of
source code is rapid market penetration and widespread testing by the
thousands of "GPL edition" MySQL users.
There also also mentions of how MySQL is run as a "virtual organization"
with 120 employees scattered throughout the world, many of whom work
from their home offices. This, the article says, enables MySQL to keep
its costs down while recruiting the best and most dedicated developers
wherever in the world they may be - developers who have already proven
themselves in the MySQL open source community.
The article ends on a mostly upbeat note, with a discussion of the
possibilities for MySQL to grow from into a $100 million a year company.
It says that while large scale success may eventually come to MySQL,
MySQL must also be wary of the "seismic forces that could easily
overwhelm" a small company such as MySQL. I suppose those seismic forces
are Oracle, Microsoft and IBM.
So, as developers, what do you think? Does MySQL meet your needs
sufficiently? Do you see it growing along with your needs? If you do not
use MySQL, which database do you use and why? Any thoughts regarding
IBM's new alliance with Zend to bring DB2 and Derby (Cloudscape) support
to PHP and how this might affect MySQL's market share among PHP users?
For those interested, more information is available at:
http://harvardbusinessonline.hbsp.harvard.edu/b01/en/common/item_detail.jhtml?id=SM124
- Jay
From fields at hedge.net Tue Mar 1 12:40:43 2005
From: fields at hedge.net (Adam Fields)
Date: Tue, 1 Mar 2005 12:40:43 -0500
Subject: [nycphp-talk] MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <4224A5B6.5050802@ceruleansky.com>
References: <4224A5B6.5050802@ceruleansky.com>
Message-ID: <20050301174043.GI4345@lola.aquick.org>
On Tue, Mar 01, 2005 at 12:26:14PM -0500, Jayesh Sheth wrote:
[...]
> features ... such as stored procedures, triggers and views. [...] MySQL
> [has not been useful for] the more transaction processing and business
> intelligence applications that constitute the majority of enterprise
> database deployments."
[...]
Oracle has NEVER acknowledged the fact that on the order of 98% of
database users don't even know about the existence of most of these
features. They're "nice to have", but hardly critical for even a
relatively large db-driven application.
Oracle's great, but it's overkill for all but the most demanding
applications.
> So, as developers, what do you think? Does MySQL meet your needs
> sufficiently? Do you see it growing along with your needs? If you do not
> use MySQL, which database do you use and why? Any thoughts regarding
> IBM's new alliance with Zend to bring DB2 and Derby (Cloudscape) support
> to PHP and how this might affect MySQL's market share among PHP users?
MySQL is a fantastic alternative. It takes some customization work to
make it perform very well for specific cases, but I can't complain,
since I do a fair amount of MySQL optimization analysis work. It can
be made to scale >very< well with the right attention to architecture,
configuration, and usage.
--
- Adam
-----
** My new project --> http://www.visiognomy.com/diagrams
** Flagship blog --> http://www.aquick.org/blog
Hire me: [ http://www.adamfields.com/Adam_Fields_Resume.htm ]
Links: [ http://del.icio.us/fields ]
Photos: [ http://www.aquick.org/photoblog ]
From george at omniti.com Tue Mar 1 12:45:13 2005
From: george at omniti.com (George Schlossnagle)
Date: Tue, 1 Mar 2005 12:45:13 -0500
Subject: [nycphp-talk] MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <20050301174043.GI4345@lola.aquick.org>
References: <4224A5B6.5050802@ceruleansky.com>
<20050301174043.GI4345@lola.aquick.org>
Message-ID:
On Mar 1, 2005, at 12:40 PM, Adam Fields wrote:
> the fact that on the order of 98% of
> database users don't even know about the existence of most of these
> features.
Source? And users using only MySQL (where these features don't exist)
don't count.
George
From tgales at tgaconnect.com Tue Mar 1 12:53:28 2005
From: tgales at tgaconnect.com (Tim Gales)
Date: Tue, 1 Mar 2005 12:53:28 -0500
Subject: [nycphp-talk] MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <4224A5B6.5050802@ceruleansky.com>
Message-ID: <000101c51e87$93372490$d0893818@oberon1>
Jayesh Sheth writes:
...There is a lot of focus on how MySQL has 'less features'
than other database providers (such as Oracle and IBM)...
Sometimes less is more --
T. Gales & Associates
'Helping People Connect with Technology'
http://www.tgaconnect.com
From fields at hedge.net Tue Mar 1 12:54:48 2005
From: fields at hedge.net (Adam Fields)
Date: Tue, 1 Mar 2005 12:54:48 -0500
Subject: [nycphp-talk] MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To:
References: <4224A5B6.5050802@ceruleansky.com>
<20050301174043.GI4345@lola.aquick.org>
Message-ID: <20050301175448.GK4345@lola.aquick.org>
On Tue, Mar 01, 2005 at 12:45:13PM -0500, George Schlossnagle wrote:
> On Mar 1, 2005, at 12:40 PM, Adam Fields wrote:
> >the fact that on the order of 98% of
> >database users don't even know about the existence of most of these
> >features.
>
> Source? And users using only MySQL (where these features don't exist)
> don't count.
Purely speculative, from my own sampling of web and backend
application developers over the years, across at least five relational
databases other than MySQL.
Sure - many of the DBAs know about them, but most app developers, in
my experience, don't. Or, at least, they don't consider them as useful
alternatives in the general case. And, in many cases, they'd be right
- a lot of things work just fine without them.
--
- Adam
-----
** My new project --> http://www.visiognomy.com/diagrams
** Flagship blog --> http://www.aquick.org/blog
Hire me: [ http://www.adamfields.com/Adam_Fields_Resume.htm ]
Links: [ http://del.icio.us/fields ]
Photos: [ http://www.aquick.org/photoblog ]
From mitch.pirtle at gmail.com Tue Mar 1 13:10:30 2005
From: mitch.pirtle at gmail.com (Mitch Pirtle)
Date: Tue, 1 Mar 2005 13:10:30 -0500
Subject: [nycphp-talk] MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <20050301174043.GI4345@lola.aquick.org>
References: <4224A5B6.5050802@ceruleansky.com>
<20050301174043.GI4345@lola.aquick.org>
Message-ID: <330532b605030110101087edd9@mail.gmail.com>
Hey Adam.
On Tue, 1 Mar 2005 12:40:43 -0500, Adam Fields wrote:
> On Tue, Mar 01, 2005 at 12:26:14PM -0500, Jayesh Sheth wrote:
> [...]
> > features ... such as stored procedures, triggers and views. [...] MySQL
> > [has not been useful for] the more transaction processing and business
> > intelligence applications that constitute the majority of enterprise
> > database deployments."
> [...]
>
> Oracle has NEVER acknowledged the fact that on the order of 98% of
> database users don't even know about the existence of most of these
> features. They're "nice to have", but hardly critical for even a
> relatively large db-driven application.
I will never advocate Oracle for anything, but can tell you for
certain that there are many business applications that simply cannot
live without these features.
IMHO it is only certain circumstances that would dictate that you NOT
use these features.
For example, take your prototypical application for HR, where you
track employees, their vacation and benefits. With MySQL you are
forced to put all of the business rules in the application layer --
preferably PHP ;-) -- causing unneccessary duplication of effort and
providing more opportunity for error. Not to mention the added effort
of porting all that logic from the PHP web application to the .Net fat
client, or to the python server-side scripts...
Put all of the data-related logic in the database as stored procs, and
you can share that logic with any application that can connect to your
database. So the web front end is using the exact same rules as the
fat client for HR people and so on. The language used is no longer of
consequence, you are free to choose as you see fit.
> Oracle's great, but it's overkill for all but the most demanding
> applications.
It's overkill for anything, even nuclear particle research. I mean,
once I populated a table with java methods as plaintext, constructed a
SELECT, compiled and executed the results of the query right in the
database. Why in the world would you need this? LOL
> > So, as developers, what do you think? Does MySQL meet your needs
> > sufficiently? Do you see it growing along with your needs? If you do not
> > use MySQL, which database do you use and why? Any thoughts regarding
> > IBM's new alliance with Zend to bring DB2 and Derby (Cloudscape) support
> > to PHP and how this might affect MySQL's market share among PHP users?
A very good friend of mine is working over in Jersey at a commerce
portal for retailers in the fashion industry. We are both fond of
PostgreSQL, but he is happy to stick with MySQL. His explanation is
that "as our needs and requirements grow, MySQL is growing with us.
When we will really need , MySQL will probably support it."
I want to love MySQL, I really do, but I am a huge proponent of stored
procedures, triggers and views. Until then my default answer is
PostgreSQL, which (to me at least) is MySQL with all the missing stuff
added.
The only thing keeping me from advocating _only_ PostgreSQL is the
fact that I am also a huge supporter of database abstraction for web
applications that are distributed (like Mambo), where platform
neutrality is a desperate need.
> MySQL is a fantastic alternative. It takes some customization work to
> make it perform very well for specific cases, but I can't complain,
> since I do a fair amount of MySQL optimization analysis work. It can
> be made to scale >very< well with the right attention to architecture,
> configuration, and usage.
I could never have run ClassMates.Com without MySQL. With the database
on a dual P-III with the world's slowest RAID controller, I managed to
server over 1 million distinct visitors every day without mishap.
Tried on a quad alpha with four times the hardware, and didn't have a
chance. And I went through certification as an Oracle DBA just for the
exercise, so I did not just install Oracle and test against the
default, I recompiled the kernel and hotrodded the heck out of that
machine.
MySQL on the quad alpha, however, was something to behold ;-)
Ultimately, IMHO there are two FOSS databases that cover the whole
gamut of needs. If you need embedded, distributed, clustered, just
plain huge, or just plain fast... For me the combination of MySQL and
PostgreSQL has made commercial databases a non-issue.
-- Mitch
From faber at linuxnj.com Tue Mar 1 13:46:30 2005
From: faber at linuxnj.com (Faber Fedor)
Date: Tue, 1 Mar 2005 13:46:30 -0500
Subject: [nycphp-talk] Re: MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <4224A5B6.5050802@ceruleansky.com>
References: <4224A5B6.5050802@ceruleansky.com>
Message-ID: <20050301184630.GA24722@uranus.faber.nom>
On 01/03/05 12:26 -0500, Jayesh Sheth wrote:
> So, as developers, what do you think? Does MySQL meet your needs
> sufficiently?
For small cases of "sufficient". MySQL is "good enough" and that's
important. Most developers don't know or care about transactions,
stored procs, etc. because those things aren't "programming". Hell,
most developers don't know how to do quality SQL.
Can you do the transactions in your code instead of on the database?
Sure. And I can keep all of my accounting records on paper forms, but
why use archaic methods when you don't need to?
> Do you see it growing along with your needs?
It will eventually get to be a real RDBMS and at some point, it will
read email as well.
> If you do not use MySQL, which database do you use and why?
I like PostgreSQL but I want to play with Firebird because of what I
hear about it's transactional capabilities.
--
Regards,
Faber
Linux New Jersey: Open Source Solutions for New Jersey
http://www.linuxnj.com
From faber at linuxnj.com Tue Mar 1 13:47:56 2005
From: faber at linuxnj.com (Faber Fedor)
Date: Tue, 1 Mar 2005 13:47:56 -0500
Subject: [nycphp-talk] Re: MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <20050301174043.GI4345@lola.aquick.org>
References: <4224A5B6.5050802@ceruleansky.com>
<20050301174043.GI4345@lola.aquick.org>
Message-ID: <20050301184756.GB24722@uranus.faber.nom>
On 01/03/05 12:40 -0500, Adam Fields wrote:
> It can be made to scale >very< well with the right attention to
> architecture, configuration, and usage.
Got any references on that?
--
Regards,
Faber
Linux New Jersey: Open Source Solutions for New Jersey
http://www.linuxnj.com
From fields at hedge.net Tue Mar 1 13:48:08 2005
From: fields at hedge.net (Adam Fields)
Date: Tue, 1 Mar 2005 13:48:08 -0500
Subject: [nycphp-talk] MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <330532b605030110101087edd9@mail.gmail.com>
References: <4224A5B6.5050802@ceruleansky.com>
<20050301174043.GI4345@lola.aquick.org>
<330532b605030110101087edd9@mail.gmail.com>
Message-ID: <20050301184808.GM4345@lola.aquick.org>
On Tue, Mar 01, 2005 at 01:10:30PM -0500, Mitch Pirtle wrote:
[...]
> For example, take your prototypical application for HR, where you
> track employees, their vacation and benefits. With MySQL you are
> forced to put all of the business rules in the application layer --
> preferably PHP ;-) -- causing unneccessary duplication of effort and
> providing more opportunity for error. Not to mention the added effort
> of porting all that logic from the PHP web application to the .Net fat
> client, or to the python server-side scripts...
It's been my experience (and MySQL certainly encourages this approach)
that databases are frequently not reused. Obviously, I can't
generalize to all of the database usages out there - there are lots of
different patterns. But I think developers for a while have been
slowly migrating to strongly tying this kind of thing to the
applications rather than the data stores. Accessing the same data is
then not done by connecting straight to the db, but through an API
provided by the app, which enforces your model rules. This gives you
better portability to other data stores within the context of the app,
but less easy reuse of the data directly, but also a different kind of
distributed functionality.
Whether that's a good thing is arguable - I think there are tradeoffs
both ways. But it's definitely a pattern I see a lot of.
> Put all of the data-related logic in the database as stored procs, and
In, I must point out, a language that's specific to the database. I'm
sure you've tried to migrate MSSQL stored procedures to Oracle, yes?
Not what I'd call pretty.
> you can share that logic with any application that can connect to your
> database. So the web front end is using the exact same rules as the
> fat client for HR people and so on. The language used is no longer of
> consequence, you are free to choose as you see fit.
>
> > Oracle's great, but it's overkill for all but the most demanding
> > applications.
>
> It's overkill for anything, even nuclear particle research. I mean,
> once I populated a table with java methods as plaintext, constructed a
> SELECT, compiled and executed the results of the query right in the
> database. Why in the world would you need this? LOL
[...]
Heh.
--
- Adam
-----
** My new project --> http://www.visiognomy.com/diagrams
** Flagship blog --> http://www.aquick.org/blog
Hire me: [ http://www.adamfields.com/Adam_Fields_Resume.htm ]
Links: [ http://del.icio.us/fields ]
Photos: [ http://www.aquick.org/photoblog ]
From fields at hedge.net Tue Mar 1 13:59:23 2005
From: fields at hedge.net (Adam Fields)
Date: Tue, 1 Mar 2005 13:59:23 -0500
Subject: [nycphp-talk] Re: MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <20050301184756.GB24722@uranus.faber.nom>
References: <4224A5B6.5050802@ceruleansky.com>
<20050301174043.GI4345@lola.aquick.org>
<20050301184756.GB24722@uranus.faber.nom>
Message-ID: <20050301185923.GN4345@lola.aquick.org>
On Tue, Mar 01, 2005 at 01:47:56PM -0500, Faber Fedor wrote:
> On 01/03/05 12:40 -0500, Adam Fields wrote:
> > It can be made to scale >very< well with the right attention to
> > architecture, configuration, and usage.
>
> Got any references on that?
What kind of metrics are interesting to you?
I usually measure this informally as "can the database/app combination
serve all of the users of the application without unreasonable delays
or bottlenecks?" - and that depends on the application. Sometimes this
means individual query performance, sometimes it means number of
simultaneous connections, sometimes it means raw throughput.
I've actually just recently decided to offer a discrete MySQL
optimization analysis package in my consulting practice, and I'd be
curious to know what you'd find interesting in a case study.
--
- Adam
-----
** My new project --> http://www.visiognomy.com/diagrams
** Flagship blog --> http://www.aquick.org/blog
Hire me: [ http://www.adamfields.com/Adam_Fields_Resume.htm ]
Links: [ http://del.icio.us/fields ]
Photos: [ http://www.aquick.org/photoblog ]
From agfische at email.smith.edu Tue Mar 1 14:11:50 2005
From: agfische at email.smith.edu (Aaron Fischer)
Date: Tue, 1 Mar 2005 14:11:50 -0500
Subject: [nycphp-talk] Re: MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <20050301184630.GA24722@uranus.faber.nom>
References: <4224A5B6.5050802@ceruleansky.com>
<20050301184630.GA24722@uranus.faber.nom>
Message-ID: <7d1fc8a39a3d4e7f3fbf3187faed938c@email.smith.edu>
I'm wondering what, if any, relationship there is between Firebird (DB)
and the various Mozilla browser projects bearing similar names
(Firefox, Thunderbird, Firebird, etc.)?
-Aaron
On Mar 1, 2005, at 1:46 PM, Faber Fedor wrote:
> I like PostgreSQL but I want to play with Firebird because of what I
> hear about it's transactional capabilities.
From tgales at tgaconnect.com Tue Mar 1 14:26:09 2005
From: tgales at tgaconnect.com (Tim Gales)
Date: Tue, 1 Mar 2005 14:26:09 -0500
Subject: [nycphp-talk] MySQL Case Study - Stanford Graduate School
ofBusiness (avail. at HBR Online)
In-Reply-To: <330532b605030110101087edd9@mail.gmail.com>
Message-ID: <000401c51e94$85cd6230$d0893818@oberon1>
Mitch Pirtle writes:
> > Oracle's great, but it's overkill for all but the most demanding
> > applications.
>
> It's overkill for anything, even nuclear particle research.
If you're feeling kinda 'high energy', have a look at:
The LCG Persistency Framework (POOL) and distributed database
deployment projects
http://www.rhic.bnl.gov/hepix/talks/041019pm/duellmann.ppt
The LCG Application Area persistency framework (POOL) at CERN
uses (plans) a Relation Abstraction Layer (RAL) which will
couple database back-end services like Oracle and MySQL...
T. Gales & Associates
'Helping People Connect with Technology'
http://www.tgaconnect.com
From tim_lists at o2group.com Tue Mar 1 14:41:46 2005
From: tim_lists at o2group.com (Tim Lieberman)
Date: Tue, 01 Mar 2005 12:41:46 -0700
Subject: [nycphp-talk] Re: MySQL Case Study - Stanford Graduate School
of Business (avail. at HBR Online)
In-Reply-To: <7d1fc8a39a3d4e7f3fbf3187faed938c@email.smith.edu>
References: <4224A5B6.5050802@ceruleansky.com> <20050301184630.GA24722@uranus.faber.nom>
<7d1fc8a39a3d4e7f3fbf3187faed938c@email.smith.edu>
Message-ID: <4224C57A.8030801@o2group.com>
Firefox is named Firefox because Firebird was Firebird before the
Firebird that's now Firefox was.
Hope this clears things up.
-Tim
Aaron Fischer wrote:
> I'm wondering what, if any, relationship there is between Firebird
> (DB) and the various Mozilla browser projects bearing similar names
> (Firefox, Thunderbird, Firebird, etc.)?
>
> -Aaron
>
> On Mar 1, 2005, at 1:46 PM, Faber Fedor wrote:
>
>> I like PostgreSQL but I want to play with Firebird because of what I
>> hear about it's transactional capabilities.
>
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From agfische at email.smith.edu Tue Mar 1 14:50:30 2005
From: agfische at email.smith.edu (Aaron Fischer)
Date: Tue, 1 Mar 2005 14:50:30 -0500
Subject: [nycphp-talk] Re: MySQL Case Study - Stanford Graduate School
of Business (avail. at HBR Online)
In-Reply-To: <4224C57A.8030801@o2group.com>
References: <4224A5B6.5050802@ceruleansky.com> <20050301184630.GA24722@uranus.faber.nom>
<7d1fc8a39a3d4e7f3fbf3187faed938c@email.smith.edu>
<4224C57A.8030801@o2group.com>
Message-ID: <9252c2a3b289b49a379786988465dd00@email.smith.edu>
Sure does, thanks. =)
-Aaron
On Mar 1, 2005, at 2:41 PM, Tim Lieberman wrote:
> Firefox is named Firefox because Firebird was Firebird before the
> Firebird that's now Firefox was.
>
> Hope this clears things up.
>
> -Tim
> Aaron Fischer wrote:
>
>> I'm wondering what, if any, relationship there is between Firebird
>> (DB) and the various Mozilla browser projects bearing similar names
>> (Firefox, Thunderbird, Firebird, etc.)?
>>
>> -Aaron
From mitch.pirtle at gmail.com Tue Mar 1 14:53:13 2005
From: mitch.pirtle at gmail.com (Mitch Pirtle)
Date: Tue, 1 Mar 2005 14:53:13 -0500
Subject: [nycphp-talk] MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <20050301184808.GM4345@lola.aquick.org>
References: <4224A5B6.5050802@ceruleansky.com>
<20050301174043.GI4345@lola.aquick.org>
<330532b605030110101087edd9@mail.gmail.com>
<20050301184808.GM4345@lola.aquick.org>
Message-ID: <330532b605030111533cb8534@mail.gmail.com>
On Tue, 1 Mar 2005 13:48:08 -0500, Adam Fields wrote:
> On Tue, Mar 01, 2005 at 01:10:30PM -0500, Mitch Pirtle wrote:
>
> It's been my experience (and MySQL certainly encourages this approach)
> that databases are frequently not reused. Obviously, I can't
> generalize to all of the database usages out there - there are lots of
> different patterns. But I think developers for a while have been
> slowly migrating to strongly tying this kind of thing to the
> applications rather than the data stores. Accessing the same data is
> then not done by connecting straight to the db, but through an API
> provided by the app, which enforces your model rules. This gives you
> better portability to other data stores within the context of the app,
> but less easy reuse of the data directly, but also a different kind of
> distributed functionality.
>
> Whether that's a good thing is arguable - I think there are tradeoffs
> both ways. But it's definitely a pattern I see a lot of.
In the business world I am seeing the exact opposite - each
organization, thanks to MS Access or Filemaker Pro or some such, has
data scattered about the four corners of the earth (engineering,
sales, support and HR) and a consolidation effort is slowly rising up
the priority list.
If the organization decides to commit to a particular database
platform (for whatever reason), not using all of the features
available to your advantage just makes no sense.
And in that scenario (which for my clients is a vast majority) forcing
your developers and consultants to replicate that functionality at the
application level (paying double in efforts and cost) equally makes no
sense.
Not saying this is the only valid approach mind you, just one that
cannot be discounted as a fringe scenario.
> > Put all of the data-related logic in the database as stored procs, and
>
> In, I must point out, a language that's specific to the database. I'm
> sure you've tried to migrate MSSQL stored procedures to Oracle, yes?
> Not what I'd call pretty.
There are plenty of folks out there (myself included) that would
consider that a moot point.
Writing database-platform neutral SQL is hard in most cases, and
impossible in many others. At that point (just writing SQL calls) you
are already typically tied to a database platform, so why should you
not use what is available? Why not take advantage of the available
features if you can benefit?
As a matter of fact, the "less is more" approach of MySQL forces you
to make changes to your database design as a result. So you could
argue the opposite side of that point with just as much conviction.
;-)
And I would say that one of the patterns you are seeing is actually
the result of MySQL, where developers are 'growing up' in a world
where you cannot enforce logic at the database level and have to
duplicate that at the application layers. Since this occasionally
results in wasted resources (duplication of effort), many of these
databases end up being small islands of data instead, only available
to the one application they were written for. This may not always be a
bad situation though, but I want to stress that in many instances this
can be a very bad situation.
That is why the paired offering of MySQL and PostgreSQL is such a
perfect combination. One gives you speed and ease of use, the other
provides power and features. Both are suported on multiple platforms,
and can be accessed by a myriad of languages and environments. I say
this is the golden age of FOSS databases!
-- Mitch
From danielc at analysisandsolutions.com Tue Mar 1 15:34:05 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Tue, 1 Mar 2005 15:34:05 -0500
Subject: [nycphp-talk] Re: MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <20050301184630.GA24722@uranus.faber.nom>
References: <4224A5B6.5050802@ceruleansky.com>
<20050301184630.GA24722@uranus.faber.nom>
Message-ID: <20050301203405.GA8242@panix.com>
Hey Faber:
On Tue, Mar 01, 2005 at 01:46:30PM -0500, Faber Fedor wrote:
> I like PostgreSQL but I want to play with Firebird because of what I
> hear about it's transactional capabilities.
There are very strange quirks in the InterBase/Firebird libraries and PHP
extension that make them a bit of a nuisance. If you do try them with
PHP, make sure to be using PHP 5.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From tgales at tgaconnect.com Tue Mar 1 16:16:57 2005
From: tgales at tgaconnect.com (Tim Gales)
Date: Tue, 1 Mar 2005 16:16:57 -0500
Subject: [nycphp-talk] MySQL Case Study - Stanford Graduate School
ofBusiness (avail. at HBR Online)
In-Reply-To: <330532b605030111533cb8534@mail.gmail.com>
Message-ID: <000301c51ea4$0051ae30$d0893818@oberon1>
Mitch Pirtle writes:
> If the organization decides to commit to a particular
> database platform (for whatever reason), not using all of the
> features available to your advantage just makes no sense.
Well, it can turn out that major portions of your database
contain information, which is primarily read-only.
Even the niftiest stored procedure capabilities and
transactional rollback facilities cannot be implemented
in such a was as to use "all of the features available"
on read-only tables.
Being able to use compressed tables as well as (in) memory
tables in places and transaction-safe tables only where
you need them can be a decided advantage.
(as usual, it depends on what it is you are trying to do)
T. Gales & Associates
'Helping People Connect with Technology'
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.5.7 - Release Date: 3/1/2005
From tim_lists at o2group.com Tue Mar 1 16:18:05 2005
From: tim_lists at o2group.com (Tim Lieberman)
Date: Tue, 01 Mar 2005 14:18:05 -0700
Subject: [nycphp-talk] MySQL Case Study - Stanford Graduate School
of Business (avail. at HBR Online)
In-Reply-To: <330532b605030111533cb8534@mail.gmail.com>
References: <4224A5B6.5050802@ceruleansky.com> <20050301174043.GI4345@lola.aquick.org> <330532b605030110101087edd9@mail.gmail.com> <20050301184808.GM4345@lola.aquick.org>
<330532b605030111533cb8534@mail.gmail.com>
Message-ID: <4224DC0D.5060607@o2group.com>
Mitch Pirtle wrote:
>If the organization decides to commit to a particular database
>platform (for whatever reason), not using all of the features
>available to your advantage just makes no sense.
>
>And in that scenario (which for my clients is a vast majority) forcing
>your developers and consultants to replicate that functionality at the
>application level (paying double in efforts and cost) equally makes no
>sense.
>
>
I think a lot of developers don't use the database features that they
could because poor requirements turn limitations designed into the
application into business rules for the database. Some months later,
another application is designed that is supposed to be able to play
fast(er) and loose(r) with the data. Now, developers need to move the
constriants out of the database, and into the first application, so the
DB will allow application #2 to do it's job. Or, maybe you can handle
things carefully in the database.
I know this bit me several times early in my career.
-Tim
From faber at linuxnj.com Tue Mar 1 19:34:42 2005
From: faber at linuxnj.com (Faber Fedor)
Date: Tue, 1 Mar 2005 19:34:42 -0500
Subject: [nycphp-talk] Re: MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <20050301203405.GA8242@panix.com>
References: <4224A5B6.5050802@ceruleansky.com>
<20050301184630.GA24722@uranus.faber.nom>
<20050301203405.GA8242@panix.com>
Message-ID: <20050302003442.GA25009@uranus.faber.nom>
On 01/03/05 15:34 -0500, Daniel Convissor wrote:
> Hey Faber:
Hey Dan,
> On Tue, Mar 01, 2005 at 01:46:30PM -0500, Faber Fedor wrote:
>
> > I like PostgreSQL but I want to play with Firebird because of what I
> > hear about it's transactional capabilities.
>
> There are very strange quirks in the InterBase/Firebird libraries and PHP
> extension that make them a bit of a nuisance. If you do try them with
> PHP, make sure to be using PHP 5.
PHP isn't the only language I use. ;-) Since I will be looking at the
Ajax technology (XHTML, CSS, JS, and one or two languages on the
backend), PHP will probably come in to play, though.
Thanks for the heads up.
--
Regards,
Faber
Linux New Jersey: Open Source Solutions for New Jersey
http://www.linuxnj.com
From 1j0lkq002 at sneakemail.com Wed Mar 2 01:05:12 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Wed, 02 Mar 2005 01:05:12 -0500
Subject: [nycphp-talk] MySQL Case Study - Stanford Graduate School of
Business (avail. at HBR Online)
In-Reply-To: <4224A5B6.5050802@ceruleansky.com>
References: <4224A5B6.5050802@ceruleansky.com>
Message-ID: <21653-58222@sneakemail.com>
Jayesh Sheth jayeshsh-at-ceruleansky.com |nyphp dev/internal group use|
wrote:
> Any thoughts regarding IBM's new alliance with Zend to bring DB2 and
> Derby (Cloudscape) support to PHP and how this might affect MySQL's
> market share among PHP users?
In my view, IBM understands how to make money implementing real FOSS
solutions. As the issues surrounding MySQL licensing continue to evolve
in favor of the commercial side, they may be right about an oppty for
another truly FOSS db.
From stephen at musgrave.org Wed Mar 2 10:15:49 2005
From: stephen at musgrave.org (Stephen Musgrave)
Date: Wed, 2 Mar 2005 10:15:49 -0500
Subject: [nycphp-talk] PHP/MySQL on Windows SBS Box
In-Reply-To:
References:
Message-ID: <429e540856dad9fdd32f57a733685ad6@musgrave.org>
Thank you all for your feedback.
On Feb 25, 2005, at 7:06 PM, Frank Wong wrote:
> Actually, if IIS on SBS behaves like IIS on XP Pro, it is easy to
> direct
> port 80 to Apache instead of IIS. The following steps will stop IIS
> from
> grabbing port 80.
>
> 1) Goto IIS admin
> 2) Right click on 'Default Web Site'
> 3) Select 'Properties'
> 4) Under 'Web Site' tab, change 'TCP Port' to anything other than 80.
> 5) Hit Apply
>
> or the other method is to goto Services and stop the 'IIS Admin'
> service
> then set it to manual start.
>
> Either of those ways will get IIS of your back.
>
>
> _______________
> Frank Wong
>
> -----Original Message-----
> From: talk-bounces at lists.nyphp.org
> [mailto:talk-bounces at lists.nyphp.org]On Behalf Of John Nunez
> Sent: Friday, February 25, 2005 6:14 PM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] PHP/MySQL on Windows SBS Box
>
>
> Latched?!?! Death Grip on port 80.
>
> There are some hacks out there to allow Apache to handle port 80 but I
> haven't done any of this for a while.
>
>
>
> On Feb 25, 2005, at 4:20 PM, csnyder wrote:
>>
>> So then you'd have to use IIS, right? I'm guessing it's already
>> latched onto port 80...
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
>
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
>
From jfreeman at nybg.org Wed Mar 2 11:22:47 2005
From: jfreeman at nybg.org (Joshua S. Freeman)
Date: Wed, 02 Mar 2005 11:22:47 -0500
Subject: [nycphp-talk] Universe/DB2 and PHP
Message-ID:
Is there anyone here who's ever built a site using PHP with Universe/DB2 on
the backend instead of, say, MySQL?
J.
--
COMPUTER HELPDESK (when inside the Garden): http://helpdesk.nybg.org/
Joshua S. Freeman
Dir. of Information Technology
New York Botanical Garden
v: 718 817 8937 m: 347 392 2560
This message (including any attachments) contains confidential information
intended for a specific individual/group of individuals and a specific
purpose, and is protected by law. If you are not an intended recipient, you
should delete this message. Any disclosure, copying, or distribution of
this message, or the taking of any action based on it, is strictly
prohibited.
From danielc at analysisandsolutions.com Wed Mar 2 12:08:42 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Wed, 2 Mar 2005 12:08:42 -0500
Subject: [nycphp-talk] stuff from SecurityFocus Newsletter #290
Message-ID: <20050302170842.GA7220@panix.com>
PHP related stuff in SecurityFocus Newsletter #290
I must say PHP has become very popular. Of all the web
applications mentioned in SecurityFocus' lists of
vulnerabilities, there are FAR more mentions of apps using
PHP than any other language. The low barrier to entry
has a downside, eh?
PHP STUFF
=========
PHP4 Readfile Denial Of Service Vulnerability
http://www.securityfocus.com/bid/12665
ZeroBoard Multiple Cross-Site Scripting Vulnerabilities
http://www.securityfocus.com/bid/12596
PMachine Pro Remote File Include Vulnerability
http://www.securityfocus.com/bid/12597
Invision Power Board SML Code Script Injection Vulnerability
http://www.securityfocus.com/bid/12607
Mambo Open Source Tar.PHP Remote File Include Vulnerability
http://www.securityfocus.com/bid/12608
INL Ulog-php Multiple Unspecified SQL Injection Vulnerabilit...
http://www.securityfocus.com/bid/12610
PANews Remote PHP Script Code Execution Vulnerability
http://www.securityfocus.com/bid/12611
PHPBB Multiple Remote Path Disclosure Vulnerabilities
http://www.securityfocus.com/bid/12618
PHPBB Arbitrary File Disclosure Vulnerability
http://www.securityfocus.com/bid/12621
VBulletin Misc.PHP Arbitrary PHP Script Code Execution Vulne...
http://www.securityfocus.com/bid/12622
PHPBB Arbitrary File Deletion Vulnerability
http://www.securityfocus.com/bid/12623
MediaWiki Multiple Unspecified Remote Vulnerabilities
http://www.securityfocus.com/bid/12625
iGeneric iG Shop Multiple SQL Injection Vulnerabilities
http://www.securityfocus.com/bid/12627
PBLang Bulletin Board System Search.PHP Cross-Site Scripting...
http://www.securityfocus.com/bid/12631
PBLang Bulletin Board System PMPShow.PHP HTML Injection Vuln...
http://www.securityfocus.com/bid/12633
PBLang Bulletin Board System PM.PHP HTML Injection Vulnerabi...
http://www.securityfocus.com/bid/12634
ELOG Web Logbook Attached Filename Remote Buffer Overflow Vu...
http://www.securityfocus.com/bid/12639
ELOG Web Logbook Multiple Remote Unspecified Vulnerabilities
http://www.securityfocus.com/bid/12640
PHPMyAdmin Multiple Libraries And Themes Remote Cross-Site S...
http://www.securityfocus.com/bid/12644
PHPMyAdmin Multiple Local File Include Vulnerabilities
http://www.securityfocus.com/bid/12645
OOApp Guestbook Multiple HTML Injection Vulnerabilities
http://www.securityfocus.com/bid/12647
PunBB Multiple Remote Input Validation Vulnerabilities
http://www.securityfocus.com/bid/12652
PHPWebSite Image File Processing Remote Arbitrary PHP File U...
http://www.securityfocus.com/bid/12653
CubeCart Multiple Cross-Site Scripting Vulnerabilities
http://www.securityfocus.com/bid/12658
PBLang Bulletin Board System Remote PHP Script Injection Vul...
http://www.securityfocus.com/bid/12666
OTHER STUFF
===========
Microsoft Internet Explorer Pop-up Window Title Bar Spoofing...
http://www.securityfocus.com/bid/12602
Mozilla Firefox Scrollbar Remote Code Execution Vulnerabilit...
http://www.securityfocus.com/bid/12655
Mozilla Suite Multiple Remote Vulnerabilities
http://www.securityfocus.com/bid/12659
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From danielc at analysisandsolutions.com Wed Mar 2 12:23:33 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Wed, 2 Mar 2005 12:23:33 -0500
Subject: [nycphp-talk] Universe/DB2 and PHP
In-Reply-To:
References:
Message-ID: <20050302172333.GA25094@panix.com>
Hey Joshua:
On Wed, Mar 02, 2005 at 11:22:47AM -0500, Joshua S. Freeman wrote:
> Is there anyone here who's ever built a site using PHP with Universe/DB2 on
> the backend instead of, say, MySQL?
While I haven't built a site using it, I have used it during my
development of PEAR DB. It works like a charm via the odbc driver.
http://pear.php.net/package/DB
If you're curious about any quirks it may require, see my presentation
about database portability:
http://www.analysisandsolutions.com/presentations/portability/
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From dmintz at davidmintz.org Wed Mar 2 17:20:43 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Wed, 2 Mar 2005 17:20:43 -0500 (EST)
Subject: [nycphp-talk] fgets(): why bytes - 1
Message-ID:
A little theoretical question to which I *know* you guys know the
answer so don't be coy (-:
The fgets() function documentation says:
string fgets ( resource handle [, int length] )
Returns a string of up to length - 1 bytes read from the file pointed to
by handle. Reading ends when length - 1 bytes have been read, [...]
How come it's length - 1? My research suggests the answer is, because it
PHP'wraps fgets() a C function of the same name which does it that way.
OK then, why does the C function fgets() do it that way? I heard a rumor
that says the C function appends a NULL character to the string, so that
might explain it -- to leave some room. But if so, why the null character?
Gratefully,
---
David Mintz
http://davidmintz.org/
From dmintz at davidmintz.org Wed Mar 2 17:24:58 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Wed, 2 Mar 2005 17:24:58 -0500 (EST)
Subject: [nycphp-talk] fgets(): why bytes - 1
In-Reply-To:
References:
Message-ID:
On Wed, 2 Mar 2005, David Mintz wrote:
Sorry for this typo, so egregious that I think I should correct it:
>
> because it
> PHP'wraps fgets() a C function of the same name which does it that way.
>
make that "because PHP's gets() wraps a C function..."
---
David Mintz
http://davidmintz.org/
From hans at cyberxdesigns.com Wed Mar 2 17:34:44 2005
From: hans at cyberxdesigns.com (hans at cyberxdesigns.com)
Date: Wed, 2 Mar 2005 17:34:44 -0500 (EST)
Subject: [nycphp-talk] fgets(): why bytes - 1
In-Reply-To:
References:
Message-ID: <33229.127.0.0.1.1109802884.squirrel@www.cyberxdesigns.com>
Silly guess here, but a string in C is an array of characters terminated
with a null. The null marks the end of the array. C does not, AFIK, have
a native string type. I think C just has arrays of characters that are
used as strings. I remember writing functions to handle arrays of
characters like a string. Could be total wrong here, been a long while.
Hans
> On Wed, 2 Mar 2005, David Mintz wrote:
>
> Sorry for this typo, so egregious that I think I should correct it:
>
>>
>> because it
>> PHP'wraps fgets() a C function of the same name which does it that way.
>>
>
> make that "because PHP's gets() wraps a C function..."
>
> ---
> David Mintz
> http://davidmintz.org/
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From john at cyber-ny.com Wed Mar 2 17:35:38 2005
From: john at cyber-ny.com (John Nunez)
Date: Wed, 2 Mar 2005 17:35:38 -0500
Subject: [nycphp-talk] fgets(): why bytes - 1
In-Reply-To:
References:
Message-ID: <4117e5a65d033c1ac4f103fe56d8b9cd@cyber-ny.com>
Hey David,
C uses Null Terminated strings. This means that a string can contain
any character except for NULL. Like other non-printable control
character such as BELL, TAB, etc...
Check out this link for a better explanation :
http://www-ccs.ucsd.edu/c/charset.html#null-terminated%20string
- John
On Mar 2, 2005, at 5:20 PM, David Mintz wrote:
>
> A little theoretical question to which I *know* you guys know the
> answer so don't be coy (-:
>
> The fgets() function documentation says:
>
> string fgets ( resource handle [, int length] )
>
> Returns a string of up to length - 1 bytes read from the file pointed
> to
> by handle. Reading ends when length - 1 bytes have been read, [...]
>
> How come it's length - 1? My research suggests the answer is, because
> it
> PHP'wraps fgets() a C function of the same name which does it that
> way.
>
> OK then, why does the C function fgets() do it that way? I heard a
> rumor
> that says the C function appends a NULL character to the string, so
> that
> might explain it -- to leave some room. But if so, why the null
> character?
>
> Gratefully,
>
>
> ---
> David Mintz
> http://davidmintz.org/
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From faber at linuxnj.com Wed Mar 2 18:37:42 2005
From: faber at linuxnj.com (Faber Fedor)
Date: Wed, 2 Mar 2005 18:37:42 -0500
Subject: [nycphp-talk] Re: Safely running root commands
In-Reply-To: <0MKz5u-1D5lZ20E0M-0001M2@mrelay.perfora.net>
References: <20050228041409.GA14798@uranus.faber.nom>
<0MKz5u-1D5lZ20E0M-0001M2@mrelay.perfora.net>
Message-ID: <20050302233742.GA32073@uranus.faber.nom>
Okay, since you guys suggested I run my root commands from a daemon,
I've been playing with that for the past couple of days. I stole^W
copied one of the perl daemons listed in "perldoc perlipc'
(http://www.linuxnj.com/personal/qui_server.pl) and I used the sample
PHP client from the website manual
(http://www.linuxnj.com/personal/qui_client.php).
If I manually telnet to the daemon and give the commands "ls" and
"quit", the daemon responds with a dir listing and quits. When I try to
do the same thing via the PHP client, I get a dir listing and then it sits
there.
I've made every modification I can think of and nothing makes the PHP
client work like the manual (telnet) client. I Assume there is
something about sockets I don't grok, but every example I've seen of
this in different languages is what I have working manually.
What am I missing?
--
Regards,
Faber
Linux New Jersey: Open Source Solutions for New Jersey
http://www.linuxnj.com
From dmintz at davidmintz.org Wed Mar 2 22:32:41 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Wed, 2 Mar 2005 22:32:41 -0500 (EST)
Subject: [nycphp-talk] fgets(): why bytes - 1
In-Reply-To: <4117e5a65d033c1ac4f103fe56d8b9cd@cyber-ny.com>
References:
<4117e5a65d033c1ac4f103fe56d8b9cd@cyber-ny.com>
Message-ID:
Thanks for the enlightenment, guys.
I should put "learn C" a few notches higher on my To Do list.
---
David Mintz
http://davidmintz.org/
From krook at us.ibm.com Thu Mar 3 10:50:55 2005
From: krook at us.ibm.com (Daniel Krook)
Date: Thu, 3 Mar 2005 10:50:55 -0500
Subject: [nycphp-talk] Universe/DB2 and PHP
In-Reply-To:
Message-ID:
> Is there anyone here who's ever built a site using PHP with Universe/DB2
on
> the backend instead of, say, MySQL?
Nothing large, but it's a direction we're going in for a few internal web
applications.
>From an administration point of view, it's fairly simple to add DB2
support to PHP. Just add the following flag to your PHP configure after
you've installed DB2 on the server:
--with-ibm-db2 [assuming the default location, /home/db2inst1/sqllib]
Then add this to apachectl or the profile of the user who starts Apache or
which ever web server you're planning to use:
. /home/db2inst1/sqllib/db2profile
>From an application standpoint, use PEAR DB and look out for the issues
that Dan Convissor points out.
Daniel Krook, Advisory IT Specialist - Application Development
WW Web Production Services North 2, ibm.com
1133 Westchester Avenue, White Plains, NY 10604
Personal: http://info.krook.org/
Persona: http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=9A9796897
From nestorflorez at earthlink.net Thu Mar 3 13:05:15 2005
From: nestorflorez at earthlink.net (Nestor Florez)
Date: Thu, 3 Mar 2005 10:05:15 -0800 (PST)
Subject: [nycphp-talk] Mambo in the news!
Message-ID: <8475202.1109873115405.JavaMail.root@rizzo.psp.pas.earthlink.net>
People,
After hearing so much about MAMBO, I decided to install it on my WAMP system.
The reality of the installation is different. I can see why peopl ewoul dget turn off about
installing this product. I started the installation and I could not even get pass STEP 1 of the
installation. It kept telling me that th username and password that created was wrong.
OK, so I went to the forum and I found out that you have to use old_password() function
in order for your password to work. OK, I got pass STEP 1 all the way to STEP 4. In STEP 4
I get to choose to "View Site" or "Administrator". "View Site" displays the default MAMBO site.
If I choose ADMINISTRATION, it asks for my username and password, which is display on STEP 4,
and when I enter the username and password it tells me that they are incorrect....Hey, the
MAMBO system on STEP 4 is telling me to enter this in the ADMINISTRATION page.
Anyways I am frustrated, becuase is not working and Iafter reading the forum it seems that a lot of
people are having the same problemss.
Anybody has fixed the problem of "usernma or password incorrect" when attempting to login into
the administration area?
Which I was living in NY so that I could attend the MAMBO talk from last month.
Thanks,
Nestor ;-)
From ashaw at iifwp.org Thu Mar 3 13:33:13 2005
From: ashaw at iifwp.org (Allen Shaw)
Date: Thu, 03 Mar 2005 13:33:13 -0500
Subject: [nycphp-talk] transparent SIDs fail with a colon ??
In-Reply-To: <20050302172333.GA25094@panix.com>
References:
<20050302172333.GA25094@panix.com>
Message-ID: <42275869.5070809@iifwp.org>
Hi Folks,
Here's a surprising phenomenon I'm getting when using transparent
session IDs, one that makes no sense to me. Here are two hyperlinks on
the same page, as they are originally coded:
> Home |
> Sign Out |
>
Now, if we use transparent SIDs, PHP will transform these like so:
> Home |
> Sign Out |
>
Notice that the first link doesn't get the form_Session argment added on
to the URL -- only the second one. How come? It's the colon. The
colon in "submitid=32:674105001109864182" apparently screws up PHP's
attempts to insert the session ID into the URL. If you just take out
the colon, you're fine; but use a colon and it's no dice.
I also tried using ":" instead of an actual colon, and I get even
crazier results. PHP inserts the SID argument in the *middle* of the
URL just before the ":" entity, like so:
>Home
Seems like a bug, but I couldn't find anything on it (bugs.php.net,
google). Is this just weird, or am I missing something? (Experience
shows that it's more often the latter than the former...)
- Allen
--
===========================================================
Allen Shaw ashaw at iifwp.org
IIFWP Data and 914.631.1331 x.106
IT Services http://www.iifwp.org
From ashaw at iifwp.org Thu Mar 3 13:36:36 2005
From: ashaw at iifwp.org (Allen Shaw)
Date: Thu, 03 Mar 2005 13:36:36 -0500
Subject: [nycphp-talk] transparent SIDs fail with a colon ??
In-Reply-To: <42275869.5070809@iifwp.org>
References: <20050302172333.GA25094@panix.com>
<42275869.5070809@iifwp.org>
Message-ID: <42275934.7060206@iifwp.org>
Dang typos...
Line after second example is supposed to say: "Notice that the first
link doesn't get the PHPSESSID argment ..." (Worked on this with PHPLib
first and then in a bare-bones script to double-check before sending. So
much for double-checking....)
Allen Shaw wrote:
>
>> Home |
>> > href="logout.php?template=welcome&submitid=32.67&PHPSESSID=7e647029bccb9d34fc0b0b0aa6e6a5d0">Sign
>> Out |
>
> Notice that the first link doesn't get the form_Session argment added
> on to the URL -- only the second one. How come? It's the colon.
--
===========================================================
Allen Shaw ashaw at iifwp.org
IIFWP Data and 914.631.1331 x.106
IT Services http://www.iifwp.org
From danielc at analysisandsolutions.com Thu Mar 3 13:55:47 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Thu, 3 Mar 2005 13:55:47 -0500
Subject: [nycphp-talk] transparent SIDs fail with a colon ??
In-Reply-To: <42275869.5070809@iifwp.org>
References:
<20050302172333.GA25094@panix.com> <42275869.5070809@iifwp.org>
Message-ID: <20050303185547.GA9330@panix.com>
Hi:
On Thu, Mar 03, 2005 at 01:33:13PM -0500, Allen Shaw wrote:
> I also tried using ":" instead of an actual colon
That's an HTML entity. Try the url encoding, %3A, instead.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From ashaw at iifwp.org Thu Mar 3 14:12:08 2005
From: ashaw at iifwp.org (Allen Shaw)
Date: Thu, 03 Mar 2005 14:12:08 -0500
Subject: [nycphp-talk] transparent SIDs fail with a colon ??
In-Reply-To: <20050303185547.GA9330@panix.com>
References: <20050302172333.GA25094@panix.com>
<42275869.5070809@iifwp.org> <20050303185547.GA9330@panix.com>
Message-ID: <42276188.6060800@iifwp.org>
Doh, okay that did it. But why would PHP not handle the literal ':' the
way I expected? It's a reserved character in a URI, isn't it?
[googlegoogle... yep.]
As I said, it usually turns out that I was "missing something". :o)
Thanks,
- A.
Daniel Convissor wrote:
>Hi:
>
>On Thu, Mar 03, 2005 at 01:33:13PM -0500, Allen Shaw wrote:
>
>
>
>>I also tried using ":" instead of an actual colon
>>
>>
>
>That's an HTML entity. Try the url encoding, %3A, instead.
>
>--Dan
>
>
>
--
===========================================================
Allen Shaw ashaw at iifwp.org
IIFWP Data and 914.631.1331 x.106
IT Services http://www.iifwp.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From mitch.pirtle at gmail.com Thu Mar 3 21:40:39 2005
From: mitch.pirtle at gmail.com (Mitch Pirtle)
Date: Thu, 3 Mar 2005 21:40:39 -0500
Subject: [nycphp-talk] Mambo in the news!
In-Reply-To: <8475202.1109873115405.JavaMail.root@rizzo.psp.pas.earthlink.net>
References: <8475202.1109873115405.JavaMail.root@rizzo.psp.pas.earthlink.net>
Message-ID: <330532b605030318402b21217c@mail.gmail.com>
On Thu, 3 Mar 2005 10:05:15 -0800 (PST), Nestor Florez
wrote:
> People,
>
> After hearing so much about MAMBO, I decided to install it on my WAMP system.
That's really good.
> The reality of the installation is different.
That's really bad.
> I can see why peopl ewoul dget turn off about
> installing this product. I started the installation and I could not even get pass STEP 1 of the
> installation. It kept telling me that th username and password that created was wrong.
Tell you what, I will help you figure this out, but you need to give
me some information so my guesses are more like educated guesses ;-)
What do you mean, were you giving the installer a bad mysql username,
or did you create the admin user with a password that you cannot
recall?
Knowing what version Mambo you are trying is also a big plus.
And I wish you could have made the presentation from last month, as I
would have loved to walk everyone through the installation of Mambo,
on either Windows or Linux platform.
-- Mitch, thinking about a flash presentation...
From nestorflorez at earthlink.net Thu Mar 3 23:06:08 2005
From: nestorflorez at earthlink.net (Nestor Florez)
Date: Thu, 3 Mar 2005 20:06:08 -0800 (GMT-08:00)
Subject: [nycphp-talk] Mambo in the news!
Message-ID: <19122721.1109909168515.JavaMail.root@scooter.psp.pas.earthlink.net>
Mitch,
Thanks for your reply.
I have MANBO 4.5.2 installed and now is just a matter of learning it.
The problems I had was that as soon as I started the installation STEP 1 failed.
it kept saying that "the username or password is incorrect", now I am the one
that creates the user and password in my MYSQL DB. I found thru the MAMBO
forum that it is a common problem and the solution was that when giving the
GRANT command in MYSQL I need to use the functionold_password() when
identifying the password.. that worked.
The second problem was that on STEP 4 it tell me to go the administration site
of MAMBO and use "admin" as the user and a password created by MAMBO, but
when ever I did that it gavea message "Incorrect user name or password" .
Well I got tire of that crap and I went into the administration/index.php or common.php
and I foced it to accept my password.
Voila, everything is working but I just thing that it shouldd be easier to install.
TO me it seems that the people set up everything to have an easyu installation but
it seems as they have not updated the installation of they fail to look at some
possible installation problems.
Well, now I will have one of my coworkers take a look at MAMBO to see if we
can use it in the our H.S. district since our budget is getting slashed.
Thanks for your reply.
Nestor :-)
http://www.IneedWork.org
PS: I could not make it to your presentation because I am a bit far from NY,
I live in San Diego California. We do have a php User group here but is
not as active as yours. the last time we met was in November.
-----Original Message-----
From: Mitch Pirtle
Sent: Mar 3, 2005 6:40 PM
To: NYPHP Talk ,
"NYPHP SIG: Mambo"
Subject: Re: [nycphp-talk] Mambo in the news!
On Thu, 3 Mar 2005 10:05:15 -0800 (PST), Nestor Florez
wrote:
> People,
>
> After hearing so much about MAMBO, I decided to install it on my WAMP system.
That's really good.
> The reality of the installation is different.
That's really bad.
> I can see why peopl ewoul dget turn off about
> installing this product. I started the installation and I could not even get pass STEP 1 of the
> installation. It kept telling me that th username and password that created was wrong.
Tell you what, I will help you figure this out, but you need to give
me some information so my guesses are more like educated guesses ;-)
What do you mean, were you giving the installer a bad mysql username,
or did you create the admin user with a password that you cannot
recall?
Knowing what version Mambo you are trying is also a big plus.
And I wish you could have made the presentation from last month, as I
would have loved to walk everyone through the installation of Mambo,
on either Windows or Linux platform.
-- Mitch, thinking about a flash presentation...
_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org
From smanes at magpie.com Thu Mar 3 23:57:49 2005
From: smanes at magpie.com (Steve Manes)
Date: Thu, 03 Mar 2005 23:57:49 -0500
Subject: [nycphp-talk] Man, this is the best
Message-ID: <4227EACD.6070908@magpie.com>
Completely mesmerizing!
http://www.dgtalpimp.com/m3_gtr_nurburgring.wmv
(...it ain't your neighbor's SUV)
From smanes at magpie.com Fri Mar 4 00:06:01 2005
From: smanes at magpie.com (Steve Manes)
Date: Fri, 04 Mar 2005 00:06:01 -0500
Subject: [nycphp-talk] Man, this is the best
In-Reply-To: <4227EACD.6070908@magpie.com>
References: <4227EACD.6070908@magpie.com>
Message-ID: <4227ECB9.7000602@magpie.com>
Steve Manes wrote:
>
> Completely mesmerizing!
>
> http://www.dgtalpimp.com/m3_gtr_nurburgring.wmv
>
> (...it ain't your neighbor's SUV)
Sorry!!! Wrong 'talk@' list! Apologies...
From sajith.ml at gmail.com Fri Mar 4 03:30:36 2005
From: sajith.ml at gmail.com (Sajith A)
Date: Fri, 4 Mar 2005 14:00:36 +0530
Subject: [nycphp-talk] Php Framework
Message-ID:
Hello,
Could someone please suggest a good framework for php5 that separates
business logic and presentation. Also i would like to know whether
there it is advisable to go for MVC pattern in php development.
Thanks and regards
Sajith A
From alexchan.1976 at gmail.com Fri Mar 4 07:36:17 2005
From: alexchan.1976 at gmail.com (Alex C)
Date: Fri, 4 Mar 2005 07:36:17 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To:
References:
Message-ID: <8f494f76050304043630a04213@mail.gmail.com>
I really like Flexy Template in Pear.
alex
On Fri, 4 Mar 2005 14:00:36 +0530, Sajith A wrote:
> Hello,
> Could someone please suggest a good framework for php5 that separates
> business logic and presentation. Also i would like to know whether
> there it is advisable to go for MVC pattern in php development.
> Thanks and regards
> Sajith A
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From php at haberco.com Fri Mar 4 07:42:30 2005
From: php at haberco.com (Eddie Haber)
Date: Fri, 04 Mar 2005 07:42:30 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <8f494f76050304043630a04213@mail.gmail.com>
Message-ID:
There's a big article on iConnect in this months PHP-Architect. Has anyone
had any practical experience with it?
Writing application frameworks is becoming almost as common as writing
template engines. BTW, I don't think Flexy constitutes a framework.
Eddie
On 3/4/05 7:36 AM, "Alex C" wrote:
> I really like Flexy Template in Pear.
> alex
>
>
> On Fri, 4 Mar 2005 14:00:36 +0530, Sajith A wrote:
>> Hello,
>> Could someone please suggest a good framework for php5 that separates
>> business logic and presentation. Also i would like to know whether
>> there it is advisable to go for MVC pattern in php development.
>> Thanks and regards
>> Sajith A
>> _______________________________________________
>> New York PHP Talk Mailing List
>> AMP Technology
>> Supporting Apache, MySQL and PHP
>> http://lists.nyphp.org/mailman/listinfo/talk
>> http://www.nyphp.org
>>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
From codebowl at gmail.com Fri Mar 4 07:47:39 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Fri, 4 Mar 2005 07:47:39 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To:
References: <8f494f76050304043630a04213@mail.gmail.com>
Message-ID: <8d9a4280050304044737468ff8@mail.gmail.com>
there's always Prado
http://www.xisc.com/
On Fri, 04 Mar 2005 07:42:30 -0500, Eddie Haber wrote:
> There's a big article on iConnect in this months PHP-Architect. Has anyone
> had any practical experience with it?
>
> Writing application frameworks is becoming almost as common as writing
> template engines. BTW, I don't think Flexy constitutes a framework.
>
> Eddie
>
>
> On 3/4/05 7:36 AM, "Alex C" wrote:
>
> > I really like Flexy Template in Pear.
> > alex
> >
> >
> > On Fri, 4 Mar 2005 14:00:36 +0530, Sajith A wrote:
> >> Hello,
> >> Could someone please suggest a good framework for php5 that separates
> >> business logic and presentation. Also i would like to know whether
> >> there it is advisable to go for MVC pattern in php development.
> >> Thanks and regards
> >> Sajith A
> >> _______________________________________________
> >> New York PHP Talk Mailing List
> >> AMP Technology
> >> Supporting Apache, MySQL and PHP
> >> http://lists.nyphp.org/mailman/listinfo/talk
> >> http://www.nyphp.org
> >>
> > _______________________________________________
> > New York PHP Talk Mailing List
> > AMP Technology
> > Supporting Apache, MySQL and PHP
> > http://lists.nyphp.org/mailman/listinfo/talk
> > http://www.nyphp.org
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From phil at bearingasset.com Fri Mar 4 08:51:41 2005
From: phil at bearingasset.com (Phil Duffy)
Date: Fri, 4 Mar 2005 08:51:41 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To:
Message-ID: <20050304135121.76F2DA8774@virtu.nyphp.org>
Sajith,
MVC with PHP is a challenge I am trying to solve. I tried to implement
phpMVC under Windows XP/IIS and couldn't get it to work. I then used some
code from Chapter 13 of Professional PHP 5 by Lecky-Thompson, Eide-Goodman,
Nowicki and Cove (Wiley Publishing). While I could get this to install
under XP/IIS, it did not perform as documented in Chapter 13. I then
re-installed under Linux/Apache/MySQL/PHP (XAMPP distribution). Again, I
could get it to install, but it did not perform as documented (identical to
XP/IIS installation). I have been in touch with the publisher, but received
no response.
I have seen arguments on both sides of the PHP/MVC argument. No doubt the
amount of code is greater with MVC patterns and for simple systems I have
seen an argument against it. On the other hand, initially simple systems
tend to grow in complexity over time, so the additional effort can be
justified in many cases. I have had an experience where a very advanced
client/server system did not employ the kind of segmentation that would
allow it to be migrated to the web environment. The investment in that
effort was lost.
Hope some of this helps.
Phil
-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Sajith A
Sent: Friday, March 04, 2005 3:31 AM
To: NYPHP Talk
Subject: [nycphp-talk] Php Framework
Hello,
Could someone please suggest a good framework for php5 that separates
business logic and presentation. Also i would like to know whether
there it is advisable to go for MVC pattern in php development.
Thanks and regards
Sajith A
_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org
From chsnyder at gmail.com Fri Mar 4 09:01:26 2005
From: chsnyder at gmail.com (csnyder)
Date: Fri, 4 Mar 2005 09:01:26 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <20050304135121.76F2DA8774@virtu.nyphp.org>
References:
<20050304135121.76F2DA8774@virtu.nyphp.org>
Message-ID:
I could not wake up and face the day without MVC, or whatever bastard
version of the pattern I happen to be using. Not only is it possible
with PHP, it's highly recommended for maintainability (and therefore
security).
I don't buy the argument that more code is involved, at least not for
any system more complex than a simple weblog. Writing a framework to
take care of the infrastructure of parsing and responding to HTTP (or
whatever) requests allows you to concentrate day to day on business
logic and display routines.
I think that, like a CMS, your choice of framework is highly
subjective. Unless you fall in love on first sight you will probably
end up writing your own.
From yury at heavenspa.com Fri Mar 4 09:06:30 2005
From: yury at heavenspa.com (Yury Rush)
Date: Fri, 4 Mar 2005 09:06:30 -0500
Subject: [nycphp-talk] Man, this is the best
In-Reply-To: <4227ECB9.7000602@magpie.com>
Message-ID:
Makes you wanna get out on the highway and .... pass some people :P
Long live the BMW!
regards
Yury
-----Original Message-----
From: talk-bounces at lists.nyphp.org
[mailto:talk-bounces at lists.nyphp.org]On Behalf Of Steve Manes
Sent: Friday, March 04, 2005 12:06 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Man, this is the best
Steve Manes wrote:
>
> Completely mesmerizing!
>
> http://www.dgtalpimp.com/m3_gtr_nurburgring.wmv
>
> (...it ain't your neighbor's SUV)
Sorry!!! Wrong 'talk@' list! Apologies...
_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org
From brent at landover.com Fri Mar 4 09:12:25 2005
From: brent at landover.com (Brent Baisley)
Date: Fri, 4 Mar 2005 09:12:25 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To:
References:
Message-ID: <8886518b2a106399fd999b038edbfb91@landover.com>
I would say MVC would most definitely be advisable. However, I would
employ MVC more as a technique to adhere to for whatever framework you
end up using, whether it be custom or someone else's. Just like you've
probably never designed a database that reached 5th level
normalization, you probably won't get a perfect separation of Model,
View and Controller code. But employing the MVC design pattern, and
design patterns in general, will make things easier to maintain and
make changes to.
On Mar 4, 2005, at 3:30 AM, Sajith A wrote:
> Hello,
> Could someone please suggest a good framework for php5 that separates
> business logic and presentation. Also i would like to know whether
> there it is advisable to go for MVC pattern in php development.
> Thanks and regards
> Sajith A
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
From php at haberco.com Fri Mar 4 09:15:10 2005
From: php at haberco.com (Eddie Haber)
Date: Fri, 04 Mar 2005 09:15:10 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To:
Message-ID:
What Brent is nicely trying to say is MVC is not a framework. It is a
methodology or technique.
JAVA has the best frameworks for enterprise development like Jboss, It would
great for PHP to have a robust application framework that was in standard
use and distributed with the language.
E
On 3/4/05 9:01 AM, "csnyder" wrote:
> I could not wake up and face the day without MVC, or whatever bastard
> version of the pattern I happen to be using. Not only is it possible
> with PHP, it's highly recommended for maintainability (and therefore
> security).
>
> I don't buy the argument that more code is involved, at least not for
> any system more complex than a simple weblog. Writing a framework to
> take care of the infrastructure of parsing and responding to HTTP (or
> whatever) requests allows you to concentrate day to day on business
> logic and display routines.
>
> I think that, like a CMS, your choice of framework is highly
> subjective. Unless you fall in love on first sight you will probably
> end up writing your own.
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
From george at omniti.com Fri Mar 4 09:19:48 2005
From: george at omniti.com (George Schlossnagle)
Date: Fri, 4 Mar 2005 09:19:48 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To:
References:
Message-ID: <7a3f04a66ddf6edffa7de66c7e405631@omniti.com>
On Mar 4, 2005, at 9:15 AM, Eddie Haber wrote:
> What Brent is nicely trying to say is MVC is not a framework. It is a
> methodology or technique.
>
> JAVA has the best frameworks for enterprise development like Jboss, It
> would
> great for PHP to have a robust application framework that was in
> standard
> use and distributed with the language.
There's a strong argument that PHP itself is a framework, and that
anything you build on top of it is a meta-framework.
George
From james at 2-bit-toys.com Fri Mar 4 13:25:00 2005
From: james at 2-bit-toys.com (James Tu)
Date: Fri, 04 Mar 2005 10:25:00 -0800
Subject: [nycphp-talk] best versions of apache and php to run together
Message-ID: <6.2.0.14.0.20050304102030.03305650@www.2-bit-toys.com>
I'm a newbie to AMP, but I've on teams where they were using Apache 1.3x
and PHP 4.x.
What is the most stable version of Apache and PHP to run together?
Would you recommend Windows or Linux? When (what volume of transactions)
would I really have to consider between Windows or Linux?
Thanks.
James Tu
james at 2-bit-toys.com
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.6.0 - Release Date: 3/2/2005
From lists at zaunere.com Fri Mar 4 10:51:33 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Fri, 4 Mar 2005 10:51:33 -0500
Subject: [nycphp-talk] best versions of apache and php to run together
In-Reply-To: <6.2.0.14.0.20050304102030.03305650@www.2-bit-toys.com>
Message-ID: <20050304155138.B1560A8774@virtu.nyphp.org>
> I'm a newbie to AMP, but I've on teams where they were using Apache 1.3x
> and PHP 4.x.
>
> What is the most stable version of Apache and PHP to run together?
This is always a hot topic of discussion, but at the end of the day, most will probably agree that the latest 1.3.x of Apache and latest 4.x of PHP is the most stable. I've also had good luck with PHP 5.x, but there's a lot of new code in there, so it's just not as mature as 4.x.
> Would you recommend Windows or Linux? When (what volume of transactions)
> would I really have to consider between Windows or Linux?
I'd of course go with Linux or FreeBSD, and a UNIX will almost always be more efficient that a Windows. That said, there are a lot of people deploying very large systems on Windows, and it does work fine. If you have the system administration know how in house, go with a UNIX.
H
From james at 2-bit-toys.com Fri Mar 4 13:49:03 2005
From: james at 2-bit-toys.com (James Tu)
Date: Fri, 04 Mar 2005 10:49:03 -0800
Subject: [nycphp-talk] best versions of apache and php to run
together
In-Reply-To: <20050304155138.B1560A8774@virtu.nyphp.org>
References: <6.2.0.14.0.20050304102030.03305650@www.2-bit-toys.com>
<20050304155138.B1560A8774@virtu.nyphp.org>
Message-ID: <6.2.0.14.0.20050304104735.032c0df0@www.2-bit-toys.com>
Thanks Hans! I'll probably stick with Windows, Apache 1.3x and PHP 4.x.
-JT
At 07:51 AM 3/4/2005, you wrote:
> > I'm a newbie to AMP, but I've on teams where they were using Apache 1.3x
> > and PHP 4.x.
> >
> > What is the most stable version of Apache and PHP to run together?
>
>This is always a hot topic of discussion, but at the end of the day, most
>will probably agree that the latest 1.3.x of Apache and latest 4.x of PHP
>is the most stable. I've also had good luck with PHP 5.x, but there's a
>lot of new code in there, so it's just not as mature as 4.x.
>
> > Would you recommend Windows or Linux? When (what volume of transactions)
> > would I really have to consider between Windows or Linux?
>
>I'd of course go with Linux or FreeBSD, and a UNIX will almost always be
>more efficient that a Windows. That said, there are a lot of people
>deploying very large systems on Windows, and it does work fine. If you
>have the system administration know how in house, go with a UNIX.
>
>H
>
>
>_______________________________________________
>New York PHP Talk Mailing List
>AMP Technology
>Supporting Apache, MySQL and PHP
>http://lists.nyphp.org/mailman/listinfo/talk
>http://www.nyphp.org
>
>
>
>
>
>--
>No virus found in this incoming message.
>Checked by AVG Anti-Virus.
>Version: 7.0.308 / Virus Database: 266.6.0 - Release Date: 3/2/2005
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.6.0 - Release Date: 3/2/2005
From codebowl at gmail.com Fri Mar 4 11:25:41 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Fri, 4 Mar 2005 11:25:41 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <7a3f04a66ddf6edffa7de66c7e405631@omniti.com>
References:
<7a3f04a66ddf6edffa7de66c7e405631@omniti.com>
Message-ID: <8d9a428005030408252cd069fe@mail.gmail.com>
i believe PHP is a sort of framework but it's not an OO framework, i
think php should move itself to be more OO and it would be considered
a framework, i mean rather than mysql_fetch_array it could be
something like DB->MySQL->FetchArray() DB->MsSQL->FetchArray() all of
which is possible to do by writing abstraction layers but a out of the
box solution that was the standard for php would be great :D
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From george at omniti.com Fri Mar 4 11:31:25 2005
From: george at omniti.com (George Schlossnagle)
Date: Fri, 4 Mar 2005 11:31:25 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <8d9a428005030408252cd069fe@mail.gmail.com>
References:
<7a3f04a66ddf6edffa7de66c7e405631@omniti.com>
<8d9a428005030408252cd069fe@mail.gmail.com>
Message-ID: <7d29eb836a03e37fdf7eb68629e26345@omniti.com>
On Mar 4, 2005, at 11:25 AM, Joseph Crawford wrote:
> i believe PHP is a sort of framework but it's not an OO framework, i
> think php should move itself to be more OO and it would be considered
> a framework, i mean rather than mysql_fetch_array it could be
> something like DB->MySQL->FetchArray() DB->MsSQL->FetchArray() all of
> which is possible to do by writing abstraction layers but a out of the
> box solution that was the standard for php would be great :D
Besides the fact that this particular example is covered entirely by
PDO (new db interface layer becoming standard in 5.1), why does
everything need to be OO? I like OO as much as the next guy (at least
as much as some next guys), but I have yet to see many examples that
demonstrate where a lack of an OOP access pattern to some core PHP
facility is really, truly, insurmountably less usable than the
procedural way.
George
From tom at supertom.com Fri Mar 4 11:56:38 2005
From: tom at supertom.com (Tom Melendez)
Date: Fri, 04 Mar 2005 11:56:38 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <7d29eb836a03e37fdf7eb68629e26345@omniti.com>
References:
<7a3f04a66ddf6edffa7de66c7e405631@omniti.com>
<8d9a428005030408252cd069fe@mail.gmail.com>
<7d29eb836a03e37fdf7eb68629e26345@omniti.com>
Message-ID: <42289346.60903@supertom.com>
Well, I wasn't going to get involved in this discussion, but since
George threw his hat in, I have to back him up.
I agree with George. OO is a great way to keep things organized and
modular, but I'm not thrilled with "everything" being OO for no
particular reason.
It is ironic that it is going this way, as I met Rasmus at the BOF at
Linuxworld in 1999 (I believe it was then, there was only six or seven
of us there), and he specifically said that he DIDN'T believe PHP needed
OO, which was why it wasn't truly implemented back then. In hindsight, I
can't say I totally agree, as I think having the OO functionality is a
good thing. But, who does the "Java-esque" syntax and features of PHP5
really benefit?
Tom
http://www.liphp.org
George Schlossnagle wrote:
>
> On Mar 4, 2005, at 11:25 AM, Joseph Crawford wrote:
>
>> i believe PHP is a sort of framework but it's not an OO framework, i
>> think php should move itself to be more OO and it would be considered
>> a framework, i mean rather than mysql_fetch_array it could be
>> something like DB->MySQL->FetchArray() DB->MsSQL->FetchArray() all of
>> which is possible to do by writing abstraction layers but a out of the
>> box solution that was the standard for php would be great :D
>
>
> Besides the fact that this particular example is covered entirely by
> PDO (new db interface layer becoming standard in 5.1), why does
> everything need to be OO? I like OO as much as the next guy (at least
> as much as some next guys), but I have yet to see many examples that
> demonstrate where a lack of an OOP access pattern to some core PHP
> facility is really, truly, insurmountably less usable than the
> procedural way.
>
> George
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From george at omniti.com Fri Mar 4 11:59:13 2005
From: george at omniti.com (George Schlossnagle)
Date: Fri, 4 Mar 2005 11:59:13 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <42289346.60903@supertom.com>
References:
<7a3f04a66ddf6edffa7de66c7e405631@omniti.com>
<8d9a428005030408252cd069fe@mail.gmail.com>
<7d29eb836a03e37fdf7eb68629e26345@omniti.com>
<42289346.60903@supertom.com>
Message-ID: <3957aebd9d01a1b84e5f4a98b2745490@omniti.com>
On Mar 4, 2005, at 11:56 AM, Tom Melendez wrote:
> Well, I wasn't going to get involved in this discussion, but since
> George threw his hat in, I have to back him up.
>
> I agree with George. OO is a great way to keep things organized and
> modular, but I'm not thrilled with "everything" being OO for no
> particular reason.
>
> It is ironic that it is going this way, as I met Rasmus at the BOF at
> Linuxworld in 1999 (I believe it was then, there was only six or seven
> of us there), and he specifically said that he DIDN'T believe PHP
> needed OO, which was why it wasn't truly implemented back then. In
> hindsight, I can't say I totally agree, as I think having the OO
> functionality is a good thing. But, who does the "Java-esque" syntax
> and features of PHP5 really benefit?
I think the java-esque syntax and features in php5 benefit the people
who like OOP. PHP3/4's OO model was built by people who didn't like
OOP and didn't really want it in the language. And it shows. PHP5's
support is nice, imho. It adds a number of 'standard' OOP features
that people who like to use OOP expect and appreciate. I like where
PHP5's OOP support is going because it (again, imho) keeps along the
lines of 'A language with good OOP support' and not 'A good OOP
language'. That's a fine semantic difference that means alot to me.
George
From phil at bearingasset.com Fri Mar 4 13:05:53 2005
From: phil at bearingasset.com (Phil Duffy)
Date: Fri, 4 Mar 2005 13:05:53 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <8f494f76050304043630a04213@mail.gmail.com>
Message-ID: <20050304180547.C8622A8774@virtu.nyphp.org>
Alex,
What kind of documentation exists for Flexy?
Phil
-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Alex C
Sent: Friday, March 04, 2005 7:36 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Php Framework
I really like Flexy Template in Pear.
alex
On Fri, 4 Mar 2005 14:00:36 +0530, Sajith A wrote:
> Hello,
> Could someone please suggest a good framework for php5 that separates
> business logic and presentation. Also i would like to know whether
> there it is advisable to go for MVC pattern in php development.
> Thanks and regards
> Sajith A
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org
From alexchan.1976 at gmail.com Fri Mar 4 13:27:05 2005
From: alexchan.1976 at gmail.com (Alex C)
Date: Fri, 4 Mar 2005 13:27:05 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <20050304180547.C8622A8774@virtu.nyphp.org>
References: <8f494f76050304043630a04213@mail.gmail.com>
<20050304180547.C8622A8774@virtu.nyphp.org>
Message-ID: <8f494f76050304102761fdc182@mail.gmail.com>
Phil,
The only documentation is on pear manual site.
alex
On Fri, 4 Mar 2005 13:05:53 -0500, Phil Duffy wrote:
> Alex,
>
> What kind of documentation exists for Flexy?
>
> Phil
>
> -----Original Message-----
> From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
> Behalf Of Alex C
> Sent: Friday, March 04, 2005 7:36 AM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] Php Framework
>
> I really like Flexy Template in Pear.
> alex
>
> On Fri, 4 Mar 2005 14:00:36 +0530, Sajith A wrote:
> > Hello,
> > Could someone please suggest a good framework for php5 that separates
> > business logic and presentation. Also i would like to know whether
> > there it is advisable to go for MVC pattern in php development.
> > Thanks and regards
> > Sajith A
> > _______________________________________________
> > New York PHP Talk Mailing List
> > AMP Technology
> > Supporting Apache, MySQL and PHP
> > http://lists.nyphp.org/mailman/listinfo/talk
> > http://www.nyphp.org
> >
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From chsnyder at gmail.com Fri Mar 4 13:39:01 2005
From: chsnyder at gmail.com (csnyder)
Date: Fri, 4 Mar 2005 13:39:01 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <42289346.60903@supertom.com>
References:
<7a3f04a66ddf6edffa7de66c7e405631@omniti.com>
<8d9a428005030408252cd069fe@mail.gmail.com>
<7d29eb836a03e37fdf7eb68629e26345@omniti.com>
<42289346.60903@supertom.com>
Message-ID:
On Fri, 04 Mar 2005 11:56:38 -0500, Tom Melendez wrote:
> But, who does the "Java-esque" syntax and features of PHP5
> really benefit?
PHP developers who have "grown up" with the language really need to
know about the best uses for these features, because they aren't
immediately obvious.
Interfaces, for instance, have the potential to make a lot of open
source PHP applications more modular. Don't like the database layer
that ships with that CMS? Drop in another class that implements the
same interface. Don't like the authentication mechanism? Drop in a
class that implements the same interface, but authenticates to LDAP
instead of a local database.
If the developers have done their job and stuck to the declared
interface, it will all "just work".
Unfortunately, I think we're years away from having a standard
collection of useful, well-defined generic interfaces that developers
would be willing to implement in their classes and use in their
applications. I'd love to see NYPHP leading the way on this, but as
with everything else, finding the time and expertise to put it
together is difficult.
From Cbielanski at inta.org Fri Mar 4 13:45:32 2005
From: Cbielanski at inta.org (Chris Bielanski)
Date: Fri, 4 Mar 2005 13:45:32 -0500
Subject: [nycphp-talk] Php Framework
Message-ID: <43387D79FA1DB74AA876E4C3F4867D320C8217@intamail1.ny.inta.org>
Isn't this some of the case argued for STL in C++? If it's a similar case at
all, then, like C++, it could be 15+ years before all the interfaces can be
defined, ratified and developed.
Just food for thought. My experience is that most programmers, me included,
use only minimal features as provided by OO - primarily inheritance.
Everything else is still GOPP (Good Ol' Procedural Programming) wrapped in
methods and members. Your mileage may vary :)
Thanks,
Chris Bielanski
Web Programmer,
International Trademark Association,
655 Third Avenue, 10th Floor
New York, NY 10017-5617 USA
+1 (212) 642-1745, f: +1 (212) 768-7796
mailto:cbielanski at inta.org, www.inta.org
INTA -- 125 Years of Excellence
> -----Original Message-----
> From: csnyder [mailto:chsnyder at gmail.com]
> Sent: Friday, March 04, 2005 1:39 PM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] Php Framework
>
>
> On Fri, 04 Mar 2005 11:56:38 -0500, Tom Melendez
> wrote:
> > But, who does the "Java-esque" syntax and features of PHP5
> > really benefit?
>
> PHP developers who have "grown up" with the language really need to
> know about the best uses for these features, because they aren't
> immediately obvious.
>
> Interfaces, for instance, have the potential to make a lot of open
> source PHP applications more modular. Don't like the database layer
> that ships with that CMS? Drop in another class that implements the
> same interface. Don't like the authentication mechanism? Drop in a
> class that implements the same interface, but authenticates to LDAP
> instead of a local database.
>
> If the developers have done their job and stuck to the declared
> interface, it will all "just work".
>
> Unfortunately, I think we're years away from having a standard
> collection of useful, well-defined generic interfaces that developers
> would be willing to implement in their classes and use in their
> applications. I'd love to see NYPHP leading the way on this, but as
> with everything else, finding the time and expertise to put it
> together is difficult.
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From codebowl at gmail.com Fri Mar 4 13:49:23 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Fri, 4 Mar 2005 13:49:23 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <43387D79FA1DB74AA876E4C3F4867D320C8217@intamail1.ny.inta.org>
References: <43387D79FA1DB74AA876E4C3F4867D320C8217@intamail1.ny.inta.org>
Message-ID: <8d9a4280050304104973273619@mail.gmail.com>
i know i use OO every chance i get i love the flexability
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From 1j0lkq002 at sneakemail.com Fri Mar 4 14:06:15 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Fri, 04 Mar 2005 14:06:15 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <43387D79FA1DB74AA876E4C3F4867D320C8217@intamail1.ny.inta.org>
References: <43387D79FA1DB74AA876E4C3F4867D320C8217@intamail1.ny.inta.org>
Message-ID: <21774-78214@sneakemail.com>
Chris Bielanski Cbielanski-at-inta.org |nyphp dev/internal group use| wrote:
>Isn't this some of the case argued for STL in C++? If it's a similar case at all, then, like C++, it could be 15+ years before all the interfaces can be
>defined, ratified and developed.
>
brings back painful memories.
When introduced as a solution, C++ IOStreams were breathtaking in
concept. But implementations that worked were just as proprietary as
anything else (my perspective anyway). I gave up with it all after too
many hours juggling the "stable" outdated MFC (no templates), the Draft
ANSI standard (emerging STL), and the fact that comercial products at
the time handled the problem by picking ONE compiler to support (in
my case it was.... WATCOM !).
I think the solution is to be the boss. That way you can define the
interface and all the code will always work with it :-)
From flakie at gmail.com Fri Mar 4 15:16:14 2005
From: flakie at gmail.com (Eric Rank)
Date: Fri, 4 Mar 2005 14:16:14 -0600
Subject: [nycphp-talk] Php Framework
In-Reply-To: <8f494f76050304043630a04213@mail.gmail.com>
References:
<8f494f76050304043630a04213@mail.gmail.com>
Message-ID:
Sajith,
A reasonably good MVC architecture, named Seagull, is here:
http://seagull.phpkitchen.com/
It is developed as a full blown CMS. I didn't want to submit entirely
to it's means of taking care of content, but I found the design and
flow to be very nce. After figuring out how it worked, I stripped it
down to the barebones, and began developing custom modules for it.
I'll back up Alex when it comes to the Flexy templating system. The
forementioned architecture uses them, and man, it couldn't make
separating Busines logic from presentation any easier. It's reasonably
quick to learn too.
Eric Rank
On Fri, 4 Mar 2005 07:36:17 -0500, Alex C wrote:
> I really like Flexy Template in Pear.
> alex
>
>
> On Fri, 4 Mar 2005 14:00:36 +0530, Sajith A wrote:
> > Hello,
> > Could someone please suggest a good framework for php5 that separates
> > business logic and presentation. Also i would like to know whether
> > there it is advisable to go for MVC pattern in php development.
> > Thanks and regards
> > Sajith A
From sajith.ml at gmail.com Fri Mar 4 16:54:22 2005
From: sajith.ml at gmail.com (Sajith A)
Date: Sat, 5 Mar 2005 03:24:22 +0530
Subject: [nycphp-talk] Php Framework
In-Reply-To: <8d9a4280050304044737468ff8@mail.gmail.com>
References: <8f494f76050304043630a04213@mail.gmail.com>
<8d9a4280050304044737468ff8@mail.gmail.com>
Message-ID:
Joseph Crawford wrote:
> there's always Prado
> http://www.xisc.com/
Thank you Joseph for your time. I've heard before that Prado is
inspired by tapestry and dotnet's component model. After seeing the
code which involves xml parsing heavily, i doubt whether it will pose
any performance overheads. I also doubt how much help will caching do
to increase performance in a web application having dynamic data.
Thank you
From lists at zaunere.com Fri Mar 4 20:34:32 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Fri, 4 Mar 2005 20:34:32 -0500
Subject: [nycphp-talk] Re: Safely running root commands
In-Reply-To: <20050302233742.GA32073@uranus.faber.nom>
Message-ID: <0MKyxe-1D7OBd3erx-00047d@mrelay.perfora.net>
> Okay, since you guys suggested I run my root commands from a daemon,
> I've been playing with that for the past couple of days. I stole^W
> copied one of the perl daemons listed in "perldoc perlipc'
> (http://www.linuxnj.com/personal/qui_server.pl) and I used the sample
> PHP client from the website manual
> (http://www.linuxnj.com/personal/qui_client.php).
>
> If I manually telnet to the daemon and give the commands "ls" and
> "quit", the daemon responds with a dir listing and quits. When I try to
> do the same thing via the PHP client, I get a dir listing and then it sits
> there.
>
> I've made every modification I can think of and nothing makes the PHP
> client work like the manual (telnet) client. I Assume there is
> something about sockets I don't grok, but every example I've seen of
> this in different languages is what I have working manually.
The PHP link above doesn't seem to be alive so it's hard to tell without any code. Probably an error in the way you're working with the sockets as you say.
H
From faber at linuxnj.com Fri Mar 4 20:55:47 2005
From: faber at linuxnj.com (Faber Fedor)
Date: Fri, 4 Mar 2005 20:55:47 -0500
Subject: [nycphp-talk] Re: Safely running root commands
In-Reply-To: <0MKyxe-1D7OBd3erx-00047d@mrelay.perfora.net>
References: <20050302233742.GA32073@uranus.faber.nom>
<0MKyxe-1D7OBd3erx-00047d@mrelay.perfora.net>
Message-ID: <20050305015547.GA12501@uranus.faber.nom>
On 04/03/05 20:34 -0500, Hans Zaunere wrote:
> The PHP link above doesn't seem to be alive so it's hard to tell without any code. Probably an error in the way you're working with the sockets as you say.
>
True. I've since gotten a new perl server/daemon and am playing with
that. I'm making some progress, but it's slooooooooowwwwwwwwwwwwwwww.
--
Regards,
Faber
Linux New Jersey: Open Source Solutions for New Jersey
http://www.linuxnj.com
From sajith.ml at gmail.com Sat Mar 5 00:09:44 2005
From: sajith.ml at gmail.com (Sajith A)
Date: Sat, 5 Mar 2005 10:39:44 +0530
Subject: [nycphp-talk] Php Framework
In-Reply-To:
References: <8f494f76050304043630a04213@mail.gmail.com>
<8d9a4280050304044737468ff8@mail.gmail.com>
Message-ID:
While searching for frameworks i came across this link.
http://wact.sourceforge.net/index.php/MvcFrameworksWrittenInPhp
Quoting....
-------------------------
One difference between the Java based Struts[MVC framework] and PHP is
the way in which http request dispatch is accomplished. Struts uses an
XML file to map http requests onto Java objects and PHP ports of
Struts must also construct such a mapping. In Struts, the objects that
represents this mapping are persistent in the java virtual machine
between requests. In the PHP ports, no state is retained between
requests. This means that the mapping is reparsed or reloaded on every
request. This adds a per request processing overhead to using this
FrontController pattern in PHP which does not exist in Java.
(Actually, java pays for the overhead in RAM usage instead of CPU
usage.)
-------------------------
I was having a similar doubt in my mind. Will caching the parsed xml
in someway help to improve the performance.
Intersting to see that Ben Ramsey is giving a presentation in
International PHP Conference 2005 - "Framing the Frameworks: What Are
They and Do I Need One? " But that will be in may only. He has also
asked for case studies here .
http://benramsey.com/2004/11/29/case-studies-for-php-based-frameworks/.
it would have been really helpful if he had shared some info in his
webside before may.
I hope many people here have developed medium to large scale apps in
php. Have you people personally used any open-source frameworks or
did u make one of your own? - and was it mvc.
Thanks and regards.
From chsnyder at gmail.com Sat Mar 5 03:56:08 2005
From: chsnyder at gmail.com (csnyder)
Date: Sat, 5 Mar 2005 03:56:08 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To:
References: <8f494f76050304043630a04213@mail.gmail.com>
<8d9a4280050304044737468ff8@mail.gmail.com>
Message-ID:
On Sat, 5 Mar 2005 10:39:44 +0530, Sajith A wrote:
> Will caching the parsed xml
> in someway help to improve the performance.
Probably. Take a look at serialize().
http://www.php.net/serialize
From gatzby3jr at gmail.com Sat Mar 5 16:37:52 2005
From: gatzby3jr at gmail.com (Brian O'Connor)
Date: Sat, 5 Mar 2005 16:37:52 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To:
References: <8f494f76050304043630a04213@mail.gmail.com>
<8d9a4280050304044737468ff8@mail.gmail.com>
Message-ID: <29da5d15050305133736561b2d@mail.gmail.com>
I'm relatively new to php to some of you guys ... can someone explain
to me what php framework is used for?
On Sat, 5 Mar 2005 03:56:08 -0500, csnyder wrote:
> On Sat, 5 Mar 2005 10:39:44 +0530, Sajith A wrote:
> > Will caching the parsed xml
> > in someway help to improve the performance.
>
> Probably. Take a look at serialize().
> http://www.php.net/serialize
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
--
Brian O'Connor
From codebowl at gmail.com Sat Mar 5 17:03:12 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Sat, 5 Mar 2005 17:03:12 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <29da5d15050305133736561b2d@mail.gmail.com>
References: <8f494f76050304043630a04213@mail.gmail.com>
<8d9a4280050304044737468ff8@mail.gmail.com>
<29da5d15050305133736561b2d@mail.gmail.com>
Message-ID: <8d9a4280050305140378704c94@mail.gmail.com>
it is an object oriented framework, basically a collection of classes
and functions that you use. Object oriented code is great for code
reuse, if designed properly you can use the same function over and
over for many things and more functons are not needed.
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From gatzby3jr at gmail.com Sat Mar 5 17:09:24 2005
From: gatzby3jr at gmail.com (Brian O'Connor)
Date: Sat, 5 Mar 2005 17:09:24 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <8d9a4280050305140378704c94@mail.gmail.com>
References: <8f494f76050304043630a04213@mail.gmail.com>
<8d9a4280050304044737468ff8@mail.gmail.com>
<29da5d15050305133736561b2d@mail.gmail.com>
<8d9a4280050305140378704c94@mail.gmail.com>
Message-ID: <29da5d15050305140929e71ea5@mail.gmail.com>
Ah, I'm not really that really great at writing anything oo so I guess
I should focus on that before I get into pre-built frameworks.
On Sat, 5 Mar 2005 17:03:12 -0500, Joseph Crawford wrote:
> it is an object oriented framework, basically a collection of classes
> and functions that you use. Object oriented code is great for code
> reuse, if designed properly you can use the same function over and
> over for many things and more functons are not needed.
>
> --
> Joseph Crawford Jr.
> Codebowl Solutions
> codebowl at gmail.com
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
--
Brian O'Connor
From tgales at tgaconnect.com Sat Mar 5 19:45:37 2005
From: tgales at tgaconnect.com (Tim Gales)
Date: Sat, 5 Mar 2005 19:45:37 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To: <29da5d15050305133736561b2d@mail.gmail.com>
Message-ID: <009e01c521e5$d03af7c0$d0893818@oberon1>
Brian O'Connor writes:
> I'm relatively new to php to some of you guys ... can someone
> explain to me what php framework is used for?
I am not 100% sure what a framework is.
It seems to me that a framework is a set of reusable
software components which can be readily used to solve a
class of problems.
I don't think object oriented design is involved as a
requirement for a set of components to be considered
a framework.
T. Gales & Associates
'Helping People Connect with Technology'
http://www.tgaconnect.com
"If PHP is anything, then its a framework,
which includes a really cute scripting language"
-- Sterling Hughes
Weblog, Friday, November 28. 2003
From dmintz at davidmintz.org Sun Mar 6 16:24:47 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Sun, 6 Mar 2005 16:24:47 -0500 (EST)
Subject: [nycphp-talk] how about a nice discount on Zend 4?
Message-ID:
Dear Zend:
How about a nice fat discount for NYPHPers who already own Zend 3 and want
to upgrade to Zend Studio 4 Professional?
(-:
---
David Mintz
http://davidmintz.org/
From sol2ray at gmail.com Sun Mar 6 22:43:34 2005
From: sol2ray at gmail.com (Sol Toure)
Date: Sun, 6 Mar 2005 22:43:34 -0500
Subject: [nycphp-talk] EI only please!!!
Message-ID: <4a67dc390503061943744c0c3a@mail.gmail.com>
Hi everyone.
I've got the following error message trying to access movielink.com
with MOZILLA browser:
" Sorry, but in order to enjoy the Movielink service you must use
Internet Explorer 5.0 or higher, which supports certain technologies
we utilize for downloading movies. Click here to get the latest
version of Internet Explorer.
We do not support Mozilla or Netscape. We apologize for any
inconvenience this may cause."
OT but I thought I'd ask you guyz opinion on it.
Sol
From cmerlo441 at gmail.com Sun Mar 6 22:59:24 2005
From: cmerlo441 at gmail.com (Christopher Merlo)
Date: Sun, 6 Mar 2005 22:59:24 -0500
Subject: [nycphp-talk] EI only please!!!
In-Reply-To: <4a67dc390503061943744c0c3a@mail.gmail.com>
References: <4a67dc390503061943744c0c3a@mail.gmail.com>
Message-ID: <94658648050306195942eb35fb@mail.gmail.com>
On Sun, 6 Mar 2005 22:43:34 -0500, Sol Toure wrote:
> We do not support Mozilla or Netscape. We apologize for any
> inconvenience this may cause."
>
> OT but I thought I'd ask you guyz opinion on it.
If I were inclined to complain to companies about this any more, I'd
simply inform them that the only inconvenience is theirs -- losing my
business.
--
cmerlo441 at gmail.com
http://www.theyellowbox.com/
From george at omniti.com Sun Mar 6 23:19:54 2005
From: george at omniti.com (George Schlossnagle)
Date: Sun, 6 Mar 2005 23:19:54 -0500
Subject: [nycphp-talk] EI only please!!!
In-Reply-To: <4a67dc390503061943744c0c3a@mail.gmail.com>
References: <4a67dc390503061943744c0c3a@mail.gmail.com>
Message-ID: <55294044544960f8bd2f9bdb0d584aed@omniti.com>
On Mar 6, 2005, at 10:43 PM, Sol Toure wrote:
> Hi everyone.
>
> I've got the following error message trying to access movielink.com
> with MOZILLA browser:
>
> " Sorry, but in order to enjoy the Movielink service you must use
> Internet Explorer 5.0 or higher, which supports certain technologies
> we utilize for downloading movies. Click here to get the latest
> version of Internet Explorer.
> We do not support Mozilla or Netscape. We apologize for any
> inconvenience this may cause."
>
> OT but I thought I'd ask you guyz opinion on it.
What's the point of having an opinion on it? They've cut off roughly
13% of their potential users. Hopefully (for them) they weighed their
options before they did so. In their case, it seems that they used
DRM'd media that's only supported on Windows. Whether or that was a
stupid decision on their part is their own calculus. Us debating the
wisdom of it is rather pointless.
George
From kushner at gmail.com Sun Mar 6 23:52:20 2005
From: kushner at gmail.com (Daniel Kushner)
Date: Sun, 6 Mar 2005 20:52:20 -0800
Subject: [nycphp-talk] how about a nice discount on Zend 4?
In-Reply-To:
References:
Message-ID: <7ac626ed05030620522031aed9@mail.gmail.com>
Hi David,
I'll get something out to Hans Zaunere in the next few days.
Best,
Daniel
______________________________________
Director of Education
Zend Technologies Ltd.
Zend Certified Engineer
http://zend.com/zce.php?c=ZEND001047&r=209122599
Tel: +1 (408) 253-8800
Fax: +1 (408) 253-8801
daniel at zend.com
http://www.zend.com
==================================================================
Learn PHP from the experts
http://www.zend.com/training/courses
==================================================================
On Sun, 6 Mar 2005 16:24:47 -0500 (EST), David Mintz
wrote:
>
> Dear Zend:
>
> How about a nice fat discount for NYPHPers who already own Zend 3 and want
> to upgrade to Zend Studio 4 Professional?
>
> (-:
>
> ---
> David Mintz
> http://davidmintz.org/
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From nyphp at aspl.in Mon Mar 7 00:27:57 2005
From: nyphp at aspl.in (Anirudh Zala)
Date: Mon, 7 Mar 2005 10:57:57 +0530
Subject: [nycphp-talk] Php Framework
References: <8f494f76050304043630a04213@mail.gmail.com>
Message-ID: <013d01c522d6$840f7b40$10cc000a@aum1>
Another good and simplest example of MVC architecture is
"class.rFastTemplate.php". Follow below link
http://www.linuxjournal.com/article/4573 Maybe many programmers are familiar
with this.
Thanks
Zala
----- Original Message -----
From: "Eric Rank"
To: "NYPHP Talk"
Sent: Saturday, March 05, 2005 1:46 AM
Subject: Re: [nycphp-talk] Php Framework
> Sajith,
>
> A reasonably good MVC architecture, named Seagull, is here:
>
> http://seagull.phpkitchen.com/
>
> It is developed as a full blown CMS. I didn't want to submit entirely
> to it's means of taking care of content, but I found the design and
> flow to be very nce. After figuring out how it worked, I stripped it
> down to the barebones, and began developing custom modules for it.
>
> I'll back up Alex when it comes to the Flexy templating system. The
> forementioned architecture uses them, and man, it couldn't make
> separating Busines logic from presentation any easier. It's reasonably
> quick to learn too.
>
> Eric Rank
>
>
>
>
>
>
> On Fri, 4 Mar 2005 07:36:17 -0500, Alex C wrote:
> > I really like Flexy Template in Pear.
> > alex
> >
> >
> > On Fri, 4 Mar 2005 14:00:36 +0530, Sajith A wrote:
> > > Hello,
> > > Could someone please suggest a good framework for php5 that separates
> > > business logic and presentation. Also i would like to know whether
> > > there it is advisable to go for MVC pattern in php development.
> > > Thanks and regards
> > > Sajith A
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From nestorflorez at earthlink.net Mon Mar 7 00:34:11 2005
From: nestorflorez at earthlink.net (Nestor Florez)
Date: Sun, 6 Mar 2005 21:34:11 -0800 (GMT-08:00)
Subject: [nycphp-talk] EI only please!!!
Message-ID: <2642286.1110173651188.JavaMail.root@gonzo.psp.pas.earthlink.net>
There is an extension IEVIEW that could add to your mozilla to
help you see some of those site. I hope this helps.
Nestor :-)
-----Original Message-----
From: George Schlossnagle
Sent: Mar 6, 2005 8:19 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] EI only please!!!
On Mar 6, 2005, at 10:43 PM, Sol Toure wrote:
> Hi everyone.
>
> I've got the following error message trying to access movielink.com
> with MOZILLA browser:
>
> " Sorry, but in order to enjoy the Movielink service you must use
> Internet Explorer 5.0 or higher, which supports certain technologies
> we utilize for downloading movies. Click here to get the latest
> version of Internet Explorer.
> We do not support Mozilla or Netscape. We apologize for any
> inconvenience this may cause."
>
> OT but I thought I'd ask you guyz opinion on it.
What's the point of having an opinion on it? They've cut off roughly
13% of their potential users. Hopefully (for them) they weighed their
options before they did so. In their case, it seems that they used
DRM'd media that's only supported on Windows. Whether or that was a
stupid decision on their part is their own calculus. Us debating the
wisdom of it is rather pointless.
George
_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org
From james at 2-bit-toys.com Mon Mar 7 04:08:55 2005
From: james at 2-bit-toys.com (James Tu)
Date: Mon, 07 Mar 2005 01:08:55 -0800
Subject: [nycphp-talk] good resources for webserver and database load
balancing
In-Reply-To: <7ac626ed05030620522031aed9@mail.gmail.com>
References:
<7ac626ed05030620522031aed9@mail.gmail.com>
Message-ID: <6.2.0.14.0.20050307010649.03379950@www.2-bit-toys.com>
Hi:
I'm trying to do some research into load balancing using apache, php, and
mysql.
Any recommendation for resources. I'm doing my due diligence to search the
web, but I figured that the php community is another resource to tap.
Thanks.
-James
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.6.2 - Release Date: 3/4/2005
From jayeshsh at ceruleansky.com Mon Mar 7 11:23:10 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Mon, 07 Mar 2005 11:23:10 -0500
Subject: [nycphp-talk] PHP-GTK install how-to for Linux
Message-ID: <422C7FEE.9020405@ceruleansky.com>
Hello all,
I find PHP-GTK to be very cool, but very difficult to install on Linux.
It was, in contrast, very easy to install on Windows.
I have written up a detailed tutorial on how to do it on Xandros Linux
2.0 (Debian-based).
I did this to spare myself (and others) the agony of trying to compile
it without knowing what all the requirements and procedures all.
Also - PHP-GTK 1.0.1 has a nasty bug that results in make errors unless
it is patched before the configure stage.
These details, and more can be found at:
http://www.moztips.com/index.php?id=472
Best regards,
- Jay Sheth
From 1j0lkq002 at sneakemail.com Mon Mar 7 13:13:37 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Mon, 07 Mar 2005 13:13:37 -0500
Subject: [nycphp-talk] A chance to contribute LAMP/ PHP expertise?
In-Reply-To: <422C7FEE.9020405@ceruleansky.com>
References: <422C7FEE.9020405@ceruleansky.com>
Message-ID: <8367-87702@sneakemail.com>
Maybe OT but I don't think so.
WordPress recently updated to 1.5 and it is a well-liked FOSS PHP/MySQL
app.
Lately various users have been noting system-level problems, including
high CPU load and large numbers of simultaneous MySQL connections, and
several bloggers have been dumped by their hosts due to resource abuse
on shared servers.
The developers are discussing the issue and from the latest posts that
comment on how hard PHP canbe to debug (see the bottom of the page), I
am betting they could use a wee bit of the high-powered NYPHP LAMP
expertise I see up here every week.
Anybody care to help "solve the problem" ?
http://wordpress.org/support/topic.php?id=26372#post-148972
-=john andrews
From adam at trachtenberg.com Mon Mar 7 13:33:57 2005
From: adam at trachtenberg.com (Adam Maccabee Trachtenberg)
Date: Mon, 7 Mar 2005 13:33:57 -0500 (EST)
Subject: [nycphp-talk] A chance to contribute LAMP/ PHP expertise?
In-Reply-To: <8367-87702@sneakemail.com>
References: <422C7FEE.9020405@ceruleansky.com> <8367-87702@sneakemail.com>
Message-ID:
On Mon, 7 Mar 2005, inforequest wrote:
> Anybody care to help "solve the problem" ?
>
> http://wordpress.org/support/topic.php?id=26372#post-148972
>From a quick glance at the thread, it seems the "latest comments"
plug-in is the cause. My guess is that this is a super-expensive db
call.
Two choices. Rewrite the SQL to make this cheaper. Or, instead of
pulling the data new for every request, generate the data on a fixed
schedule (like every 60 seconds), cache the results, and pull that
instead.
If I wasn't super busy right now, I would look in more detail.
-adam
--
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!
From matt at atopia.net Mon Mar 7 17:00:22 2005
From: matt at atopia.net (Matt Juszczak)
Date: Mon, 7 Mar 2005 17:00:22 -0500 (EST)
Subject: [nycphp-talk] PHP5 Static Classes
In-Reply-To:
References: <8d9a428005020209086d8b80d9@mail.gmail.com>
<20050202182034.GA5008@panix.com>
<46a6c72c99446a87a43e4e7f79085160@jobsforge.com>
<8d9a428005020214254e8c46d3@mail.gmail.com>
Message-ID: <20050307165853.I64995@neptune.atopia.net>
OK, so I was reading this post and I have a feeling that my question can
be answered as an ongoing continuation of this post.
I understand Object Oriented Programming in places such as a daemon, or
when you're writing a game in java that constantly continues to run.
But I don't understand the use of Object Oriented Programming in
scripting. Once the page is loaded, a new instance of any object you've
created must be re-created (unlike java where you can create a game and
constantly interact with the same data set).
So my main question is: Why do people use object oriented programming in
websites?
Thanks! :)
-Matt
On Wed, 2 Feb 2005, Adam Maccabee Trachtenberg wrote:
> On Wed, 2 Feb 2005, Joseph Crawford wrote:
>
>> my question is how long will the object reside on the server though?
>
> You are confused. Static objects are constant within the request, but
> they do not persist between requests.
>
>> i understand that the object is the same for all users, but what if
>> the site has 0 users, does the object still exist? does it still
>> retain all the information? when another visitor comes, does it
>> continue to use that instance or create a new instance
>
> A new instance. Here is a better way of thinking of static in an OO
> context. Static properties are similar to namespaced global variables;
> static methods are similar to namespaced functions.
>
> You can refer to them anywhere within a script without worrying that
> they might vary from instance to instance. (i.e. based on specific
> instance data.)
>
> You cannot set a value in one request and then access it in a second
> one. As Dan says, that's what a database is for.
>
> -adam
>
> --
> adam at trachtenberg.com | http://www.trachtenberg.com
> author of o'reilly's "upgrading to php 5" and "php cookbook"
> avoid the holiday rush, buy your copies today!
> _______________________________________________
> New York PHP Talk
> Supporting AMP Technology (Apache/MySQL/PHP)
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
>
> !DSPAM:42015666650711093663439!
>
From krook at us.ibm.com Mon Mar 7 17:24:39 2005
From: krook at us.ibm.com (Daniel Krook)
Date: Mon, 7 Mar 2005 17:24:39 -0500
Subject: [nycphp-talk] PHP5 Static Classes
In-Reply-To: <20050307165853.I64995@neptune.atopia.net>
Message-ID:
> So my main question is: Why do people use object oriented programming
in
> websites?
There's a several reasons to use OOP for web applications. For one, it
matches model-driven development, which means you can put together a
wireframe or workflow of what your site will do and use objects to
represent the actors (Customers, Products), and methods to represent their
actions (checkOut, logIn). If you're working with clients or business
teams who aren't technical, these concepts benefit them by modeling their
rules and requirements and benefit you by providing a skeleton for the
code you must write.
An added benefit of OOP is the inherent organization that it provides you.
If you must later add a new bit of functionality, it should be obvious to
you - or any new team members that you might hire during the maintenance
or development of the application - where that new code should go.
The reason that one would use OOP when building a web app in PHP isn't for
technical advantages such as performance or persistence, it's about
writing maintainable and flexible code that mirrors your clients' changing
business needs.
Daniel Krook, Advisory IT Specialist - Application Development
WW Web Production Services North 2, ibm.com
1133 Westchester Avenue, White Plains, NY 10604
Personal: http://info.krook.org/
Persona: http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=9A9796897
From gatzby3jr at gmail.com Mon Mar 7 17:40:13 2005
From: gatzby3jr at gmail.com (Brian O'Connor)
Date: Mon, 7 Mar 2005 17:40:13 -0500
Subject: [nycphp-talk] PHP5 Static Classes
In-Reply-To:
References: <20050307165853.I64995@neptune.atopia.net>
Message-ID: <29da5d15050307144055d8d0f8@mail.gmail.com>
Daniel -
That's a very helpful response ... I've been trying to grasp the
advantages of OOP in websites for quite some time now, and that has
shined some light on the issue for me.
Thank you.
On Mon, 7 Mar 2005 17:24:39 -0500, Daniel Krook wrote:
> > So my main question is: Why do people use object oriented programming
> in
> > websites?
>
> There's a several reasons to use OOP for web applications. For one, it
> matches model-driven development, which means you can put together a
> wireframe or workflow of what your site will do and use objects to
> represent the actors (Customers, Products), and methods to represent their
> actions (checkOut, logIn). If you're working with clients or business
> teams who aren't technical, these concepts benefit them by modeling their
> rules and requirements and benefit you by providing a skeleton for the
> code you must write.
>
> An added benefit of OOP is the inherent organization that it provides you.
> If you must later add a new bit of functionality, it should be obvious to
> you - or any new team members that you might hire during the maintenance
> or development of the application - where that new code should go.
>
> The reason that one would use OOP when building a web app in PHP isn't for
> technical advantages such as performance or persistence, it's about
> writing maintainable and flexible code that mirrors your clients' changing
> business needs.
>
> Daniel Krook, Advisory IT Specialist - Application Development
> WW Web Production Services North 2, ibm.com
> 1133 Westchester Avenue, White Plains, NY 10604
>
> Personal: http://info.krook.org/
> Persona: http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=9A9796897
>
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
--
Brian O'Connor
From codebowl at gmail.com Mon Mar 7 17:42:16 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Mon, 7 Mar 2005 17:42:16 -0500
Subject: [nycphp-talk] PHP5 Static Classes
In-Reply-To:
References: <20050307165853.I64995@neptune.atopia.net>
Message-ID: <8d9a4280050307144270a336c3@mail.gmail.com>
I would also like to note that if you combine OOP and sessions you
dont have to re-create each object. for my members area i created a
user class that is stored in the users session, based on each page
load it checks to see if the session is set, if so it continues if not
it creates a new object and set's it to session, something like this
include('classfile.php');
session_start();
if( isset( $_SESSION['user'] ) ) {
$user = &$_SESSION['user'];
} else {
$user = new User();
$_SESSION['user'] = &$user;
}
then you can use $user throught your application and it will update
the session object as you use it :D
This causes less overhead of having to re-create the object and to
store all data into the db with each page load. You can go through
several pages, then in the end store the data from the object.
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From jayeshsh at ceruleansky.com Mon Mar 7 17:47:16 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Mon, 07 Mar 2005 17:47:16 -0500
Subject: [nycphp-talk] PHP5 Static Classes
Message-ID: <422CD9F4.7090207@ceruleansky.com>
Hi Matt,
the following new book lists a lot of good reasons for using
object-oriented programming with PHP:
PHP 5 Objects, Patterns, and Practice
http://apress.com/book/bookDisplay.html?bID=358
Even though this book is about how to use objects and patterns in PHP 5,
the author explains on numerous occassions how the object-oriented
version of something can save you from duplicating code, or improving
the readability of your code.
With PHP you can put a functional / procedural interface on top
instantiated objects, as you do not have to have a 'main' method as in
Java. In other words:
require 'happy_funcs.php';
require 'moodBrightener.class.php';
$person = 'Fred';
if ( person_is_unhappy($person) )
{
$mints = new moodBrightener('mints');
$mints->makeHappy($person);
}
Often, it is not so much a matter of saving computer resources, but
saving human resources. Some OOP techniques can help to ,modularize
chunks of code, and establish relationships between them. And unlike
functions, classes can 'borrow' or inherit functionality from other
classes. So this saves you from copying and pasting code.
I hope this somewhat generalized example makes sense.
- Jay
From shiflett at php.net Mon Mar 7 17:51:01 2005
From: shiflett at php.net (Chris Shiflett)
Date: Mon, 07 Mar 2005 17:51:01 -0500
Subject: [nycphp-talk] PHP5 Static Classes
In-Reply-To:
References:
Message-ID: <422CDAD5.3080107@php.net>
Daniel Krook wrote:
> There's a several reasons to use OOP for web applications.
Apologies in advance for posting with nothing valuable to say, but I
wanted to commend Daniel for one of the most straightforward and useful
explanations of OOP I've read. He even avoided buzzwords. :-)
Chris
From krook at us.ibm.com Mon Mar 7 17:57:48 2005
From: krook at us.ibm.com (Daniel Krook)
Date: Mon, 7 Mar 2005 17:57:48 -0500
Subject: [nycphp-talk] PHP5 Static Classes
In-Reply-To: <422CDAD5.3080107@php.net>
Message-ID:
> Apologies in advance for posting with nothing valuable to say, but I
> wanted to commend Daniel for one of the most straightforward and useful
> explanations of OOP I've read. He even avoided buzzwords. :-)
Thanks Chris, but for the record, I swapped in "flexible" for "extensible"
just before I hit send :)
From nyphp at enobrev.com Mon Mar 7 20:40:40 2005
From: nyphp at enobrev.com (Mark Armendariz)
Date: Mon, 7 Mar 2005 20:40:40 -0500
Subject: [nycphp-talk] Maintaining sessions between PHP and CFs
Message-ID: <20050308014028.3E0ECA862F@virtu.nyphp.org>
My client's site is all Cold Fusion right now (been writing / maintaining it
for about 5 years now), but some things are just far more efficient with PHP
and since the traffic is growing exponentially, I'd like to utilize the best
of both worlds.
I just converted the database from SQL Server to MySQL since I'm far better
at tweaking with MySql. I figure I can put the sessions in the database and
carry them over between the two. Probably CF Client Variables and a custom
session handler in php, I suppose.
This job is nearing it's budget limits, so I'd rather use something already
in use rather than take the time to write something. Have any of you ever
done this or know of any libraries that exist for this?
(PHP 4.3.1 and CFMX 6.1 on IIS using MySql 4)
Thanks!
Mark Armendariz
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From nestorflorez at earthlink.net Mon Mar 7 20:49:10 2005
From: nestorflorez at earthlink.net (Nestor Florez)
Date: Mon, 7 Mar 2005 17:49:10 -0800 (GMT-08:00)
Subject: [nycphp-talk] Maintaining sessions between PHP and CFs
Message-ID: <24594914.1110246550161.JavaMail.root@bigbird.psp.pas.earthlink.net>
I've done something similar passing session variables from PHP to PERL
YOu simply read the variable because they are using the HTML protocol
Good Luck :-)
-----Original Message-----
From: Mark Armendariz
Sent: Mar 7, 2005 5:40 PM
To: 'NYPHP Talk'
Subject: [nycphp-talk] Maintaining sessions between PHP and CFs
My client's site is all Cold Fusion right now (been writing / maintaining it
for about 5 years now), but some things are just far more efficient with PHP
and since the traffic is growing exponentially, I'd like to utilize the best
of both worlds.
I just converted the database from SQL Server to MySQL since I'm far better
at tweaking with MySql. I figure I can put the sessions in the database and
carry them over between the two. Probably CF Client Variables and a custom
session handler in php, I suppose.
This job is nearing it's budget limits, so I'd rather use something already
in use rather than take the time to write something. Have any of you ever
done this or know of any libraries that exist for this?
(PHP 4.3.1 and CFMX 6.1 on IIS using MySql 4)
Thanks!
Mark Armendariz
From matt at atopia.net Tue Mar 8 02:44:33 2005
From: matt at atopia.net (Matt Juszczak)
Date: Tue, 8 Mar 2005 02:44:33 -0500 (EST)
Subject: [nycphp-talk] Maintaining sessions between PHP and CFs
In-Reply-To: <24594914.1110246550161.JavaMail.root@bigbird.psp.pas.earthlink.net>
References: <24594914.1110246550161.JavaMail.root@bigbird.psp.pas.earthlink.net>
Message-ID: <20050308023948.P81327@neptune.atopia.net>
If the data you are trying to pass between PHP and CF is "secure data",
then in my opinion you can create a table with two fields ...
md5String md5, name varchar(32), value varchar(64)
Then just have a redirect.php and a redirect.cfm ... redirect.php checks
for a variable called action, labelled IN or OUT. If action is IN, it
stores the data in session, takes the md5 string of something, and passes
that along to redirect.cfm with action=OUT, which takes the info out of
the table, and sets a new session. The redirect.cfm does the same thing,
except it inserts the data into the table and then passes on to
redirect.php.
HTH,
Matt
On Mon, 7 Mar 2005, Nestor Florez wrote:
> I've done something similar passing session variables from PHP to PERL
> YOu simply read the variable because they are using the HTML protocol
>
> Good Luck :-)
>
> -----Original Message-----
> From: Mark Armendariz
> Sent: Mar 7, 2005 5:40 PM
> To: 'NYPHP Talk'
> Subject: [nycphp-talk] Maintaining sessions between PHP and CFs
>
> My client's site is all Cold Fusion right now (been writing / maintaining it
> for about 5 years now), but some things are just far more efficient with PHP
> and since the traffic is growing exponentially, I'd like to utilize the best
> of both worlds.
>
>
>
> I just converted the database from SQL Server to MySQL since I'm far better
> at tweaking with MySql. I figure I can put the sessions in the database and
> carry them over between the two. Probably CF Client Variables and a custom
> session handler in php, I suppose.
>
>
>
> This job is nearing it's budget limits, so I'd rather use something already
> in use rather than take the time to write something. Have any of you ever
> done this or know of any libraries that exist for this?
>
>
>
> (PHP 4.3.1 and CFMX 6.1 on IIS using MySql 4)
>
>
>
> Thanks!
>
>
>
> Mark Armendariz
>
>
>
>
>
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
>
> !DSPAM:422d04c6685921152894481!
>
From list at harveyk.com Tue Mar 8 12:06:11 2005
From: list at harveyk.com (harvey)
Date: Tue, 08 Mar 2005 12:06:11 -0500
Subject: [nycphp-talk] Sssllllooooowwwww Page
Message-ID: <6.1.0.6.2.20050308120518.05c3bdf8@127.0.0.1>
Hello NYPHP,
I've got a page that works totally fine for me. Takes a few seconds to load
on cable connection with IE 6 PC. Works fine for a colleague with DSL on
the Mac (not sure which browser). But for the most important person
(client!) the page is taking over a minute and a half to load. He's on Win
XP and IE (probably 6) with cable connection.
Relevant details are below. Basically, there's a table of shows, a table of
bands, and a table that connects the two so you know which bands are
playing in which shows. The admin chooses a show and sees a list of about
500-1000 bands with the current bands for that show already checked. The
admin can uncheck them, check others, etc, and update the show.
Any ideas if the slowness in loading might be due to the select statement?
Is there a more efficient query structure? Or maybe just writing the 1000
form inputs is taking too long? I was thinking about getting rid of the
show/band array table and just adding 10 fields to the show table:
band1_fid, band2_fid, etc... That would probably speed things up, but all
the work was already done for the current method and it works totally fine
(except too slow for the client)...
Thanks in advance for any suggestions!
Harvey
$show_id is a passed variable
music_bands: (List of bands)
band_id
band_name
music_show_bands_array: (Keeps track of which bands are in which shows)
s_b_id
show_fid
band_fid
SELECT music_bands.band_id AS id, music_bands.band_name AS band,
music_show_bands_array.s_b_id AS inthere
FROM music_bands
LEFT JOIN music_show_bands_array ON ((music_show_bands_array.band_fid =
music_bands.band_id) AND (music_show_bands_array.show_fid = $show_id))
ORDER BY music_subcats.subcat_name ASC
Then there's a form with about 500-1000 bands listed as follows:
>
From faber at linuxnj.com Tue Mar 8 12:15:17 2005
From: faber at linuxnj.com (Faber Fedor)
Date: Tue, 8 Mar 2005 12:15:17 -0500
Subject: [nycphp-talk] Re: Sssllllooooowwwww Page
In-Reply-To: <6.1.0.6.2.20050308120518.05c3bdf8@127.0.0.1>
References: <6.1.0.6.2.20050308120518.05c3bdf8@127.0.0.1>
Message-ID: <20050308171517.GA8042@uranus.faber.nom>
On 08/03/05 12:06 -0500, harvey wrote:
> Hello NYPHP,
>
> I've got a page that works totally fine for me. Takes a few seconds to load
> on cable connection with IE 6 PC. Works fine for a colleague with DSL on
> the Mac (not sure which browser). But for the most important person
> (client!) the page is taking over a minute and a half to load. He's on Win
> XP and IE (probably 6) with cable connection.
Why are you looking at code changes when the problem is obviously with
the client's computer/connection?
You should find out what the problem is before you start fixing it.
--
Regards,
Faber
Linux New Jersey: Open Source Solutions for New Jersey
http://www.linuxnj.com
From list at harveyk.com Tue Mar 8 13:12:05 2005
From: list at harveyk.com (harvey)
Date: Tue, 08 Mar 2005 13:12:05 -0500
Subject: [nycphp-talk] Re: Sssllllooooowwwww Page
In-Reply-To: <20050308171517.GA8042@uranus.faber.nom>
References: <6.1.0.6.2.20050308120518.05c3bdf8@127.0.0.1>
<20050308171517.GA8042@uranus.faber.nom>
Message-ID: <6.1.0.6.2.20050308130934.05c06ef8@mail.harveyk.com>
Same thing happened to the client's assistant in a different location on a
different system.
Maybe both their connections are slow. Can't change that. But I can change
the code if that will help.
At 12:15 PM 3/8/2005, Faber Fedor wrote:
>On 08/03/05 12:06 -0500, harvey wrote:
> > Hello NYPHP,
> >
> > I've got a page that works totally fine for me. Takes a few seconds to
> load
> > on cable connection with IE 6 PC. Works fine for a colleague with DSL on
> > the Mac (not sure which browser). But for the most important person
> > (client!) the page is taking over a minute and a half to load. He's on Win
> > XP and IE (probably 6) with cable connection.
>
>Why are you looking at code changes when the problem is obviously with
>the client's computer/connection?
>
>You should find out what the problem is before you start fixing it.
>
>--
>
>Regards,
>
>Faber
>
>Linux New Jersey: Open Source Solutions for New Jersey
>http://www.linuxnj.com
>
>
>
>_______________________________________________
>New York PHP Talk Mailing List
>AMP Technology
>Supporting Apache, MySQL and PHP
>http://lists.nyphp.org/mailman/listinfo/talk
>http://www.nyphp.org
From rahmin at insite-out.com Tue Mar 8 13:19:29 2005
From: rahmin at insite-out.com (Rahmin Pavlovic)
Date: Tue, 8 Mar 2005 13:19:29 -0500
Subject: [nycphp-talk] Sssllllooooowwwww Page
Message-ID: <200503081819.j28IJTE4030922@webmail2.megamailservers.com>
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL:
From danielc at analysisandsolutions.com Tue Mar 8 13:34:38 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Tue, 8 Mar 2005 13:34:38 -0500
Subject: [nycphp-talk] Re: Sssllllooooowwwww Page
In-Reply-To: <6.1.0.6.2.20050308130934.05c06ef8@mail.harveyk.com>
References: <6.1.0.6.2.20050308120518.05c3bdf8@127.0.0.1>
<20050308171517.GA8042@uranus.faber.nom>
<6.1.0.6.2.20050308130934.05c06ef8@mail.harveyk.com>
Message-ID: <20050308183438.GA22192@panix.com>
On Tue, Mar 08, 2005 at 01:12:05PM -0500, harvey wrote:
> Same thing happened to the client's assistant in a different location
> on a different system.
Different machine, but probably on the same network and using the same
route over the Internet to/from your server. Have them run trace
route:
win: tracert www.servername.com
other: traceroute www.servername.com
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From brent at landover.com Tue Mar 8 13:35:14 2005
From: brent at landover.com (Brent Baisley)
Date: Tue, 8 Mar 2005 13:35:14 -0500
Subject: [nycphp-talk] Sssllllooooowwwww Page
In-Reply-To: <6.1.0.6.2.20050308120518.05c3bdf8@127.0.0.1>
References: <6.1.0.6.2.20050308120518.05c3bdf8@127.0.0.1>
Message-ID: <3291f9f79f21a9dc0c21a1567015231c@landover.com>
I would first start troubleshooting where the problem is. Put some
timers in your code that gets displayed on the web page so you can see
what piece took the longest time. I assume you are using some sort of
output buffering, which will allow you to see how long it takes to
actually deliver the result from the server to the client. I always
build up my web page in a variable, then I have a single echo at the
end of my code that delivers it to the client.
If you are not using output buffering, then network latency may be
what's killing you. If you are delivering the web page piece meal,
which it looks like what you are doing, you are probably using far more
network packets than should and not taking advantage of http
compression. You can do a trace route to your clients ip address to get
an idea of network latency. Remember, cable is a share connection, so
if there are lots of people with cable modems in your clients
neighborhood, there may be lots of collisions. The more network packets
you require to deliver your data, the more likely it is there will be a
collision.
My recommendation is to change you code so you are storing everything
in a variable, then echo the variable when you have everything. That
will probably speed everything up considerably.
On Mar 8, 2005, at 12:06 PM, harvey wrote:
> Hello NYPHP,
>
> I've got a page that works totally fine for me. Takes a few seconds to
> load on cable connection with IE 6 PC. Works fine for a colleague with
> DSL on the Mac (not sure which browser). But for the most important
> person (client!) the page is taking over a minute and a half to load.
> He's on Win XP and IE (probably 6) with cable connection.
>
> Relevant details are below. Basically, there's a table of shows, a
> table of bands, and a table that connects the two so you know which
> bands are playing in which shows. The admin chooses a show and sees a
> list of about 500-1000 bands with the current bands for that show
> already checked. The admin can uncheck them, check others, etc, and
> update the show.
>
> Any ideas if the slowness in loading might be due to the select
> statement? Is there a more efficient query structure? Or maybe just
> writing the 1000 form inputs is taking too long? I was thinking about
> getting rid of the show/band array table and just adding 10 fields to
> the show table: band1_fid, band2_fid, etc... That would probably speed
> things up, but all the work was already done for the current method
> and it works totally fine (except too slow for the client)...
>
> Thanks in advance for any suggestions!
>
> Harvey
>
>
> $show_id is a passed variable
>
> music_bands: (List of bands)
> band_id
> band_name
>
> music_show_bands_array: (Keeps track of which bands are in which shows)
> s_b_id
> show_fid
> band_fid
>
> SELECT music_bands.band_id AS id, music_bands.band_name AS band,
> music_show_bands_array.s_b_id AS inthere
> FROM music_bands
> LEFT JOIN music_show_bands_array ON ((music_show_bands_array.band_fid
> = music_bands.band_id) AND (music_show_bands_array.show_fid =
> $show_id))
> ORDER BY music_subcats.subcat_name ASC
>
> Then there's a form with about 500-1000 bands listed as follows:
>
> checked"; } ?>>
>
>
>
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
From lists at zaunere.com Tue Mar 8 14:53:04 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Tue, 8 Mar 2005 14:53:04 -0500
Subject: [nycphp-talk] A chance to contribute LAMP/ PHP expertise?
In-Reply-To: <8367-87702@sneakemail.com>
Message-ID: <0MKz5u-1D8klQ2EP1-0007tQ@mrelay.perfora.net>
> Maybe OT but I don't think so.
>
> WordPress recently updated to 1.5 and it is a well-liked FOSS PHP/MySQL
> app.
>
> Lately various users have been noting system-level problems, including
> high CPU load and large numbers of simultaneous MySQL connections, and
> several bloggers have been dumped by their hosts due to resource abuse
> on shared servers.
>
> The developers are discussing the issue and from the latest posts that
> comment on how hard PHP canbe to debug (see the bottom of the page), I
> am betting they could use a wee bit of the high-powered NYPHP LAMP
> expertise I see up here every week.
>
> Anybody care to help "solve the problem" ?
Sure - NYPHP is $150/hour :)
> http://wordpress.org/support/topic.php?id=26372#post-148972
Without digging into their queries, schema, and code, it's probably one or more of these things:
-- poor indexing
-- poor use of the MySQL database handle
-- poor programming; perhaps they are copying around large arrays/objects
-- recursive queries; throwing hundreds of queries at the database that could be done with a simple join (probably the result of a programming error or bad design)
It's hard to say without knowing more. Feel free to invite them on the list and provide some details (where the resource bottleneck is, MySQL or Apache?). I'm sure it'd be a great learning experience for us all.
---
Hans Zaunere
President, Founder
New York PHP
http://www.nyphp.org
AMP Technology
Supporting Apache, MySQL and PHP
From jeff.loiselle at gmail.com Tue Mar 8 16:25:39 2005
From: jeff.loiselle at gmail.com (Jeff Loiselle)
Date: Tue, 8 Mar 2005 16:25:39 -0500
Subject: [nycphp-talk] PEAR:DB & SQL Injection
Message-ID: <4b18871105030813255f02e0bd@mail.gmail.com>
Dan/Anyone,
When using prepare() and execute() in PEAR:DB, is there still
possibility of SQL injection attakcs? What further measures should I
take to guard myself from these types attacks using this library?
TIA.
---
Jeff Loiselle
Web Developer, Musician, and Observer
jeff at loiselles.com
From lists at zaunere.com Tue Mar 8 16:44:55 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Tue, 8 Mar 2005 16:44:55 -0500
Subject: [nycphp-talk] Maintaining sessions between PHP and CFs
In-Reply-To: <20050308014028.3E0ECA862F@virtu.nyphp.org>
Message-ID: <20050308213919.011AF99B2@mailrelay.t-mobile.com>
I?ve done this, albeit ?asynchronous,? meaning that folks were logging into a CF application and I wanted them to be authenticated securely on a remote PHP server.
When the user logged in at the CF site, a single line of CF code did the trick, and ?called-ahead? to the PHP application. I forget the exact syntax in CF, but it was something like this:
The protected/ directory was protected by IP restrictions, and not linked to from anywhere. The sessionid was a md5 hash.
So, naturally, the user would login on the CF side, which would call ahead to the PHP application. This was only done once, since all I needed to do was keep track of whether they?ve authenticated or not, and it was asynchronous, that is the PHP application never called back to CF.
But the same principal could easily be applied and expanded upon. For instance, both the CF and PHP applications would have hidden pages, and object/arrays/etc could be serialized or converted to GET/POST/cookies to transport the information. Simply forming your own HTTP requests would give you a lot of flexibility ? you could even imbed the information into the HTTP header if you wanted. You could use XML for this, but I don?t really see any advantage, unless your session data is extremely complex, which it shouldn?t be any way ?
H
________________________________________
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Mark Armendariz
Sent: Monday, March 07, 2005 8:41 PM
To: 'NYPHP Talk'
Subject: [nycphp-talk] Maintaining sessions between PHP and CFs
My client?s site is all Cold Fusion right now (been writing / maintaining it for about 5 years now), but some things are just far more efficient with PHP and since the traffic is growing exponentially, I?d like to utilize the best of both worlds.
I just converted the database from SQL Server to MySQL since I?m far better at tweaking with MySql. I figure I can put the sessions in the database and carry them over between the two. Probably CF Client Variables and a custom session handler in php, I suppose.
This job is nearing it?s budget limits, so I?d rather use something already in use rather than take the time to write something. Have any of you ever done this or know of any libraries that exist for this?
(PHP 4.3.1 and CFMX 6.1 on IIS using MySql 4)
Thanks!
Mark Armendariz
From danielc at analysisandsolutions.com Tue Mar 8 18:34:59 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Tue, 8 Mar 2005 18:34:59 -0500
Subject: [nycphp-talk] PEAR:DB & SQL Injection
In-Reply-To: <4b18871105030813255f02e0bd@mail.gmail.com>
References: <4b18871105030813255f02e0bd@mail.gmail.com>
Message-ID: <20050308233459.GA4025@panix.com>
Hi Jeff:
On Tue, Mar 08, 2005 at 04:25:39PM -0500, Jeff Loiselle wrote:
> When using prepare() and execute() in PEAR:DB, is there still
> possibility of SQL injection attakcs?
No, but it guards you against "attacks." :)
While prepare/execute should solve most issues, I always strictly check
incoming data. If the column is an integer, I make sure the data only
contains integers and isn't too long. Etc...
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From matt at jiffycomp.com Tue Mar 8 21:48:59 2005
From: matt at jiffycomp.com (Matt Morgan)
Date: Tue, 08 Mar 2005 21:48:59 -0500
Subject: [nycphp-talk] Re: Sssllllooooowwwww Page
In-Reply-To: <6.1.0.6.2.20050308130934.05c06ef8@mail.harveyk.com>
References: <6.1.0.6.2.20050308120518.05c3bdf8@127.0.0.1> <20050308171517.GA8042@uranus.faber.nom>
<6.1.0.6.2.20050308130934.05c06ef8@mail.harveyk.com>
Message-ID: <422E641B.4000905@jiffycomp.com>
[attempted to rearrange top posting for clarity--my apologies if I
mucked up the ">" signs]
> harvey wrote:
> > At 12:15 PM 3/8/2005, Faber Fedor wrote:
> > > On 08/03/05 12:06 -0500, harvey wrote:
> > > Hello NYPHP,
> > >
> > > I've got a page that works totally fine for me. Takes a few
seconds to load
> > > on cable connection with IE 6 PC. Works fine for a colleague with
DSL on
> > > the Mac (not sure which browser). But for the most important person
> > > (client!) the page is taking over a minute and a half to load.
He's on Win
> > > XP and IE (probably 6) with cable connection.
> > Why are you looking at code changes when the problem is obviously with
> > the client's computer/connection?
> > You should find out what the problem is before you start fixing it.
> Same thing happened to the client's assistant in a different location
on a different system.
> Maybe both their connections are slow. Can't change that. But I can
change the code if that will help.
This is not a slow connection problem unless every page on your site
loads slow for them. You could test by making a very simple, text/plain
page with as much content as your bands/shows page and seeing if they
download it faster. But I think I know what's going to happen (it will
load fast). If it does load slowly, they have bigger problems.
Nor do I think it's a problem with your code, unless you are generating
bad HTML (have you validated it?). The browser doesn't see the php, only
the HTML. And if it goes fast for you, the php part is fast. I suspect a
table-rendering issue with their browsers, or maybe they have some funny
filtering setup that scans big pages slowly, or whatever (they,
hopefully, should be able to tell you what the "whatever" might be). Or
maybe (like most Windows computers out there) they're crammed with
viruses and spyware and ... In any case, most likely it's on their end
and changing your code won't fix it, unless you can remove all HTML
tables from the generated page and/or you're sending bad HTML.
First, test the connection by having them download a large, but simple
page. Second, validate the HTML your code generates. If it validates
your code is good, or good enough. Third, Firefox is free. Ask them to
install it and try your (validated) pages with Firefox. Or, if they
don't want to install Firefox, have them update IE to exactly the
version you're using, or something newer (check to verify what they're
actually using--you're not sure, right?).
Note: I am more of an admin than a programmer. If that was my network, I
would assume something was wrong on my end and take responsibility for
it. I sincerely believe that your responsibility here is to generate
valid HTML (unless they specified otherwise :-)), and anything else is
their problem. Maybe that's difficult in some way, but you shouldn't be
afraid to say it. If there's something wrong over there, they should
know about it.
Good luck,
Matt
From list at harveyk.com Tue Mar 8 22:33:34 2005
From: list at harveyk.com (harvey)
Date: Tue, 08 Mar 2005 22:33:34 -0500
Subject: [nycphp-talk] Re: Sssllllooooowwwww Page
In-Reply-To: <422E641B.4000905@jiffycomp.com>
References: <6.1.0.6.2.20050308120518.05c3bdf8@127.0.0.1>
<20050308171517.GA8042@uranus.faber.nom>
<6.1.0.6.2.20050308130934.05c06ef8@mail.harveyk.com>
<422E641B.4000905@jiffycomp.com>
Message-ID: <6.1.0.6.2.20050308221307.05dd3e78@mail.harveyk.com>
Hello Matt,
Thanks for the note. I loaded the page in my browser, copied the source,
and uploaded that for the client to test.
As far as table rendering, there really shouldn't be an issue since the
page is just one table with maybe half a dozen rows, one or two columns max.
I'll try validating my html, but I doubt there are any major issues with
it; the page is pretty simple, just pretty big.
I doubt I can get the client to use Firefox, but probably can get them to
upgrade their IE to version 6.
Daniel earlier suggested that even though the client and assistant are on
different machines, they're "probably on the same network and using the same
route over the Internet to/from your server. Have them run trace route."
But actually the client and his assistant are at two different companies,
different machines, networks, etc. Unless of course they are in the same
building and are sharing the same connection, which I guess is possible.
I'll check.
With some tips from Brent, I implemented a potential fix that he suggested
earlier, "My recommendation is to change you code so you are storing
everything in a variable, then echo the variable when you have everything.
That will probably speed everything up considerably." Still waiting for the
client to test and get back to me.
Rahmin suggested breaking up the long form with the list of bands into a
few smaller pages, but the client already complains that there are too many
pages to click through.
So, that's where I am right now...
Thanks to everyone for their help so far.
Harvey
At 09:48 PM 3/8/2005, Matt Morgan wrote:
>[attempted to rearrange top posting for clarity--my apologies if I mucked
>up the ">" signs]
>
> > harvey wrote:
> > > At 12:15 PM 3/8/2005, Faber Fedor wrote:
> > > > On 08/03/05 12:06 -0500, harvey wrote:
> > > > Hello NYPHP,
> > > >
> > > > I've got a page that works totally fine for me. Takes a few seconds
> to load
> > > > on cable connection with IE 6 PC. Works fine for a colleague with
> DSL on
> > > > the Mac (not sure which browser). But for the most important person
> > > > (client!) the page is taking over a minute and a half to load. He's
> on Win
> > > > XP and IE (probably 6) with cable connection.
>
> > > Why are you looking at code changes when the problem is obviously with
> > > the client's computer/connection?
> > > You should find out what the problem is before you start fixing it.
>
> > Same thing happened to the client's assistant in a different location
> on a different system.
> > Maybe both their connections are slow. Can't change that. But I can
> change the code if that will help.
>
>This is not a slow connection problem unless every page on your site loads
>slow for them. You could test by making a very simple, text/plain page
>with as much content as your bands/shows page and seeing if they download
>it faster. But I think I know what's going to happen (it will load fast).
>If it does load slowly, they have bigger problems.
>
>Nor do I think it's a problem with your code, unless you are generating
>bad HTML (have you validated it?). The browser doesn't see the php, only
>the HTML. And if it goes fast for you, the php part is fast. I suspect a
>table-rendering issue with their browsers, or maybe they have some funny
>filtering setup that scans big pages slowly, or whatever (they, hopefully,
>should be able to tell you what the "whatever" might be). Or maybe (like
>most Windows computers out there) they're crammed with viruses and spyware
>and ... In any case, most likely it's on their end and changing your code
>won't fix it, unless you can remove all HTML tables from the generated
>page and/or you're sending bad HTML.
>
>First, test the connection by having them download a large, but simple
>page. Second, validate the HTML your code generates. If it validates your
>code is good, or good enough. Third, Firefox is free. Ask them to install
>it and try your (validated) pages with Firefox. Or, if they don't want to
>install Firefox, have them update IE to exactly the version you're using,
>or something newer (check to verify what they're actually using--you're
>not sure, right?).
>
>Note: I am more of an admin than a programmer. If that was my network, I
>would assume something was wrong on my end and take responsibility for it.
>I sincerely believe that your responsibility here is to generate valid
>HTML (unless they specified otherwise :-)), and anything else is their
>problem. Maybe that's difficult in some way, but you shouldn't be afraid
>to say it. If there's something wrong over there, they should know about it.
>
>Good luck,
>Matt
>_______________________________________________
>New York PHP Talk Mailing List
>AMP Technology
>Supporting Apache, MySQL and PHP
>http://lists.nyphp.org/mailman/listinfo/talk
>http://www.nyphp.org
From nyphp at enobrev.com Wed Mar 9 04:39:05 2005
From: nyphp at enobrev.com (Mark Armendariz)
Date: Wed, 9 Mar 2005 04:39:05 -0500
Subject: [nycphp-talk] Maintaining sessions between PHP and CFs
In-Reply-To: <20050308213919.011AF99B2@mailrelay.t-mobile.com>
Message-ID: <20050309093931.9ADAFA8633@virtu.nyphp.org>
> I've done this, albeit "asynchronous," meaning that folks were logging
> into a CF application and I wanted them to be authenticated securely on a
> remote PHP server.
>
> When the user logged in at the CF site, a single line of CF code did the
> trick, and "called-ahead" to the PHP application. I forget the exact
> syntax in CF, but it was something like this:
>
> request=http://my.php.site.com/protected/preauth.php?sessionid=kdj39ks932k
> 98s>
This had crossed my mind. As a matter of fact, I'm using similar means to
clock my MySQL queries (currently with adodb's logger and performance
functionality). And if I didn't have control over the CFAdmin, this is most
likely the way I'd go.
I had this notion that there had to be a way to use the session data across
languages. After all, it's all just data stored *somewhere on the server.
Well, Cold Fusion 'Session' variables are stored in RAM, with no options to
store them in a database. This wouldn't do.
It turns out though, that their 'Client' scope (which is meant for prolonged
client session vars - server side) can be stored in the database AND can be
made to act like their session variables (expiring upon browser close).
I chose my db, it created the tables and now every session carries a record
in my database with a # delimited list of values (no structures, although I
could probably WDDX something together if I gave a damn about complexity).
Just as well, a CFID/CFTOKEN pair is given to every browser (or added to
links should cookies be disabled). So I use that cfid cookie / param,
search the CF client's database for the user's session and viola.
I've been doing it in a very basic manner thus far. I'm sure I'll write
some sort of session handler for it one of these days - time permitting, but
for now I'm all set.
Best of all, it was a quick and easy solution without having to build /
replace any internal functionality. I can update the CF client variables
via sql calls and when the user returns to a CF page the cookie will be
there so the session will remain active. I'll probably have to add
CFID/CFTOKEN's to url's for non-cookie setups...
Ok, now back to my 'explains' and query tweaks.
Thank you all for your great responses!
Mark
From nyphp at enobrev.com Wed Mar 9 04:41:33 2005
From: nyphp at enobrev.com (Mark Armendariz)
Date: Wed, 9 Mar 2005 04:41:33 -0500
Subject: [nycphp-talk] Maintaining sessions between PHP and CFs
In-Reply-To: <20050308213919.011AF99B2@mailrelay.t-mobile.com>
Message-ID: <20050309094133.458C9A8633@virtu.nyphp.org>
> I've done this, albeit "asynchronous," meaning that folks were logging
> into a CF application and I wanted them to be authenticated securely on a
> remote PHP server.
BTW, for this project I was lucky enough to have everything on one server.
Were it separate servers I can guarantee I would have gone the way Hans did.
That or some sort of Single-Sign-On application if the budget would allow
for it.
Mark
From john at cyber-ny.com Wed Mar 9 10:14:02 2005
From: john at cyber-ny.com (John Nunez)
Date: Wed, 9 Mar 2005 10:14:02 -0500
Subject: [nycphp-talk] Re: Sssllllooooowwwww Page
In-Reply-To: <6.1.0.6.2.20050308221307.05dd3e78@mail.harveyk.com>
References: <6.1.0.6.2.20050308120518.05c3bdf8@127.0.0.1>
<20050308171517.GA8042@uranus.faber.nom>
<6.1.0.6.2.20050308130934.05c06ef8@mail.harveyk.com>
<422E641B.4000905@jiffycomp.com>
<6.1.0.6.2.20050308221307.05dd3e78@mail.harveyk.com>
Message-ID: <9a55fa116ab353592a5392a0815b1628@cyber-ny.com>
Harvey,
If you have phpMyAdmin on that server run your SQL queries with the
COMMAND "EXPLAIN" in front of your SELECT Queries. Make sure your have
the proper indexes on the tables.
Someone previously suggested copying all output to a variable then
transmitting it to the browser. This will increase the speed of your
page loading. There will be a slight pause on request but then it just
flows in.
500 - 1000 form items is quite a bit of formatting for the browser so
make sure all formatting is done via CSS. It's one setting for all
TABLES, TRs, TDs, INPUTs.
Good Luck,
John Nunez
On Mar 8, 2005, at 10:33 PM, harvey wrote:
> Hello Matt,
>
> Thanks for the note. I loaded the page in my browser, copied the
> source, and uploaded that for the client to test.
>
> As far as table rendering, there really shouldn't be an issue since
> the page is just one table with maybe half a dozen rows, one or two
> columns max.
>
> I'll try validating my html, but I doubt there are any major issues
> with it; the page is pretty simple, just pretty big.
>
> I doubt I can get the client to use Firefox, but probably can get them
> to upgrade their IE to version 6.
>
> Daniel earlier suggested that even though the client and assistant are
> on different machines, they're "probably on the same network and using
> the same
> route over the Internet to/from your server. Have them run trace
> route." But actually the client and his assistant are at two different
> companies, different machines, networks, etc. Unless of course they
> are in the same building and are sharing the same connection, which I
> guess is possible. I'll check.
>
> With some tips from Brent, I implemented a potential fix that he
> suggested earlier, "My recommendation is to change you code so you are
> storing everything in a variable, then echo the variable when you have
> everything. That will probably speed everything up considerably."
> Still waiting for the client to test and get back to me.
>
> Rahmin suggested breaking up the long form with the list of bands into
> a few smaller pages, but the client already complains that there are
> too many pages to click through.
>
> So, that's where I am right now...
>
> Thanks to everyone for their help so far.
>
> Harvey
>
>
>
> At 09:48 PM 3/8/2005, Matt Morgan wrote:
>
>> [attempted to rearrange top posting for clarity--my apologies if I
>> mucked up the ">" signs]
>>
>> > harvey wrote:
>> > > At 12:15 PM 3/8/2005, Faber Fedor wrote:
>> > > > On 08/03/05 12:06 -0500, harvey wrote:
>> > > > Hello NYPHP,
>> > > >
>> > > > I've got a page that works totally fine for me. Takes a few
>> seconds to load
>> > > > on cable connection with IE 6 PC. Works fine for a colleague
>> with DSL on
>> > > > the Mac (not sure which browser). But for the most important
>> person
>> > > > (client!) the page is taking over a minute and a half to load.
>> He's on Win
>> > > > XP and IE (probably 6) with cable connection.
>>
>> > > Why are you looking at code changes when the problem is obviously
>> with
>> > > the client's computer/connection?
>> > > You should find out what the problem is before you start fixing
>> it.
>>
>> > Same thing happened to the client's assistant in a different
>> location on a different system.
>> > Maybe both their connections are slow. Can't change that. But I can
>> change the code if that will help.
>>
>> This is not a slow connection problem unless every page on your site
>> loads slow for them. You could test by making a very simple,
>> text/plain page with as much content as your bands/shows page and
>> seeing if they download it faster. But I think I know what's going to
>> happen (it will load fast). If it does load slowly, they have bigger
>> problems.
>>
>> Nor do I think it's a problem with your code, unless you are
>> generating bad HTML (have you validated it?). The browser doesn't see
>> the php, only the HTML. And if it goes fast for you, the php part is
>> fast. I suspect a table-rendering issue with their browsers, or maybe
>> they have some funny filtering setup that scans big pages slowly, or
>> whatever (they, hopefully, should be able to tell you what the
>> "whatever" might be). Or maybe (like most Windows computers out
>> there) they're crammed with viruses and spyware and ... In any case,
>> most likely it's on their end and changing your code won't fix it,
>> unless you can remove all HTML tables from the generated page and/or
>> you're sending bad HTML.
>>
>> First, test the connection by having them download a large, but
>> simple page. Second, validate the HTML your code generates. If it
>> validates your code is good, or good enough. Third, Firefox is free.
>> Ask them to install it and try your (validated) pages with Firefox.
>> Or, if they don't want to install Firefox, have them update IE to
>> exactly the version you're using, or something newer (check to verify
>> what they're actually using--you're not sure, right?).
>>
>> Note: I am more of an admin than a programmer. If that was my
>> network, I would assume something was wrong on my end and take
>> responsibility for it. I sincerely believe that your responsibility
>> here is to generate valid HTML (unless they specified otherwise :-)),
>> and anything else is their problem. Maybe that's difficult in some
>> way, but you shouldn't be afraid to say it. If there's something
>> wrong over there, they should know about it.
>>
>> Good luck,
>> Matt
>> _______________________________________________
>> New York PHP Talk Mailing List
>> AMP Technology
>> Supporting Apache, MySQL and PHP
>> http://lists.nyphp.org/mailman/listinfo/talk
>> http://www.nyphp.org
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From list at harveyk.com Wed Mar 9 14:51:48 2005
From: list at harveyk.com (harvey)
Date: Wed, 09 Mar 2005 14:51:48 -0500
Subject: [nycphp-talk] Re: Sssllllooooowwwww Page
In-Reply-To: <9a55fa116ab353592a5392a0815b1628@cyber-ny.com>
References: <6.1.0.6.2.20050308120518.05c3bdf8@127.0.0.1>
<20050308171517.GA8042@uranus.faber.nom>
<6.1.0.6.2.20050308130934.05c06ef8@mail.harveyk.com>
<422E641B.4000905@jiffycomp.com>
<6.1.0.6.2.20050308221307.05dd3e78@mail.harveyk.com>
<9a55fa116ab353592a5392a0815b1628@cyber-ny.com>
Message-ID: <6.1.0.6.2.20050309144651.0502b5e0@mail.harveyk.com>
Ok, well, I think the problem is somehow Yahoo's (the client's host).
The load times for the page have been totally erratic, and so have the form
submit times.
I just copied the page and relevant database tables to a Dreamhost account
I have.
Voila! Everything runs perfectly fast now. Not even 2 seconds to load or
form submit.
Seems like it might be something screwy with the Yahoo mysql server or even
web server.
Not sure, but that's what it seems like to me?
At 10:14 AM 3/9/2005, John Nunez wrote:
>Harvey,
>
>If you have phpMyAdmin on that server run your SQL queries with the
>COMMAND "EXPLAIN" in front of your SELECT Queries. Make sure your have the
>proper indexes on the tables.
>
>Someone previously suggested copying all output to a variable then
>transmitting it to the browser. This will increase the speed of your page
>loading. There will be a slight pause on request but then it just flows in.
>
>500 - 1000 form items is quite a bit of formatting for the browser so make
>sure all formatting is done via CSS. It's one setting for all TABLES, TRs,
>TDs, INPUTs.
>
>Good Luck,
>John Nunez
>
>On Mar 8, 2005, at 10:33 PM, harvey wrote:
>
>>Hello Matt,
>>
>>Thanks for the note. I loaded the page in my browser, copied the source,
>>and uploaded that for the client to test.
>>
>>As far as table rendering, there really shouldn't be an issue since the
>>page is just one table with maybe half a dozen rows, one or two columns max.
>>
>>I'll try validating my html, but I doubt there are any major issues with
>>it; the page is pretty simple, just pretty big.
>>
>>I doubt I can get the client to use Firefox, but probably can get them to
>>upgrade their IE to version 6.
>>
>>Daniel earlier suggested that even though the client and assistant are on
>>different machines, they're "probably on the same network and using the same
>>route over the Internet to/from your server. Have them run trace route."
>>But actually the client and his assistant are at two different companies,
>>different machines, networks, etc. Unless of course they are in the same
>>building and are sharing the same connection, which I guess is possible.
>>I'll check.
>>
>>With some tips from Brent, I implemented a potential fix that he
>>suggested earlier, "My recommendation is to change you code so you are
>>storing everything in a variable, then echo the variable when you have
>>everything. That will probably speed everything up considerably." Still
>>waiting for the client to test and get back to me.
>>
>>Rahmin suggested breaking up the long form with the list of bands into a
>>few smaller pages, but the client already complains that there are too
>>many pages to click through.
>>
>>So, that's where I am right now...
>>
>>Thanks to everyone for their help so far.
>>
>>Harvey
>>
>>
>>
>>At 09:48 PM 3/8/2005, Matt Morgan wrote:
>>
>>>[attempted to rearrange top posting for clarity--my apologies if I
>>>mucked up the ">" signs]
>>>
>>> > harvey wrote:
>>> > > At 12:15 PM 3/8/2005, Faber Fedor wrote:
>>> > > > On 08/03/05 12:06 -0500, harvey wrote:
>>> > > > Hello NYPHP,
>>> > > >
>>> > > > I've got a page that works totally fine for me. Takes a few
>>> seconds to load
>>> > > > on cable connection with IE 6 PC. Works fine for a colleague with
>>> DSL on
>>> > > > the Mac (not sure which browser). But for the most important person
>>> > > > (client!) the page is taking over a minute and a half to load.
>>> He's on Win
>>> > > > XP and IE (probably 6) with cable connection.
>>>
>>> > > Why are you looking at code changes when the problem is obviously with
>>> > > the client's computer/connection?
>>> > > You should find out what the problem is before you start fixing it.
>>>
>>> > Same thing happened to the client's assistant in a different location
>>> on a different system.
>>> > Maybe both their connections are slow. Can't change that. But I can
>>> change the code if that will help.
>>>
>>>This is not a slow connection problem unless every page on your site
>>>loads slow for them. You could test by making a very simple, text/plain
>>>page with as much content as your bands/shows page and seeing if they
>>>download it faster. But I think I know what's going to happen (it will
>>>load fast). If it does load slowly, they have bigger problems.
>>>
>>>Nor do I think it's a problem with your code, unless you are generating
>>>bad HTML (have you validated it?). The browser doesn't see the php, only
>>>the HTML. And if it goes fast for you, the php part is fast. I suspect a
>>>table-rendering issue with their browsers, or maybe they have some funny
>>>filtering setup that scans big pages slowly, or whatever (they,
>>>hopefully, should be able to tell you what the "whatever" might be). Or
>>>maybe (like most Windows computers out there) they're crammed with
>>>viruses and spyware and ... In any case, most likely it's on their end
>>>and changing your code won't fix it, unless you can remove all HTML
>>>tables from the generated page and/or you're sending bad HTML.
>>>
>>>First, test the connection by having them download a large, but simple
>>>page. Second, validate the HTML your code generates. If it validates
>>>your code is good, or good enough. Third, Firefox is free. Ask them to
>>>install it and try your (validated) pages with Firefox. Or, if they
>>>don't want to install Firefox, have them update IE to exactly the
>>>version you're using, or something newer (check to verify what they're
>>>actually using--you're not sure, right?).
>>>
>>>Note: I am more of an admin than a programmer. If that was my network, I
>>>would assume something was wrong on my end and take responsibility for
>>>it. I sincerely believe that your responsibility here is to generate
>>>valid HTML (unless they specified otherwise :-)), and anything else is
>>>their problem. Maybe that's difficult in some way, but you shouldn't be
>>>afraid to say it. If there's something wrong over there, they should
>>>know about it.
>>>
>>>Good luck,
>>>Matt
>>>_______________________________________________
>>>New York PHP Talk Mailing List
>>>AMP Technology
>>>Supporting Apache, MySQL and PHP
>>>http://lists.nyphp.org/mailman/listinfo/talk
>>>http://www.nyphp.org
>>
>>_______________________________________________
>>New York PHP Talk Mailing List
>>AMP Technology
>>Supporting Apache, MySQL and PHP
>>http://lists.nyphp.org/mailman/listinfo/talk
>>http://www.nyphp.org
>
>_______________________________________________
>New York PHP Talk Mailing List
>AMP Technology
>Supporting Apache, MySQL and PHP
>http://lists.nyphp.org/mailman/listinfo/talk
>http://www.nyphp.org
From 1j0lkq002 at sneakemail.com Wed Mar 9 16:11:08 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Wed, 09 Mar 2005 16:11:08 -0500
Subject: [nycphp-talk] Re: Sssllllooooowwwww Page
In-Reply-To: <6.1.0.6.2.20050309144651.0502b5e0@mail.harveyk.com>
References: <6.1.0.6.2.20050308120518.05c3bdf8@127.0.0.1> <20050308171517.GA8042@uranus.faber.nom> <6.1.0.6.2.20050308130934.05c06ef8@mail.harveyk.com> <422E641B.4000905@jiffycomp.com> <6.1.0.6.2.20050308221307.05dd3e78@mail.harveyk.com> <9a55fa116ab353592a5392a0815b1628@cyber-ny.com>
<6.1.0.6.2.20050309144651.0502b5e0@mail.harveyk.com>
Message-ID: <11392-16801@sneakemail.com>
harvey list-at-harveyk.com |nyphp dev/internal group use| wrote:
> Ok, well, I think the problem is somehow Yahoo's (the client's host).
> The load times for the page have been totally erratic, and so have the
> form submit times.
> I just copied the page and relevant database tables to a Dreamhost
> account I have.
> Voila! Everything runs perfectly fast now. Not even 2 seconds to load
> or form submit.
> Seems like it might be something screwy with the Yahoo mysql server or
> even web server.
> Not sure, but that's what it seems like to me?
>
You may want to add a no cache directive to the header, to see if the
various aching systems are causing your delays.
-=john
From phil at bearingasset.com Thu Mar 10 11:19:31 2005
From: phil at bearingasset.com (Phil Duffy)
Date: Thu, 10 Mar 2005 11:19:31 -0500
Subject: [nycphp-talk] Php Framework
In-Reply-To:
Message-ID: <20050310161909.1BC2AA8779@virtu.nyphp.org>
Eric (or anybody else who might contribute),
I appreciate your suggestion about Seagull. I have accessed the
documentation and it appears to be exactly what I was looking for. I have
downloaded seagull-0.4.0dev1.tar.gz and looked into the Install Instructions
for Seagull App Framework, comparing these with the New Installation
instructions from SeagullDocs, and at this point am getting a bit confused.
I would appreciate any pointers you might be able to offer. I have not yet
installed Seagull in the [install-dir] because I am trying to determine what
that should be, but I have familiarized myself with the seagull directory
tree.
For background I am installing on SuSE Linux 9.0 using the XAMPP
distribution, so the PEAR library is already in place. According to XAMPP
documentation, the Apache DocumentRoot directory is /opt/lampp/htdocs/.
My questions are the following:
~ What is [install-dir] in this context?
~ Where do I insert the seagull directory tree in the current filesystem
tree?
~ Are there any other installation steps that I should follow?
~ How does one demonstrate installation success?
Many thanks for any assistance.
Phil
-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Eric Rank
Sent: Friday, March 04, 2005 3:16 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Php Framework
Sajith,
A reasonably good MVC architecture, named Seagull, is here:
http://seagull.phpkitchen.com/
It is developed as a full blown CMS. I didn't want to submit entirely
to it's means of taking care of content, but I found the design and
flow to be very nce. After figuring out how it worked, I stripped it
down to the barebones, and began developing custom modules for it.
I'll back up Alex when it comes to the Flexy templating system. The
forementioned architecture uses them, and man, it couldn't make
separating Busines logic from presentation any easier. It's reasonably
quick to learn too.
Eric Rank
On Fri, 4 Mar 2005 07:36:17 -0500, Alex C wrote:
> I really like Flexy Template in Pear.
> alex
>
>
> On Fri, 4 Mar 2005 14:00:36 +0530, Sajith A wrote:
> > Hello,
> > Could someone please suggest a good framework for php5 that separates
> > business logic and presentation. Also i would like to know whether
> > there it is advisable to go for MVC pattern in php development.
> > Thanks and regards
> > Sajith A
_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org
From devrieda at gmail.com Thu Mar 10 22:39:49 2005
From: devrieda at gmail.com (Derek DeVries)
Date: Thu, 10 Mar 2005 20:39:49 -0700
Subject: [nycphp-talk] object getter/setter methods
Message-ID: <7bdec587050310193974b57ada@mail.gmail.com>
For every object that I create I end up making countless getter/setter
methods. My User class is littered with methods like getUsername(),
getEmail(), etc. This can add up to thousands of lines of code for my
objects. Is there a better way around this? A method like this would
cut down on code:
/**
* Get the value of the given property.
* eg. $username = $user->get('username');
* @param string $var Name of the property
* @return mixed
*/
function get($var)
{
return isset($this->{$var}) ? $this->{$var} : null;
}
However this would allow for access to any of the properties, which I
don't necessarily want. Has anyone tried using the above approach to
success/failure? I suppose another approach would be to make all of
the accessable properties in an associative array. I am aware of
php5's __get/__set magic methods but am currently still using v4. I
like the idea of having the specific getX()/setX() methods in my API
because it seems clearer for others to read. However I feel that I'm
writing a lot of unnecessary code.
I've run into this article titled: Why getter and setter methods are
evil. http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html
This is a java article that advocates eliminating accessors. I'm not
sure if I want to go to that extreme, but I guess there are a few good
points.
From cmerlo441 at gmail.com Fri Mar 11 01:50:43 2005
From: cmerlo441 at gmail.com (Christopher Merlo)
Date: Fri, 11 Mar 2005 01:50:43 -0500
Subject: [nycphp-talk] object getter/setter methods
In-Reply-To: <7bdec587050310193974b57ada@mail.gmail.com>
References: <7bdec587050310193974b57ada@mail.gmail.com>
Message-ID: <94658648050310225021a971aa@mail.gmail.com>
On Thu, 10 Mar 2005 20:39:49 -0700, Derek DeVries wrote:
> For every object that I create I end up making countless getter/setter
> methods.
If I may be allowed to badly paraphrase Dan's point from a couple days
ago, OOP isn't about writing less code now; it's about writing less
code later. And who's going to be writing the code later? Often it's
other people. Give them as many tools as you can to reduce their
code.
Yeah, a complex enough class is going to have tons of get and set
methods. That's part of what makes it easy to use.
--
cmerlo441 at gmail.com
http://www.theyellowbox.com/
From dmintz at davidmintz.org Fri Mar 11 10:44:59 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Fri, 11 Mar 2005 10:44:59 -0500 (EST)
Subject: [nycphp-talk] object getter/setter methods
In-Reply-To: <94658648050310225021a971aa@mail.gmail.com>
References: <7bdec587050310193974b57ada@mail.gmail.com>
<94658648050310225021a971aa@mail.gmail.com>
Message-ID:
I seem to recall working with a Java IDE that had a wizard-lie thingy
where you could make a basic bean. It would create all the getters and
setters for you. You could envision a PHP tool that could look at a PHP
class, see its fields and generate accessor methods for you... I wonder if
it's been done (-:
---
David Mintz
http://davidmintz.org/
From nyphp at enobrev.com Fri Mar 11 12:13:50 2005
From: nyphp at enobrev.com (Mark Armendariz)
Date: Fri, 11 Mar 2005 12:13:50 -0500
Subject: [nycphp-talk] object getter/setter methods
In-Reply-To:
Message-ID: <20050311171345.5BE05A85F0@virtu.nyphp.org>
> You could envision a PHP tool that could look at a PHP
> class, see its fields and generate accessor methods for you... I wonder if
> it's been done (-:
Easy enough to make, no doubt. But I ran into this a WHIIILE back (nice to
see it's still up):
http://www.card2u.com.my/ClassBuilder/
Mark
From krook at us.ibm.com Fri Mar 11 12:27:21 2005
From: krook at us.ibm.com (Daniel Krook)
Date: Fri, 11 Mar 2005 12:27:21 -0500
Subject: [nycphp-talk] object getter/setter methods
In-Reply-To:
Message-ID:
> I seem to recall working with a Java IDE that had a wizard-lie thingy
> where you could make a basic bean. It would create all the getters and
> setters for you. You could envision a PHP tool that could look at a PHP
> class, see its fields and generate accessor methods for you... I wonder
if
> it's been done (-:
Eclipse / WebSphere AD does this, it's very handy... especially when it
comes to refactoring things. I wouldn't be surprised if there were some
PHP plugins that offer similar behavior:
http://www.google.com/search?hl=en&lr=&q=eclipse+php+plugins&btnG=Search
The Web Standards Tool subproject of the Eclipse Web Tools Platform looks
promising too:
"The subproject will provide tools that directly support the base
standards and that are also extensible. For example, the HTML editor will
be extensible to support HTML-based template languages such as PHP and
JSP. While a JSP editor is in the scope of the JST subproject, exemplar
tools for popular Open Source languages such as PHP are in scope."
http://eclipse.org/webtools/
http://eclipse.org/webtools/wst/main.xml
Daniel Krook, Advisory IT Specialist - Application Development
WW Web Production Services North 2, ibm.com
Personal: http://info.krook.org/
BluePages: http://w3.ibm.com/bluepages?searchcnum=9A9796897
From nyphp at n0p.net Fri Mar 11 12:45:33 2005
From: nyphp at n0p.net (Flavio daCosta)
Date: Fri, 11 Mar 2005 12:45:33 -0500
Subject: [nycphp-talk] object getter/setter methods
In-Reply-To: <7bdec587050310193974b57ada@mail.gmail.com>
References: <7bdec587050310193974b57ada@mail.gmail.com>
Message-ID: <1110563134.8925.21.camel@localhost>
I too am curious the consensus of this question. I have thought of
implementing something similar to the following, but havent yet.
I know this can be simplified in php5, but this gives similar
functionality in php4...
Flavio
-- untested code --
function get( $var )
{
if( method_exists( $this, 'get' . $var ) )
{
return call_user_function( array( $this, 'get' . $var) );
}
$public_properties = array( 'exposed_var1', 'exposed_var2' );
if( in_array( $var, $public_properties ) )
{
return $this->{$var};
}
return null;
}
function set( $var, $value )
{
if( method_exists( $this, 'set' . $var ) )
{
return call_user_function( array( $this, 'set' . $var) );
}
$public_properties = array( 'exposed_var1', 'exposed_var2' );
if( in_array( $var, $public_properties && isset( $this->{$var}) )
{
$this->{$var} = $value;
}
}
-- end untested code ---
From ashaw at iifwp.org Fri Mar 11 12:56:38 2005
From: ashaw at iifwp.org (Allen Shaw)
Date: Fri, 11 Mar 2005 12:56:38 -0500
Subject: accessor pros/cons (was [nycphp-talk] object getter/setter methods)
In-Reply-To: <7bdec587050310193974b57ada@mail.gmail.com>
References: <7bdec587050310193974b57ada@mail.gmail.com>
Message-ID: <4231DBD6.6060308@iifwp.org>
Derek's question (balancing the value and trouble of creating accessor
functions for each variable) did not *exactly* match the topic of the
article he mentioned: deciding on the design-wisdom of accessor
functions in general, assuming that they often have the effect of
allowing other code to meddle in what is "really" the business of the
class.
The article says:
> My experience is that maintainability is inversely proportionate to
> the amount of data that moves between objects. Though you might not
> see how yet, you can actually eliminate most of this data movement.
>
> By designing carefully and focusing on what you must do rather than
> how you'll do it, you eliminate the vast majority of getter/setter
> methods in your program. /Don't ask for the information you need to do
> the work; ask the object that has the information to do the work for you./
>
Seems to me he has a point, and as a novice programmer I'm persuaded to
try and avoid reading/manipulating class properties as much as possible
and write the class do whatever the calling code might be doing with
that property. Did anyone read the article and want to comment on it?
- Allen
Derek DeVries wrote:
>For every object that I create I end up making countless getter/setter
>methods. My User class is littered with methods like getUsername(),
>getEmail(), etc. This can add up to thousands of lines of code for my
>objects. Is there a better way around this? A method like this would
>cut down on code:
>
>/**
> * Get the value of the given property.
> * eg. $username = $user->get('username');
> * @param string $var Name of the property
> * @return mixed
> */
>function get($var)
>{
> return isset($this->{$var}) ? $this->{$var} : null;
>}
>
>However this would allow for access to any of the properties, which I
>don't necessarily want. Has anyone tried using the above approach to
>success/failure? I suppose another approach would be to make all of
>the accessable properties in an associative array. I am aware of
>php5's __get/__set magic methods but am currently still using v4. I
>like the idea of having the specific getX()/setX() methods in my API
>because it seems clearer for others to read. However I feel that I'm
>writing a lot of unnecessary code.
>
>I've run into this article titled: Why getter and setter methods are
>evil. http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html
>
>This is a java article that advocates eliminating accessors. I'm not
>sure if I want to go to that extreme, but I guess there are a few good
>points.
>_______________________________________________
>New York PHP Talk Mailing List
>AMP Technology
>Supporting Apache, MySQL and PHP
>http://lists.nyphp.org/mailman/listinfo/talk
>http://www.nyphp.org
>
>
>
--
===========================================================
Allen Shaw ashaw at iifwp.org
IIFWP Data and 914.631.1331 x.106
IT Services http://www.iifwp.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From devrieda at gmail.com Fri Mar 11 12:58:51 2005
From: devrieda at gmail.com (Derek DeVries)
Date: Fri, 11 Mar 2005 10:58:51 -0700
Subject: [nycphp-talk] object getter/setter methods
In-Reply-To: <1110563134.8925.21.camel@localhost>
References: <7bdec587050310193974b57ada@mail.gmail.com>
<1110563134.8925.21.camel@localhost>
Message-ID: <7bdec587050311095847f16e19@mail.gmail.com>
daCosta's approach is pretty much what I was considering. I already
have a small script to automate creating basic classes along with
their getter/setters. My issue lies more in determining if the methods
(extra code) is needed, or if there is a simpler way to do this. It
seems from previous responses that the consensus is to keep the
getter/setter methods.
On Fri, 11 Mar 2005 12:45:33 -0500, Flavio daCosta wrote:
> I too am curious the consensus of this question. I have thought of
> implementing something similar to the following, but havent yet.
From cmerlo441 at gmail.com Fri Mar 11 13:37:19 2005
From: cmerlo441 at gmail.com (Christopher Merlo)
Date: Fri, 11 Mar 2005 13:37:19 -0500
Subject: accessor pros/cons (was [nycphp-talk] object getter/setter methods)
In-Reply-To: <4231DBD6.6060308@iifwp.org>
References: <7bdec587050310193974b57ada@mail.gmail.com>
<4231DBD6.6060308@iifwp.org>
Message-ID: <9465864805031110376f3aee8e@mail.gmail.com>
On Fri, 11 Mar 2005 12:56:38 -0500, Allen Shaw wrote:
> The article says:
>
> By designing carefully and focusing on what you must do rather than how
> you'll do it, you eliminate the vast majority of getter/setter methods in
> your program. Don't ask for the information you need to do the work; ask the
> object that has the information to do the work for you.
I agree with this philosophy, and try to impart it to my (Java)
students. To really *get* OOP, you have to retrain yourself to think
a certain way. (This is slightly easier with my students, most of
whom have never programmed procedurally.) An object should be
self-sufficient, and the user of the object should get the information
needed by doing nothing more than passing a couple of messages to it.
You, the class designer, should have already done all the other work.
I disagree, BTW, with the notion that you can avoid coding the
accessors and mutators, because you never know when someone will want
to use one; however, I do agree that smart class design can avoid the
user's need to call them most of the time.
Like the article said, figure out first what people need to do with
your objects; the rest flows naturally.
--
cmerlo441 at gmail.com
http://www.theyellowbox.com/
From agfische at email.smith.edu Fri Mar 11 15:28:37 2005
From: agfische at email.smith.edu (Aaron Fischer)
Date: Fri, 11 Mar 2005 15:28:37 -0500
Subject: [nycphp-talk] A tale of two tables...
Message-ID: <5942350551ec1979db009acbdfcd0dff@email.smith.edu>
Greetings,
I'm about to build a little mini application and would appreciate a
little feedback/advice.
The application allows for a user to log in and view a list of hosts
and guests. The data is stored in two MySQL tables (one for hosts and
one for guests).
The user will be able to pick a host and match them to a guest.
My plan is to have a column called match_id in both the host and guest
table. When someone selects a host and guest, the app will insert a
unique id into both the host and guest record. My plan was to use a
date/time stamp (including seconds) to create the unique match_id.
Another page view will display the list of matched hosts and guests,
where I will query both tables and join them by the match_id.
So, here are my questions:
Is there a better way to create a unique id than the time/date stamp?
What would happen if two users are logged in at the same time and make
a match at the exact same time? Not sure how MySQL handles when
requests are being made at the same time. Would it barf? Could it
potentially create two identical date/time stamps for two different
matched groups? (That would be very bad, given how I have designed the
system so far).
Thanks in advance for any info and/or pointers, or even just validation
that I'm on the right track. =)
-Aaron
From jfreeman at nybg.org Fri Mar 11 15:30:04 2005
From: jfreeman at nybg.org (Joshua S. Freeman)
Date: Fri, 11 Mar 2005 15:30:04 -0500
Subject: [nycphp-talk] Mbstring
Message-ID:
Question:
We recently upgraded PHP on an internal server to 5.0.3 and we're seeing
some odd stuff with regards to strings.
PhpSupport doesn't really mention anything useful.
But phpMyAdmin throws this:
The mbstring PHP extension was not found and you seem to be using multibyte
charset. Without mbstring extension phpMyAdmin is unable to split strings
correctly and it may result in unexpected results.
Php.ini sez this:
[mbstring]
; language for internal character representation.
;mbstring.language = Japanese
; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
;mbstring.internal_encoding = EUC-JP
; http input encoding.
;mbstring.http_input = auto
; http output encoding. mb_output_handler must be
; registered as output buffer to function
;mbstring.http_output = SJIS
; enable automatic encoding translation accoding to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
; portable libs/applications.
;mbstring.encoding_translation = Off
; automatic encoding detection order.
; auto means
;mbstring.detect_order = auto
; substitute_character used when character cannot be converted
; one from another
;mbstring.substitute_character = none;
; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
;mbstring.func_overload = 0
I know I'm moving in the right direction but I'm not sure what needs to be
uncommented (and then httpd needs to be cycled)...
Does anyone have prior experience they can share which will lead me to
uncomment the right thing and NOT uncomment the WRONG thing?
TIA,
J.
--
COMPUTER HELPDESK (when inside the Garden): http://helpdesk.nybg.org/
Joshua S. Freeman
Dir. of Information Technology
New York Botanical Garden
v: 718 817 8937 m: 347 392 2560
This message (including any attachments) contains confidential information
intended for a specific individual/group of individuals and a specific
purpose, and is protected by law. If you are not an intended recipient, you
should delete this message. Any disclosure, copying, or distribution of
this message, or the taking of any action based on it, is strictly
prohibited.
From dcech at phpwerx.net Fri Mar 11 15:36:40 2005
From: dcech at phpwerx.net (Dan Cech)
Date: Fri, 11 Mar 2005 15:36:40 -0500
Subject: [nycphp-talk] A tale of two tables...
In-Reply-To: <5942350551ec1979db009acbdfcd0dff@email.smith.edu>
References: <5942350551ec1979db009acbdfcd0dff@email.smith.edu>
Message-ID: <42320158.1000103@phpwerx.net>
Ok,
The first question is what kind of relationship are you trying to model
here?
Is it:
- one-one - each host is matched to a single guest
- one-many - each host may be matched to many guests
- many-one - each guest may be matched to multiple hosts
- many-many - each host may be matched to many guests and each guest may
be matched to many hosts
If it is 1-1, then you would only need a column in the host table to
hold the id of the matched guest, with a unique index to prevent
multiple hosts being matched to the same guest. You could also do this
in reverse (add a column to the guest table to hold the id of the
matched host)
If it is 1-many or many-1 you do the same thing but without the unique index
If it is many-many you will need a third table to hold the matches.
This table would have at least 2 fields to hold the host id and guest
id. You may want to add other fields such as the event or user (if I am
on the right track in terms of your application)
Dan
Aaron Fischer wrote:
> Greetings,
>
> I'm about to build a little mini application and would appreciate a
> little feedback/advice.
>
> The application allows for a user to log in and view a list of hosts and
> guests. The data is stored in two MySQL tables (one for hosts and one
> for guests).
>
> The user will be able to pick a host and match them to a guest.
>
> My plan is to have a column called match_id in both the host and guest
> table. When someone selects a host and guest, the app will insert a
> unique id into both the host and guest record. My plan was to use a
> date/time stamp (including seconds) to create the unique match_id.
>
> Another page view will display the list of matched hosts and guests,
> where I will query both tables and join them by the match_id.
>
> So, here are my questions:
>
> Is there a better way to create a unique id than the time/date stamp?
> What would happen if two users are logged in at the same time and make a
> match at the exact same time? Not sure how MySQL handles when requests
> are being made at the same time. Would it barf? Could it potentially
> create two identical date/time stamps for two different matched groups?
> (That would be very bad, given how I have designed the system so far).
>
> Thanks in advance for any info and/or pointers, or even just validation
> that I'm on the right track. =)
>
> -Aaron
>
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
From agfische at email.smith.edu Fri Mar 11 15:46:19 2005
From: agfische at email.smith.edu (Aaron Fischer)
Date: Fri, 11 Mar 2005 15:46:19 -0500
Subject: [nycphp-talk] A tale of two tables...
In-Reply-To: <42320158.1000103@phpwerx.net>
References: <5942350551ec1979db009acbdfcd0dff@email.smith.edu>
<42320158.1000103@phpwerx.net>
Message-ID: <04c6cd7f5b0895273c26d58864633cb0@email.smith.edu>
> The first question is what kind of relationship are you trying to
> model here?
>
> Is it:
> - one-one - each host is matched to a single guest
>
Yes, it's one-one.
> If it is 1-1, then you would only need a column in the host table to
> hold the id of the matched guest, with a unique index to prevent
> multiple hosts being matched to the same guest. You could also do
> this in reverse (add a column to the guest table to hold the id of the
> matched host)
>
> Dan
I do indeed have a unique index (in both tables). I'm a bit of a SQL
(joining) novice. I will create the column in one of the tables to
hold the unique id of the other.
That's really cool, simple and elegant, I love it.
Thanks Dan!
-Aaron
From dcech at phpwerx.net Fri Mar 11 15:55:23 2005
From: dcech at phpwerx.net (Dan Cech)
Date: Fri, 11 Mar 2005 15:55:23 -0500
Subject: [nycphp-talk] A tale of two tables...
In-Reply-To: <04c6cd7f5b0895273c26d58864633cb0@email.smith.edu>
References: <5942350551ec1979db009acbdfcd0dff@email.smith.edu> <42320158.1000103@phpwerx.net>
<04c6cd7f5b0895273c26d58864633cb0@email.smith.edu>
Message-ID: <423205BB.3050903@phpwerx.net>
Happy to be able to help.
Dan
Aaron Fischer wrote:
>> The first question is what kind of relationship are you trying to
>> model here?
>>
>> Is it:
>> - one-one - each host is matched to a single guest
>>
>
> Yes, it's one-one.
>
>> If it is 1-1, then you would only need a column in the host table to
>> hold the id of the matched guest, with a unique index to prevent
>> multiple hosts being matched to the same guest. You could also do
>> this in reverse (add a column to the guest table to hold the id of the
>> matched host)
>>
>> Dan
>
>
>
>
> I do indeed have a unique index (in both tables). I'm a bit of a SQL
> (joining) novice. I will create the column in one of the tables to hold
> the unique id of the other.
>
> That's really cool, simple and elegant, I love it.
>
> Thanks Dan!
>
> -Aaron
From john at cyber-ny.com Fri Mar 11 16:32:11 2005
From: john at cyber-ny.com (John Nunez)
Date: Fri, 11 Mar 2005 16:32:11 -0500
Subject: [nycphp-talk] Q: How can I get all of the articles under a certain
category?
Message-ID: <0d850d9e0d7efb733b5401e754191899@cyber-ny.com>
Hi Guys,
How can I get all of the articles under a certain category?
I have a table with the following structure:
Categories
ID - int
CategoryName - varchar(128)
ParentID - int [Foreign Key to Categories->ID]
Articles
ID - int
Category_ID - int [Foreign Key to Categories->ID]
Article_Name - varchar(128)
Sample Category Tree
--------------------
Food[1]
--Natural[2]
----Fruits[3]
------Apples[4]
------Pears[5]
------Oranges[6]
Now the client wants to be able to click on "Natural" and if there are
no articles listed directly under it get all the articles for "Fruits",
"Apples", "Pears", "Oranges".
The only solution I have is to write a recursive function that will
retrieve each CategoryID that has the ParentID of the argument passed.
Once I have this array of CategoryIDs can then run a query on the
Articles table. As this tree grows it can amount to tons of MySQL
Queries for each click that might be skipped anyway. Is there anyway to
do this with one or two calls in MySQL?
I have argued against this but "the powers that be" told me it's a must
have feature.
Thanks,
John
From dcech at phpwerx.net Fri Mar 11 16:43:15 2005
From: dcech at phpwerx.net (Dan Cech)
Date: Fri, 11 Mar 2005 16:43:15 -0500
Subject: [nycphp-talk] Q: How can I get all of the articles under a certain
category?
In-Reply-To: <0d850d9e0d7efb733b5401e754191899@cyber-ny.com>
References: <0d850d9e0d7efb733b5401e754191899@cyber-ny.com>
Message-ID: <423210F3.6010402@phpwerx.net>
John,
Unfortunately there is no easy way that I know of to do this with the
structure you are using, because it's not a 'true' hierarchy.
My favorite solution is a modified version of Joe Celko's Nested Sets.
Basically there is no elegant way to do it without changing your
database structure.
Dan
John Nunez wrote:
> Hi Guys,
>
> How can I get all of the articles under a certain category?
>
> I have a table with the following structure:
>
> Categories
> ID - int
> CategoryName - varchar(128)
> ParentID - int [Foreign Key to Categories->ID]
>
> Articles
> ID - int
> Category_ID - int [Foreign Key to Categories->ID]
> Article_Name - varchar(128)
>
> Sample Category Tree
> --------------------
> Food[1]
> --Natural[2]
> ----Fruits[3]
> ------Apples[4]
> ------Pears[5]
> ------Oranges[6]
>
> Now the client wants to be able to click on "Natural" and if there are
> no articles listed directly under it get all the articles for "Fruits",
> "Apples", "Pears", "Oranges".
>
> The only solution I have is to write a recursive function that will
> retrieve each CategoryID that has the ParentID of the argument passed.
> Once I have this array of CategoryIDs can then run a query on the
> Articles table. As this tree grows it can amount to tons of MySQL
> Queries for each click that might be skipped anyway. Is there anyway to
> do this with one or two calls in MySQL?
>
> I have argued against this but "the powers that be" told me it's a must
> have feature.
>
> Thanks,
> John
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
From dcech at phpwerx.net Fri Mar 11 16:46:55 2005
From: dcech at phpwerx.net (Dan Cech)
Date: Fri, 11 Mar 2005 16:46:55 -0500
Subject: [nycphp-talk] Q: How can I get all of the articles under a certain
category?
In-Reply-To: <0d850d9e0d7efb733b5401e754191899@cyber-ny.com>
References: <0d850d9e0d7efb733b5401e754191899@cyber-ny.com>
Message-ID: <423211CF.20508@phpwerx.net>
John,
On a side note, if you are forced to build the recursive system it can
actually be more efficient to retrieve the entire hierarchy tree with
one SQL call and build it up in memory that to execute a query for each
category.
Dan
John Nunez wrote:
> Hi Guys,
>
> How can I get all of the articles under a certain category?
>
> I have a table with the following structure:
>
> Categories
> ID - int
> CategoryName - varchar(128)
> ParentID - int [Foreign Key to Categories->ID]
>
> Articles
> ID - int
> Category_ID - int [Foreign Key to Categories->ID]
> Article_Name - varchar(128)
>
> Sample Category Tree
> --------------------
> Food[1]
> --Natural[2]
> ----Fruits[3]
> ------Apples[4]
> ------Pears[5]
> ------Oranges[6]
>
> Now the client wants to be able to click on "Natural" and if there are
> no articles listed directly under it get all the articles for "Fruits",
> "Apples", "Pears", "Oranges".
>
> The only solution I have is to write a recursive function that will
> retrieve each CategoryID that has the ParentID of the argument passed.
> Once I have this array of CategoryIDs can then run a query on the
> Articles table. As this tree grows it can amount to tons of MySQL
> Queries for each click that might be skipped anyway. Is there anyway to
> do this with one or two calls in MySQL?
>
> I have argued against this but "the powers that be" told me it's a must
> have feature.
>
> Thanks,
> John
From mjdewitt at alexcommgrp.com Fri Mar 11 16:54:20 2005
From: mjdewitt at alexcommgrp.com (DeWitt, Michael)
Date: Fri, 11 Mar 2005 16:54:20 -0500
Subject: [nycphp-talk] Q: How can I get all of the articles under a cer
tain category?
Message-ID:
How about getting counts of articles for the parent and then you can walk
the counts checking to see if articles exist?
step 1
get parent id of category needed (select from categories)
step 2
get counts for all categories under parent id ( join
articles to categories )
step 3
if you have article(s) under the category id fetch them
else show tree of categories within parent that do have
counts
This method should allow you to walk up and down the parent/category tree. I
know you mentioned walng down from the parent to category, but what if they
said "apples" and you have no article, what will you offer instead?
Mike
> -----Original Message-----
> From: Dan Cech [SMTP:dcech at phpwerx.net]
> Sent: Friday, March 11, 2005 4:43 PM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] Q: How can I get all of the articles under
> a certain category?
>
> John,
>
> Unfortunately there is no easy way that I know of to do this with the
> structure you are using, because it's not a 'true' hierarchy.
>
> My favorite solution is a modified version of Joe Celko's Nested Sets.
>
> Basically there is no elegant way to do it without changing your
> database structure.
>
> Dan
>
> John Nunez wrote:
> > Hi Guys,
> >
> > How can I get all of the articles under a certain category?
> >
> > I have a table with the following structure:
> >
> > Categories
> > ID - int
> > CategoryName - varchar(128)
> > ParentID - int [Foreign Key to Categories->ID]
> >
> > Articles
> > ID - int
> > Category_ID - int [Foreign Key to Categories->ID]
> > Article_Name - varchar(128)
> >
> > Sample Category Tree
> > --------------------
> > Food[1]
> > --Natural[2]
> > ----Fruits[3]
> > ------Apples[4]
> > ------Pears[5]
> > ------Oranges[6]
> >
> > Now the client wants to be able to click on "Natural" and if there are
> > no articles listed directly under it get all the articles for "Fruits",
> > "Apples", "Pears", "Oranges".
> >
> > The only solution I have is to write a recursive function that will
> > retrieve each CategoryID that has the ParentID of the argument passed.
> > Once I have this array of CategoryIDs can then run a query on the
> > Articles table. As this tree grows it can amount to tons of MySQL
> > Queries for each click that might be skipped anyway. Is there anyway to
> > do this with one or two calls in MySQL?
> >
> > I have argued against this but "the powers that be" told me it's a must
> > have feature.
> >
> > Thanks,
> > John
> >
> > _______________________________________________
> > New York PHP Talk Mailing List
> > AMP Technology
> > Supporting Apache, MySQL and PHP
> > http://lists.nyphp.org/mailman/listinfo/talk
> > http://www.nyphp.org
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
From lists at zaunere.com Fri Mar 11 16:57:38 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Fri, 11 Mar 2005 16:57:38 -0500
Subject: [nycphp-talk] Q: How can I get all of the articles under a
certaincategory?
In-Reply-To: <423210F3.6010402@phpwerx.net>
Message-ID: <0MKz1m-1D9s8b3MVz-0006rD@mrelay.perfora.net>
> Unfortunately there is no easy way that I know of to do this with the
> structure you are using, because it's not a 'true' hierarchy.
>
> My favorite solution is a modified version of Joe Celko's Nested Sets.
>
> Basically there is no elegant way to do it without changing your
> database structure.
>
> Dan
>
> John Nunez wrote:
> > Hi Guys,
> >
> > How can I get all of the articles under a certain category?
> >
> > I have a table with the following structure:
> >
> > Categories
> > ID - int
> > CategoryName - varchar(128)
> > ParentID - int [Foreign Key to Categories->ID]
> >
> > Articles
> > ID - int
> > Category_ID - int [Foreign Key to Categories->ID]
> > Article_Name - varchar(128)
> >
> > Sample Category Tree
> > --------------------
> > Food[1]
> > --Natural[2]
> > ----Fruits[3]
> > ------Apples[4]
> > ------Pears[5]
> > ------Oranges[6]
> >
> > Now the client wants to be able to click on "Natural" and if there are
> > no articles listed directly under it get all the articles for "Fruits",
> > "Apples", "Pears", "Oranges".
> >
> > The only solution I have is to write a recursive function that will
> > retrieve each CategoryID that has the ParentID of the argument passed.
> > Once I have this array of CategoryIDs can then run a query on the
> > Articles table. As this tree grows it can amount to tons of MySQL
> > Queries for each click that might be skipped anyway. Is there anyway to
> > do this with one or two calls in MySQL?
If you're using MySQL 4.1 you can use subqueries, which will reduce the number of distinct queries you're hitting the database with. There are essentially two forms:
derived tables
SELECT * FROM (SELECT * FROM othertable)
and regular:
SELECT * FROM mytable WHERE column1 = (SELECT column1 FROM othertable)
There are also many variations:
http://dev.mysql.com/doc/mysql/en/subqueries.html
At the end of the day, however, with the structure you have in place, you'll be somewhat limited. NSM (nested set model) is the way to go if possible. Here's an implementation of it that I did, although it needs to be updated:
http://pcomd.net/pcom.php?pcomname=pnsm
and could be optimized for MySQL 4.1.
---
Hans Zaunere
President, Founder
New York PHP
http://www.nyphp.org
AMP Technology
Supporting Apache, MySQL and PHP
From yury at heavenspa.com Fri Mar 11 17:16:12 2005
From: yury at heavenspa.com (Yury :: heavenspa Web Services)
Date: Fri, 11 Mar 2005 17:16:12 -0500
Subject: [nycphp-talk] questions --
References: <0d850d9e0d7efb733b5401e754191899@cyber-ny.com>
<423210F3.6010402@phpwerx.net>
Message-ID: <026501c52687$ef4d2ce0$8e7ba8c0@400sc>
hi folks..
I have some questions, maybe someone can offer some good suggestions.
-i have a client who is a photolab, he want to offer his clients the ability
to upload their images to him. My solution was building a website, using php
to let his clients upload the files. Files can be anywhere from 1 meg to 15
megs - EACH.
I found a inexpensive phpupload script with great functionality.
http://www.scriptscenter.com/ezupload/
There are a few issues --
- since the files are large -- php.ini by default lets you upload 2meg files
- uploading such huge files could timeout while uploading..
question: is there a way around these 2 issues?
next - the client also asked about automating the files to download to his
internal computers.. Is there anything out there that could do such a thing?
Has anyone worked on anything like this before.. any ideas-
sugestions-comments?
thanks in advance.
regards
yury
From andrew at plexpod.com Fri Mar 11 19:13:51 2005
From: andrew at plexpod.com (Andrew Yochum)
Date: Fri, 11 Mar 2005 19:13:51 -0500
Subject: [nycphp-talk] questions --
In-Reply-To: <026501c52687$ef4d2ce0$8e7ba8c0@400sc>
References: <0d850d9e0d7efb733b5401e754191899@cyber-ny.com>
<423210F3.6010402@phpwerx.net>
<026501c52687$ef4d2ce0$8e7ba8c0@400sc>
Message-ID: <20050312001332.GG12129@desario.homelinux.net>
On Fri, Mar 11, 2005 at 05:16:12PM -0500, Yury :: heavenspa Web Services wrote:
> I found a inexpensive phpupload script with great functionality.
> http://www.scriptscenter.com/ezupload/
>
> There are a few issues --
> - since the files are large -- php.ini by default lets you upload 2meg files
> - uploading such huge files could timeout while uploading..
>
> question: is there a way around these 2 issues?
Yep. You'll need some control over the apache and PHP config. I've
gotten similar things working with very large files successfully. This
looks like a good guide:
http://www.mambodocman.com/index2.php?option=content&do_pdf=1&id=5
> next - the client also asked about automating the files to download to his
> internal computers.. Is there anything out there that could do such a thing?
You could automate this by running the command line version of Unison
(file synchronizer) in a script periodically with the Windows Task
Scheduler or a cron job. See:
http://www.cis.upenn.edu/~bcpierce/unison/
http://www.iopus.com/guides/winscheduler.htm
http://www.help2go.com/article182.html
HTH,
Andrew
From 1j0lkq002 at sneakemail.com Fri Mar 11 20:55:30 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Fri, 11 Mar 2005 20:55:30 -0500
Subject: [nycphp-talk] questions --
In-Reply-To: <026501c52687$ef4d2ce0$8e7ba8c0@400sc>
References: <0d850d9e0d7efb733b5401e754191899@cyber-ny.com> <423210F3.6010402@phpwerx.net>
<026501c52687$ef4d2ce0$8e7ba8c0@400sc>
Message-ID: <17415-12936@sneakemail.com>
Yury :: heavenspa Web Services yury-at-heavenspa.com |nyphp dev/internal
group use| wrote:
> hi folks..
>
> I have some questions, maybe someone can offer some good suggestions.
>
> -i have a client who is a photolab, he want to offer his clients the
> ability to upload their images to him. My solution was building a
> website, using php to let his clients upload the files. Files can be
> anywhere from 1 meg to 15 megs - EACH.
>
> I found a inexpensive phpupload script with great functionality.
> http://www.scriptscenter.com/ezupload/
>
> There are a few issues -- - since the files are large -- php.ini by
> default lets you upload 2meg files
> - uploading such huge files could timeout while uploading..
>
> question: is there a way around these 2 issues?
>
> next - the client also asked about automating the files to download to
> his internal computers.. Is there anything out there that could do
> such a thing?
>
> Has anyone worked on anything like this before.. any ideas-
> sugestions-comments?
>
> thanks in advance.
> regards
> yury
> _
I don't know the coders personally, but you might look at smugmug.com
for an example. They provide a choice of just about all the ways to do
it.... I grew up with them as a photo site and it was kind of painful as
they figure out ways to do it over the past few years:
java applet if your browser can handle it, one-at-a-time html uploads,
multiple-selects via JS for html upload, FTP via browser, progress bar
via refresh (PHP or other), ActiveX component, etc.
Now it's easy and files can be huge. The latest work is a full API which
resulted in users building cool tools like a Windows Explorer drag 'n
drop tool and web services for uploading/downloading entire galleries.
One person even built a scraper as a means of backing up his library,
thumbnails and all (that project might have prompted the opening of the
API :-)
-=john andrews
From rs234 at cornell.edu Fri Mar 11 22:57:03 2005
From: rs234 at cornell.edu (Wai Siow)
Date: Fri, 11 Mar 2005 22:57:03 -0500 (EST)
Subject: [nycphp-talk] questions --
In-Reply-To: <20050312001332.GG12129@desario.homelinux.net>
References: <0d850d9e0d7efb733b5401e754191899@cyber-ny.com>
<423210F3.6010402@phpwerx.net> <026501c52687$ef4d2ce0$8e7ba8c0@400sc>
<20050312001332.GG12129@desario.homelinux.net>
Message-ID: <1576.65.110.156.52.1110599823.squirrel@65.110.156.52>
Hey Yuri:
First post after joining the list, hi everyone! And see below:
> On Fri, Mar 11, 2005 at 05:16:12PM -0500, Yury :: heavenspa Web Services
> wrote:
>> I found a inexpensive phpupload script with great functionality.
>> http://www.scriptscenter.com/ezupload/
>>
>> There are a few issues --
>> - since the files are large -- php.ini by default lets you upload 2meg
>> files
>> - uploading such huge files could timeout while uploading..
>>
>> question: is there a way around these 2 issues?
>
> Yep. You'll need some control over the apache and PHP config. I've
> gotten similar things working with very large files successfully. This
> looks like a good guide:
> http://www.mambodocman.com/index2.php?option=content&do_pdf=1&id=5
Given you do have access to these settings you can simply change the time,
size, and such... also, I believe the upload size limit can be set from
the script itself, so you can change it there if you don't want to
globally increases the upload size. As for the upload script, if you
really want to stick with just php, you can always utilize javascript to
create more "file" form fields (similar to gmail's attachment upload if
you have seen it) as necessary in real time. Then you can use that
information to set your upload limit dynamically.
>> next - the client also asked about automating the files to download to
>> his
>> internal computers.. Is there anything out there that could do such a
>> thing?
>
> You could automate this by running the command line version of Unison
> (file synchronizer) in a script periodically with the Windows Task
> Scheduler or a cron job. See:
> http://www.cis.upenn.edu/~bcpierce/unison/
> http://www.iopus.com/guides/winscheduler.htm
> http://www.help2go.com/article182.html
First time I hear about unison, but Andrew's suggestion is definitely the
way to go, either set up a cron job or windows task should do the job, and
you can write the script to do this in any language.
> HTH,
> Andrew
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
Wai (Raymond) Siow
Web Application Programmer
Web Development Team
Cornell Cooperative Extension
From john at cyber-ny.com Fri Mar 11 23:45:35 2005
From: john at cyber-ny.com (John Nunez)
Date: Fri, 11 Mar 2005 23:45:35 -0500
Subject: [nycphp-talk] Q: How can I get all of the articles under a
certaincategory?
In-Reply-To: <0MKz1m-1D9s8b3MVz-0006rD@mrelay.perfora.net>
References: <0MKz1m-1D9s8b3MVz-0006rD@mrelay.perfora.net>
Message-ID: <418e97bd78ae2cb7bf7fda5d77e20b7d@cyber-ny.com>
I want to thanks everyone for their comments! The client and my boss
decided to drop this feature. Notch one for the developer.
I want to learn more about Nested Set Models so I have been googling
around on this. This project would take a lot of work to convert (270
category entries, 57 on the root). It was the fact that 3000 articles
would be displayed on the click of Root that made the client change
their minds. Their board members are still on AOL Dial Up.
Thanks,
John
On Mar 11, 2005, at 4:57 PM, Hans Zaunere wrote:
>
>> Unfortunately there is no easy way that I know of to do this with the
>> structure you are using, because it's not a 'true' hierarchy.
>>
>> My favorite solution is a modified version of Joe Celko's Nested Sets.
>>
>> Basically there is no elegant way to do it without changing your
>> database structure.
>>
>> Dan
>>
>> John Nunez wrote:
>>> Hi Guys,
>>>
>>> How can I get all of the articles under a certain category?
>>>
>>> I have a table with the following structure:
>>>
>>> Categories
>>> ID - int
>>> CategoryName - varchar(128)
>>> ParentID - int [Foreign Key to Categories->ID]
>>>
>>> Articles
>>> ID - int
>>> Category_ID - int [Foreign Key to Categories->ID]
>>> Article_Name - varchar(128)
>>>
>>> Sample Category Tree
>>> --------------------
>>> Food[1]
>>> --Natural[2]
>>> ----Fruits[3]
>>> ------Apples[4]
>>> ------Pears[5]
>>> ------Oranges[6]
>>>
>>> Now the client wants to be able to click on "Natural" and if there
>>> are
>>> no articles listed directly under it get all the articles for
>>> "Fruits",
>>> "Apples", "Pears", "Oranges".
>>>
>>> The only solution I have is to write a recursive function that will
>>> retrieve each CategoryID that has the ParentID of the argument
>>> passed.
>>> Once I have this array of CategoryIDs can then run a query on the
>>> Articles table. As this tree grows it can amount to tons of MySQL
>>> Queries for each click that might be skipped anyway. Is there anyway
>>> to
>>> do this with one or two calls in MySQL?
>
> If you're using MySQL 4.1 you can use subqueries, which will reduce
> the number of distinct queries you're hitting the database with.
> There are essentially two forms:
>
> derived tables
>
> SELECT * FROM (SELECT * FROM othertable)
>
> and regular:
>
> SELECT * FROM mytable WHERE column1 = (SELECT column1 FROM othertable)
>
> There are also many variations:
>
> http://dev.mysql.com/doc/mysql/en/subqueries.html
>
> At the end of the day, however, with the structure you have in place,
> you'll be somewhat limited. NSM (nested set model) is the way to go
> if possible. Here's an implementation of it that I did, although it
> needs to be updated:
>
> http://pcomd.net/pcom.php?pcomname=pnsm
>
> and could be optimized for MySQL 4.1.
>
>
> ---
> Hans Zaunere
> President, Founder
>
> New York PHP
> http://www.nyphp.org
>
> AMP Technology
> Supporting Apache, MySQL and PHP
>
>
>
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From john at cyber-ny.com Fri Mar 11 23:59:08 2005
From: john at cyber-ny.com (John Nunez)
Date: Fri, 11 Mar 2005 23:59:08 -0500
Subject: [nycphp-talk] questions --
In-Reply-To: <026501c52687$ef4d2ce0$8e7ba8c0@400sc>
References: <0d850d9e0d7efb733b5401e754191899@cyber-ny.com>
<423210F3.6010402@phpwerx.net>
<026501c52687$ef4d2ce0$8e7ba8c0@400sc>
Message-ID: <4de4b57e931c719f8b3c624de0dae2cf@cyber-ny.com>
Yury,
You can have the user compress the files and upload. List the directory
of the compress file, get the user's comments on the order, insert a
order file into the compressed file, place a copy on a backup directory
and a copy on the sync directory. Use RSYNC over SSH to get the files
onto the client's PC. Using Cron and SSH Keys would be secure and
automated.
Thanks,
John
On Mar 11, 2005, at 5:16 PM, Yury :: heavenspa Web Services wrote:
> hi folks..
>
> I have some questions, maybe someone can offer some good suggestions.
>
> -i have a client who is a photolab, he want to offer his clients the
> ability to upload their images to him. My solution was building a
> website, using php to let his clients upload the files. Files can be
> anywhere from 1 meg to 15 megs - EACH.
>
> I found a inexpensive phpupload script with great functionality.
> http://www.scriptscenter.com/ezupload/
>
> There are a few issues -- - since the files are large -- php.ini by
> default lets you upload 2meg files
> - uploading such huge files could timeout while uploading..
>
> question: is there a way around these 2 issues?
>
> next - the client also asked about automating the files to download to
> his internal computers.. Is there anything out there that could do
> such a thing?
>
> Has anyone worked on anything like this before.. any ideas-
> sugestions-comments?
>
> thanks in advance.
> regards
> yury
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From tgales at tgaconnect.com Sat Mar 12 07:27:45 2005
From: tgales at tgaconnect.com (Tim Gales)
Date: Sat, 12 Mar 2005 07:27:45 -0500
Subject: [nycphp-talk] questions --
In-Reply-To: <1576.65.110.156.52.1110599823.squirrel@65.110.156.52>
Message-ID: <000601c526fe$e52d5830$d0893818@oberon1>
Wai Siow writes:
>...I believe the upload
> size limit can be set from the script itself, so you can
> change it there if you don't want to globally increases the
> upload size.
Upload_max_filesize is per directory...
Here is some information from the php manual which may
be helpful:
upload_max_filesize (PHP_INI_PERDIR -- default 2M)
post_max_size (PHP_INI_PERDIR -- default 8M)
"To upload large files, this value [post_max_size] must be
larger than upload_max_filesize."
memory_limit (PHP_INI_ALL -- default 8M)
"If memory limit is enabled by your configure script, memory_limit
also affects file uploading. Generally speaking, memory_limit should
be larger than post_max_size"
And as yuri originally mentioned, max_input_time (PHP_INI_ALL --
default 60 seconds) could come into play as a limiting factor.
(Hmmn, file uploading -- could be a good topic for a phundamental)
T. Gales & Associates
'Helping People Connect with Technology'
http://www.tgaconnect.com
From jayeshsh at ceruleansky.com Sat Mar 12 10:34:45 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Sat, 12 Mar 2005 10:34:45 -0500 (EST)
Subject: [nycphp-talk] PHP on Win.: Get Drive Letter for Current Script
Message-ID: <42692.69.86.84.233.1110641685.spork@webmail.ceruleansky.com>
Hello all,
I am trying to get PHP to co-operate when it comes to creating a CD- /
flash-drive-based catalog.
When a user pops in a CD or USB drive, the running PHP script should be
able to detect which drive letter it's on. Depending on how the eventual
application evolves, if the user chooses to install the catalog viewer on
another drive (say c:\ or d:\), the resulting PHP script(s) that are
copied to those drives need to know which drive they reside on (so some
configuration files with drive information in them can be written).
I was thinking of using the WinRar self extracting module to extract and
copy the files from CD (or from a download) onto the chosen drive. WinRar
can run a .bat or .exe file post-installation. In this case, it would be a
.bat file that runs a PHP script which writes configuration files with
information such as 'absolute path to htdocs subdirectory on this drive'
and so on.
Perhaps I need to use a better installer such as Nullsoft's installer
which might write customized files for me. But I was thinking: it is nicer
to initial setup in PHP, especially since it is not rocket science - it is
just figuring out on which drive the script is running, and the absolute
paths to various subdirectories, and then writing to those subdirectory.
You can get the relative path to the currently running script from $_ENV,
but not the path with a drive letter. (The HTTP server for the catalog
needs an absolute path.)
The $_ENV environment variable contains various reference to the
'homedrive', for example $_ENV['homedrive']. But what if the user chooses
to install the catalog viewer to d:\, or e:\ ? This information is not
provided by $_ENV.
I did some research, and came across the W32api functions:
http://us4.php.net/manual/en/ref.w32api.php
This extension enables you to call functions available in Windows dlls (or
other dlls) using PHP.
I also found a good article on the subject at PHP Architect (
https://www.phparch.com/issue.php?mid=5 ).
This article lists the following code snippet to get and display
information using the GetSystemInfo function from kernel32.dll. I looked
at Microsoft's API documentation on this subject (
http://msdn.microsoft.com/library/en-us/sysinfo/base/getsysteminfo.asp?frame=true
) but I could not find out how to use this function to determine the drive
letter on which the current script is running.
Does anyone know how to do this using the W32api extension or by any other
method?
One (convoluted) way to do this would be to let the script check for the
existence of a file on all drives, C - Z using is_file(). So it would
check for c:\myfile123.php, d:\myfile123.php, and so on. But this is not
the best way to do it. There has got to be a better way!
Here is the code I mentioned above (had to copy this from the PDF as the
code was for some reason not listed on disk):
1
2
3
4 Windows System Information
5
6
7
Windows System Information
8
9
Property
10
Value
11
12
" . $type_elements[$i] . "
" .
55 $arr[$type_elements[$i]] . "
\n";
56 }
57
58 // Space out a buffer again for use with GetSystemDirectoryA()
59
60 $buf=str_repeat(' ', 64);
61
62 // Run our other Windows API functions and display their results in a
HTML table
63 GetSystemDirectoryA($buf, strlen($buf));
64
65 echo "
SystemDirectory
" . $buf . "
\n";
66
67 echo "
Version
" . GetVersion() . "
\n";
68
69 ?>
70
71
72
73
From chsnyder at gmail.com Sat Mar 12 10:40:28 2005
From: chsnyder at gmail.com (csnyder)
Date: Sat, 12 Mar 2005 10:40:28 -0500
Subject: [nycphp-talk] Mbstring
In-Reply-To:
References:
Message-ID:
On Fri, 11 Mar 2005 15:30:04 -0500, Joshua S. Freeman wrote:
>
> Question:
>
> We recently upgraded PHP on an internal server to 5.0.3 and we're seeing
> some odd stuff with regards to strings.
>
> PhpSupport doesn't really mention anything useful.
>
> But phpMyAdmin throws this:
>
> The mbstring PHP extension was not found and you seem to be using multibyte
> charset. Without mbstring extension phpMyAdmin is unable to split strings
> correctly and it may result in unexpected results.
I'm not an expert on this, as PHP's native support for utf-8 has
always been enough for me.
But answers to the following might be helpful in troubleshooting:
Are you, in fact, using multibyte characters? What characterset?
Was your previous version of PHP compiled with mbstring enabled? Are
you using the same ini file?
From tgales at tgaconnect.com Sat Mar 12 11:13:28 2005
From: tgales at tgaconnect.com (Tim Gales)
Date: Sat, 12 Mar 2005 11:13:28 -0500
Subject: [nycphp-talk] PHP on Win.: Get Drive Letter for Current Script
In-Reply-To: <42692.69.86.84.233.1110641685.spork@webmail.ceruleansky.com>
Message-ID: <000001c5271e$6dda6aa0$d0893818@oberon1>
Jayesh Sheth writes:
> I am trying to get PHP to co-operate when it comes to
> creating a CD- / flash-drive-based catalog.
>
> When a user pops in a CD or USB drive, the running PHP script
> should be able to detect which drive letter it's on.
> I also found a good article on the subject at PHP Architect (
> https://www.phparch.com/issue.php?mid=5 ).
>
> This article lists the following code snippet to get and
> display information using the GetSystemInfo function from
> kernel32.dll. I looked at Microsoft's API documentation on
> this subject (
> http://msdn.microsoft.com/library/en-us/sysinfo/base/getsystem
> info.asp?frame=true
> ) but I could not find out how to use this function to
> determine the drive letter on which the current script is running.
GetCurrentDirectory( sizeof( DirPath ), DirPath );
should give you the active drive and directory.
I don't know if you can hook up to the call with
w32api_invoke_function (....)
Seems like it might possibly work...
T. Gales & Associates
'Helping People Connect with Technology'
http://www.tgaconnect.com
From lists at zaunere.com Sat Mar 12 11:44:51 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Sat, 12 Mar 2005 11:44:51 -0500
Subject: [nycphp-talk] Mbstring
In-Reply-To:
Message-ID: <0MKz5u-1DA9jT33kG-0001tX@mrelay.perfora.net>
> We recently upgraded PHP on an internal server to 5.0.3 and we're seeing
> some odd stuff with regards to strings.
String in general, or really just the warning from phpMyAdmin?
> PhpSupport doesn't really mention anything useful.
>
> But phpMyAdmin throws this:
>
> The mbstring PHP extension was not found and you seem to be using multibyte
> charset. Without mbstring extension phpMyAdmin is unable to split strings
> correctly and it may result in unexpected results.
It's likely you don't have the mbstring extension installed. You can recompiled PHP with --enable-mbstring, or if you're on Windows you can uncomment the php_mbstring.dll line and restart.
http://sourceforge.net/forum/message.php?msg_id=2984100
Or do what I do and ignore it - I'm not using multibyte characters, so phpMyAdmin is flapping in the wind.
---
Hans Zaunere
President, Founder
New York PHP
http://www.nyphp.org
AMP Technology
Supporting Apache, MySQL and PHP
From jayeshsh at ceruleansky.com Sat Mar 12 22:34:59 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Sat, 12 Mar 2005 22:34:59 -0500 (EST)
Subject: [nycphp-talk] PHP on Win.: Get Drive Letter for Current Script
Message-ID: <54725.69.86.84.233.1110684899.spork@webmail.ceruleansky.com>
Hi Tim,
thanks for your reply. You referred me to the current Windows API
function, but my sample (PHP) code did not work.
I think is because this extension only worked with a range of older
versions of PHP, judging from information on the individual function pages
for this extension (
http://us4.php.net/manual/en/function.w32api-deftype.php ).
Here the sample code that I used with PHP 4.3.10
This is resulted in a fatal error saying that GetCurrentDirectoryA is not
defined as a function. I.e., this extension is not working.
I tried the ffi ( http://pecl.php.net/package/ffi ) extension PHP 5, but
it gave the following error:
---------------------------
Warning
---------------------------
PHP Startup: ??8: Unable to initialize module
Module compiled with module API=20020429, debug=0, thread-safety=1
PHP compiled with module API=20041030, debug=0, thread-safety=1
These options need to match
If anyone knows a way around please let me know (perhaps a C extension for
PHP 4? I can understand a bit of C when I read it, but writing it is
another thing).
Thanks,
- Jay Sheth
From danielc at analysisandsolutions.com Sun Mar 13 11:47:18 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Sun, 13 Mar 2005 11:47:18 -0500
Subject: [nycphp-talk] php in SecurityFocus Newsletter #291
Message-ID: <20050313164718.GA12790@panix.com>
Another exciting installment of your favorite drama!
SecurityFocus Newsletter #291
PHP ISSUES
7. FCKeditor For PHP-Nuke Arbitrary File Upload Vulnerability
BugTraq ID: 12676
9. PHPBB Authentication Bypass Vulnerability
BugTraq ID: 12678
14. PostNuke Pheonix CATID Parameter Remote SQL Injection Vulner...
BugTraq ID: 12683
15. PostNuke Pheonix SHOW Parameter Remote SQL Injection Vulnera...
BugTraq ID: 12684
16. PostNuke Phoenix Download Module Multiple Cross-Site Scripti...
BugTraq ID: 12685
16. PostNuke Phoenix Download Module Multiple Cross-Site Scripti...
BugTraq ID: 12685
18. PHP Arena PANews Remote Input Validation Vulnerabilities
BugTraq ID: 12687
21. PBLang Bulletin Board System SendPM.PHP Directory Traversal ...
BugTraq ID: 12690
22. CutePHP CuteNews X-Forwarded-For Script Injection Vulnerabil...
BugTraq ID: 12691
23. SafeHTML Multiple HTML Entity Bypass Vulnerabilities
BugTraq ID: 12692
I recall an earlier BugTraq listing along these lines, so this may be a
duplicate report.
25. PBLang Bulletin Board System DelPM.PHP Arbitrary Personal Me...
BugTraq ID: 12694
27. PHPNews Auth.PHP Remote File Include Vulnerability
BugTraq ID: 12696
30. PHP Glob Function Local Information Disclosure Vulnerability
BugTraq ID: 12701
35. MercuryBoard Avatar HTML Injection Vulnerability
BugTraq ID: 12706
36. MercuryBoard Index.PHP SQL Injection Vulnerability
BugTraq ID: 12707
47. WoltLab Burning Board/Burning Board Lite Sessoin.PHP Multipl...
BugTraq ID: 12718
48. PABox HTML Injection Vulnerability
BugTraq ID: 12719
49. D-Forum Nav.PHP3 Cross-Site Scripting Vulnerability
BugTraq ID: 12720
50. Typo3 CMW_Linklist Extension SQL Injection Vulnerability
BugTraq ID: 12721
54. Stadtaus.Com Download Center Lite Arbitrary Remote PHP File ...
BugTraq ID: 12726
38. ProjectBB Multiple Remote Cross-Site Scripting Vulnerabiliti...
BugTraq ID: 12709
39. ProjectBB Multiple SQL Injection Vulnerabilities
BugTraq ID: 12710
37. auraCMS Multiple Cross-Site Scripting Vulnerabilities
BugTraq ID: 12708
24. 427BB Multiple Remote HTML Injection Vulnerabilities
BugTraq ID: 12693
20. Forumwa Multiple Remote Input Validation Vulnerabilities
BugTraq ID: 12689
OTHER IMPORTANT WEB RELATED ISSUES
4. Mozilla Firefox Address Bar Image Dragging Remote Script Exe...
BugTraq ID: 12672
45. Squid Proxy Set-Cookie Headers Information Disclosure Vulner...
BugTraq ID: 12716
46. ImageMagick File Name Handling Remote Format String Vulnerab...
BugTraq ID: 12717
56. Mozilla Suite/Firefox HTTP Authentication Dialogs Tab Focus ...
BugTraq ID: 12728
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From dcech at phpwerx.net Sun Mar 13 12:29:02 2005
From: dcech at phpwerx.net (Dan Cech)
Date: Sun, 13 Mar 2005 12:29:02 -0500
Subject: [nycphp-talk] PHP on Win.: Get Drive Letter for Current Script
In-Reply-To: <54725.69.86.84.233.1110684899.spork@webmail.ceruleansky.com>
References: <54725.69.86.84.233.1110684899.spork@webmail.ceruleansky.com>
Message-ID: <4234785E.4000007@phpwerx.net>
Jay,
You should be able to use the getcwd() function to tell you where the
script is running.
Dan
Jayesh Sheth wrote:
> Hi Tim,
>
> thanks for your reply. You referred me to the current Windows API
> function, but my sample (PHP) code did not work.
>
> I think is because this extension only worked with a range of older
> versions of PHP, judging from information on the individual function pages
> for this extension (
> http://us4.php.net/manual/en/function.w32api-deftype.php ).
>
> Here the sample code that I used with PHP 4.3.10
>
> // Get current directory using Windows System DLL API
>
> // Load the w32api extension
> // Dynamic loading did not work for me (so I added an entry to php.ini)
> dl("php_w32api.dll");
>
> // Register Windows API function
> w32api_register_function("kernel32.dll", "GetCurrentDirectoryA", "string");
>
> // Make a buffer of appropriate size to store the current directory path
> $buf = str_repeat(' ', 255);
>
> // Call the function so that it stores the value of the current directory
> path in $buf
> GetCurrentDirectoryA($buf, strlen($buf));
>
> // Output it:
> echo "Current directory is $buf .";
>
> ?>
>
> This is resulted in a fatal error saying that GetCurrentDirectoryA is not
> defined as a function. I.e., this extension is not working.
>
> I tried the ffi ( http://pecl.php.net/package/ffi ) extension PHP 5, but
> it gave the following error:
> ---------------------------
> Warning
> ---------------------------
> PHP Startup: ??8: Unable to initialize module
> Module compiled with module API=20020429, debug=0, thread-safety=1
> PHP compiled with module API=20041030, debug=0, thread-safety=1
> These options need to match
>
> If anyone knows a way around please let me know (perhaps a C extension for
> PHP 4? I can understand a bit of C when I read it, but writing it is
> another thing).
>
> Thanks,
>
> - Jay Sheth
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
From dcech at phpwerx.net Sun Mar 13 12:36:07 2005
From: dcech at phpwerx.net (Dan Cech)
Date: Sun, 13 Mar 2005 12:36:07 -0500
Subject: [nycphp-talk] PHP on Win.: Get Drive Letter for Current Script
In-Reply-To: <4234785E.4000007@phpwerx.net>
References: <54725.69.86.84.233.1110684899.spork@webmail.ceruleansky.com>
<4234785E.4000007@phpwerx.net>
Message-ID: <42347A07.3080406@phpwerx.net>
Jay,
Just occurred to me you could also use the __FILE__ constant.
Dan
Dan Cech wrote:
> Jay,
>
> You should be able to use the getcwd() function to tell you where the
> script is running.
>
> Dan
>
> Jayesh Sheth wrote:
>
>> Hi Tim,
>>
>> thanks for your reply. You referred me to the current Windows API
>> function, but my sample (PHP) code did not work.
>>
>> I think is because this extension only worked with a range of older
>> versions of PHP, judging from information on the individual function
>> pages
>> for this extension (
>> http://us4.php.net/manual/en/function.w32api-deftype.php ).
>>
>> Here the sample code that I used with PHP 4.3.10
>>
>> > // Get current directory using Windows System DLL API
>>
>> // Load the w32api extension
>> // Dynamic loading did not work for me (so I added an entry to php.ini)
>> dl("php_w32api.dll");
>>
>> // Register Windows API function
>> w32api_register_function("kernel32.dll", "GetCurrentDirectoryA",
>> "string");
>>
>> // Make a buffer of appropriate size to store the current directory path
>> $buf = str_repeat(' ', 255);
>>
>> // Call the function so that it stores the value of the current directory
>> path in $buf
>> GetCurrentDirectoryA($buf, strlen($buf));
>>
>> // Output it:
>> echo "Current directory is $buf .";
>>
>> ?>
>>
>> This is resulted in a fatal error saying that GetCurrentDirectoryA is not
>> defined as a function. I.e., this extension is not working.
>>
>> I tried the ffi ( http://pecl.php.net/package/ffi ) extension PHP 5, but
>> it gave the following error:
>> ---------------------------
>> Warning
>> ---------------------------
>> PHP Startup: ??8: Unable to initialize module
>> Module compiled with module API=20020429, debug=0, thread-safety=1
>> PHP compiled with module API=20041030, debug=0, thread-safety=1
>> These options need to match
>>
>> If anyone knows a way around please let me know (perhaps a C extension
>> for
>> PHP 4? I can understand a bit of C when I read it, but writing it is
>> another thing).
>>
>> Thanks,
>>
>> - Jay Sheth
>> _______________________________________________
>> New York PHP Talk Mailing List
>> AMP Technology
>> Supporting Apache, MySQL and PHP
>> http://lists.nyphp.org/mailman/listinfo/talk
>> http://www.nyphp.org
>
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
From jayeshsh at ceruleansky.com Sun Mar 13 17:14:20 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Sun, 13 Mar 2005 17:14:20 -0500 (EST)
Subject: [nycphp-talk] PHP on Win.: Get Drive Letter for Current Script
Message-ID: <37062.69.86.84.233.1110752060.spork@webmail.ceruleansky.com>
Hi Dan,
thanks a million! The getcwd() function did the trick. I did not even know
it existed. I think it would be a really useful function. I cannot believe
I did not know of it until now.
Thanks also for the __FILE__ constant tip.
If you come to the monthly meeting / dinners, I owe you a drink.
Best regards,
- Jay
From jayeshsh at ceruleansky.com Sun Mar 13 17:24:05 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Sun, 13 Mar 2005 17:24:05 -0500 (EST)
Subject: [nycphp-talk] PHP on Win.: Get Drive Letter for Current Script
Message-ID: <57542.69.86.84.233.1110752645.spork@webmail.ceruleansky.com>
Hi Dan,
Looking at my test script again, there is an important difference between
getcwd() and __FILE__ that may be of interest of to others.
The sample script is:
I invoked it with:
cd c:\php4cli
php-cli.exe c:\devel\php\getcwd.php
And it outputted:
C:\PHP4CLI
c:\devel\php\getcwd.php
So, perhaps getcwd() outputs where you currently are at the command line,
but __FILE__ outputs the full path (including drive letter) to the
currently running script.
Best regards,
- Jay
From dcech at phpwerx.net Sun Mar 13 17:31:02 2005
From: dcech at phpwerx.net (Dan Cech)
Date: Sun, 13 Mar 2005 17:31:02 -0500
Subject: [nycphp-talk] PHP on Win.: Get Drive Letter for Current Script
In-Reply-To: <57542.69.86.84.233.1110752645.spork@webmail.ceruleansky.com>
References: <57542.69.86.84.233.1110752645.spork@webmail.ceruleansky.com>
Message-ID: <4234BF26.5010700@phpwerx.net>
Jayesh Sheth wrote:
> Hi Dan,
>
> Looking at my test script again, there is an important difference between
> getcwd() and __FILE__ that may be of interest of to others.
>
> The sample script is:
> echo getcwd();
> echo "\n";
> echo __FILE__;
> ?>
>
> I invoked it with:
> cd c:\php4cli
> php-cli.exe c:\devel\php\getcwd.php
>
> And it outputted:
> C:\PHP4CLI
> c:\devel\php\getcwd.php
>
> So, perhaps getcwd() outputs where you currently are at the command line,
> but __FILE__ outputs the full path (including drive letter) to the
> currently running script.
Indeed, you are correct. In a web environment they are usually the
same, but from the command line or if you use the chdir() function in
your scripts, getcwd could very easily be different.
I wish I could get down to some of the meetings to take up your offer!
Dan
> Best regards,
>
> - Jay
From codebowl at gmail.com Mon Mar 14 09:58:32 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Mon, 14 Mar 2005 09:58:32 -0500
Subject: [nycphp-talk] PHP Images from Raw Binary
Message-ID: <8d9a428005031406587ce86fa0@mail.gmail.com>
Hello Everyone,
I have done this before so i know it works, however i also know i am
missing a step, maybe a replace or maybe even a foreach loop to do a
replace or something.
I am using a 3rd party solution to show some data on a clients site,
this is an MSSQL database, i have gotten it to connect fine FINALLY,
however now i run into a problem with the images.
Each record has an image column which i am told contains RAW Binary.
i have tried this code
$img = imagecreatefromstring($row['medium_photo']);
header('Content-Type: image/jpeg');
imagejpeg($img);
however that results in this error
The image "http://66.111.250.100/test.php" cannot be displayed,
because it contains errors.
you can see the binary data by going to
http://66.111.250.100/test.php
IIRC i needed to do some foreach loop on this binary data and perform
some operation on each element but i cannot remember what was needed
honestly. This is where i call the help of you guys :D
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From lists at zaunere.com Mon Mar 14 18:34:57 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Mon, 14 Mar 2005 18:34:57 -0500
Subject: [nycphp-talk] Special offer for NYPHP from Zend
Message-ID: <0MKz5u-1DAz5P0u3I-0003vT@mrelay.perfora.net>
Hi folks,
Thanks to Daniel Kushner and Zend, we're able to extend a $100 discount on the new Zend Studio 4.0. See http://www.zend.com/store/products/zend-studio/ for details on this new release.
Please use discount code Q1PHPNY0305 before October 5th.
Regards,
---
Hans Zaunere
President, Founder
New York PHP
http://www.nyphp.org
AMP Technology
Supporting Apache, MySQL and PHP
From gatzby3jr at gmail.com Mon Mar 14 19:12:49 2005
From: gatzby3jr at gmail.com (Brian O'Connor)
Date: Mon, 14 Mar 2005 19:12:49 -0500
Subject: [nycphp-talk] Special offer for NYPHP from Zend
In-Reply-To: <0MKz5u-1DAz5P0u3I-0003vT@mrelay.perfora.net>
References: <0MKz5u-1DAz5P0u3I-0003vT@mrelay.perfora.net>
Message-ID: <29da5d1505031416127a5d3161@mail.gmail.com>
I assume this doesn't extend to the Standard edition?
I'm just a high school student so I can't really afford to fork out
$200 for a php editor, even though I use the Zend Trial and I think
it's one of the best editor's out there.
On Mon, 14 Mar 2005 18:34:57 -0500, Hans Zaunere wrote:
>
> Hi folks,
>
> Thanks to Daniel Kushner and Zend, we're able to extend a $100 discount on the new Zend Studio 4.0. See http://www.zend.com/store/products/zend-studio/ for details on this new release.
>
> Please use discount code Q1PHPNY0305 before October 5th.
>
> Regards,
>
> ---
> Hans Zaunere
> President, Founder
>
> New York PHP
> http://www.nyphp.org
>
> AMP Technology
> Supporting Apache, MySQL and PHP
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
--
Brian O'Connor
From rs234 at cornell.edu Mon Mar 14 19:15:56 2005
From: rs234 at cornell.edu (Wai Siow)
Date: Mon, 14 Mar 2005 19:15:56 -0500 (EST)
Subject: [nycphp-talk] Special offer for NYPHP from Zend
In-Reply-To: <29da5d1505031416127a5d3161@mail.gmail.com>
References: <0MKz5u-1DAz5P0u3I-0003vT@mrelay.perfora.net>
<29da5d1505031416127a5d3161@mail.gmail.com>
Message-ID: <1275.65.110.156.52.1110845756.squirrel@65.110.156.52>
i thought there's a student edition that's 99 dollars though... - Ray
> I assume this doesn't extend to the Standard edition?
>
> I'm just a high school student so I can't really afford to fork out
> $200 for a php editor, even though I use the Zend Trial and I think
> it's one of the best editor's out there.
>
>
> On Mon, 14 Mar 2005 18:34:57 -0500, Hans Zaunere
> wrote:
>>
>> Hi folks,
>>
>> Thanks to Daniel Kushner and Zend, we're able to extend a $100 discount
>> on the new Zend Studio 4.0. See
>> http://www.zend.com/store/products/zend-studio/ for details on this new
>> release.
>>
>> Please use discount code Q1PHPNY0305 before October 5th.
>>
>> Regards,
>>
>> ---
>> Hans Zaunere
>> President, Founder
>>
>> New York PHP
>> http://www.nyphp.org
>>
>> AMP Technology
>> Supporting Apache, MySQL and PHP
>>
>> _______________________________________________
>> New York PHP Talk Mailing List
>> AMP Technology
>> Supporting Apache, MySQL and PHP
>> http://lists.nyphp.org/mailman/listinfo/talk
>> http://www.nyphp.org
>>
>
>
> --
> Brian O'Connor
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
Wai (Raymond) Siow
Web Application Developer / Programmer
Web Development Team
Cornell Cooperative Extension
Email: r s two three four at cornell dot edu
Phone: (six-o-seven) two-five-five-seven-nine-four-nine
From matt at jiffycomp.com Mon Mar 14 21:50:56 2005
From: matt at jiffycomp.com (Matt Morgan)
Date: Mon, 14 Mar 2005 21:50:56 -0500
Subject: [nycphp-talk] Special offer for NYPHP from Zend
In-Reply-To: <1275.65.110.156.52.1110845756.squirrel@65.110.156.52>
References: <0MKz5u-1DAz5P0u3I-0003vT@mrelay.perfora.net> <29da5d1505031416127a5d3161@mail.gmail.com>
<1275.65.110.156.52.1110845756.squirrel@65.110.156.52>
Message-ID: <42364D90.3030706@jiffycomp.com>
Yup:
http://www.zend.com/store/products/zend-studio/pricing.php
Wai Siow wrote:
>i thought there's a student edition that's 99 dollars though... - Ray
>
>
>
>>I assume this doesn't extend to the Standard edition?
>>
>>I'm just a high school student so I can't really afford to fork out
>>$200 for a php editor, even though I use the Zend Trial and I think
>>it's one of the best editor's out there.
>>
>>
>>On Mon, 14 Mar 2005 18:34:57 -0500, Hans Zaunere
>>wrote:
>>
>>
>>>Hi folks,
>>>
>>>Thanks to Daniel Kushner and Zend, we're able to extend a $100 discount
>>>on the new Zend Studio 4.0. See
>>>http://www.zend.com/store/products/zend-studio/ for details on this new
>>>release.
>>>
>>>Please use discount code Q1PHPNY0305 before October 5th.
>>>
>>>Regards,
>>>
>>>---
>>>Hans Zaunere
>>>President, Founder
>>>
>>>New York PHP
>>>http://www.nyphp.org
>>>
>>>AMP Technology
>>>Supporting Apache, MySQL and PHP
>>>
>>>_______________________________________________
>>>New York PHP Talk Mailing List
>>>AMP Technology
>>>Supporting Apache, MySQL and PHP
>>>http://lists.nyphp.org/mailman/listinfo/talk
>>>http://www.nyphp.org
>>>
>>>
>>>
>>--
>>Brian O'Connor
>>_______________________________________________
>>New York PHP Talk Mailing List
>>AMP Technology
>>Supporting Apache, MySQL and PHP
>>http://lists.nyphp.org/mailman/listinfo/talk
>>http://www.nyphp.org
>>
>>
>>
>
>
>Wai (Raymond) Siow
>Web Application Developer / Programmer
>Web Development Team
>Cornell Cooperative Extension
>Email: r s two three four at cornell dot edu
>Phone: (six-o-seven) two-five-five-seven-nine-four-nine
>
>_______________________________________________
>New York PHP Talk Mailing List
>AMP Technology
>Supporting Apache, MySQL and PHP
>http://lists.nyphp.org/mailman/listinfo/talk
>http://www.nyphp.org
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From gatzby3jr at gmail.com Mon Mar 14 22:04:02 2005
From: gatzby3jr at gmail.com (Brian O'Connor)
Date: Mon, 14 Mar 2005 22:04:02 -0500
Subject: [nycphp-talk] Special offer for NYPHP from Zend
In-Reply-To: <42364D90.3030706@jiffycomp.com>
References: <0MKz5u-1DAz5P0u3I-0003vT@mrelay.perfora.net>
<29da5d1505031416127a5d3161@mail.gmail.com>
<1275.65.110.156.52.1110845756.squirrel@65.110.156.52>
<42364D90.3030706@jiffycomp.com>
Message-ID: <29da5d1505031419045f4884e2@mail.gmail.com>
See this is where I get confused:
Student Pricing:
Description Price
Zend Studio - Professional Edition $99 Contact Us
Zend Studio - Standard Edition $99 Contact Us
They're both $100, but I doubt I could use the Zend nyphp discount to
get it for free (technically they'd owe ME a dollar :D)
On Mon, 14 Mar 2005 21:50:56 -0500, Matt Morgan wrote:
> Yup:
>
> http://www.zend.com/store/products/zend-studio/pricing.php
>
>
> Wai Siow wrote:
> i thought there's a student edition that's 99 dollars though... - Ray
> I assume this doesn't extend to the Standard edition? I'm just a high
> school student so I can't really afford to fork out $200 for a php editor,
> even though I use the Zend Trial and I think it's one of the best editor's
> out there. On Mon, 14 Mar 2005 18:34:57 -0500, Hans Zaunere
> wrote:
> Hi folks, Thanks to Daniel Kushner and Zend, we're able to extend a $100
> discount on the new Zend Studio 4.0. See
> http://www.zend.com/store/products/zend-studio/ for details on this new
> release. Please use discount code Q1PHPNY0305 before October 5th. Regards,
> --- Hans Zaunere President, Founder New York PHP http://www.nyphp.org AMP
> Technology Supporting Apache, MySQL and PHP
> _______________________________________________ New York PHP Talk Mailing
> List AMP Technology Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org -- Brian
> O'Connor _______________________________________________ New York PHP Talk
> Mailing List AMP Technology Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org Wai
> (Raymond) Siow Web Application Developer / Programmer Web Development Team
> Cornell Cooperative Extension Email: r s two three four at cornell dot edu
> Phone: (six-o-seven) two-five-five-seven-nine-four-nine
> _______________________________________________ New York PHP Talk Mailing
> List AMP Technology Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
>
--
Brian O'Connor
From jayeshsh at ceruleansky.com Mon Mar 14 22:14:24 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Mon, 14 Mar 2005 22:14:24 -0500 (EST)
Subject: [nycphp-talk] Maguma Open Studio
Message-ID: <57284.69.86.84.233.1110856464.spork@webmail.ceruleansky.com>
Hello all,
I thought some of you may be interested in the newly released Maguma Open
Studio. It is an open source version of Maguma's older Maguma Studio
product.
I had bought this product a couple of years ago, and it was pretty good
(although limited in some respects) at the time. At the time I really
liked the fact that Maguma bundled PHP, MySQL, PHPMyAdmin and Apache
(along with controls to start and stop Apache) into one package. But now I
use XAMPP for the LAMP stack and jEdit for an editor.
>From a cursory look, this new, open source version seems to have new
icons, and probably other new enhancements too. It also has a built in
debugger. It seems to be a bit rough around the edges, but since the
source has been posted at Sourceforge, such deficiencies / bugs are
perhaps best seen as invitation to fix them.
An open source PHP IDE for Windows and Linux is a welcome addition to the
PHP community. The Sourceforge description says "Delphi / Kylix" leading
me to believe that it could also be compiled for Linux using Kylix -
although I have not used either Delphi or Kylix, and don't know if code
from one can be imported into another. Binaries are only available for
Windows, but it's still worth checking out.
For more information, please see:
http://www.maguma.com/index.php?article=os_main&id=126
and
http://sourceforge.net/projects/openstudio
Best regards,
- Jay Sheth
From jayeshsh at ceruleansky.com Mon Mar 14 22:48:52 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Mon, 14 Mar 2005 22:48:52 -0500 (EST)
Subject: [nycphp-talk] PHP on Win.: Get Drive Letter for Current Script
Message-ID: <58567.69.86.84.233.1110858532.spork@webmail.ceruleansky.com>
Hi all,
I just thought this information would be useful to others. The WinBinder
extension provides some very useful system information through its
wb_get_system_info() function:
http://www.hypervisual.com/winbinder/manual/functions/wb_get_system_info.html
Best regards,
- Jay Sheth
From atul at monkeyclan.com Tue Mar 15 13:22:13 2005
From: atul at monkeyclan.com (Atul Ohri)
Date: Tue, 15 Mar 2005 13:22:13 -0500
Subject: [nycphp-talk] Changing UNIX shadow passwords with PHP
Message-ID: <200503151830.j2FIU8j06616@host.brandunknown.com>
Hey Everyone.
I've been trying to figure out a simple yet secure way to allow user's with
mailboxes on any of our servers to change their passwords via the web. I
have done extensive research on the web and haven't found anything promising
regarding doing this in PHP. It seems I may be able to accomplish it with a
Perl script and then I could wrap that Perl script around a PHP interface
but I'm not even sure that would work. The passwords are stored in a shadow
passwd file format so however I accomplish this I would have to change to
root to make changes to the /etc/shadow file. Would I have to use SUID to
accomplish this? Does anyone know of any PHP scripts that could help me
accomplish my goal? I'm sure someone somewhere has the need for a script
like this. Naturally all of this would take place over a secure connection.
So does anyone have any advice on how I can accomplish this in PHP?
Atul
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From rolan at omnistep.com Tue Mar 15 14:20:17 2005
From: rolan at omnistep.com (Rolan Yang)
Date: Tue, 15 Mar 2005 14:20:17 -0500
Subject: [nycphp-talk] Changing UNIX shadow passwords with PHP
In-Reply-To: <200503151830.j2FIU8j06616@host.brandunknown.com>
References: <200503151830.j2FIU8j06616@host.brandunknown.com>
Message-ID: <42373571.1040707@omnistep.com>
Look into sudo. You can sudo the "/usr/bin/passwd" file so that it can
be run as the user of your apache (probably "nobody" or "apache" or
"http"), then do a
system("/usr/bin/passwd $user $password");
in php. This method would make a sysadmin a bit nervous though.
Another safer way to go about it would be to append all password
requests to a designated file, in the format "username:password" then
create a root owned cron script which runs "/usr/sbin/chpasswd
" every minute or so. You would want to employ some method of
file locking within the cron script and also the php script because if
the job runs while the php script is writing to the file, odd things can
happen.
~Rolan
Atul Ohri wrote:
> Hey Everyone?
>
> I?ve been trying to figure out a simple yet secure way to allow user?s
> with mailboxes on any of our servers to change their passwords via the
> web. I have done extensive research on the web and haven?t found
> anything promising regarding doing this in PHP. It seems I may be able
> to accomplish it with a Perl script and then I could wrap that Perl
> script around a PHP interface but I?m not even sure that would work.
> The passwords are stored in a shadow passwd file format so however I
> accomplish this I would have to change to root to make changes to the
> /etc/shadow file. Would I have to use SUID to accomplish this? Does
> anyone know of any PHP scripts that could help me accomplish my goal?
> I?m sure someone somewhere has the need for a script like this?
> Naturally all of this would take place over a secure connection.
>
> So does anyone have any advice on how I can accomplish this in PHP?
>
> Atul
>
>------------------------------------------------------------------------
>
>
>
From chsnyder at gmail.com Tue Mar 15 14:44:46 2005
From: chsnyder at gmail.com (csnyder)
Date: Tue, 15 Mar 2005 14:44:46 -0500
Subject: [nycphp-talk] Changing UNIX shadow passwords with PHP
In-Reply-To: <42373571.1040707@omnistep.com>
References: <200503151830.j2FIU8j06616@host.brandunknown.com>
<42373571.1040707@omnistep.com>
Message-ID:
On Tue, 15 Mar 2005 14:20:17 -0500, Rolan Yang wrote:
> Another safer way to go about it would be to append all password
> requests to a designated file, in the format "username:password" then
> create a root owned cron script which runs "/usr/sbin/chpasswd
> " every minute or so. You would want to employ some method of
> file locking within the cron script and also the php script because if
> the job runs while the php script is writing to the file, odd things can
> happen.
Please pretend that this is the *only* way to carry this out. Giving
the webserver access to sudo is just asking for BIG trouble down the
line. The very idea makes me shudder (sorry, Rolan).
Your cron script should probably respect a list of "never change"
accounts, including root and whatever account you use for shell
access.
From atul at monkeyclan.com Tue Mar 15 16:07:21 2005
From: atul at monkeyclan.com (Atul Ohri)
Date: Tue, 15 Mar 2005 16:07:21 -0500
Subject: [nycphp-talk] Changing UNIX shadow passwords with PHP
Message-ID: <200503152115.j2FLF3j13805@host.brandunknown.com>
Well this is all very helpful. I agree that the safer way to do this would
be through the cron job. I'm looking into various ways to do that and have
yet to find an efficient file locking mechanism that will work for both Perl
and PHP.
But a bigger problem I'm having is that because my server is using Virtual
Hosts I haven't figured out how to use the usermod function to change
passwords. Basically if a user has a username of "foo" on the "bar.com"
domain, usermod would require the username parameter to be "foo at bar.com".
But that doesn't work because the /etc/shadow that is in the virtual
directory for the bar.com domain just has "foo" as the username.
I guess the smartest way around this would be to manually process the
/etc/shadow file instead of using usermod.
Atul
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From rs234 at cornell.edu Tue Mar 15 16:12:31 2005
From: rs234 at cornell.edu (Wai Siow)
Date: Tue, 15 Mar 2005 16:12:31 -0500 (EST)
Subject: [nycphp-talk] search engine suggestion
In-Reply-To:
References: <200503151830.j2FIU8j06616@host.brandunknown.com>
<42373571.1040707@omnistep.com>
Message-ID: <1175.128.253.19.86.1110921151.squirrel@128.253.19.86>
Hi all:
I am currently looking for a search engine to be used for our next website
redesign... and wonder if there's anything good that does a good job with
the following:
1. able to index different types of file, incl but not limited to: pdf,
html, php, doc.
2. able to index a database driven site, i.e. site with its content stored
in a database.
3. handle large number of documents (500K?) or no limit. can merge index
files during search / after indexing if necessary.
4. definitely not as expensive as the google search server, which cost
somewhere like 25K... we'd probably at most be able to spend 5K on the
solution.
5. config files or a web/gui interface for indexing (but not confusing, i
consider swish-e not terrible), can be easily integrated into a custom php
search result page.
I've looked at swish-e and DTSearch so far, but I am sure you guys have
better idea than I do. If you have some good suggestions please let me
know. Thanks in advance!
Wai (Raymond) Siow
Web Application Developer / Programmer
Web Development Team
Cornell Cooperative Extension
Email: r s two three four at cornell dot edu
Phone: (six-o-seven) two-five-five-seven-nine-four-nine
From corey at domanistudios.com Tue Mar 15 16:41:25 2005
From: corey at domanistudios.com (corey szopinski)
Date: Tue, 15 Mar 2005 16:41:25 -0500
Subject: [nycphp-talk] search engine suggestion
In-Reply-To: <1175.128.253.19.86.1110921151.squirrel@128.253.19.86>
Message-ID:
Although it?s not PHP, Atomz has most of the features you?re looking for.
I?ve used it a couple of times and have been very happy with it (as happy as
one can be with a search engine, that is). It's a hosted (ASP-style)
service. Point it at your site, tell it how often to index, and then design
the results page. Pretty simple. There's plenty of administrative control
via a web interface, and it'll send a monthly report what it's been up to.
http://atomz.com/applications/search/features.htm
-c
On 3/15/05 4:12 PM, "Wai Siow" wrote:
> 1. able to index different types of file, incl but not limited to: pdf,
> html, php, doc.
>
> 2. able to index a database driven site, i.e. site with its content stored
> in a database.
>
> 3. handle large number of documents (500K?) or no limit. can merge index
> files during search / after indexing if necessary.
>
> 4. definitely not as expensive as the google search server, which cost
> somewhere like 25K... we'd probably at most be able to spend 5K on the
> solution.
>
> 5. config files or a web/gui interface for indexing (but not confusing, i
> consider swish-e not terrible), can be easily integrated into a custom php
> search result page.
Corey Szopinski
Director of Technology
DOMANI STUDIOS
corey at domanistudios.com
55 Washington St. Suite 822
Brooklyn, NY 11201
718-797-4470 x116
From chsnyder at gmail.com Tue Mar 15 17:37:52 2005
From: chsnyder at gmail.com (csnyder)
Date: Tue, 15 Mar 2005 17:37:52 -0500
Subject: [nycphp-talk] Changing UNIX shadow passwords with PHP
In-Reply-To: <200503152115.j2FLF3j13805@host.brandunknown.com>
References: <200503152115.j2FLF3j13805@host.brandunknown.com>
Message-ID:
On Tue, 15 Mar 2005 16:07:21 -0500, Atul Ohri wrote:
>
> Well this is all very helpful? I agree that the safer way to do this would
> be through the cron job. I'm looking into various ways to do that and have
> yet to find an efficient file locking mechanism that will work for both Perl
> and PHP.
How about creating/looking for /tmp/shadow.lock ?
> But that doesn't work because the /etc/shadow that is in the virtual
> directory for the bar.com domain just has "foo" as the username.
Does passwd(1) work? As long as the root user that runs the command is
jailed in the same virtual host, it will update the correct
/etc/shadow.
--
Chris Snyder
http://chxo.com/
From danielc at analysisandsolutions.com Tue Mar 15 17:48:01 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Tue, 15 Mar 2005 17:48:01 -0500
Subject: [nycphp-talk] Changing UNIX shadow passwords with PHP
In-Reply-To: <200503152115.j2FLF3j13805@host.brandunknown.com>
References: <200503152115.j2FLF3j13805@host.brandunknown.com>
Message-ID: <20050315224801.GA7422@panix.com>
On Tue, Mar 15, 2005 at 04:07:21PM -0500, Atul Ohri wrote:
> yet to find an efficient file locking mechanism that will work for both
> Perl and PHP.
mv. Have the cron job move the file before using it. Have the PHP/PERL
scripts create the file over again if it doesn't exist.
By the way, you better make damn sure you carefully screen the input and
disallow any harmful characters.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From 1j0lkq002 at sneakemail.com Wed Mar 16 00:14:28 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Wed, 16 Mar 2005 00:14:28 -0500
Subject: [nycphp-talk] search engine suggestion
In-Reply-To:
References:
Message-ID: <26954-91594@sneakemail.com>
corey szopinski corey-at-domanistudios.com |nyphp dev/internal group
use| wrote:
>Although it?s not PHP, Atomz has most of the features you?re looking for.
>I?ve used it a couple of times and have been very happy with it (as happy as
>one can be with a search engine, that is). It's a hosted (ASP-style)
>service. Point it at your site, tell it how often to index, and then design
>the results page. Pretty simple. There's plenty of administrative control
>via a web interface, and it'll send a monthly report what it's been up to.
>
>http://atomz.com/applications/search/features.htm
>
>-c
>
>
I concur that Atomz had a very nice search product, but expensive. I was
quoted $20k for the Atomz service for less pages than requested here. I
used that version of Atomz for two years and it was very good.
Atomz was recently acquired by Website Story, and is being integrated
into their analytics software suite. It will not be a stand-alone search
product any longer. From the webside story site:
"*Atomz* name will be sunset upon closing of the transaction and the
organization will operate as the WebSideStory Search and Content
Solutions Business Unit." and "Some of the products are already
partially integrated, such as HBX Analytics and *Atomz* Site Search.
Deeper integration should occur within one year. The engineering
organizations are working on an integrated roadmap that we will announce
in the coming months."
As you can see from swish-e and DTSearch the problem is indexing quickly
and managing the index. In my experience there is no good product right now.
-=john andrews
From psaw at pswebcode.com Wed Mar 16 10:42:38 2005
From: psaw at pswebcode.com (Peter Sawczynec)
Date: Wed, 16 Mar 2005 10:42:38 -0500
Subject: [nycphp-talk] search engine suggestion
In-Reply-To: <26954-91594@sneakemail.com>
Message-ID: <002901c52a3e$c84b3c80$68e4a144@Liz>
phpdig
-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of inforequest
Sent: Wednesday, March 16, 2005 12:14 AM
To: talk at lists.nyphp.org
Subject: Re: [nycphp-talk] search engine suggestion
corey szopinski corey-at-domanistudios.com |nyphp dev/internal group
use| wrote:
>Although it?s not PHP, Atomz has most of the features you?re looking
>for. I?ve used it a couple of times and have been very happy with it
>(as happy as one can be with a search engine, that is). It's a hosted
>(ASP-style) service. Point it at your site, tell it how often to index,
>and then design the results page. Pretty simple. There's plenty of
>administrative control via a web interface, and it'll send a monthly
>report what it's been up to.
>
>http://atomz.com/applications/search/features.htm
>
>-c
>
>
I concur that Atomz had a very nice search product, but expensive. I was
quoted $20k for the Atomz service for less pages than requested here. I
used that version of Atomz for two years and it was very good.
Atomz was recently acquired by Website Story, and is being integrated
into their analytics software suite. It will not be a stand-alone search
product any longer. From the webside story site:
"*Atomz* name will be sunset upon closing of the transaction and the
organization will operate as the WebSideStory Search and Content
Solutions Business Unit." and "Some of the products are already
partially integrated, such as HBX Analytics and *Atomz* Site Search.
Deeper integration should occur within one year. The engineering
organizations are working on an integrated roadmap that we will announce
in the coming months."
As you can see from swish-e and DTSearch the problem is indexing quickly
and managing the index. In my experience there is no good product right now.
-=john andrews
_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org
From john at cyber-ny.com Wed Mar 16 12:17:59 2005
From: john at cyber-ny.com (John Nunez)
Date: Wed, 16 Mar 2005 12:17:59 -0500
Subject: [nycphp-talk] Q: Authenticating XML Data Exchange
Message-ID: <763b5f4e0ad66f5d1ac82b063137be65@cyber-ny.com>
Hey Guys,
I have a project where membership database information will be passed
to a fulfillment center as the members sign into the system. The
center's server will send back info on the status of the transaction
once the member goes through the checkout process. We will be using
PHP/MySQL on the client's site and the fulfillment center will be using
ASP/MSSQL.
How can I make sure that the data I get back is from the fulfillment
center's server? Can SOAP be used over SSL? I am reading a few
tutorials on SOAP and I can get Google and Amazon's Web Services
working but what about security?
Thanks,
John
From atul at monkeyclan.com Wed Mar 16 12:29:21 2005
From: atul at monkeyclan.com (Atul Ohri)
Date: Wed, 16 Mar 2005 12:29:21 -0500
Subject: [nycphp-talk] Changing UNIX shadow passwords with PHP
Message-ID: <200503161737.j2GHbFj26031@host.brandunknown.com>
Thanks for the input everybody.
I'll go ahead with using a cron job, a shadow lock file, a chroot jail, and
the passwd function.
Now it's just a matter of getting it to work flawlessly.
Atul
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From andrew at plexpod.com Wed Mar 16 14:57:45 2005
From: andrew at plexpod.com (Andrew Yochum)
Date: Wed, 16 Mar 2005 14:57:45 -0500
Subject: [nycphp-talk] Q: Authenticating XML Data Exchange
In-Reply-To: <763b5f4e0ad66f5d1ac82b063137be65@cyber-ny.com>
References: <763b5f4e0ad66f5d1ac82b063137be65@cyber-ny.com>
Message-ID: <20050316195745.GQ7597@zoidberg.digitalpulp.com>
On Wed, Mar 16, 2005 at 12:17:59PM -0500, John Nunez wrote:
> How can I make sure that the data I get back is from the fulfillment
> center's server? Can SOAP be used over SSL? I am reading a few
> tutorials on SOAP and I can get Google and Amazon's Web Services
> working but what about security?
Sure, SOAP can be used over SSL encrypted HTTP. SOAP messages are just
that, messages, and can and have been delivered by nearly any method,
including http(s), smtp, jabber, and if you're truly desparate, even
smoke signals. The point is that SOAP is not tied to the transport
mechanism. Your SOAP library or framework will be the limiting factor
in what means it is able to exchange mesages.
HTH,
Andrew
From dmintz at davidmintz.org Wed Mar 16 16:04:51 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Wed, 16 Mar 2005 16:04:51 -0500 (EST)
Subject: [nycphp-talk] Q: Authenticating XML Data Exchange
In-Reply-To: <20050316195745.GQ7597@zoidberg.digitalpulp.com>
References: <763b5f4e0ad66f5d1ac82b063137be65@cyber-ny.com>
<20050316195745.GQ7597@zoidberg.digitalpulp.com>
Message-ID:
On Wed, 16 Mar 2005, Andrew Yochum wrote:
>
> SOAP messages are just that, messages, and can and have been delivered
> by nearly any method, including http(s), smtp, jabber, and if you're
> truly desparate, even smoke signals.
We need to see a demo of the smoke signals at the next NYPHP meeting --
then again maybe the building management would not approve.
---
David Mintz
http://davidmintz.org/
From suzerain at suzerain.com Wed Mar 16 16:46:17 2005
From: suzerain at suzerain.com (Marc Antony Vose)
Date: Wed, 16 Mar 2005 16:46:17 -0500
Subject: [nycphp-talk] stupid curly quotes
In-Reply-To: <4234BF26.5010700@phpwerx.net>
References: <57542.69.86.84.233.1110752645.spork@webmail.ceruleansky.com>
<4234BF26.5010700@phpwerx.net>
Message-ID:
Hi there.
This is an old problem that I am again searching for the prefect solution to.
How do people here handle stripping crap like curly quotes out of
text that users are pasting from Microsoft Word?
Any pointers or advice are welcome...:)
Cheers,
--
Marc Antony Vose
http://www.suzerain.com/
Never underestimate the power of human stupidity.
-- Lazarus Long
From suzerain at suzerain.com Wed Mar 16 16:50:04 2005
From: suzerain at suzerain.com (Marc Antony Vose)
Date: Wed, 16 Mar 2005 16:50:04 -0500
Subject: [nycphp-talk] stupid curly quotes
Message-ID:
Hi there.
I should have clarified that I mean situations where the end-user is
not under your control; specifically, when text is pasted from Word
into an HTML form.
>This is an old problem that I am again searching for the prefect solution to.
>
>How do people here handle stripping crap like curly quotes out of
>text that users are pasting from Microsoft Word?
>
>Any pointers or advice are welcome...:)
Cheers,
--
Marc Antony Vose
http://www.suzerain.com/
Never underestimate the power of human stupidity.
-- Lazarus Long
From rs234 at cornell.edu Wed Mar 16 17:15:01 2005
From: rs234 at cornell.edu (Wai Siow)
Date: Wed, 16 Mar 2005 17:15:01 -0500 (EST)
Subject: [nycphp-talk] stupid curly quotes
In-Reply-To:
References:
Message-ID: <3044.65.110.156.52.1111011301.squirrel@65.110.156.52>
preg_replace would be the best i think... then u can just use a regexp like
[^a-zA-Z0-9\-\s\.\,]* to replace all the non-alpha numerical (excluding a
few exceptions like punctuations) with anything u want...
note: the regexp is just an example... so there might be typos and
stuff... read the doc on regexp to create one that will suit your needs
- Ray
> Hi there.
>
>
> I should have clarified that I mean situations where the end-user is
> not under your control; specifically, when text is pasted from Word
> into an HTML form.
>
>
>>This is an old problem that I am again searching for the prefect solution
>> to.
>>
>>How do people here handle stripping crap like curly quotes out of
>>text that users are pasting from Microsoft Word?
>>
>>Any pointers or advice are welcome...:)
>
>
> Cheers,
> --
> Marc Antony Vose
> http://www.suzerain.com/
>
> Never underestimate the power of human stupidity.
> -- Lazarus Long
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
Wai (Raymond) Siow
Web Application Developer / Programmer
Web Development Team
Cornell Cooperative Extension
Email: r s two three four at cornell dot edu
Phone: (six-o-seven) two-five-five-seven-nine-four-nine
From dcech at phpwerx.net Wed Mar 16 17:15:18 2005
From: dcech at phpwerx.net (Dan Cech)
Date: Wed, 16 Mar 2005 17:15:18 -0500
Subject: [nycphp-talk] stupid curly quotes
In-Reply-To:
References:
Message-ID: <4238AFF6.4020706@phpwerx.net>
$text = preg_replace('/[`?]/','\'',$text);
Dan
Marc Antony Vose wrote:
> Hi there.
>
>
> I should have clarified that I mean situations where the end-user is not
> under your control; specifically, when text is pasted from Word into an
> HTML form.
>
>
>> This is an old problem that I am again searching for the prefect
>> solution to.
>>
>> How do people here handle stripping crap like curly quotes out of text
>> that users are pasting from Microsoft Word?
>>
>> Any pointers or advice are welcome...:)
>
>
>
> Cheers,
From chsnyder at gmail.com Wed Mar 16 17:31:59 2005
From: chsnyder at gmail.com (csnyder)
Date: Wed, 16 Mar 2005 17:31:59 -0500
Subject: [nycphp-talk] Q: Authenticating XML Data Exchange
In-Reply-To:
References: <763b5f4e0ad66f5d1ac82b063137be65@cyber-ny.com>
<20050316195745.GQ7597@zoidberg.digitalpulp.com>
Message-ID:
On Wed, 16 Mar 2005 16:04:51 -0500 (EST), David Mintz
wrote:
> On Wed, 16 Mar 2005, Andrew Yochum wrote:
>
> >
> > SOAP messages are just that, messages, and can and have been delivered
> > by nearly any method, including http(s), smtp, jabber, and if you're
> > truly desparate, even smoke signals.
>
> We need to see a demo of the smoke signals at the next NYPHP meeting --
> then again maybe the building management would not approve.
>
Carrier pigeon then?
From leam at reuel.net Wed Mar 16 18:10:12 2005
From: leam at reuel.net (leam at reuel.net)
Date: Wed, 16 Mar 2005 18:10:12 -0500
Subject: [nycphp-talk] Changing UNIX shadow passwords with PHP
In-Reply-To: <42373571.1040707@omnistep.com>
References: <200503151830.j2FIU8j06616@host.brandunknown.com>
<42373571.1040707@omnistep.com>
Message-ID: <20050316231012.GB2890@leitz>
Pardon the newbieness, but is there an expect like extension to php that would let you interact with the regular password program?
ciao!
leam
On Tue, Mar 15, 2005 at 02:20:17PM -0500, Rolan Yang wrote:
> Look into sudo. You can sudo the "/usr/bin/passwd" file so that it can
> be run as the user of your apache (probably "nobody" or "apache" or
> "http"), then do a
> system("/usr/bin/passwd $user $password");
> in php. This method would make a sysadmin a bit nervous though.
>
> Another safer way to go about it would be to append all password
> requests to a designated file, in the format "username:password" then
> create a root owned cron script which runs "/usr/sbin/chpasswd
> " every minute or so. You would want to employ some method of
> file locking within the cron script and also the php script because if
> the job runs while the php script is writing to the file, odd things can
> happen.
>
> ~Rolan
>
> Atul Ohri wrote:
>
> >Hey Everyone?
> >
> >I?ve been trying to figure out a simple yet secure way to allow user?s
> >with mailboxes on any of our servers to change their passwords via the
> >web. I have done extensive research on the web and haven?t found
> >anything promising regarding doing this in PHP. It seems I may be able
> >to accomplish it with a Perl script and then I could wrap that Perl
> >script around a PHP interface but I?m not even sure that would work.
> >The passwords are stored in a shadow passwd file format so however I
> >accomplish this I would have to change to root to make changes to the
> >/etc/shadow file. Would I have to use SUID to accomplish this? Does
> >anyone know of any PHP scripts that could help me accomplish my goal?
> >I?m sure someone somewhere has the need for a script like this?
> >Naturally all of this would take place over a secure connection.
> >
> >So does anyone have any advice on how I can accomplish this in PHP?
> >
> >Atul
> >
> >------------------------------------------------------------------------
> >
> >
> >
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
>
From andrew at plexpod.com Wed Mar 16 18:27:33 2005
From: andrew at plexpod.com (Andrew Yochum)
Date: Wed, 16 Mar 2005 18:27:33 -0500
Subject: [nycphp-talk] Q: Authenticating XML Data Exchange
In-Reply-To:
References: <763b5f4e0ad66f5d1ac82b063137be65@cyber-ny.com>
<20050316195745.GQ7597@zoidberg.digitalpulp.com>
Message-ID: <20050316232732.GA16557@desario.homelinux.net>
On Wed, Mar 16, 2005 at 05:31:59PM -0500, csnyder wrote:
> On Wed, 16 Mar 2005 16:04:51 -0500 (EST), David Mintz
> wrote:
> > On Wed, 16 Mar 2005, Andrew Yochum wrote:
> >
> > >
> > > SOAP messages are just that, messages, and can and have been delivered
> > > by nearly any method, including http(s), smtp, jabber, and if you're
> > > truly desparate, even smoke signals.
> >
> > We need to see a demo of the smoke signals at the next NYPHP meeting --
> > then again maybe the building management would not approve.
> >
>
> Carrier pigeon then?
As long as the round trips are within the pigeon labor laws then I think
we're OK.
From danielc at analysisandsolutions.com Wed Mar 16 19:06:03 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Wed, 16 Mar 2005 19:06:03 -0500
Subject: [nycphp-talk] stupid curly quotes
In-Reply-To:
References: <57542.69.86.84.233.1110752645.spork@webmail.ceruleansky.com>
<4234BF26.5010700@phpwerx.net>
Message-ID: <20050317000603.GA6590@panix.com>
On Wed, Mar 16, 2005 at 04:46:17PM -0500, Marc Antony Vose wrote:
>
> How do people here handle stripping crap like curly quotes out of
> text that users are pasting from Microsoft Word?
$search = array(
'/[\x07\x95]/',
'/\x85/',
'/[\x91\x92]/',
'/[\x93\x94]/',
);
$replace = array(
'-',
'...',
'\'',
'"',
);
$data = preg_replace($search, $replace, $data);
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From 1j0lkq002 at sneakemail.com Wed Mar 16 19:12:10 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Wed, 16 Mar 2005 19:12:10 -0500
Subject: [nycphp-talk] stupid curly quotes
In-Reply-To:
References: <57542.69.86.84.233.1110752645.spork@webmail.ceruleansky.com> <4234BF26.5010700@phpwerx.net>
Message-ID: <23353-78785@sneakemail.com>
Marc Antony Vose suzerain-at-suzerain.com |nyphp dev/internal group use|
wrote:
> Hi there.
>
> This is an old problem that I am again searching for the prefect
> solution to.
>
> How do people here handle stripping crap like curly quotes out of text
> that users are pasting from Microsoft Word?
>
> Any pointers or advice are welcome...:)
>
> Cheers,
http://us3.php.net/tidy
-=john andrews
From jayeshsh at ceruleansky.com Wed Mar 16 21:41:49 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Wed, 16 Mar 2005 21:41:49 -0500
Subject: [nycphp-talk] QuickForm / PHP (Zend Engine) Bug - callback function
never called
Message-ID: <4238EE6D.7070900@ceruleansky.com>
Hello all,
I have come across commonly occuring QuickForm bug that might be due to
either a QuickForm bug or a Zend Engine bug (unless I am doing something
really stupid here.)
Okay, here's the gist of it:
If a QuickForm object is instantiated inside of a conditional check, the
callback processing function will not be run, UNLESS the callback
function is defined BEFORE the if "( $form->validate() )" check.
(The following examples are based on sample code from David Sklar's
"Essential PHP Tools" book.)
For example, in the following case, the callback function will NOT be run:
---------------------------
validate())'
The callback function will now NOT be run
This is a PHP or QF bug
*/
define ("IS_TRUE", true);
if (IS_TRUE)
{
// Load the HTML_QuickForm module
require 'HTML/QuickForm.php';
// Instantiate a new form
$form = new HTML_QuickForm('book');
// Add a text box
$form->addElement('text','title','Book Title:');
// Add a select box
$subjects = array('Math','Ice Fishing','Anatomy');
$form->addElement('select','subject','Subject(s): ',$subjects);
// Add a submit button
$form->addElement('submit','save','Save Book');
// Add a validation rule: title is required
$form->addRule('title','Please Enter a Book Title','required');
$praise_book_called = false;
// Call the processing function if the submitted form
// data is valid; otherwise, display the form
if ( $form->validate() )
{
$f = $form->process('praise_book');
if (! $f || ! $praise_book_called)
{
if ( ! $praise_book_called )
{
echo "
Error / PHP Bug:
";
echo "
";
print_r($f);
echo "
";
}
else
{
echo "
Other error.
";
}
}
}
else
{
$form->display();
}
// Define a function to process the form data
function praise_book($v)
{
global $subjects, $praise_book_called;
$praise_book_called = true;
// Entity-encode any special characters in $v['title']
$v['title'] = htmlentities($v['title']);
print "$v[title] is a great book about ";
print $subjects[$v['subject']] . '.';
return true;
}
}
else
{
exit("
Error: An unknown error has occured. Exiting.
");
}
?>
---------------------------
The following error will be outputted (via print_r() )
---------------------------
Error / PHP Bug:
HTML_QuickForm_Error Object
(
[error_message_prefix] => QuickForm Error:
[mode] => 1
[level] => 1024
[code] => -7
[message] => process callback does not exist
[userinfo] => Callback function does not exist in QuickForm::process()
[backtrace] => Array
(
[0] => Array
(
[file] => c:\apachefriends\xampp\php\pear\HTML\QuickForm.php
[line] => 1818
[function] => PEAR_Error
[class] => HTML_QuickForm_Error
[type] => ->
[args] => Array
(
[0] => process callback does not exist
[1] => -7
[2] => 1
[3] => 1024
[4] => Callback function does not exist in QuickForm::process()
)
)
[SNIP ... more stuff in here. Please run the example to see the entire output.]
)
-------------------------
Now, in the following case, if praise_book is defined before 'if
($form->validate())', it will work as expected. Also, if the conditional
check "if (IS_TRUE)" is removed, it will work as expected.
What is going on here?
Is it something that I am missing, or is it a PHP or QuickForm bug?
Thanks in advance.
- Jay
From lists at zaunere.com Wed Mar 16 23:21:42 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Wed, 16 Mar 2005 23:21:42 -0500
Subject: [nycphp-talk] Maguma Open Studio
In-Reply-To: <57284.69.86.84.233.1110856464.spork@webmail.ceruleansky.com>
Message-ID: <0MKz5u-1DBmW01GKz-0006Ua@mrelay.perfora.net>
> >From a cursory look, this new, open source version seems to have new
> icons, and probably other new enhancements too. It also has a built in
> debugger. It seems to be a bit rough around the edges, but since the
> source has been posted at Sourceforge, such deficiencies / bugs are
> perhaps best seen as invitation to fix them.
The topic of IDE and general programming environments/techniques for PHP are a common one. A face-off style meeting would be good if someone would be willing to moderate/organize it.
---
Hans Zaunere
President, Founder
New York PHP
http://www.nyphp.org
AMP Technology
Supporting Apache, MySQL and PHP
From dcech at phpwerx.net Thu Mar 17 08:15:56 2005
From: dcech at phpwerx.net (Dan Cech)
Date: Thu, 17 Mar 2005 08:15:56 -0500
Subject: [nycphp-talk] QuickForm / PHP (Zend Engine) Bug - callback function
never called
In-Reply-To: <4238EE6D.7070900@ceruleansky.com>
References: <4238EE6D.7070900@ceruleansky.com>
Message-ID: <4239830C.7020305@phpwerx.net>
Jay,
As far as I know function definitions within conditional blocks are
executed inline with the other code, thus the behaviour you describe
would be correct as the function would not yet have been defined.
I could be way off though...
Dan
Jayesh Sheth wrote:
> Hello all,
>
> I have come across commonly occuring QuickForm bug that might be due to
> either a QuickForm bug or a Zend Engine bug (unless I am doing something
> really stupid here.)
>
> Okay, here's the gist of it:
>
> If a QuickForm object is instantiated inside of a conditional check, the
> callback processing function will not be run, UNLESS the callback
> function is defined BEFORE the if "( $form->validate() )" check.
>
> (The following examples are based on sample code from David Sklar's
> "Essential PHP Tools" book.)
> For example, in the following case, the callback function will NOT be run:
> ---------------------------
> /*
> praise_book() function is defined AFTER 'if ($form->validate())'
> The callback function will now NOT be run
> This is a PHP or QF bug
> */
>
> define ("IS_TRUE", true);
>
> if (IS_TRUE)
> {
> // Load the HTML_QuickForm module
> require 'HTML/QuickForm.php';
>
> // Instantiate a new form
> $form = new HTML_QuickForm('book');
> // Add a text box
> $form->addElement('text','title','Book Title:');
> // Add a select box
> $subjects = array('Math','Ice Fishing','Anatomy');
> $form->addElement('select','subject','Subject(s): ',$subjects);
> // Add a submit button
> $form->addElement('submit','save','Save Book');
>
> // Add a validation rule: title is required
> $form->addRule('title','Please Enter a Book Title','required');
>
> $praise_book_called = false;
>
> // Call the processing function if the submitted form
> // data is valid; otherwise, display the form
> if ( $form->validate() )
> {
> $f = $form->process('praise_book');
> if (! $f || ! $praise_book_called)
> {
> if ( ! $praise_book_called )
> {
> echo "
Error / PHP Bug:
";
> echo "
";
> print_r($f);
> echo "
";
> }
> else
> {
> echo "
Other error.
";
> }
> }
> }
> else
> {
> $form->display();
> }
>
> // Define a function to process the form data
> function praise_book($v)
> {
> global $subjects, $praise_book_called;
> $praise_book_called = true;
> // Entity-encode any special characters in $v['title']
> $v['title'] = htmlentities($v['title']);
> print "$v[title] is a great book about ";
> print $subjects[$v['subject']] . '.';
> return true;
> }
>
> }
> else
> {
> exit("
Error: An unknown error has occured. Exiting.
");
> }
> ?>
> ---------------------------
> The following error will be outputted (via print_r() )
>
> ---------------------------
> Error / PHP Bug:
>
> HTML_QuickForm_Error Object
> (
> [error_message_prefix] => QuickForm Error: [mode] => 1
> [level] => 1024
> [code] => -7
> [message] => process callback does not exist
> [userinfo] => Callback function does not exist in QuickForm::process()
> [backtrace] => Array
> (
> [0] => Array
> (
> [file] =>
> c:\apachefriends\xampp\php\pear\HTML\QuickForm.php
> [line] => 1818
> [function] => PEAR_Error
> [class] => HTML_QuickForm_Error
> [type] => ->
> [args] => Array
> (
> [0] => process callback does not exist
> [1] => -7
> [2] => 1
> [3] => 1024
> [4] => Callback function does not exist in
> QuickForm::process()
> )
>
> )
>
> [SNIP ... more stuff in here. Please run the example to see
> the entire output.]
> )
>
> -------------------------
> Now, in the following case, if praise_book is defined before 'if
> ($form->validate())', it will work as expected. Also, if the conditional
> check "if (IS_TRUE)" is removed, it will work as expected.
>
> What is going on here?
> Is it something that I am missing, or is it a PHP or QuickForm bug?
>
> Thanks in advance.
>
> - Jay
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
From Cbielanski at inta.org Thu Mar 17 11:39:47 2005
From: Cbielanski at inta.org (Chris Bielanski)
Date: Thu, 17 Mar 2005 11:39:47 -0500
Subject: [nycphp-talk] stupid curly quotes
Message-ID: <328AA5243F20DA4DABDC022745BF3A07FEE1@INTAMAIL2k3.ny.inta.org>
This deserves to be in a KB of some kind... I like that it'll even catch the
em-dash!
> -----Original Message-----
> From: Daniel Convissor [mailto:danielc at analysisandsolutions.com]
> Sent: Wednesday, March 16, 2005 7:06 PM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] stupid curly quotes
>
> On Wed, Mar 16, 2005 at 04:46:17PM -0500, Marc Antony Vose wrote:
> >
> > How do people here handle stripping crap like curly quotes
> out of text
> > that users are pasting from Microsoft Word?
>
> $search = array(
> '/[\x07\x95]/',
> '/\x85/',
> '/[\x91\x92]/',
> '/[\x93\x94]/',
> );
> $replace = array(
> '-',
> '...',
> '\'',
> '"',
> );
> $data = preg_replace($search, $replace, $data);
>
> --Dan
>
> --
> T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
> data intensive web and database programming
> http://www.AnalysisAndSolutions.com/
> 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f:
> 718-854-0409 _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From jayeshsh at ceruleansky.com Thu Mar 17 12:47:10 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Thu, 17 Mar 2005 12:47:10 -0500
Subject: [nycphp-talk] QuickForm / PHP (Zend Engine) Bug - callback function
never called
Message-ID: <4239C29E.4070106@ceruleansky.com>
Hello Dan,
Thanks for your reply. I have boiled down this experience to two test
cases. In the first case, there is no conditional check, and so the
call_user_func() succeeds. In the second case, the call to
call_user_func() fails, simply due to the conditional check. I feel
there is no logical reason for the inclusion of a conditional check to
cause call_user_func to fail. Does anyone on this list know if someone
has deliberately designed PHP this way, and if so, why?
Thanks in advance,
- Jay Sheth
Example 1: call_user_func() succeeds.
--------------------------------------------------------------------------
echo_echo() is a callable function.
";
call_user_func('echo_echo');
}
else
{
echo "
Error: echo_echo() is NOT a callable function.
";
}
function echo_echo()
{
echo "
This has been outputted by the echo_echo function.
";
}
?>
--------------------------------------------------------------------------
Example 2: call_user_func() FAILS, due to conditional check
--------------------------------------------------------------------------
echo_echo() is a callable function. ";
call_user_func('echo_echo');
}
else
{
echo "
Error: echo_echo() is NOT a callable function.
";
}
function echo_echo()
{
echo "
This has been outputted by the echo_echo function.
";
}
}
else
{
echo "
Unfortunately, it's not true.
";
}
?>
--------------------------------------------------------------------------
From danielc at analysisandsolutions.com Thu Mar 17 12:54:08 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Thu, 17 Mar 2005 12:54:08 -0500
Subject: [nycphp-talk] QuickForm / PHP (Zend Engine) Bug - callback
function never called
In-Reply-To: <4239C29E.4070106@ceruleansky.com>
References: <4239C29E.4070106@ceruleansky.com>
Message-ID: <20050317175408.GA26676@panix.com>
Jay:
On Thu, Mar 17, 2005 at 12:47:10PM -0500, Jayesh Sheth wrote:
> cause call_user_func to fail. Does anyone on this list know if someone
> has deliberately designed PHP this way, and if so, why?
Yes. A function has to be declared before you can use it. Functions
declared normally (outside conditional statements) are declared when the
file is parsed. Functions declared in conditional statements are declared
during run time _when_ _execution_ _gets_ _to_ _them_. So, you can solve
your issue by reordering your script to put the function declaration above
the is_callable() call.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From jayeshsh at ceruleansky.com Thu Mar 17 13:45:18 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Thu, 17 Mar 2005 13:45:18 -0500
Subject: [nycphp-talk] Another QuickForm Bug (Hidden Element Processing)
Message-ID: <4239D03E.6040604@ceruleansky.com>
Hello all,
I have found what I think is another bug in QuickForm (QF). Here is a
summary of it:
if a non-QF form posts a hidden value to a QF form, the QF form object
is unable to overwrite the hidden element's value.
1) An example can be found here:
http://www.moztips.com/qf_bugs/qf_hidden_bug.php?need_login_form=yes
View the source, and examine the hidden input fields.
Type some text, and submit the form. Scroll down to see the print_r()
values of the output.
Submitted Form Values:
Array
(
[my_title] => bogus text
[hidden_value1] => This is a bogus value that should be overwritten.
[need_login_form] => no
[save] => Submit this form to the QF script
)
2) Then visit:
http://www.moztips.com/qf_bugs/qf_hidden_bug.php?need_login_form=no
View the source again, and submit it.
You will see that the value of the 'hidden_value2' is reset to 'This is
a hidden value' in the second case, but not in the first.
Submitted Form Values:
Array
(
[hidden_value1] => This is a hidden value.
[hidden_value2] => This is a hidden value.
[need_login_form] => no
[my_title] => bogus text
[save] => Submit this QF form for processing
)
The full source of this example follows my message. Again, am I doing
something really stupid, am I overlooking something, or is this a bug?
Thanks in advance,
- Jay Sheth
_________________________________________________________________
bogus text
[hidden_value1] => This is a bogus value that should be overwritten.
[need_login_form] => no
)
*/
// 4) hidden_value1 should have the value 'This is a hidden value.'
// 5) Using print_r($form), we see that element 2 of
HTML_QuickForm_hidden Object contains the original text, and is not
// overwritten with the value of $hidden
/*
[2] => HTML_QuickForm_hidden Object
(
[_label] =>
[_type] => hidden
[_flagFrozen] =>
[_persistantFreeze] =>
[_attributes] => Array
(
[name] => hidden_value1
[type] => hidden
[value] => This is a bogus value that should
be overwritten.
)
[_tabOffset] => 0
[_tab] =>
[_lineEnd] =>
[_comment] =>
)
*/
// 6) Note that if you submit this form via the QuickForm form (by
accessing qf_hidden_bug.php?need_login_form=no)
// The hidden_value2 is overwritten.
$myself = $_SERVER['PHP_SELF'];
if ( $_REQUEST['need_login_form'] == 'no' )
{
// Load the HTML_QuickForm module
require 'HTML/QuickForm.php';
// Instantiate a new form
$form = new HTML_QuickForm('book');
$form->addElement('header', 'my_header', 'QuickForm Version');
// Add a text box
$form->addElement('text','my_title','Please enter some text:');
$hidden = 'This is a hidden value.';
// Add two hidden elements.
// The value from $hidden will NOT be passed to hidden_value1 when
the form is posted to using the alternate form
// contained in the else block below.
// Access this form with qf_hidden_bug.php?need_login_form=yes .
Then press the submit button to see that
// hidden_value1 is NOT set to 'This is a hidden value.'.
$form->addElement('hidden', 'hidden_value1', $hidden);
$form->addElement('hidden', 'hidden_value2', $hidden); // The value
from $hidden will be passed to hidden_value2
$form->addElement('hidden', 'need_login_form', 'no'); // Need to
come back to this QF block after form is submitted
// Add a submit button
$form->addElement('submit','save','Submit this QF form for processing');
if ( isset( $_POST['save'] ) )
{
echo "
\$form : QF form object \n";
print_r($form);
echo "
";
}
// Define a function to process the form data
function process_form($v)
{
echo "_______________________________ Submitted Form
Values:
\n";
print_r($v);
echo "
\n";
return true;
}
// Call the processing function if the submitted form
// data is valid; otherwise, display the form
if ( $form->validate() )
{
$form->process('process_form');
}
else
{
$form->display();
}
}
else
{
echo "";
}
?>
From jayeshsh at ceruleansky.com Thu Mar 17 14:12:37 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Thu, 17 Mar 2005 14:12:37 -0500
Subject: [nycphp-talk] QuickForm / PHP (Zend Engine) Bug - callback function
never called
Message-ID: <4239D6A5.7060506@ceruleansky.com>
Hi Dan,
Thanks for your reply.
>Yes. A function has to be declared before you can use it. Functions
>declared normally (outside conditional statements) are declared when the
>file is parsed. Functions declared in conditional statements are
declared
>during run time _when_ _execution_ _gets_ _to_ _them_. So, you can solve
>your issue by reordering your script to put the function declaration
above
>the is_callable() call.
I was not actively aware of this difference before. I tried a similar
example in JavaScript, and it behaved the way you described it.
I guess this is pretty standard practice (in programming languages, that
is), and I was not aware of the differences between the parse order of
functions declared inside of and outside of conditional blocks.
Normally this situation is less common, since I usually declare
functions before I use them (include files that contain related
functions at the top of the page), unless it's QuickForm, in which case
I tend to do it this way.
Best Regards,
- Jay
From 1j0lkq002 at sneakemail.com Thu Mar 17 14:24:47 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Thu, 17 Mar 2005 14:24:47 -0500
Subject: [nycphp-talk] For those interested in search,
Google starts a code site
In-Reply-To: <20050317175408.GA26676@panix.com>
References: <4239C29E.4070106@ceruleansky.com>
<20050317175408.GA26676@panix.com>
Message-ID: <8063-17197@sneakemail.com>
http://code.google.com/
APIs are here : http://code.google.com/apis.html
-=john andrews
*About Code.google.com*
*What is code.google.com?*
Code.google.com is our site for external developers interested in
Google-related development. It?s where we?ll publish free source
code and lists of our API services.
*Who are the people behind code.google.com?*
A lot of people worked together to both prepare source code for
release and prepare code.google.com for launch and ongoing
maintenance. We really care about free and open source software
(F/OSS) at Google, and this site is one aspect of that affection.
*Google's Projects*
*Which projects are being released?*
We've chosen 4 projects to start out. Perftools, sparsehashtable,
coredumper and goopy/functional. Details can be found at
http://code.google.com/projects.html
*Why did you choose these particular projects?*
Well, several reasons, actually.
? Google Engineers picked them.
You may have heard about 20% time, in which Google engineers are
encouraged to work on a personal project one day out of the
week. Open Source interests a lot of Google developers, so we
thought taking advantage of this program was a good way to
prepare code for release and maintenance.
? They make future releases possible.
The programs we've chosen are all what we consider
infrastructural programs. By releasing these tools, we will be
able to release more software that relies on them later.
? These are the ones that were ready first.
*Are these programs still in active use at Google?*
They aren't just in active use; they're in active development. These
first projects are all current, actively maintained code straight
out of our repositories, and as we improve them, those improvements
will be merged into the free code base.
From codebowl at gmail.com Thu Mar 17 15:09:59 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Thu, 17 Mar 2005 15:09:59 -0500
Subject: [nycphp-talk] PHP 5 Exception Expertise Needed
Message-ID: <8d9a4280050317120947b499ea@mail.gmail.com>
Hello Everyone,
I have been working with the Exceptions in PHP 5 and i cannot figure
out why i am getting these results nor can i figure out how to trace
the resutls. Let me start with the code files
This is my main exception class.
* @copyright Codebowl Solutions 2005
* @package SimonVolkov
* @subpackage Exceptions
*
**/
class SvEx extends Exception {
const ERR_TYPE = "Unknown Error";
const ERR_DESC = "There has been an error. This error has been
logged. Please try again in a few minutes.";
protected $_msg;
protected $_tpl;
protected $_error;
public function __construct( $error = null ) {
$this->_error = array(
'type' => self::ERR_TYPE,
'description' => self::ERR_DESC
);
$this->_tpl = Application::Template();
$this->_tpl->assign( 'error_type', $this->_error['type'] );
$this->_tpl->assign( 'error_description', $this->_error['description'] );
$this->_msg = $error;
parent::__construct($this->_msg);
}
public function Display() {
$this->_tpl->assign('admin', 1);
$this->_tpl->assign('msg', $this->_msg);
$this->_tpl->display('error.tpl');
}
}
?>
from this i extend for each exception type that i have
here is the application exception
* @copyright Codebowl Solutions 2005
* @package SimonVolkov
* @subpackage Exceptions
*
**/
class ApplicationEx extends SvEx {
const ERR_TYPE = "Application Error";
public function __construct( $msg = null ) {
parent::__construct($msg);
$this->_error['type'] = self::ERR_TYPE;
}
}
?>
when i throw a new ApplicationEx for some reason the
$this->_error['type'] is not getting set to Application Error but yet
Unknown Error.
you can see an application error thrown on this page for testing
http://codebowl.homelinux.net:8001/clients/JVMedia/SimonVolkov/global.php
the Error Reported part is going to be hidden from the end user and
only shown to admins and locally during development.
here is the line that is throwing the ApplicationEx Exception
if( ( isset( $dbinfo['type'] ) && $dbinfo['type'] != "" ) && ( isset(
$dbinfo['host'] ) && $dbinfo['host'] != "" ) && ( isset(
$dbinfo['database'] ) && $dbinfo['database'] != "" ) ) {
self::$_db = new $dbinfo['type']($dbinfo['host'],
$dbinfo['database'], $dbinfo['user'], $dbinfo['pass']);
} else {
throw new ApplicationEx("Could not instanciate the database
object, you must specify the database type, hostname and database
name.");
}
and here is the code to catch the exceptions
try {
$app = new Application( $dbinfo );
} catch(MysqlEx $mysqlEx) {
// show the error message
$mysqlEx->Display();
} catch( ApplicationEx $appEx ) {
// show the error message
$appEx->Display();
} catch(Exception $e) {
// show the error message
$e->getMessage();
}
any help with this would be appreciated. I have tried to debug using
zend studio however using the __autoload magic function zend studio
says fatal error class SvEx cannot be found.
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From frank_wong2 at informationideas.com Thu Mar 17 18:08:42 2005
From: frank_wong2 at informationideas.com (Frank Wong)
Date: Thu, 17 Mar 2005 18:08:42 -0500
Subject: [nycphp-talk] Calling curl_init() from within a class
Message-ID:
Can someone tell me how to call curl_init() from within a class? I'm sure
it is something simple that I'm missing. Thanks in advance.
________________________
Frank Wong
From jayeshsh at ceruleansky.com Thu Mar 17 19:18:41 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Thu, 17 Mar 2005 19:18:41 -0500
Subject: [nycphp-talk] PHP 5 Exception Expertise Needed
Message-ID: <423A1E61.7040802@ceruleansky.com>
Hello Joseph,
I think I know what is going wrong regarding the exception handling
issue you mentioned.
In the SvEx class, you declared ERR_TYPE as a constant (or static member):
const ERR_TYPE = "Unknown Error";
ApplicationEx extends SvEx, and even if you redeclare ERR_TYPE in ApplicationEx, it still retains its old, immutable value from SvES, which is "Unknown Error."
If you change ERR_TYPE to be a protected member (thus inheritable by subclasses), it should work.
For example:
_error = array(
'type' => $this->err_type,
'description' => self::ERR_DESC
);
/*
$this->_tpl = Application::Template();
$this->_tpl->assign( 'error_type', $this->_error['type'] );
$this->_tpl->assign( 'error_description', $this->_error['description'] );
*/
$this->_msg = $error;
parent::__construct($this->_msg);
}
public function Display() {
$this->_tpl->assign('admin', 1);
$this->_tpl->assign('msg', $this->_msg);
$this->_tpl->display('error.tpl');
}
}
?>
and then:
_error['type'] = $this->err_type;
}
}
?>
---------------------------------------------
and then a test:
---------------------------------------------
getMessage(), "\n";
echo "
";
print_r($e);
echo "
";
}
// Continue execution
echo 'Hello World';
?>
---------------------------------
It should output the following:
---------------------------------
Caught exception: This error goes to the ApplicationEx exception handler
ApplicationEx Object
(
[err_type:protected] => Application Error
[_msg:protected] => This error goes to the ApplicationEx exception handler
[_tpl:protected] =>
[_error:protected] => Array
(
[type] => Application Error
[description] => There has been an error. This error has been
logged. Please try again in a few minutes.
)
[message:protected] => This error goes to the ApplicationEx exception handler
[string:private] =>
[code:protected] => 0
[file:protected] => C:\apachefriends\xampp\htdocs\nyphp\exceptions2.php
[line:protected] => 10
[trace:private] => Array
(
)
)
Hello World
-------------------------------------------
Hope that helps,
- Jay Sheth
From frank_wong2 at informationideas.com Thu Mar 17 19:24:50 2005
From: frank_wong2 at informationideas.com (Frank Wong)
Date: Thu, 17 Mar 2005 19:24:50 -0500
Subject: [nycphp-talk] Calling curl_init() from within a class
In-Reply-To:
Message-ID:
I just found out that our ISP made some changes to the php.ini and got rid
of CURL. It just so happened to coincide with my using CURL in a class.
Figures it is something that had nothing to do with the code and I'm pulling
my hair out looking at it.
Frank
-----Original Message-----
From: talk-bounces at lists.nyphp.org
[mailto:talk-bounces at lists.nyphp.org]On Behalf Of Frank Wong
Sent: Thursday, March 17, 2005 6:09 PM
To: NYPHP Talk
Subject: [nycphp-talk] Calling curl_init() from within a class
Can someone tell me how to call curl_init() from within a class? I'm sure
it is something simple that I'm missing. Thanks in advance.
________________________
Frank Wong
_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org
From codebowl at gmail.com Thu Mar 17 20:06:05 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Thu, 17 Mar 2005 20:06:05 -0500
Subject: [nycphp-talk] PHP 5 Exception Expertise Needed
In-Reply-To: <423A1E61.7040802@ceruleansky.com>
References: <423A1E61.7040802@ceruleansky.com>
Message-ID: <8d9a428005031717065f1e6007@mail.gmail.com>
Ah thanks
i cannot belive i did that the first rule of constants is they are just that :D
thanks i will try using a protected member.
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From pl at eskimo.net Fri Mar 18 13:14:44 2005
From: pl at eskimo.net (Peter Lehrer)
Date: Fri, 18 Mar 2005 13:14:44 -0500 (EST)
Subject: [nycphp-talk] gentoo (vs) fedora
Message-ID: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
Hi,
I would like to know if anyone has experience with Gentoo and how it
stacks up against other linux distributions, especially Fedora.
Also, does anyone have any experience with skunkweb
(http://www.skunkweb.org) and/or python and postgres, and care to share
their experiences with them? What kind of learning curve is needed for
python, for instance?
Regards,
Peter
From jeff.knight at gmail.com Fri Mar 18 13:19:22 2005
From: jeff.knight at gmail.com (Jeff Knight)
Date: Fri, 18 Mar 2005 13:19:22 -0500
Subject: [nycphp-talk] gentoo (vs) fedora
In-Reply-To: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
References: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
Message-ID: <2ca9ba9105031810192ab24425@mail.gmail.com>
It all depends on how much interaction and control you are looking
for. As a learning experience, you'll get a lot more out of a Gentoo
install, but if you just want something working reliably & right away,
with a minimum of fuss, Fedora is the way to go.
On Fri, 18 Mar 2005 13:14:44 -0500 (EST), Peter Lehrer wrote:
> Hi,
>
> I would like to know if anyone has experience with Gentoo and how it
> stacks up against other linux distributions, especially Fedora.
>
> Also, does anyone have any experience with skunkweb
> (http://www.skunkweb.org) and/or python and postgres, and care to share
> their experiences with them? What kind of learning curve is needed for
> python, for instance?
>
> Regards,
>
> Peter
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From agfische at email.smith.edu Fri Mar 18 13:25:30 2005
From: agfische at email.smith.edu (Aaron Fischer)
Date: Fri, 18 Mar 2005 13:25:30 -0500
Subject: [nycphp-talk] gentoo (vs) fedora
In-Reply-To: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
References: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
Message-ID: <4ef414743168ed69de2eabc6be3fa394@email.smith.edu>
Last semester I finished a CS course which used Python as the
programming language of instruction (it always used to be C). My
impression of Python is that it is fairly similar to PHP in a number of
ways:
Don't have to declare variables and types before using.
Can program procedural or object-oriented style.
My experience is that it was a pretty approachable language, certainly
not as strict as Java.
-Aaron
On Mar 18, 2005, at 1:14 PM, Peter Lehrer wrote:
> Hi,
>
> I would like to know if anyone has experience with Gentoo and how it
> stacks up against other linux distributions, especially Fedora.
>
> Also, does anyone have any experience with skunkweb
> (http://www.skunkweb.org) and/or python and postgres, and care to share
> their experiences with them? What kind of learning curve is needed for
> python, for instance?
>
>
> Regards,
>
> Peter
From jeff.knight at gmail.com Fri Mar 18 13:29:29 2005
From: jeff.knight at gmail.com (Jeff Knight)
Date: Fri, 18 Mar 2005 13:29:29 -0500
Subject: [nycphp-talk] gentoo (vs) fedora
In-Reply-To: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
References: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
Message-ID: <2ca9ba91050318102920ab412d@mail.gmail.com>
And don't forget a NYPHP favorite: FreeBSD
On Fri, 18 Mar 2005 13:14:44 -0500 (EST), Peter Lehrer wrote:
> Hi,
>
> I would like to know if anyone has experience with Gentoo and how it
> stacks up against other linux distributions, especially Fedora.
>
> Also, does anyone have any experience with skunkweb
> (http://www.skunkweb.org) and/or python and postgres, and care to share
> their experiences with them? What kind of learning curve is needed for
> python, for instance?
>
> Regards,
>
> Peter
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From pl at eskimo.net Fri Mar 18 13:35:39 2005
From: pl at eskimo.net (Peter Lehrer)
Date: Fri, 18 Mar 2005 13:35:39 -0500 (EST)
Subject: [nycphp-talk] gentoo (vs) fedora
In-Reply-To: <2ca9ba91050318102920ab412d@mail.gmail.com>
References: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
<2ca9ba91050318102920ab412d@mail.gmail.com>
Message-ID: <3322.66.2.44.119.1111170939.squirrel@66.2.44.119>
OK. :)
peter
> And don't forget a NYPHP favorite: FreeBSD
>
>
> On Fri, 18 Mar 2005 13:14:44 -0500 (EST), Peter Lehrer
> wrote:
>> Hi,
>>
>> I would like to know if anyone has experience with Gentoo and how it
>> stacks up against other linux distributions, especially Fedora.
>>
>> Also, does anyone have any experience with skunkweb
>> (http://www.skunkweb.org) and/or python and postgres, and care to share
>> their experiences with them? What kind of learning curve is needed for
>> python, for instance?
>>
>> Regards,
>>
>> Peter
>> _______________________________________________
>> New York PHP Talk Mailing List
>> AMP Technology
>> Supporting Apache, MySQL and PHP
>> http://lists.nyphp.org/mailman/listinfo/talk
>> http://www.nyphp.org
>>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From fields at hedge.net Fri Mar 18 13:44:56 2005
From: fields at hedge.net (Adam Fields)
Date: Fri, 18 Mar 2005 13:44:56 -0500
Subject: [nycphp-talk] gentoo (vs) fedora
In-Reply-To: <2ca9ba9105031810192ab24425@mail.gmail.com>
References: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
<2ca9ba9105031810192ab24425@mail.gmail.com>
Message-ID: <20050318184456.GO19345@lola.aquick.org>
On Fri, Mar 18, 2005 at 01:19:22PM -0500, Jeff Knight wrote:
> It all depends on how much interaction and control you are looking
> for. As a learning experience, you'll get a lot more out of a Gentoo
> install, but if you just want something working reliably & right away,
> with a minimum of fuss, Fedora is the way to go.
If you want something working reliably and right away, I'd argue that
ubuntu (or Kubuntu) is the way to go.
I've never seen an easier install.
--
- Adam
** I can fix your database problems: http://www.everylastounce.com/mysql.html **
Blog............... [ http://www.aquick.org/blog ]
Links.............. [ http://del.icio.us/fields ]
Photos............. [ http://www.aquick.org/photoblog ]
Experience......... [ http://www.adamfields.com/resume.html ]
Product Reviews: .. [ http://www.buyadam.com/blog ]
From joel at tagword.com Fri Mar 18 13:52:53 2005
From: joel at tagword.com (Joel De Gan)
Date: Fri, 18 Mar 2005 13:52:53 -0500
Subject: [nycphp-talk] gentoo (vs) fedora
In-Reply-To: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
References: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
Message-ID: <1111171973.8478.28.camel@bezel>
Love gentoo..
Was openbsd user prior and when I switched to linux looked for something
that would be similar.. gentoo fit the bill nice..
Most distro's install a bunch of garbage that some 13 year old on crack
compiled (take mandrake on a P4 for example).. Gentoo is a bit more work
to set up, but well worth it for optimizations and if you are like me
and fully lazy about patching..
Meaning, you can cron up the "emerge" tool to update your software
nightly so you are always up to date without having to think to about it
and you just need to run the built in tools for checking changes to
config files (which emerge nicely also does not clobber) and with a
world make.conf for always compiling stuff with mysql support etc et al
it is a dream for a sysadmin.
Pretty much the only distro I will use, think about using, and recommend
to programmers. For linux newbs, Mandrake or Redhat are fine to wet your
feet..
-cheers
On Fri, 2005-03-18 at 13:14, Peter Lehrer wrote:
> Hi,
>
> I would like to know if anyone has experience with Gentoo and how it
> stacks up against other linux distributions, especially Fedora.
>
> Also, does anyone have any experience with skunkweb
> (http://www.skunkweb.org) and/or python and postgres, and care to share
> their experiences with them? What kind of learning curve is needed for
> python, for instance?
>
>
> Regards,
>
> Peter
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
--
joeldg - developer, Intercosmos media group.
http://lucifer.intercosmos.net
From codebowl at gmail.com Fri Mar 18 15:06:50 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Fri, 18 Mar 2005 15:06:50 -0500
Subject: [nycphp-talk] PHP 5 Exception Expertise Needed
In-Reply-To: <8d9a428005031717065f1e6007@mail.gmail.com>
References: <423A1E61.7040802@ceruleansky.com>
<8d9a428005031717065f1e6007@mail.gmail.com>
Message-ID: <8d9a4280050318120616da6f1c@mail.gmail.com>
Jayesh,
I have attempted to do what you said i should try however i am still
getting the same results as i was before :(
* @copyright Codebowl Solutions 2005
* @package SimonVolkov
* @subpackage Exceptions
*
**/
class SvEx extends Exception {
protected $_msg;
protected $_tpl;
protected $_error = array(
'type' => "Unknown Error",
'description' => "There has been an error. This error has been
logged. Please try again in a few minutes."
);
public function __construct( $error = null ) {
$this->_tpl = Application::Template();
$this->_tpl->assign( 'error_type', $this->_error['type'] );
$this->_tpl->assign( 'error_description', $this->_error['description'] );
$this->_msg = $error;
parent::__construct($this->_msg);
}
public function Display($file, $line) {
$this->_tpl->assign('admin', 1);
$this->_tpl->assign('msg', $this->_msg);
$file = explode('\\', $file);
$top = count( $file ) - 1;
$file = '/' . $file[$top-1] . '/' . $file[$top];
$this->_tpl->assign('__FILE__', $file);
$this->_tpl->assign('__LINE__', $line);
$this->_tpl->display('error.tpl');
}
}
?>
* @copyright Codebowl Solutions 2005
* @package SimonVolkov
* @subpackage Exceptions
*
**/
class ApplicationEx extends SvEx {
public function __construct( $msg = null ) {
parent::__construct($msg);
$this->_error['type'] = "Application Error";
$this->_error['description'] = "An Application Error!";
}
}
?>
i am not sure why however the values for the error_type and
description are not getting set from the applicationEx class
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From pl at eskimo.net Fri Mar 18 17:00:15 2005
From: pl at eskimo.net (Peter Lehrer)
Date: Fri, 18 Mar 2005 17:00:15 -0500 (EST)
Subject: [nycphp-talk] gentoo (vs) fedora
In-Reply-To: <20050318184456.GO19345@lola.aquick.org>
References: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
<2ca9ba9105031810192ab24425@mail.gmail.com>
<20050318184456.GO19345@lola.aquick.org>
Message-ID: <3415.66.2.44.23.1111183215.squirrel@66.2.44.23>
> On Fri, Mar 18, 2005 at 01:19:22PM -0500, Jeff Knight wrote:
>> It all depends on how much interaction and control you are looking
>> for. As a learning experience, you'll get a lot more out of a Gentoo
>> install, but if you just want something working reliably & right away,
>> with a minimum of fuss, Fedora is the way to go.
>
> If you want something working reliably and right away, I'd argue that
> ubuntu (or Kubuntu) is the way to go.
Cool. I have a live CD ubuntu disk that I can try on windows and an
install disk. I will try them out. I think that Ubuntu is based on debian
like Gentoo.
thanks for the tip.
peter
>
> I've never seen an easier install.
>
> --
> - Adam
>
> ** I can fix your database problems:
> http://www.everylastounce.com/mysql.html **
>
> Blog............... [ http://www.aquick.org/blog ]
> Links.............. [ http://del.icio.us/fields ]
> Photos............. [ http://www.aquick.org/photoblog ]
> Experience......... [ http://www.adamfields.com/resume.html ]
> Product Reviews: .. [ http://www.buyadam.com/blog ]
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From pl at eskimo.net Fri Mar 18 17:02:50 2005
From: pl at eskimo.net (Peter Lehrer)
Date: Fri, 18 Mar 2005 17:02:50 -0500 (EST)
Subject: [nycphp-talk] gentoo (vs) fedora
In-Reply-To: <1111171973.8478.28.camel@bezel>
References: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
<1111171973.8478.28.camel@bezel>
Message-ID: <3418.66.2.44.23.1111183370.squirrel@66.2.44.23>
Good advice. I will try it out. Thanks for your input.
Peter
> Love gentoo..
> Was openbsd user prior and when I switched to linux looked for something
> that would be similar.. gentoo fit the bill nice..
>
> Most distro's install a bunch of garbage that some 13 year old on crack
> compiled (take mandrake on a P4 for example).. Gentoo is a bit more work
> to set up, but well worth it for optimizations and if you are like me
> and fully lazy about patching..
> Meaning, you can cron up the "emerge" tool to update your software
> nightly so you are always up to date without having to think to about it
> and you just need to run the built in tools for checking changes to
> config files (which emerge nicely also does not clobber) and with a
> world make.conf for always compiling stuff with mysql support etc et al
> it is a dream for a sysadmin.
> Pretty much the only distro I will use, think about using, and recommend
> to programmers. For linux newbs, Mandrake or Redhat are fine to wet your
> feet..
>
> -cheers
>
> On Fri, 2005-03-18 at 13:14, Peter Lehrer wrote:
>> Hi,
>>
>> I would like to know if anyone has experience with Gentoo and how it
>> stacks up against other linux distributions, especially Fedora.
>>
>> Also, does anyone have any experience with skunkweb
>> (http://www.skunkweb.org) and/or python and postgres, and care to share
>> their experiences with them? What kind of learning curve is needed for
>> python, for instance?
>>
>>
>> Regards,
>>
>> Peter
>> _______________________________________________
>> New York PHP Talk Mailing List
>> AMP Technology
>> Supporting Apache, MySQL and PHP
>> http://lists.nyphp.org/mailman/listinfo/talk
>> http://www.nyphp.org
>>
> --
> joeldg - developer, Intercosmos media group.
> http://lucifer.intercosmos.net
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From jeff.loiselle at gmail.com Fri Mar 18 17:24:50 2005
From: jeff.loiselle at gmail.com (Jeff Loiselle)
Date: Fri, 18 Mar 2005 17:24:50 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
Message-ID: <4b188711050318142473261fdd@mail.gmail.com>
Hello everyone,
I need some eyes on this code.. I've been staring at it for too long..
and I dont know where to go for more debugging info. I am using
Oracle and I get this error:
DELETE FROM ? WHERE DOC_ID=? [nativecode=ORA-00903: invalid table name]
I've checked the table names and tried just one at a time. Am I doing
something syntactically wrong? Where can I get more debuggin
information?
I know it's probably something really simple that I'm overlooking.
Thanks in advance.. sorry if this isn't appropriate.
------------------
$this->dbh->autoCommit(false);
$sth = $this->dbh->prepare('DELETE FROM ? WHERE DOC_ID=?');
if (PEAR::isError($sth)) {
trigger_error('Error preparing statements for document
delete:'.$sth->getUserInfo(), E_USER_ERROR);
}
// Set array of tables where records will be removed
$data = array(array('APPROVAL_STATUS', $doc_id),
array('AUTHORS', $doc_id),
array('CORE_MATERIALS_FILENUM', $doc_id),
array('DISCLOSURE', $doc_id),
array('DOCUMENT', $doc_id),
array('DOCUMENT_IMAGE', $doc_id),
array('INTELLECTUAL_PROPERTY', $doc_id),
array('KEYWORDS', $doc_id),
array('PI_VERSION', $doc_id),
array('SIGNATURES', $doc_id));
$res = $this->dbh->executeMultiple($sth, $data);
if (PEAR::isError($res)) {
$rollback = $this->dbh->rollback();
if (PEAR::isError($rollback)) {
trigger_error('Error while attempting to rollback document
delete:'.$rollback->getUserInfo(), E_USER_ERROR);
}
trigger_error('Error executing delete statements for document
delete:'.$res->getUserInfo(), E_USER_ERROR);
}
$commit = $this->dbh->commit();
if (PEAR::isError($commit)) {
trigger_error('Error while commiting document
delete:'.$commit->getUserInfo(), E_USER_ERROR);
}
---
Jeff Loiselle
Web Developer, Musician, and Observer
From brian at vermonster.com Fri Mar 18 17:31:39 2005
From: brian at vermonster.com (Brian Kaney)
Date: Fri, 18 Mar 2005 17:31:39 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <4b188711050318142473261fdd@mail.gmail.com>
References: <4b188711050318142473261fdd@mail.gmail.com>
Message-ID: <1111185099.12867.31.camel@brian.vermonster.com>
On Fri, 2005-03-18 at 17:24, Jeff Loiselle wrote:
> Hello everyone,
>
> I need some eyes on this code.. I've been staring at it for too long..
> and I dont know where to go for more debugging info. I am using
> Oracle and I get this error:
>
> DELETE FROM ? WHERE DOC_ID=? [nativecode=ORA-00903: invalid table name]
>
Try to use the ! for the field name. This binding wildcard won't add
the quoting and will pass straight through.
DELETE FROM ! WHERE DOC_ID=?
- Brian
From matt at jobsforge.com Fri Mar 18 20:46:17 2005
From: matt at jobsforge.com (Matthew Terenzio)
Date: Fri, 18 Mar 2005 20:46:17 -0500
Subject: [nycphp-talk] recursive simplexml
Message-ID: <1f348d9e290565b79d33c2c76f10cf81@jobsforge.com>
I want to recursively iterate over an OPML file. It can have any number
of 'outline' elements and each can have any number of children
'outline' elements.
As I move down the tree I'll handle each by looking at their 'type'
attribute.
here is an example snip of an OPML file:
and where my mind was headed...
$file = file_get_contents("thefile.opml");
$xml = new RecursiveIteratorIterator(new SimpleXMLIterator($file),
true);
foreach($xml as $element) {
if ($element == 'outline') {
if ($element[type] == 'link') {
SimonSays 'do this';
}
if ($element[type] == 'headline'{
SimonSays 'do that';
}
}
}
How far off am I?
From codebowl at gmail.com Sat Mar 19 09:45:29 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Sat, 19 Mar 2005 09:45:29 -0500
Subject: [nycphp-talk] PHP 5 Exception Expertise Needed
In-Reply-To: <8d9a4280050318120616da6f1c@mail.gmail.com>
References: <423A1E61.7040802@ceruleansky.com>
<8d9a428005031717065f1e6007@mail.gmail.com>
<8d9a4280050318120616da6f1c@mail.gmail.com>
Message-ID: <8d9a4280050319064531878f9a@mail.gmail.com>
ok so i figured out where my problem was, it was in the constructor
for the SvEx class, i had the template assigns there, i moved them to
the Dispolay method and it works as expected :)
one question though.
If an exceptions is thrown by PHP such as a fatal error or what not, i
cannot use my Display method. Is there an easy way to rethrow an
exception as a certain type? I would like to rethrow all exceptions
as SvEx type so that i can use my display method to get it to show a
nicely formatted error to go wtih the site's design, here is what i
have so far
End Users View (custom display)
http://codebowl.homelinux.net:8001/clients/JVMedia/SimonVolkov/global.php
Developers View (custom display) ( using localhost for the domain )
http://codebowl.homelinux.net:8001/clients/JVMedia/SimonVolkov/global.php?local=1
Default Exception Display
http://codebowl.homelinux.net:8001/clients/JVMedia/SimonVolkov/global.php?default=1
i would like to be able to use my Display method with all exceptions /
error that PHP is throwing. Any ideas would be great.
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From adam at trachtenberg.com Sat Mar 19 11:49:13 2005
From: adam at trachtenberg.com (Adam Maccabee Trachtenberg)
Date: Sat, 19 Mar 2005 11:49:13 -0500 (EST)
Subject: [nycphp-talk] PHP 5 Exception Expertise Needed
In-Reply-To: <8d9a4280050319064531878f9a@mail.gmail.com>
References: <423A1E61.7040802@ceruleansky.com>
<8d9a428005031717065f1e6007@mail.gmail.com>
<8d9a4280050318120616da6f1c@mail.gmail.com>
<8d9a4280050319064531878f9a@mail.gmail.com>
Message-ID:
On Sat, 19 Mar 2005, Joseph Crawford wrote:
> If an exceptions is thrown by PHP such as a fatal error or what not, i
> cannot use my Display method. Is there an easy way to rethrow an
> exception as a certain type? I would like to rethrow all exceptions
> as SvEx type so that i can use my display method to get it to show a
> nicely formatted error to go wtih the site's design, here is what i
> have so far
To catch all exceptions without wrapping code inside try/catch blocks, do this:
function my_exception_handler($e) {
throw new SvEx($e->getMessage(), $e->getCode());
}
set_exception_handler('my_exception_handler');
Although, it may be better to aggregate the original Exception inside
your custom one, as I believe the debugging information will be
disrupted. (Such as the line number and stack trace.)
However, the good practice fairy says it's better to really wrap stuff
inside try/catch, so you know exactly what you're doing and when
you're doing it. (I guess you could always just make a master
try/catch around the main control flow.)
-adam
PS: Upgrading to PHP5: Chapter 7. Error Handling and Debugging:
Setting a Custom Exception Handler
--
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!
From codebowl at gmail.com Sat Mar 19 11:53:05 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Sat, 19 Mar 2005 11:53:05 -0500
Subject: [nycphp-talk] PHP 5 Exception Expertise Needed
In-Reply-To:
References: <423A1E61.7040802@ceruleansky.com>
<8d9a428005031717065f1e6007@mail.gmail.com>
<8d9a4280050318120616da6f1c@mail.gmail.com>
<8d9a4280050319064531878f9a@mail.gmail.com>
Message-ID: <8d9a428005031908534c43db4e@mail.gmail.com>
Adam,
i tried a master try/catch but it didnt grab parse errors since they
are not thrown as exceptions in php 5.
i was trying to implement my own custom error handler and throw
exceptions based on that but i couldnt get the error handler to
trigger on parse or fatal errors either.
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From adam at trachtenberg.com Sat Mar 19 11:59:48 2005
From: adam at trachtenberg.com (Adam Maccabee Trachtenberg)
Date: Sat, 19 Mar 2005 11:59:48 -0500 (EST)
Subject: [nycphp-talk] PHP 5 Exception Expertise Needed
In-Reply-To: <8d9a428005031908534c43db4e@mail.gmail.com>
References: <423A1E61.7040802@ceruleansky.com>
<8d9a428005031717065f1e6007@mail.gmail.com>
<8d9a4280050318120616da6f1c@mail.gmail.com>
<8d9a4280050319064531878f9a@mail.gmail.com>
<8d9a428005031908534c43db4e@mail.gmail.com>
Message-ID:
On Sat, 19 Mar 2005, Joseph Crawford wrote:
> i was trying to implement my own custom error handler and throw
> exceptions based on that but i couldnt get the error handler to
> trigger on parse or fatal errors either.
You cannot catch fatal errors. That's what makes them fatal. :)
Actually, those types of errors leaves PHP in an "unstable" state, so
it just bails out and doesn't give you a chance to execute additional
code.
Sorry.
-adam
--
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!
From codebowl at gmail.com Sat Mar 19 12:01:19 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Sat, 19 Mar 2005 12:01:19 -0500
Subject: [nycphp-talk] PHP 5 Exception Expertise Needed
In-Reply-To:
References: <423A1E61.7040802@ceruleansky.com>
<8d9a428005031717065f1e6007@mail.gmail.com>
<8d9a4280050318120616da6f1c@mail.gmail.com>
<8d9a4280050319064531878f9a@mail.gmail.com>
<8d9a428005031908534c43db4e@mail.gmail.com>
Message-ID: <8d9a428005031909014f6be303@mail.gmail.com>
what about parse errors? can those be caught?
anything you would see printed on the screen for PHP errors aside from
fatals, warnings, notices i would like to catch
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From danielc at analysisandsolutions.com Sat Mar 19 12:15:24 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Sat, 19 Mar 2005 12:15:24 -0500
Subject: [nycphp-talk] security focus blah blah 292
Message-ID: <20050319171524.GA2954@panix.com>
PHP and Related Stuff From SecurityFocus Newsletter #292
MySQL AB MySQL Multiple Remote Vulnerabilities
http://www.securityfocus.com/bid/12781
Stadtaus.Com PHP Form Mail Script Remote File Include Vulner...
http://www.securityfocus.com/bid/12735
PHPBB Session.PHP Autologin User_Level Privilege Escalation ...
http://www.securityfocus.com/bid/12736
BRT CopperExport XP_Publish.PHP SQL Injection Vulnerability
http://www.securityfocus.com/bid/12740
phpMyFAQ Username SQL Injection Vulnerability
http://www.securityfocus.com/bid/12741
Jason Hines PHPWebLog Remote File Include Vulnerability
http://www.securityfocus.com/bid/12747
PHP-Fusion BBCode IMG Tag Script Injection Vulnerability
http://www.securityfocus.com/bid/12751
Xoops Custom Avatar Remote Arbitrary PHP File Upload Vulnera...
http://www.securityfocus.com/bid/12754
YaBB Remote UsersRecentPosts Cross-Site Scripting Vulnerabil...
http://www.securityfocus.com/bid/12756
Drupal Unspecified Cross-Site Scripting Vulnerability
http://www.securityfocus.com/bid/12757
PHP Arena PAFileDB Multiple Remote Cross Site Scripting Vuln...
http://www.securityfocus.com/bid/12758
SocialMPN Module Arbitrary Remote PHP File Include Vulnerabi...
http://www.securityfocus.com/bid/12774
McNews Header.PHP Arbitrary File Include Vulnerability
http://www.securityfocus.com/bid/12776
PHPOutsourcing Zorum Multiple Remote Vulnerabilities
http://www.securityfocus.com/bid/12777
All Enthusiast PhotoPost PHP Pro Multiple Remote Vulnerabili...
http://www.securityfocus.com/bid/12779
UBBCentral UBB.threads Editpost.PHP SQL Injection Vulnerabil...
http://www.securityfocus.com/bid/12784
NewsScript Access Validation Vulnerability
http://www.securityfocus.com/bid/12761
WF-Projects WF-Section SQL Injection Vulnerability
http://www.securityfocus.com/bid/12760
Aztek Forum Unauthorized Access Vulnerability
http://www.securityfocus.com/bid/12745
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From leam at reuel.net Sat Mar 19 12:33:39 2005
From: leam at reuel.net (leam at reuel.net)
Date: Sat, 19 Mar 2005 12:33:39 -0500
Subject: [nycphp-talk] security focus blah blah 292
In-Reply-To: <20050319171524.GA2954@panix.com>
References: <20050319171524.GA2954@panix.com>
Message-ID: <20050319173339.GE2894@leitz>
Blah blah blah...
MySQL does seem to have the 4.0.24 version available on their site now.
ciao!
leam
On Sat, Mar 19, 2005 at 12:15:24PM -0500, Daniel Convissor wrote:
> PHP and Related Stuff From SecurityFocus Newsletter #292
>
>
> MySQL AB MySQL Multiple Remote Vulnerabilities
> http://www.securityfocus.com/bid/12781
From adam at trachtenberg.com Sat Mar 19 12:50:29 2005
From: adam at trachtenberg.com (Adam Maccabee Trachtenberg)
Date: Sat, 19 Mar 2005 12:50:29 -0500 (EST)
Subject: [nycphp-talk] PHP 5 Exception Expertise Needed
In-Reply-To: <8d9a428005031909014f6be303@mail.gmail.com>
References: <423A1E61.7040802@ceruleansky.com>
<8d9a428005031717065f1e6007@mail.gmail.com>
<8d9a4280050318120616da6f1c@mail.gmail.com>
<8d9a4280050319064531878f9a@mail.gmail.com>
<8d9a428005031908534c43db4e@mail.gmail.com>
<8d9a428005031909014f6be303@mail.gmail.com>
Message-ID:
On Sat, 19 Mar 2005, Joseph Crawford wrote:
> what about parse errors? can those be caught?
No. How could PHP catch them when it can't figure out what your script
is? There'd be no way to specify what should be run.
-adam
--
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!
From codebowl at gmail.com Sat Mar 19 12:55:47 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Sat, 19 Mar 2005 12:55:47 -0500
Subject: [nycphp-talk] PHP 5 Exception Expertise Needed
In-Reply-To:
References: <423A1E61.7040802@ceruleansky.com>
<8d9a428005031717065f1e6007@mail.gmail.com>
<8d9a4280050318120616da6f1c@mail.gmail.com>
<8d9a4280050319064531878f9a@mail.gmail.com>
<8d9a428005031908534c43db4e@mail.gmail.com>
<8d9a428005031909014f6be303@mail.gmail.com>
Message-ID: <8d9a4280050319095526cd2261@mail.gmail.com>
ok thanks ;)
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From mitch.pirtle at gmail.com Sat Mar 19 14:56:37 2005
From: mitch.pirtle at gmail.com (Mitch Pirtle)
Date: Sat, 19 Mar 2005 14:56:37 -0500
Subject: [nycphp-talk] gentoo (vs) fedora
In-Reply-To: <3415.66.2.44.23.1111183215.squirrel@66.2.44.23>
References: <3244.66.2.45.21.1111169684.squirrel@66.2.45.21>
<2ca9ba9105031810192ab24425@mail.gmail.com>
<20050318184456.GO19345@lola.aquick.org>
<3415.66.2.44.23.1111183215.squirrel@66.2.44.23>
Message-ID: <330532b6050319115647e25848@mail.gmail.com>
On Fri, 18 Mar 2005 17:00:15 -0500 (EST), Peter Lehrer wrote:
>
> Cool. I have a live CD ubuntu disk that I can try on windows and an
> install disk. I will try them out. I think that Ubuntu is based on debian
> like Gentoo.
Ubuntu is Debian-based, and Gentoo is completely different (based on
ports, more like a linux-*bsd hybrid).
Ubuntu is coming out with a major upgrade that is really easy to use,
and if you want a commercial desktop (for cranky laptop hardware, for
example) Xandros is a great debian-based distro.
I'm putting Xandros on my laptop when I get the chance, and also found
that GNOME's LiveCD of GNOME 2.10 works great - it is apparently
ubuntu-based IIRC.
-- Mitch
From jayeshsh at ceruleansky.com Sun Mar 20 12:01:45 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Sun, 20 Mar 2005 12:01:45 -0500 (EST)
Subject: [nycphp-talk] Zend Encoder: CLI PHP Versions?
Message-ID: <47301.69.86.84.233.1111338105.spork@webmail.ceruleansky.com>
Hello all,
I spent a few frustrating hours yesterday on Zend's site and forum trying
to determine whether their encoder will work with CLI (command line)
versions of PHP.
I ask this because I am interested in creating offline programs with
WinBinder or PHP-GTK. These extensions require PHP scripts to be run from
the command line.
I even posted something to the Zend forum, but it never seems to have made
it there.
So it just seems to ask this question here.
(By the way, I checked David Sklar's Essential PHP Tools book, which
mentions several free encoders, and none of them support CLI or CGI
versions of PHP.)
Best regards,
- Jay
From rolan at omnistep.com Sun Mar 20 15:58:34 2005
From: rolan at omnistep.com (Rolan Yang)
Date: Sun, 20 Mar 2005 15:58:34 -0500
Subject: [nycphp-talk] Zend Encoder: CLI PHP Versions?
In-Reply-To: <47301.69.86.84.233.1111338105.spork@webmail.ceruleansky.com>
References: <47301.69.86.84.233.1111338105.spork@webmail.ceruleansky.com>
Message-ID: <423DE3FA.3050604@omnistep.com>
I'm not 100% sure about CLI, but it looks like Turck MMcache might do
the job.
http://turck-mmcache.sourceforge.net/index_old.html
~Rolan
Jayesh Sheth wrote:
>
>I spent a few frustrating hours yesterday on Zend's site and forum trying
>to determine whether their encoder will work with CLI (command line)
>versions of PHP.
>
>I ask this because I am interested in creating offline programs with
>WinBinder or PHP-GTK. These extensions require PHP scripts to be run from
>the command line.
>
>
>Best regards,
>
>- Jay
>
>
>
From mitch.pirtle at gmail.com Sun Mar 20 20:06:29 2005
From: mitch.pirtle at gmail.com (Mitch Pirtle)
Date: Sun, 20 Mar 2005 20:06:29 -0500
Subject: [nycphp-talk] Zend Encoder: CLI PHP Versions?
In-Reply-To: <423DE3FA.3050604@omnistep.com>
References: <47301.69.86.84.233.1111338105.spork@webmail.ceruleansky.com>
<423DE3FA.3050604@omnistep.com>
Message-ID: <330532b6050320170649b74a60@mail.gmail.com>
mmache has been superceded by eAccelerator:
http://sourceforge.net/projects/eaccelerator
-- Mitch
On Sun, 20 Mar 2005 15:58:34 -0500, Rolan Yang wrote:
> I'm not 100% sure about CLI, but it looks like Turck MMcache might do
> the job.
>
> http://turck-mmcache.sourceforge.net/index_old.html
>
> ~Rolan
From jayeshsh at ceruleansky.com Sun Mar 20 20:34:49 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Sun, 20 Mar 2005 20:34:49 -0500
Subject: [nycphp-talk] Zend Encoder: CLI PHP Versions?
Message-ID: <423E24B9.2010801@ceruleansky.com>
Hi Rolan and others,
thanks for the tip. I always have wanted to try MMCache. I went to their
site, but did not see any info on CLI usage.
Here is write-up on the state of PHP encoders and obfuscators - of what
worked and did not work for me. This might be useful to others, and
might save others the hours of experimentation that I had to go through.
Now for the Zend product, I downloaded the trial version of Zend Encoder
and also Zend Optimizer(ZO). (ZO should really be called Zend Decoder.)
While setting it up (the decoder a.k.a "Optimizer", I think), I chose
'other' as the 'web server' to option. It then asked me where my php.ini
file was, and I pointed it in the right direction. It then parsed the
php.ini file and made the following entries in it:
zend_extension_ts="C:\Program Files\Zend\lib\ZendExtensionManager.dll"
zend_extension_manager.optimizer_ts="C:\Program
Files\Zend\lib\Optimizer-2.5.7"
zend_optimizer.optimization_level=15
The Zend Encoder GUI is pretty basic, but seems to work. The sample
WinBinder application that I encoded worked flawlessly.
I checked out the IonCube encoder, but it did not seem to work. Firstly,
it seems to only support a webserver API, not PHP CLI, although I may be
wrong on this. I tried IonCube with PHP 5.0.2 (as part of XAMMP), but it
did not like it. I think the fine print in their site seemed to suggest
that their decoder dll only works with PHP 5.0.3 and above. Weird. (I
kept thinking: it should be this difficult to find whether these
products support CLI or just mod_php for Apache, which php.ini entries
need to be made, what their decoders are called, which decoder dlls are
used, where to copy them etc.)
I also tried two PHP obfuscators, one free, and one shareware / commercial.
POBS is the free one:
http://pobs.mywalhalla.net/
It looks like a nice enough product, but like the commercial one, it
produced a non-functional WinBinder application. In both cases, the
WinBinder application launched, but the controls were useless (clicking
a button did nothing.)
The commercial product is GridinSoft PHP Processor (Price: $50) (they
seem to be based in Ukraine):
http://www.gridinsoft.com/
Their product is an obfuscator, and comes with a handy-dandy file
preview and 'project' management tool, but it produced the same
perplexing 'buttons-don't-work-this-application-is-non-functional'
effect for the WinBinder script.
I also looked into Alan Knowles BCompiler, but it does not seem to have
a tool to automatically decode encoded scripts on the fly:
Main Info
Manual: http://pear.php.net/manual/en/pecl.bcompiler.php
Download DLL: http://snaps.php.net/win32/PECL_STABLE/
I also tried Roadsend's Compiler + IDE tool (available for $89 for the
basic edition):
http://www.roadsend.com
Unlke other encoders, they have completely rewritten the PHP parser and
interpreter. Their parses parses PHP code, and compiles it into a form
that their interpreter can read and execute. Whatever it 'interprets' is
obviously not plaintext, and is probably some intermediate bytecode (I
think).
It is pretty amazing that a small company such as Roadsend has rewritten
the entire PHP processor tool. Their latest version also includes a
PHP-GTK interpreter. But here's thing: they do not support all PHP
extensions, because, as far as I know, they cannot load all extensions'
dlls like the PHP interpreter does. I am not sure how they recreate PHP
GTK apps, and if they actually use the Windows GTK libraries for this.
(They must, I think.) So non-standard extensions such as WinBinder won't
work with Roadsend.
RoadEnd's product can compile PHP GTK programs into standalone exes that
can be run from CD, etc.
But here's the thing: I think that for my uses, WinBinder would be
better, even in its alpha state. Its developer seems to be really active
and I can see it moving out of alpha status pretty fast.
Well, I hope this write-up has been useful to others who are evaluation
PHP encoder options.
As the last word (or sentence, it seems), I think I have two options:
buy the Zend Encoder Small Business edition (Zend Encoder, Studio and
Accelerator for $500 instead of $3717,
http://www.zend.com/store/products/zend-smallbiz.php ) or just make the
project open source, which I think might be a good option too. If people
want to steal the source, let them, but put a license on it so they know
the dos and don'ts.
Best regards,
- Jay Sheth
From weyrick at roadsend.com Sun Mar 20 22:37:37 2005
From: weyrick at roadsend.com (Shannon Weyrick)
Date: Sun, 20 Mar 2005 22:37:37 -0500
Subject: [nycphp-talk] Zend Encoder: CLI PHP Versions?
In-Reply-To: <423E24B9.2010801@ceruleansky.com>
References: <423E24B9.2010801@ceruleansky.com>
Message-ID: <423E4181.7070405@roadsend.com>
Hi,
Just a few notes:
Roadsend Compiler isn't an encoder as such, and it doesn't store an
intermediate bytecode to be later interpreted. It is a true native
compiler, so the output is machine code that is executed directly by the
operating system (as if it were compiled C code, for example - the
result is an .EXE file). No interpreter is required. Because of the
compilation process, it is not possible to retrieve the original PHP
source code from the binary. PHP (both GTK and command line)
applications can be compiled on Linux, FreeBSD and Windows (although the
IDE is currently Windows only).
Our PHP-GTK extension does indeed use the actual GTK libraries. The
latest IDE has a Deployment feature that makes it very easy to compile
and distribute applications. Our upcoming release will include Glade
support as well as many optimizations, IDE improvements, and an
integrated step debugger.
Shannon
Roadsend, Inc.
Jayesh Sheth wrote:
>
> I also tried Roadsend's Compiler + IDE tool (available for $89 for the
> basic edition):
> http://www.roadsend.com
>
> Unlke other encoders, they have completely rewritten the PHP parser
> and interpreter. Their parses parses PHP code, and compiles it into a
> form that their interpreter can read and execute. Whatever it
> 'interprets' is obviously not plaintext, and is probably some
> intermediate bytecode (I think).
>
> It is pretty amazing that a small company such as Roadsend has
> rewritten the entire PHP processor tool. Their latest version also
> includes a PHP-GTK interpreter. But here's thing: they do not support
> all PHP extensions, because, as far as I know, they cannot load all
> extensions' dlls like the PHP interpreter does. I am not sure how they
> recreate PHP GTK apps, and if they actually use the Windows GTK
> libraries for this. (They must, I think.) So non-standard extensions
> such as WinBinder won't work with Roadsend.
>
> RoadEnd's product can compile PHP GTK programs into standalone exes
> that can be run from CD, etc.
>
From jayeshsh at ceruleansky.com Mon Mar 21 00:12:57 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Mon, 21 Mar 2005 00:12:57 -0500 (EST)
Subject: [nycphp-talk] Zend Encoder: CLI PHP Versions?
Message-ID: <63174.69.86.84.233.1111381977.spork@webmail.ceruleansky.com>
Hello Shannon,
thanks very much for the correction on Roadsend. I got the way it works
wrong - sorry about that.
It is a great, unique product that fills a gap in what is currently
available. Congrats on having shipped initial versions of it. I look
forward to future versions of the Roadsend compiler.
Thanks for clarifying the part on PHP-GTK. Support for WinBinder would be
great too !
Best regards,
- Jay Sheth
From jeff.loiselle at gmail.com Mon Mar 21 10:48:24 2005
From: jeff.loiselle at gmail.com (Jeff Loiselle)
Date: Mon, 21 Mar 2005 10:48:24 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <1111185099.12867.31.camel@brian.vermonster.com>
References: <4b188711050318142473261fdd@mail.gmail.com>
<1111185099.12867.31.camel@brian.vermonster.com>
Message-ID: <4b18871105032107485a30a07a@mail.gmail.com>
that doesn't seem to cure the problem.. i'll be looking into it more today
On Fri, 18 Mar 2005 17:31:39 -0500, Brian Kaney wrote:
> On Fri, 2005-03-18 at 17:24, Jeff Loiselle wrote:
> > Hello everyone,
> >
> > I need some eyes on this code.. I've been staring at it for too long..
> > and I dont know where to go for more debugging info. I am using
> > Oracle and I get this error:
> >
> > DELETE FROM ? WHERE DOC_ID=? [nativecode=ORA-00903: invalid table name]
> >
>
> Try to use the ! for the field name. This binding wildcard won't add
> the quoting and will pass straight through.
>
>
> DELETE FROM ! WHERE DOC_ID=?
>
> - Brian
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
--
---
Jeff Loiselle
Web Developer, Musician, and Observer
http://jeff.loiselles.com
From jeff.loiselle at gmail.com Mon Mar 21 10:59:20 2005
From: jeff.loiselle at gmail.com (Jeff Loiselle)
Date: Mon, 21 Mar 2005 10:59:20 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <4b18871105032107485a30a07a@mail.gmail.com>
References: <4b188711050318142473261fdd@mail.gmail.com>
<1111185099.12867.31.camel@brian.vermonster.com>
<4b18871105032107485a30a07a@mail.gmail.com>
Message-ID: <4b18871105032107594a75964d@mail.gmail.com>
can prepare()/autoPrepare() be used for DELETE queries?
On Mon, 21 Mar 2005 10:48:24 -0500, Jeff Loiselle
wrote:
> that doesn't seem to cure the problem.. i'll be looking into it more today
>
>
> On Fri, 18 Mar 2005 17:31:39 -0500, Brian Kaney wrote:
> > On Fri, 2005-03-18 at 17:24, Jeff Loiselle wrote:
> > > Hello everyone,
> > >
> > > I need some eyes on this code.. I've been staring at it for too long..
> > > and I dont know where to go for more debugging info. I am using
> > > Oracle and I get this error:
> > >
> > > DELETE FROM ? WHERE DOC_ID=? [nativecode=ORA-00903: invalid table name]
> > >
> >
> > Try to use the ! for the field name. This binding wildcard won't add
> > the quoting and will pass straight through.
> >
> >
> > DELETE FROM ! WHERE DOC_ID=?
> >
> > - Brian
> >
> > _______________________________________________
> > New York PHP Talk Mailing List
> > AMP Technology
> > Supporting Apache, MySQL and PHP
> > http://lists.nyphp.org/mailman/listinfo/talk
> > http://www.nyphp.org
> >
>
> --
> ---
> Jeff Loiselle
> Web Developer, Musician, and Observer
> http://jeff.loiselles.com
>
--
---
Jeff Loiselle
Web Developer, Musician, and Observer
http://jeff.loiselles.com
From jeff.loiselle at gmail.com Mon Mar 21 11:09:37 2005
From: jeff.loiselle at gmail.com (Jeff Loiselle)
Date: Mon, 21 Mar 2005 11:09:37 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <4b18871105032107594a75964d@mail.gmail.com>
References: <4b188711050318142473261fdd@mail.gmail.com>
<1111185099.12867.31.camel@brian.vermonster.com>
<4b18871105032107485a30a07a@mail.gmail.com>
<4b18871105032107594a75964d@mail.gmail.com>
Message-ID: <4b188711050321080942833575@mail.gmail.com>
ahh.. i've found the problem.. it seems that the tablename cannot be
a variable.. you have to explicity write the tablenames in.. this did
not seem obvious the first five times I read the documentation. :-)
thanks!
On Mon, 21 Mar 2005 10:59:20 -0500, Jeff Loiselle
wrote:
> can prepare()/autoPrepare() be used for DELETE queries?
>
>
> On Mon, 21 Mar 2005 10:48:24 -0500, Jeff Loiselle
> wrote:
> > that doesn't seem to cure the problem.. i'll be looking into it more today
> >
> >
> > On Fri, 18 Mar 2005 17:31:39 -0500, Brian Kaney wrote:
> > > On Fri, 2005-03-18 at 17:24, Jeff Loiselle wrote:
> > > > Hello everyone,
> > > >
> > > > I need some eyes on this code.. I've been staring at it for too long..
> > > > and I dont know where to go for more debugging info. I am using
> > > > Oracle and I get this error:
> > > >
> > > > DELETE FROM ? WHERE DOC_ID=? [nativecode=ORA-00903: invalid table name]
> > > >
> > >
> > > Try to use the ! for the field name. This binding wildcard won't add
> > > the quoting and will pass straight through.
> > >
> > >
> > > DELETE FROM ! WHERE DOC_ID=?
> > >
> > > - Brian
> > >
> > > _______________________________________________
> > > New York PHP Talk Mailing List
> > > AMP Technology
> > > Supporting Apache, MySQL and PHP
> > > http://lists.nyphp.org/mailman/listinfo/talk
> > > http://www.nyphp.org
> > >
> >
> > --
> > ---
> > Jeff Loiselle
> > Web Developer, Musician, and Observer
> > http://jeff.loiselles.com
> >
>
> --
> ---
> Jeff Loiselle
> Web Developer, Musician, and Observer
> http://jeff.loiselles.com
>
--
---
Jeff Loiselle
Web Developer, Musician, and Observer
http://jeff.loiselles.com
From danielc at analysisandsolutions.com Mon Mar 21 11:13:13 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Mon, 21 Mar 2005 11:13:13 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <4b18871105032107485a30a07a@mail.gmail.com>
References: <4b188711050318142473261fdd@mail.gmail.com>
<1111185099.12867.31.camel@brian.vermonster.com>
<4b18871105032107485a30a07a@mail.gmail.com>
Message-ID: <20050321161313.GA15934@panix.com>
On Mon, Mar 21, 2005 at 10:48:24AM -0500, Jeff Loiselle wrote:
> On Fri, 18 Mar 2005 17:31:39 -0500, Brian Kaney wrote:
> > On Fri, 2005-03-18 at 17:24, Jeff Loiselle wrote:
> > >
> > > DELETE FROM ? WHERE DOC_ID=? [nativecode=ORA-00903: invalid table name]
> >
> > DELETE FROM ! WHERE DOC_ID=?
>
> that doesn't seem to cure the problem.. i'll be looking into it more today
The process of preparing a query involves checking identifiers for
validity and then remembering the query framework in a native format for
later execution. This speeds up execution of frequently used queries
because they don't need to go through the identifier checks and compiling
each time. Thus, you can't substitute a table or column name this way.
You'll need to make a regular query in which you compose the query string
using a PHP variable.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From jeff.loiselle at gmail.com Mon Mar 21 11:42:26 2005
From: jeff.loiselle at gmail.com (Jeff Loiselle)
Date: Mon, 21 Mar 2005 11:42:26 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <20050321161313.GA15934@panix.com>
References: <4b188711050318142473261fdd@mail.gmail.com>
<1111185099.12867.31.camel@brian.vermonster.com>
<4b18871105032107485a30a07a@mail.gmail.com>
<20050321161313.GA15934@panix.com>
Message-ID: <4b18871105032108422a325173@mail.gmail.com>
Thank you very much Dan. I knew you'd pipe up to correct me sometime.
:-) That's exactly what I am doing now. I am still using prepare() and
execute() with PHP variables, even though there is only one query per
table because I sense that doing that is still more portable than
issuing query() directly?
On Mon, 21 Mar 2005 11:13:13 -0500, Daniel Convissor
wrote:
> On Mon, Mar 21, 2005 at 10:48:24AM -0500, Jeff Loiselle wrote:
> > On Fri, 18 Mar 2005 17:31:39 -0500, Brian Kaney wrote:
> > > On Fri, 2005-03-18 at 17:24, Jeff Loiselle wrote:
> > > >
> > > > DELETE FROM ? WHERE DOC_ID=? [nativecode=ORA-00903: invalid table name]
> > >
> > > DELETE FROM ! WHERE DOC_ID=?
> >
> > that doesn't seem to cure the problem.. i'll be looking into it more today
>
> The process of preparing a query involves checking identifiers for
> validity and then remembering the query framework in a native format for
> later execution. This speeds up execution of frequently used queries
> because they don't need to go through the identifier checks and compiling
> each time. Thus, you can't substitute a table or column name this way.
>
> You'll need to make a regular query in which you compose the query string
> using a PHP variable.
>
> --Dan
>
> --
> T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
> data intensive web and database programming
> http://www.AnalysisAndSolutions.com/
> 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
--
---
Jeff Loiselle
Web Developer, Musician, and Observer
http://jeff.loiselles.com
From jeff.loiselle at gmail.com Mon Mar 21 11:45:34 2005
From: jeff.loiselle at gmail.com (Jeff Loiselle)
Date: Mon, 21 Mar 2005 11:45:34 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <4b18871105032108422a325173@mail.gmail.com>
References: <4b188711050318142473261fdd@mail.gmail.com>
<1111185099.12867.31.camel@brian.vermonster.com>
<4b18871105032107485a30a07a@mail.gmail.com>
<20050321161313.GA15934@panix.com>
<4b18871105032108422a325173@mail.gmail.com>
Message-ID: <4b1887110503210845328c2c@mail.gmail.com>
Oh, and another question: can I issue autoCommit(false)... then
commit() after all my execute()s are complete? Or does that only work
with query()?
On Mon, 21 Mar 2005 11:42:26 -0500, Jeff Loiselle
wrote:
> Thank you very much Dan. I knew you'd pipe up to correct me sometime.
> :-) That's exactly what I am doing now. I am still using prepare() and
> execute() with PHP variables, even though there is only one query per
> table because I sense that doing that is still more portable than
> issuing query() directly?
>
> On Mon, 21 Mar 2005 11:13:13 -0500, Daniel Convissor
> wrote:
> > On Mon, Mar 21, 2005 at 10:48:24AM -0500, Jeff Loiselle wrote:
> > > On Fri, 18 Mar 2005 17:31:39 -0500, Brian Kaney wrote:
> > > > On Fri, 2005-03-18 at 17:24, Jeff Loiselle wrote:
> > > > >
> > > > > DELETE FROM ? WHERE DOC_ID=? [nativecode=ORA-00903: invalid table name]
> > > >
> > > > DELETE FROM ! WHERE DOC_ID=?
> > >
> > > that doesn't seem to cure the problem.. i'll be looking into it more today
> >
> > The process of preparing a query involves checking identifiers for
> > validity and then remembering the query framework in a native format for
> > later execution. This speeds up execution of frequently used queries
> > because they don't need to go through the identifier checks and compiling
> > each time. Thus, you can't substitute a table or column name this way.
> >
> > You'll need to make a regular query in which you compose the query string
> > using a PHP variable.
> >
> > --Dan
> >
> > --
> > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
> > data intensive web and database programming
> > http://www.AnalysisAndSolutions.com/
> > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
> > _______________________________________________
> > New York PHP Talk Mailing List
> > AMP Technology
> > Supporting Apache, MySQL and PHP
> > http://lists.nyphp.org/mailman/listinfo/talk
> > http://www.nyphp.org
> >
>
> --
> ---
> Jeff Loiselle
> Web Developer, Musician, and Observer
> http://jeff.loiselles.com
>
--
---
Jeff Loiselle
Web Developer, Musician, and Observer
http://jeff.loiselles.com
From ajai at bitblit.net Mon Mar 21 16:06:51 2005
From: ajai at bitblit.net (Ajai Khattri)
Date: Mon, 21 Mar 2005 16:06:51 -0500 (EST)
Subject: [nycphp-talk] gentoo (vs) fedora
In-Reply-To: <330532b6050319115647e25848@mail.gmail.com>
Message-ID:
On Sat, 19 Mar 2005, Mitch Pirtle wrote:
> Ubuntu is Debian-based, and Gentoo is completely different (based on
> ports, more like a linux-*bsd hybrid).
The only similarity is that FreeBSD and Gentoo both build from source -
apart from that they are different beasts. Gentoo (IMHO) has a better
package system than ports.
If you are a power user concerned about long-term maintenance, I would
argue that Gentoo is a better way to go.
--
Aj.
From mitch.pirtle at gmail.com Mon Mar 21 20:18:37 2005
From: mitch.pirtle at gmail.com (Mitch Pirtle)
Date: Mon, 21 Mar 2005 20:18:37 -0500
Subject: [nycphp-talk] gentoo (vs) fedora
In-Reply-To:
References: <330532b6050319115647e25848@mail.gmail.com>
Message-ID: <330532b6050321171871ec7113@mail.gmail.com>
On Mon, 21 Mar 2005 16:06:51 -0500 (EST), Ajai Khattri wrote:
>
> If you are a power user concerned about long-term maintenance, I would
> argue that Gentoo is a better way to go.
Power user, yes. But if you are just worried about long-term
maintenance, I'd have to suggest debian - those wicked-slow release
cycles are easy on the administration side :-)
-- Mitch, looking at Xandros for the cranky cantankerous laptop
From hans.kaspersetz at nyphp.org Tue Mar 22 08:36:39 2005
From: hans.kaspersetz at nyphp.org (Hans C. Kaspersetz)
Date: Tue, 22 Mar 2005 08:36:39 -0500
Subject: [nycphp-talk] NYPHP February Mambo Presentation
Message-ID: <42401F67.3070006@nyphp.org>
We have posted Mitch's February presentation to New York PHP on Mambo.
Sorry for the delay. You will find for your reading pleasure a PDF of
his slides and an MP3 for your listening pleasure.
Mambo core developer and New York PHP's
Mitch Pirtle looks at one of the hottest topics, CMS, and one of it's
hottest solutions, Mambo. Join us for an in-depth look at Mambo's power
as a CMS and framework. Now that the holidays are over we can get back
to work - and in this case, that means letting the award-winning Mambo
do all of the work for you!
This session will demonstrate how simply and quickly one can get Mambo
up and running, and then delve into the deeper mysteries of the CMS that
promises 'power in simplicity'. Covering templates, components, modules
and mambots, Mitch will then close the session answering questions from
the NYPHP crowd.
Mambo was awarded "Best Open Source Solution" at Linux World this year
and was awarded "Best Free Software Project of the Year" by The Linux
Format magazine.
http://www.nyphp.org/content/presentations/index.php
Thanks,
Hans Kaspersetz
Operations, NYPHP
http://www.cyberxdesigns.com
From danielc at analysisandsolutions.com Tue Mar 22 10:36:06 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Tue, 22 Mar 2005 10:36:06 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <4b18871105032108422a325173@mail.gmail.com>
References: <4b188711050318142473261fdd@mail.gmail.com>
<1111185099.12867.31.camel@brian.vermonster.com>
<4b18871105032107485a30a07a@mail.gmail.com>
<20050321161313.GA15934@panix.com>
<4b18871105032108422a325173@mail.gmail.com>
Message-ID: <20050322153605.GA27644@panix.com>
Hi Jeff:
On Mon, Mar 21, 2005 at 11:42:26AM -0500, Jeff Loiselle wrote:
> That's exactly what I am doing now. I am still using prepare() and
> execute() with PHP variables, even though there is only one query per
> table because I sense that doing that is still more portable than
> issuing query() directly?
Prepare/execute doesn't improve portability. Plus, I have a feeling you
are wasting resources. Prepare/execute is only efficient when you do one
prepare of the query and then will be executing that the same exact query
(without changing table/column names) multiple times.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From danielc at analysisandsolutions.com Tue Mar 22 10:48:21 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Tue, 22 Mar 2005 10:48:21 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <4b1887110503210845328c2c@mail.gmail.com>
References: <4b188711050318142473261fdd@mail.gmail.com>
<1111185099.12867.31.camel@brian.vermonster.com>
<4b18871105032107485a30a07a@mail.gmail.com>
<20050321161313.GA15934@panix.com>
<4b18871105032108422a325173@mail.gmail.com>
<4b1887110503210845328c2c@mail.gmail.com>
Message-ID: <20050322154820.GB27644@panix.com>
Jeff:
On Mon, Mar 21, 2005 at 11:45:34AM -0500, Jeff Loiselle wrote:
> Oh, and another question: can I issue autoCommit(false)... then
> commit() after all my execute()s are complete?
Should work. No need to ask. Just try it and see what happens.
--Dan
PS: How about saving everyone disk and transmission space by snipping out
the (bulk of) the prior postings when you reply?
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From mikeh at dtev.com Tue Mar 22 10:52:54 2005
From: mikeh at dtev.com (mike hjorleifsson)
Date: Tue, 22 Mar 2005 10:52:54 -0500
Subject: [nycphp-talk] Anyone familiar with PHP Surveyor ?
In-Reply-To: <20050322154820.GB27644@panix.com>
References: <4b188711050318142473261fdd@mail.gmail.com> <1111185099.12867.31.camel@brian.vermonster.com> <4b18871105032107485a30a07a@mail.gmail.com> <20050321161313.GA15934@panix.com> <4b18871105032108422a325173@mail.gmail.com> <4b1887110503210845328c2c@mail.gmail.com>
<20050322154820.GB27644@panix.com>
Message-ID: <42403F56.2000808@dtev.com>
Is anyone familiar with php surveyor, we are having some issues and need
some help
From rrust at r2communications.com Tue Mar 22 10:55:05 2005
From: rrust at r2communications.com (Randal Rust)
Date: Tue, 22 Mar 2005 10:55:05 -0500
Subject: [nycphp-talk] Automatically Generating Code from the Database
Message-ID: <42403FD9.2090207@r2communications.com>
I just had an interesting conversation with my boss, who hasn't coded
anything since COBOL. Anyway, he was saying that he is amazed that no
one has written a tool for PHP that will generate classes and methods
based on the tables in the database.
So what he's saying is that I should be able to open an application,
select a database, click an button, and presto! The result would be
classes with methods for adding, updating and viewing records for every
table in my database.
I don't know of any such thing. Dreamweaver can do this to some extent,
but as procedural scripting.
Perhaps someone here knows of a tool that can do this?
--
Randal Rust
R.Squared Communications
http://www.r2communications.com
Digital Design for Bricks-and-Mortar Businesses
From lists at zaunere.com Tue Mar 22 10:55:46 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Tue, 22 Mar 2005 10:55:46 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <20050322153605.GA27644@panix.com>
Message-ID: <0MKyxe-1DDljP2NcI-0007Pw@mrelay.perfora.net>
> Prepare/execute doesn't improve portability. Plus, I have a feeling you
> are wasting resources. Prepare/execute is only efficient when you do one
> prepare of the query and then will be executing that the same exact query
> (without changing table/column names) multiple times.
An additional benefit is when dealing with larger data fields, such as BLOB and TEXT. Column data in prepared statements don't need to be escaped, which can improve performance significantly. Also, for very large data sets, you can enable chunk sending of the data, which can also improve performance and network issues.
H
From jfreeman at nybg.org Tue Mar 22 10:58:13 2005
From: jfreeman at nybg.org (Joshua S. Freeman)
Date: Tue, 22 Mar 2005 10:58:13 -0500
Subject: [nycphp-talk] Automatically Generating Code from the Database
In-Reply-To: <42403FD9.2090207@r2communications.com>
Message-ID:
I know of a tool written in Java that can sort of do that... It takes any
structured data and builds a database, a GUI and a search engine for all of
the data...
But the woman who built it is trying to make a commercial product out of
it... It's not FOSS.
J.
On 3/22/05 10:55 AM, "Randal Rust" wrote:
> I just had an interesting conversation with my boss, who hasn't coded
> anything since COBOL. Anyway, he was saying that he is amazed that no
> one has written a tool for PHP that will generate classes and methods
> based on the tables in the database.
>
> So what he's saying is that I should be able to open an application,
> select a database, click an button, and presto! The result would be
> classes with methods for adding, updating and viewing records for every
> table in my database.
>
> I don't know of any such thing. Dreamweaver can do this to some extent,
> but as procedural scripting.
>
> Perhaps someone here knows of a tool that can do this?
--
COMPUTER HELPDESK (when inside the Garden): http://helpdesk.nybg.org/
Joshua S. Freeman
Dir. of Information Technology
New York Botanical Garden
v: 718 817 8937 m: 347 392 2560
This message (including any attachments) contains confidential information
intended for a specific individual/group of individuals and a specific
purpose, and is protected by law. If you are not an intended recipient, you
should delete this message. Any disclosure, copying, or distribution of
this message, or the taking of any action based on it, is strictly
prohibited.
From rrust at r2communications.com Tue Mar 22 11:02:16 2005
From: rrust at r2communications.com (Randal Rust)
Date: Tue, 22 Mar 2005 11:02:16 -0500
Subject: [nycphp-talk] Automatically Generating Code from the Database
In-Reply-To:
References:
Message-ID: <42404188.1030509@r2communications.com>
Joshua S. Freeman wrote:
> I know of a tool written in Java that can sort of do that... It takes any
> structured data and builds a database, a GUI and a search engine for all of
> the data...
That is exactly what my boss was talking about. He said something like
there were three tools that he used for more than 10 years. One of them
generated code, one the GUI and one did reports.
--
Randal Rust
R.Squared Communications
http://www.r2communications.com
Digital Design for Bricks-and-Mortar Businesses
From hans at cyberxdesigns.com Tue Mar 22 11:08:21 2005
From: hans at cyberxdesigns.com (Hans C. Kaspersetz)
Date: Tue, 22 Mar 2005 11:08:21 -0500
Subject: [nycphp-talk] Automatically Generating Code from the Database
In-Reply-To: <42404188.1030509@r2communications.com>
References:
<42404188.1030509@r2communications.com>
Message-ID: <424042F5.3050709@cyberxdesigns.com>
Randal Rust wrote:
> Joshua S. Freeman wrote:
>
>> I know of a tool written in Java that can sort of do that... It takes
>> any
>> structured data and builds a database, a GUI and a search engine for
>> all of
>> the data...
>
>
> That is exactly what my boss was talking about. He said something like
> there were three tools that he used for more than 10 years. One of
> them generated code, one the GUI and one did reports.
>
I think Hendry has an application that he wrote to do this. He has just
not released it yet. Hendry you out there?
HCK
--
Hans C. Kaspersetz
Cyber X Designs
http://www.cyberxdesigns.com
From brian at vermonster.com Tue Mar 22 11:28:58 2005
From: brian at vermonster.com (Brian Kaney)
Date: Tue, 22 Mar 2005 11:28:58 -0500
Subject: [nycphp-talk] Automatically Generating Code from the Database
In-Reply-To: <42403FD9.2090207@r2communications.com>
References: <42403FD9.2090207@r2communications.com>
Message-ID: <1111508938.26987.42.camel@brian.vermonster.com>
On Tue, 2005-03-22 at 10:55, Randal Rust wrote:
> I just had an interesting conversation with my boss, who hasn't coded
> anything since COBOL. Anyway, he was saying that he is amazed that no
> one has written a tool for PHP that will generate classes and methods
> based on the tables in the database.
>
That's because he is used to the older data-driven design methodology.
PHP (especially v5) and other OO languages allow us to use domain-driven
design.
Instead of starting from the database structure and working outward to
try to solve the process, start with the business problem, build your
workflows/objects and finish with the data storage. I find there is
much less iteration with this method.
Anyway, take a look at Umbrello. The idea is to model you app using UML
and hit the "generate PHP" button.
http://uml.sourceforge.net
- Brian
From jeff.loiselle at gmail.com Tue Mar 22 13:23:00 2005
From: jeff.loiselle at gmail.com (Jeff Loiselle)
Date: Tue, 22 Mar 2005 13:23:00 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <0MKyxe-1DDljP2NcI-0007Pw@mrelay.perfora.net>
References: <20050322153605.GA27644@panix.com>
<0MKyxe-1DDljP2NcI-0007Pw@mrelay.perfora.net>
Message-ID: <4b18871105032210236c55bb3e@mail.gmail.com>
> > Prepare/execute doesn't improve portability.
I had thought that using prepare() and execute() increased portability
due to this line in the documentation:
"Another place prepare/execute is useful is supporting databases which
have different SQL syntaxes."
>> Plus, I have a feeling you are wasting resources.
I felt this way too, but I thought that portability was more
important. I know I could just escape the vars, hard code the SQL and
execute the query.
I did end up testing the commit() and it worked just fine. I know I
didn't even have to ask, I did just end up testing it. Though, at
first I wasn't exactly sure how I was going to approach it, being as
it was my first time using a transaction. :-)
Thanks for all your help.
From mitch.pirtle at gmail.com Tue Mar 22 14:10:16 2005
From: mitch.pirtle at gmail.com (Mitch Pirtle)
Date: Tue, 22 Mar 2005 14:10:16 -0500
Subject: [nycphp-talk] NYPHP February Mambo Presentation
In-Reply-To: <42401F67.3070006@nyphp.org>
References: <42401F67.3070006@nyphp.org>
Message-ID: <330532b6050322111011702d0e@mail.gmail.com>
On Tue, 22 Mar 2005 08:36:39 -0500, Hans C. Kaspersetz
wrote:
> We have posted Mitch's February presentation to New York PHP on Mambo.
> Sorry for the delay. You will find for your reading pleasure a PDF of
> his slides and an MP3 for your listening pleasure.
"Mambo Mitch, Almost Live" ;-)
From danielc at analysisandsolutions.com Tue Mar 22 14:47:43 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Tue, 22 Mar 2005 14:47:43 -0500
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <4b18871105032210236c55bb3e@mail.gmail.com>
References: <20050322153605.GA27644@panix.com>
<0MKyxe-1DDljP2NcI-0007Pw@mrelay.perfora.net>
<4b18871105032210236c55bb3e@mail.gmail.com>
Message-ID: <20050322194742.GA11220@panix.com>
On Tue, Mar 22, 2005 at 01:23:00PM -0500, Jeff Loiselle wrote:
>
> I had thought that using prepare() and execute() increased portability
> due to this line in the documentation:
>
> "Another place prepare/execute is useful is supporting databases which
> have different SQL syntaxes."
Yeah. But that portability can be obtained using the quoteSmart() method
directly. Though, in most cases, you can just put in integers as unquoted
and strings as quoted with single quotes and you don't have to worry about
portability. The trick comes in two places: strings that need escaping
due to "'" or "\" in them and booleans.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From danielc at analysisandsolutions.com Tue Mar 22 14:56:19 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Tue, 22 Mar 2005 14:56:19 -0500
Subject: [nycphp-talk] Automatically Generating Code from the Database
In-Reply-To: <42403FD9.2090207@r2communications.com>
References: <42403FD9.2090207@r2communications.com>
Message-ID: <20050322195619.GB11220@panix.com>
Hi Randal:
On Tue, Mar 22, 2005 at 10:55:05AM -0500, Randal Rust wrote:
> I just had an interesting conversation with my boss, who hasn't coded
> anything since COBOL. Anyway, he was saying that he is amazed that no
> one has written a tool for PHP that will generate classes and methods
> based on the tables in the database.
Guess he hasn't been looking for anything since COBOL either. :)
http://pear.php.net/package/DB_DataObject
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From fields at hedge.net Tue Mar 22 17:29:21 2005
From: fields at hedge.net (Adam Fields)
Date: Tue, 22 Mar 2005 17:29:21 -0500
Subject: [nycphp-talk] Any way to attend the meeting tonight?
Message-ID: <20050322222921.GC26241@lola.aquick.org>
I've become unexpectedly free, but didn't rsvp.
Any way I can get in?
--
- Adam
** I can fix your database problems: http://www.everylastounce.com/mysql.html **
Blog............... [ http://www.aquick.org/blog ]
Links.............. [ http://del.icio.us/fields ]
Photos............. [ http://www.aquick.org/photoblog ]
Experience......... [ http://www.adamfields.com/resume.html ]
Product Reviews: .. [ http://www.buyadam.com/blog ]
From gatzby3jr at gmail.com Tue Mar 22 20:24:56 2005
From: gatzby3jr at gmail.com (Brian O'Connor)
Date: Tue, 22 Mar 2005 20:24:56 -0500
Subject: [nycphp-talk] Learning to use OOP in PHP
Message-ID: <29da5d1505032217246197fd35@mail.gmail.com>
Hello.
I've been using PHP for about ~1 year now. and I feel I should be
learning to use OOP to it's full capability in PHP. I've been playing
with it a little bit, but the only real way I know how to use it for
my purposes is to double query the database, once to get the ID, then
do a while loop and create an instance of the class from that ID
given. From there I would go and query the information within the
class, and have method's to return certain pieces of information so
that I wouldn't have the code on the actual page. I'm aware that
pretty much anything you want to do on a webpage can be done without
OOP, and strictly on the page, but I find myself writing a lot of the
same code that has the exact same purpose on another page. I'd like
to be able to keep my code organized, as well as be able to create a
website for someone and have someone else maintain it with ease. My
Brother was attempting to explain to me how to do OOP without double
querying the database, but it was over the phone and it was a bit more
complicated that way than with some text in front of me. What I'm
looking for are some tips on how to use it properly, or some
recommended books / websites that explain this. Thanks in advance.
--
Brian O'Connor
From lists at natserv.com Tue Mar 22 22:22:37 2005
From: lists at natserv.com (Francisco Reyes)
Date: Tue, 22 Mar 2005 22:22:37 -0500 (EST)
Subject: [nycphp-talk] Simple utility for developers
Message-ID: <20050322221745.Q95814@zoraida.natserv.net>
I just finished putting the first version of a simple (near trivial)
utility page.
All the page does is to allow to do the following functions on a string:
Length
MD5
CRC32
Upper
Lower
Proper
I decided to do the site after I found myself needing lenght for various
reasons while developing. Also put the other functions as I ocassionaly
need them too.
The URL is http://stringsutils.com
Feedback is welcome.. in particular what functions others may find
usefull.
From lists at natserv.com Tue Mar 22 22:39:51 2005
From: lists at natserv.com (Francisco Reyes)
Date: Tue, 22 Mar 2005 22:39:51 -0500 (EST)
Subject: [nycphp-talk] Top down or bottom up design (Was Automatically
Generating Code from the Database)
In-Reply-To: <1111508938.26987.42.camel@brian.vermonster.com>
References: <42403FD9.2090207@r2communications.com>
<1111508938.26987.42.camel@brian.vermonster.com>
Message-ID: <20050322222426.Q95814@zoraida.natserv.net>
On Tue, 22 Mar 2005, Brian Kaney wrote:
> That's because he is used to the older data-driven design methodology.
> PHP (especially v5) and other OO languages allow us to use domain-driven
> design.
While trying to not go too offtopic PHP...
I don't think this is an "old approach". It has to do with how someone
sees the problem and his/her background.. For example to ask a database
designer to think of the problem as processes and not of data is like
asking a fish to feel confortable outside of water. :-)
> Instead of starting from the database structure and working outward to
> try to solve the process, start with the business problem, build your
> workflows/objects and finish with the data storage. I find there is
> much less iteration with this method.
I personally think there is more risk on the top down approach. In
particular users, over time, tend to internalize the process. They don't
see certain parts of the process anymore because they just "do it" when
the screen/process comes up. If you just ask abou the processes one needs
to be carefull to make sure those internalized steps are not skipped.
On the other hand I find users tend to know the data they work with fairly
well.
Moreover, when doing a re-engineering project asking about processes tends
to get you feedback of how things are.. but the whole purpose of the
re-engineering is to re-do that.. Doing a bottom up approach allows the
user to tell you what it is that needs to be captured.. as long as their
current process.. and let's the designer come up with new ways to do the
process.
I really think that either approach will work.. it's just how a person
sees processes/design and how experienced they are.
From lists at natserv.com Tue Mar 22 22:52:52 2005
From: lists at natserv.com (Francisco Reyes)
Date: Tue, 22 Mar 2005 22:52:52 -0500 (EST)
Subject: [nycphp-talk] Learning to use OOP in PHP
In-Reply-To: <29da5d1505032217246197fd35@mail.gmail.com>
References: <29da5d1505032217246197fd35@mail.gmail.com>
Message-ID: <20050322224224.F95814@zoraida.natserv.net>
On Tue, 22 Mar 2005, Brian O'Connor wrote:
> I've been using PHP for about ~1 year now. and I feel I should be
> learning to use OOP to it's full capability in PHP.
Are you interestedin OOP or in code re-use?
Two different concepts.. just happens many people confuse them.
You can have code re-use without OO and have OO with little re-usability.
> with it a little bit, but the only real way I know how to use it for
> my purposes is to double query the database, once to get the ID, then
> do a while loop and create an instance of the class from that ID
> given.
I don't know others, but I would follow your sample much better if I had
code to look at.
>... I'm aware that
> pretty much anything you want to do on a webpage can be done without
> OOP, and strictly on the page, but I find myself writing a lot of the
> same code that has the exact same purpose on another page.
That's code re-use. You can achive it without using OO.
> to be able to keep my code organized, as well as be able to create a
> website for someone and have someone else maintain it with ease.
Which can be done without OO.
My advice is that you look for basic sites that explain Object Oriented
programming and once you better understand the concept see if you think
you like it and if it will be helpfull to you.
> Brother was attempting to explain to me how to do OOP without double
> querying the database, but it was over the phone and it was a bit more
> complicated
If you post the class you wrote myself and others would be able to give
you feedback on your class.
> looking for are some tips on how to use it properly, or some
> recommended books / websites that explain this. Thanks in advance.
I will try and give you my 2 cents version of what OO is.
It's a way to see operations based on items (or objects as used in the OO
lingo).
Whereas before you would have functions like
format(string)
compute(number)
OO tells you to think of "objects" and how different operations can be
performed on them.
Example you could have a class "figure" to refer to a geometrical figure.
You could think of what type of interaction you would need with such as
figure such as finding it's area or volume.
In the non OO world you would have something like
area(figure)
volume(figure)
But how do you know the figure has a volume?
In OO you have
figure.area()
figure.volume()
The class itself can handle returning the proper value if there is a
volume or perhaps 0 if the area is only 2 dimensions.
I am certain there are very decent explanations/tutorials out there in the
net on OO. Once you understand the concept it is not very difficult to
apply it to PHP.
From mitch.pirtle at gmail.com Tue Mar 22 23:47:20 2005
From: mitch.pirtle at gmail.com (Mitch Pirtle)
Date: Tue, 22 Mar 2005 23:47:20 -0500
Subject: [nycphp-talk] Learning to use OOP in PHP
In-Reply-To: <29da5d1505032217246197fd35@mail.gmail.com>
References: <29da5d1505032217246197fd35@mail.gmail.com>
Message-ID: <330532b605032220473df760b7@mail.gmail.com>
On Tue, 22 Mar 2005 20:24:56 -0500, Brian O'Connor wrote:
> Hello.
>
> I've been using PHP for about ~1 year now.
Welcome to the club! You joined the party right when things started getting hot.
> What I'm
> looking for are some tips on how to use it properly, or some
> recommended books / websites that explain this.
My advice for you at this point would be to read both PHP Anthology
books from Harry Fuecks, published by SitePoint. Harry has some smart
approaches to some of the things you want to address, and manages to
communicate them in a very readable format. He will also explain a lot
behind OO (especially with regards to PHP's OO underpinnings), but is
not silly about OO for everthing as a perfect panacea.
Overall very very good books.
Also reading PHP 5 Power Programming by Gutmans, Bakken and Rethans,
which of course comes from some highly respected members of the PHP
community. Seems to also be a very good book for getting beyond the
'Learning PHP' book realm.
-- Mitch
From hans at cyberxdesigns.com Wed Mar 23 00:09:35 2005
From: hans at cyberxdesigns.com (Hans C. Kaspersetz)
Date: Wed, 23 Mar 2005 00:09:35 -0500
Subject: [nycphp-talk] Learning to use OOP in PHP
In-Reply-To: <330532b605032220473df760b7@mail.gmail.com>
References: <29da5d1505032217246197fd35@mail.gmail.com>
<330532b605032220473df760b7@mail.gmail.com>
Message-ID: <4240FA0F.4000705@cyberxdesigns.com>
I can second Mitch's opinion on PHP 5 Power Programming. It is a good
introduction to PHP 5 and OOP. It is not an OOP book. It is a book
about programming with PHP 5 including information on subjects from
working with files to using PEAR and PECL packages. The book includes
information about classes and syntax in PHP5 and brief discussion about
different OOP design patterns. I found myself wanting more information
about OOP and PHP5 after reading it. But I always want more
information. It is one of the books I have read almost cover to cover.
ISBN 0-13-147149-X
Hans K
--
Hans C. Kaspersetz
Cyber X Designs
http://www.cyberxdesigns.com
Mitch Pirtle wrote:
>On Tue, 22 Mar 2005 20:24:56 -0500, Brian O'Connor wrote:
>
>
>>Hello.
>>
>>I've been using PHP for about ~1 year now.
>>
>>
>
>Welcome to the club! You joined the party right when things started getting hot.
>
>
>
>>What I'm
>>looking for are some tips on how to use it properly, or some
>>recommended books / websites that explain this.
>>
>>
>
>My advice for you at this point would be to read both PHP Anthology
>books from Harry Fuecks, published by SitePoint. Harry has some smart
>approaches to some of the things you want to address, and manages to
>communicate them in a very readable format. He will also explain a lot
>behind OO (especially with regards to PHP's OO underpinnings), but is
>not silly about OO for everthing as a perfect panacea.
>
>Overall very very good books.
>
>Also reading PHP 5 Power Programming by Gutmans, Bakken and Rethans,
>which of course comes from some highly respected members of the PHP
>community. Seems to also be a very good book for getting beyond the
>'Learning PHP' book realm.
>
>-- Mitch
>_______________________________________________
>New York PHP Talk Mailing List
>AMP Technology
>Supporting Apache, MySQL and PHP
>http://lists.nyphp.org/mailman/listinfo/talk
>http://www.nyphp.org
>
>
>
>
>
From rrust at r2communications.com Wed Mar 23 08:19:03 2005
From: rrust at r2communications.com (Randal Rust)
Date: Wed, 23 Mar 2005 08:19:03 -0500
Subject: [nycphp-talk] Top down or bottom up design (Was Automatically
Generating Code from the Database)
In-Reply-To: <20050322222426.Q95814@zoraida.natserv.net>
References: <42403FD9.2090207@r2communications.com> <1111508938.26987.42.camel@brian.vermonster.com>
<20050322222426.Q95814@zoraida.natserv.net>
Message-ID: <42416CC7.8080605@r2communications.com>
Francisco Reyes wrote:
> I really think that either approach will work.. it's just how a person
> sees processes/design and how experienced they are.
I agree with that. I think there is risk in either approach, you have to
use what best fits the situation.
In my experience, tools that generate code tend to create more overhead
than necessary. I think that I am better off writing Dreamweaver
extensions that I could use to create the basics of what I would need
for a class and its methods.
--
Randal Rust
R.Squared Communications
http://www.r2communications.com
Digital Design for Bricks-and-Mortar Businesses
From dmintz at davidmintz.org Wed Mar 23 09:42:32 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Wed, 23 Mar 2005 09:42:32 -0500 (EST)
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To: <20050322153605.GA27644@panix.com>
References: <4b188711050318142473261fdd@mail.gmail.com>
<1111185099.12867.31.camel@brian.vermonster.com>
<4b18871105032107485a30a07a@mail.gmail.com>
<20050321161313.GA15934@panix.com>
<4b18871105032108422a325173@mail.gmail.com>
<20050322153605.GA27644@panix.com>
Message-ID:
On Tue, 22 Mar 2005, Daniel Convissor wrote:
> Prepare/execute is only efficient when you do one
> prepare of the query and then will be executing that the same exact query
> (without changing table/column names) multiple times.
Is this true even when the back end is MySQL 4.1.x and the underlying PHP
API is mysqli? I thought I read an article on zend.com that extolled the
benefits of prepare/execute and suggested it was always a win, but maybe I
was smoking crack again and misunderstood.
Follow-up question: is it a wash if you are only doing the query once, or
is it actually less efficient w/ prepare/execute than without? Let's
assume you are not working with TEXT or BLOBs
---
David Mintz
http://davidmintz.org/
From lists at natserv.com Wed Mar 23 10:04:39 2005
From: lists at natserv.com (Francisco Reyes)
Date: Wed, 23 Mar 2005 10:04:39 -0500 (EST)
Subject: [nycphp-talk] Top down or bottom up design (Was Automatically
Generating Code from the Database)
In-Reply-To: <42416CC7.8080605@r2communications.com>
References: <42403FD9.2090207@r2communications.com>
<1111508938.26987.42.camel@brian.vermonster.com>
<20050322222426.Q95814@zoraida.natserv.net>
<42416CC7.8080605@r2communications.com>
Message-ID: <20050323100241.W4886@zoraida.natserv.net>
On Wed, 23 Mar 2005, Randal Rust wrote:
> In my experience, tools that generate code tend to create more overhead than
> necessary.
Agree. However the one time I find such tools usefull is when you have a
very large project ahead and the users have little idea of what they
want/need. Making dummy mockups so users could have an idea of how the
program may look can be very helpfull. Specially when trying to satisfy a
large number of users.
From gatzby3jr at gmail.com Wed Mar 23 11:09:52 2005
From: gatzby3jr at gmail.com (Brian O'Connor)
Date: Wed, 23 Mar 2005 11:09:52 -0500
Subject: [nycphp-talk] Learning to use OOP in PHP
In-Reply-To: <20050322224224.F95814@zoraida.natserv.net>
References: <29da5d1505032217246197fd35@mail.gmail.com>
<20050322224224.F95814@zoraida.natserv.net>
Message-ID: <29da5d150503230809109f19b5@mail.gmail.com>
Sorry for the vagueness.
Here is an example class I might write in order to retrieve
information for my news page:
class News
var $id;
var $rs;
function News($id)
{
$this->id = $id;
$query = "SELECT * FROM news WHERE id = $this->id;";
$result = mysql_query($query);
$rs = mysql_fetch_array($rs);
$this->rs = $rs;
}
function getTitle()
{
return $this->rs['title'];
}
function getCategory()
{
return $this->rs['category'];
}
etc with more methods almost identical to that
}
Also, it's not that I necessarily want to write OOP for everything,
but I don't like being lost when reading code with OOP in it. I
understand some of it, but a lot of times certain things go right over
my head.
On Tue, 22 Mar 2005 22:52:52 -0500 (EST), Francisco Reyes
wrote:
> On Tue, 22 Mar 2005, Brian O'Connor wrote:
> > I've been using PHP for about ~1 year now. and I feel I should be
> > learning to use OOP to it's full capability in PHP.
>
> Are you interestedin OOP or in code re-use?
> Two different concepts.. just happens many people confuse them.
> You can have code re-use without OO and have OO with little re-usability.
>
> > with it a little bit, but the only real way I know how to use it for
> > my purposes is to double query the database, once to get the ID, then
> > do a while loop and create an instance of the class from that ID
> > given.
>
> I don't know others, but I would follow your sample much better if I had
> code to look at.
>
> >... I'm aware that
> > pretty much anything you want to do on a webpage can be done without
> > OOP, and strictly on the page, but I find myself writing a lot of the
> > same code that has the exact same purpose on another page.
>
> That's code re-use. You can achive it without using OO.
>
> > to be able to keep my code organized, as well as be able to create a
> > website for someone and have someone else maintain it with ease.
>
> Which can be done without OO.
>
> My advice is that you look for basic sites that explain Object Oriented
> programming and once you better understand the concept see if you think
> you like it and if it will be helpfull to you.
>
> > Brother was attempting to explain to me how to do OOP without double
> > querying the database, but it was over the phone and it was a bit more
> > complicated
>
> If you post the class you wrote myself and others would be able to give
> you feedback on your class.
>
> > looking for are some tips on how to use it properly, or some
> > recommended books / websites that explain this. Thanks in advance.
>
> I will try and give you my 2 cents version of what OO is.
> It's a way to see operations based on items (or objects as used in the OO
> lingo).
>
> Whereas before you would have functions like
> format(string)
> compute(number)
>
> OO tells you to think of "objects" and how different operations can be
> performed on them.
>
> Example you could have a class "figure" to refer to a geometrical figure.
> You could think of what type of interaction you would need with such as
> figure such as finding it's area or volume.
> In the non OO world you would have something like
> area(figure)
> volume(figure)
>
> But how do you know the figure has a volume?
> In OO you have
> figure.area()
> figure.volume()
>
> The class itself can handle returning the proper value if there is a
> volume or perhaps 0 if the area is only 2 dimensions.
>
> I am certain there are very decent explanations/tutorials out there in the
> net on OO. Once you understand the concept it is not very difficult to
> apply it to PHP.
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
--
Brian O'Connor
From codebowl at gmail.com Wed Mar 23 11:13:50 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Wed, 23 Mar 2005 11:13:50 -0500
Subject: [nycphp-talk] Learning to use OOP in PHP
In-Reply-To: <29da5d150503230809109f19b5@mail.gmail.com>
References: <29da5d1505032217246197fd35@mail.gmail.com>
<20050322224224.F95814@zoraida.natserv.net>
<29da5d150503230809109f19b5@mail.gmail.com>
Message-ID: <8d9a42800503230813354e3ac4@mail.gmail.com>
i am not quite sure what you are attempting to accomplish here but you
can simplify
$rs = mysql_fetch_array($rs);
$this->rs = $rs;
with just $this->rs = mysql_fetch_array()
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From danielc at analysisandsolutions.com Wed Mar 23 11:40:38 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Wed, 23 Mar 2005 11:40:38 -0500
Subject: [nycphp-talk] securityfocus 293 summary
Message-ID: <20050323164038.GA14228@panix.com>
SecurityFocus Newsletter #293
PAFileDB Multiple SQL Injection And Cross-Site Scripting Vul...
http://www.securityfocus.com/bid/12788
PABox Post Icon HTML Injection Vulnerability
http://www.securityfocus.com/bid/12796
Phorum Multiple Subject and Attachment HTML Injection Vulner...
http://www.securityfocus.com/bid/12800
SimpGB Guestbook.PHP SQL Injection Vulnerability
http://www.securityfocus.com/bid/12801
PHPAdsNew AdFrame.PHP Cross-Site Scripting Vulnerability
http://www.securityfocus.com/bid/12803
VoteBox Votebox.PHP Remote File Include Vulnerability
http://www.securityfocus.com/bid/12806
McNews Install.PHP Arbitrary File Include Vulnerability
http://www.securityfocus.com/bid/12835
PHPOpenChat Multiple Remote File Include Vulnerabilities
http://www.securityfocus.com/bid/12817
PHPOpenChat Multiple HTML Injection Vulnerabilities
http://www.securityfocus.com/bid/12841
PHP-Post Multiple Remote Input Validation Vulnerabilities
http://www.securityfocus.com/bid/12845
HolaCMS Voting Module Remote File Corruption Vulnerability
http://www.securityfocus.com/bid/12789
HolaCMS Voting Module Directory Traversal Remote File Corrup...
http://www.securityfocus.com/bid/12799
ZPanel Multiple SQL Injection and File Include Vulnerabiliti...
http://www.securityfocus.com/bid/12809
Subdreamer SQL Injection Vulnerability
http://www.securityfocus.com/bid/12839
PunBB Multiple HTML Injection Vulnerabilities
http://www.securityfocus.com/bid/12828
Mozilla Suite/Firefox/Thunderbird Nested Anchor Tag Status B...
http://www.securityfocus.com/bid/12798
Apache Tomcat Remote Malformed Request Denial Of Service Vul...
http://www.securityfocus.com/bid/12795
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From adam at trachtenberg.com Wed Mar 23 12:59:53 2005
From: adam at trachtenberg.com (Adam Maccabee Trachtenberg)
Date: Wed, 23 Mar 2005 12:59:53 -0500 (EST)
Subject: [nycphp-talk] PEAR::DB prepare() and executeMultiple()
In-Reply-To:
References: <4b188711050318142473261fdd@mail.gmail.com>
<1111185099.12867.31.camel@brian.vermonster.com>
<4b18871105032107485a30a07a@mail.gmail.com>
<20050321161313.GA15934@panix.com>
<4b18871105032108422a325173@mail.gmail.com>
<20050322153605.GA27644@panix.com>
Message-ID:
On Wed, 23 Mar 2005, David Mintz wrote:
> On Tue, 22 Mar 2005, Daniel Convissor wrote:
>
> > Prepare/execute is only efficient when you do one
> > prepare of the query and then will be executing that the same exact query
> > (without changing table/column names) multiple times.
>
> Is this true even when the back end is MySQL 4.1.x and the underlying PHP
> API is mysqli? I thought I read an article on zend.com that extolled the
> benefits of prepare/execute and suggested it was always a win, but maybe I
> was smoking crack again and misunderstood.
>
> Follow-up question: is it a wash if you are only doing the query once, or
> is it actually less efficient w/ prepare/execute than without? Let's
> assume you are not working with TEXT or BLOBs
When you don't prepare the SQL statement ahead of time, the database
has to do the preparation itself before it executes the query. If you
only make the query a single time, there will be some additional
overhead with an explicit preparation, as there's additional
communication back and forth between the db and the client.
However, I would say that, at least in the case of MySQLi and MySQL
4.1, that this can be worth it, as it allows bound parameters. The big
win here is that you don't need to call mysqli_real_escape_slashes()
on strings. This can reduce your chance of opening up yourself to a
SQL injection attack. So, it's a security win, even if it's a minor
speed loss.
-adam
--
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!
From jayeshsh at ceruleansky.com Wed Mar 23 13:02:25 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Wed, 23 Mar 2005 13:02:25 -0500
Subject: [nycphp-talk] Automatically Generating Code from the Database
Message-ID: <4241AF31.9010908@ceruleansky.com>
Hello all,
I just came across this product today (via a Google Adwords Ad). It
generates a user interface that can update a given database. I have not
tried it, and the price looks a bit steep. But maybe it is worth
checking out:
http://xlinesoft.com/phprunner/screenshots.htm
A note of caution: their name is spelled wrong on their "About Us" page,
so that is something of a warning sign. Anyway, this is the first
product of its type that I have found, and someone asked for it, so I
thought I would mention it here.
Best regards,
- Jay
From lists at natserv.com Wed Mar 23 18:59:05 2005
From: lists at natserv.com (Francisco Reyes)
Date: Wed, 23 Mar 2005 18:59:05 -0500 (EST)
Subject: [nycphp-talk] Learning to use OOP in PHP
In-Reply-To: <29da5d150503230809109f19b5@mail.gmail.com>
References: <29da5d1505032217246197fd35@mail.gmail.com>
<20050322224224.F95814@zoraida.natserv.net>
<29da5d150503230809109f19b5@mail.gmail.com>
Message-ID: <20050323185423.Q8541@zoraida.natserv.net>
On Wed, 23 Mar 2005, Brian O'Connor wrote:
> Here is an example class I might write in order to retrieve
> information for my news page:
I think a class for something that specific is probably NOT a good idea.
A class, in my opinion, is meant to be something you use for several
programs.
The example you wrote is basically a one program/scenario class. I think
on a case like that it's probably counterproductive.
On the other hand if you wrote class that would take as a parameter a
connect string to the database and be able to insert/read data from ANY
table, that would be worth spending the time making a class out of it.
From danielc at analysisandsolutions.com Wed Mar 23 20:45:32 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Wed, 23 Mar 2005 20:45:32 -0500
Subject: [nycphp-talk] Learning to use OOP in PHP
In-Reply-To: <20050323185423.Q8541@zoraida.natserv.net>
References: <29da5d1505032217246197fd35@mail.gmail.com>
<20050322224224.F95814@zoraida.natserv.net>
<29da5d150503230809109f19b5@mail.gmail.com>
<20050323185423.Q8541@zoraida.natserv.net>
Message-ID: <20050324014532.GB28289@panix.com>
On Wed, Mar 23, 2005 at 06:59:05PM -0500, Francisco Reyes wrote:
>
> I think a class for something that specific is probably NOT a good idea.
> A class, in my opinion, is meant to be something you use for several
> programs.
I disagree. Reusability is only one way to use OOP.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From gatzby3jr at gmail.com Wed Mar 23 22:39:26 2005
From: gatzby3jr at gmail.com (Brian O'Connor)
Date: Wed, 23 Mar 2005 22:39:26 -0500
Subject: [nycphp-talk] Learning to use OOP in PHP
In-Reply-To: <20050323185423.Q8541@zoraida.natserv.net>
References: <29da5d1505032217246197fd35@mail.gmail.com>
<20050322224224.F95814@zoraida.natserv.net>
<29da5d150503230809109f19b5@mail.gmail.com>
<20050323185423.Q8541@zoraida.natserv.net>
Message-ID: <29da5d1505032319396c14bafe@mail.gmail.com>
That's assuming I have the news only in one spot.
I could have a news page and then a box with headlines etc somewhere
else that is displayed elsewhere (I don't, but I could).
More specifically, I was going to have a Comments and User class, with
different methods within each which could be used on multiple pages.
On Wed, 23 Mar 2005 18:59:05 -0500 (EST), Francisco Reyes
wrote:
> On Wed, 23 Mar 2005, Brian O'Connor wrote:
>
> > Here is an example class I might write in order to retrieve
> > information for my news page:
>
> I think a class for something that specific is probably NOT a good idea.
> A class, in my opinion, is meant to be something you use for several
> programs.
>
> The example you wrote is basically a one program/scenario class. I think
> on a case like that it's probably counterproductive.
>
> On the other hand if you wrote class that would take as a parameter a
> connect string to the database and be able to insert/read data from ANY
> table, that would be worth spending the time making a class out of it.
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
--
Brian O'Connor
From dmintz at davidmintz.org Thu Mar 24 15:02:07 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Thu, 24 Mar 2005 15:02:07 -0500 (EST)
Subject: [nycphp-talk] say it ain't so RE mysqli_stmt_bind_param()
Message-ID:
Is it correct that you have to do something like this:
mysqli_stmt_bind_param($stmt, "ssssssss",
$student['lastname'],
$student['firstname'],
$student['middle_initial'],
$student['address1'],
$student['city'],
$student['state'],
$student['postal_code'],
$student['email']
);
and you cannot pass an array as the last argument, like this:
mysqli_stmt_bind_param($stmt, "ssssssss",array_values($student));
...or am I missing something? Some other shortcut, perhaps?
This seems kind of painful, but then again maybe I'm a spoiled brat --
a PEAR/DB-spoiled brat, to be exact.
---
David Mintz
http://davidmintz.org/
From adam at trachtenberg.com Thu Mar 24 15:16:49 2005
From: adam at trachtenberg.com (Adam Maccabee Trachtenberg)
Date: Thu, 24 Mar 2005 15:16:49 -0500 (EST)
Subject: [nycphp-talk] say it ain't so RE mysqli_stmt_bind_param()
In-Reply-To:
References:
Message-ID:
On Thu, 24 Mar 2005, David Mintz wrote:
> mysqli_stmt_bind_param($stmt, "ssssssss",array_values($student));
>
> ...or am I missing something? Some other shortcut, perhaps?
Not that I know of. It's tricky, as the function binds by reference,
not value. I looked at adding a patch, but was too busy.
-adam
--
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!
From mikeh at dtev.com Thu Mar 24 15:22:11 2005
From: mikeh at dtev.com (mike hjorleifsson)
Date: Thu, 24 Mar 2005 15:22:11 -0500
Subject: [nycphp-talk] PHP Surveyor
In-Reply-To:
References:
Message-ID: <42432173.1070809@dtev.com>
Anyone familiar with PHP Surveyor ? I need a little help with the
printable.php script
From dmintz at davidmintz.org Thu Mar 24 15:41:17 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Thu, 24 Mar 2005 15:41:17 -0500 (EST)
Subject: [nycphp-talk] say it ain't so RE mysqli_stmt_bind_param()
In-Reply-To:
References:
Message-ID:
On Thu, 24 Mar 2005, Adam Maccabee Trachtenberg wrote:
> On Thu, 24 Mar 2005, David Mintz wrote:
>
> > mysqli_stmt_bind_param($stmt, "ssssssss",array_values($student));
> >
> > ...or am I missing something? Some other shortcut, perhaps?
>
> Not that I know of. It's tricky, as the function binds by reference,
> not value. I looked at adding a patch, but was too busy.
Excuses!!
Maybe a future version... meanwhile I'll shut up and deal with it.
Thanks Adam.
BTW kudos for the discussion in "Upgrading to PHP 5". It is particularly
helpful where the official docs are lacking, and in at least one instance,
inaccurate.
Since flattery will get me everywhere, another question: What's the
benefit of binding output parameters? My guess would be speed.
---
David Mintz
http://davidmintz.org/
From adam at trachtenberg.com Thu Mar 24 18:07:52 2005
From: adam at trachtenberg.com (Adam Maccabee Trachtenberg)
Date: Thu, 24 Mar 2005 18:07:52 -0500 (EST)
Subject: [nycphp-talk] say it ain't so RE mysqli_stmt_bind_param()
In-Reply-To:
References:
Message-ID:
On Thu, 24 Mar 2005, David Mintz wrote:
> Since flattery will get me everywhere, another question: What's the
> benefit of binding output parameters? My guess would be speed.
Good question.
I haven't benchmarked it, but I don't think speed would really be the
big win here. I would say code clarity could be a win, but some might
say that an explicit assignment is actually more clear. I guess it
depends upon your preference for magic.
-adam
--
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!
From 1j0lkq002 at sneakemail.com Thu Mar 24 23:33:57 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Thu, 24 Mar 2005 23:33:57 -0500
Subject: [nycphp-talk] follow-up on someone's question about how Yahoo!
handles 302 redirects
In-Reply-To: <20050323164038.GA14228@panix.com>
References: <20050323164038.GA14228@panix.com>
Message-ID: <29257-77528@sneakemail.com>
As a follow-up to the SEO presentation last Tuesday, someone asked how
Yahoo! handles 302 redirects since there does not seem to be any
"hijacking" problem on Yahoo!
During the talk I did not recall that Yahoo! presented their new
approach to handling the 302 redirect in Las Vegas last November. I was
in that audience and it was very important at the time, because Yahoo!
had been mis-handling 301's as well as 302's for several months prior to
that and it had become a real hassle. I don't know why I forgot about it
-- Anyway I looked it up and it is archived on the Yahoo! blog here :
http://www.ysearchblog.com/files/wmw2004/search-engines-and-webmasters.ppt
See slides 14 and 15 for a description of how they handle the 301 and
302 redirects.
Basically if the 302 is within-site, they either keep the original
anyway (if it was root) OR (if it was deep within site) keep the new
target page.
If the 302 is OFF-SITE, they choose to store the target in the index,
which eliminates any benefit to 302 redirecting as a form of hijacking.
-=john andrews
From lists at natserv.com Fri Mar 25 01:08:49 2005
From: lists at natserv.com (Francisco Reyes)
Date: Fri, 25 Mar 2005 01:08:49 -0500 (EST)
Subject: [nycphp-talk] Learning to use OOP in PHP
In-Reply-To: <20050324014532.GB28289@panix.com>
References: <29da5d1505032217246197fd35@mail.gmail.com>
<20050322224224.F95814@zoraida.natserv.net>
<29da5d150503230809109f19b5@mail.gmail.com>
<20050323185423.Q8541@zoraida.natserv.net>
<20050324014532.GB28289@panix.com>
Message-ID: <20050325010822.R27171@zoraida.natserv.net>
On Wed, 23 Mar 2005, Daniel Convissor wrote:
> I disagree. Reusability is only one way to use OOP.
And the others?
From chsnyder at gmail.com Fri Mar 25 01:46:07 2005
From: chsnyder at gmail.com (csnyder)
Date: Fri, 25 Mar 2005 01:46:07 -0500
Subject: [nycphp-talk] follow-up on someone's question about how Yahoo!
handles 302 redirects
In-Reply-To: <29257-77528@sneakemail.com>
References: <20050323164038.GA14228@panix.com> <29257-77528@sneakemail.com>
Message-ID:
On Thu, 24 Mar 2005 23:33:57 -0500, inforequest
<1j0lkq002 at sneakemail.com> wrote:
> Basically if the 302 is within-site, they either keep the original
> anyway (if it was root) OR (if it was deep within site) keep the new
> target page.
> If the 302 is OFF-SITE, they choose to store the target in the index,
> which eliminates any benefit to 302 redirecting as a form of hijacking.
This seems like a pretty straightforward answer to the problem.
Why would you want to index the results of a "temporary" move to
another host in the first place? There must be some reason they built
it that way...
From jeff.loiselle at gmail.com Fri Mar 25 10:48:46 2005
From: jeff.loiselle at gmail.com (Jeff Loiselle)
Date: Fri, 25 Mar 2005 10:48:46 -0500
Subject: [nycphp-talk] PHP Quebec
Message-ID: <4b18871105032507481f408c1e@mail.gmail.com>
So at the last meeting, some of you poisoned my mind by suggesting
that PHP: Quebec would be a good time. :-) So now I am considering
planning a trip up there. It's only a 7 hour drive from where I am in
Connecticut. This would be my first trip to Canada. I've been just
about everywhere else, but Canada is still uncharted territory for me.
Think it's too late to register or scam my way in as a student? ;-)
Anyone else going as a speaker or not?
---
Jeff Loiselle
Web Developer, Musician, and Observer
jeff at loiselles.com
From adam at trachtenberg.com Fri Mar 25 11:46:51 2005
From: adam at trachtenberg.com (Adam Maccabee Trachtenberg)
Date: Fri, 25 Mar 2005 11:46:51 -0500 (EST)
Subject: [nycphp-talk] PHP Quebec
In-Reply-To: <4b18871105032507481f408c1e@mail.gmail.com>
References: <4b18871105032507481f408c1e@mail.gmail.com>
Message-ID:
On Fri, 25 Mar 2005, Jeff Loiselle wrote:
> Think it's too late to register or scam my way in as a student? ;-)
> Anyone else going as a speaker or not?
http://conf.phpquebec.com/en/conf2005/tarif
Looks like you might still be able to get the student rate at the door
as long as you have student id.
I went last year, and enjoyed myself. Just be sure to get out of the
hotel for a bit and walk around the city -- drinking at bars doesn't
count!
I believe Chris and Chris (Hendry and Shiflett) will be there.
-adam
--
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!
From shiflett at php.net Fri Mar 25 13:49:01 2005
From: shiflett at php.net (Chris Shiflett)
Date: Fri, 25 Mar 2005 13:49:01 -0500
Subject: [nycphp-talk] PHP Quebec
In-Reply-To: <4b18871105032507481f408c1e@mail.gmail.com>
References: <4b18871105032507481f408c1e@mail.gmail.com>
Message-ID: <42445D1D.2030006@php.net>
Jeff Loiselle wrote:
> So at the last meeting, some of you poisoned my mind by suggesting
> that PHP: Quebec would be a good time. :-) So now I am considering
> planning a trip up there. It's only a 7 hour drive from where I am in
> Connecticut. This would be my first trip to Canada. I've been just
> about everywhere else, but Canada is still uncharted territory for me.
>
> Think it's too late to register or scam my way in as a student? ;-)
> Anyone else going as a speaker or not?
I've never been, but Adam spoke well of last year's event, and I'm
planning on having fun, if that counts for anything. :-)
Chris
--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/
From shiflett at php.net Fri Mar 25 13:50:48 2005
From: shiflett at php.net (Chris Shiflett)
Date: Fri, 25 Mar 2005 13:50:48 -0500
Subject: [nycphp-talk] PHP Quebec
In-Reply-To:
References: <4b18871105032507481f408c1e@mail.gmail.com>
Message-ID: <42445D88.7000000@php.net>
Adam Maccabee Trachtenberg wrote:
> I went last year, and enjoyed myself. Just be sure to get out of the
> hotel for a bit and walk around the city -- drinking at bars doesn't
> count!
Sure it does! :-)
> I believe Chris and Chris (Hendry and Shiflett) will be there.
As will Hans and Hans (Kaspersetz and Zaunere).
There has to be a good joke in here somewhere...
Chris
--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/
From adam at trachtenberg.com Fri Mar 25 14:01:47 2005
From: adam at trachtenberg.com (Adam Maccabee Trachtenberg)
Date: Fri, 25 Mar 2005 14:01:47 -0500 (EST)
Subject: [nycphp-talk] PHP Quebec
In-Reply-To: <42445D88.7000000@php.net>
References: <4b18871105032507481f408c1e@mail.gmail.com>
<42445D88.7000000@php.net>
Message-ID:
On Fri, 25 Mar 2005, Chris Shiflett wrote:
> > I believe Chris and Chris (Hendry and Shiflett) will be there.
>
> As will Hans and Hans (Kaspersetz and Zaunere).
>
> There has to be a good joke in here somewhere...
And they are here to pump you up.
-adam
--
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!
From sol2ray at gmail.com Fri Mar 25 15:09:58 2005
From: sol2ray at gmail.com (Sol Toure)
Date: Fri, 25 Mar 2005 15:09:58 -0500
Subject: [nycphp-talk] PHP Quebec
In-Reply-To: <42445D88.7000000@php.net>
References: <4b18871105032507481f408c1e@mail.gmail.com>
<42445D88.7000000@php.net>
Message-ID: <4a67dc3905032512091e27f34d@mail.gmail.com>
> > I believe Chris and Chris (Hendry and Shiflett) will be there.
>
> As will Hans and Hans (Kaspersetz and Zaunere).
>
> There has to be a good joke in here somewhere...
>
Is this correct?
printf("%Hans, %Hans, %Chris and %Chris", $Kaspersetz, $Zaunere,
$Hendy, $Shiflett);
From jeff.loiselle at gmail.com Fri Mar 25 16:42:25 2005
From: jeff.loiselle at gmail.com (Jeff Loiselle)
Date: Fri, 25 Mar 2005 16:42:25 -0500
Subject: [nycphp-talk] PHP Quebec
In-Reply-To: <4a67dc3905032512091e27f34d@mail.gmail.com>
References: <4b18871105032507481f408c1e@mail.gmail.com>
<42445D88.7000000@php.net> <4a67dc3905032512091e27f34d@mail.gmail.com>
Message-ID: <4b18871105032513427b32b7cc@mail.gmail.com>
Well, I already found a hotel for $45/night.. so if anyone is still
thinking about going.. at least it can be done cheap. :-)
On Fri, 25 Mar 2005 15:09:58 -0500, Sol Toure wrote:
> > > I believe Chris and Chris (Hendry and Shiflett) will be there.
> >
> > As will Hans and Hans (Kaspersetz and Zaunere).
> >
> > There has to be a good joke in here somewhere...
> >
>
> Is this correct?
>
> printf("%Hans, %Hans, %Chris and %Chris", $Kaspersetz, $Zaunere,
> $Hendy, $Shiflett);
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
--
---
Jeff Loiselle
Web Developer, Musician, and Observer
http://jeff.loiselles.com
From chendry at gmail.com Fri Mar 25 19:24:59 2005
From: chendry at gmail.com (Christopher Hendry)
Date: Fri, 25 Mar 2005 19:24:59 -0500
Subject: [nycphp-talk] PHP Quebec
In-Reply-To: <4b18871105032513427b32b7cc@mail.gmail.com>
References: <4b18871105032507481f408c1e@mail.gmail.com>
<42445D88.7000000@php.net> <4a67dc3905032512091e27f34d@mail.gmail.com>
<4b18871105032513427b32b7cc@mail.gmail.com>
Message-ID: <769e4ce050325162472dfd273@mail.gmail.com>
I'm glad I missed most of this thread...but yes, I'll be there and
last year was a great time. So far it's my favorite PHP conference.
Though I'm still convinced that there is something wrong with the beer
up there, because as hard as Hans Z and I tried, we could barely catch
a buzz.
Will be trying again this year tho if anyone wants to join me.
C
From cmerlo441 at gmail.com Sat Mar 26 01:54:13 2005
From: cmerlo441 at gmail.com (Christopher Merlo)
Date: Sat, 26 Mar 2005 01:54:13 -0500
Subject: [nycphp-talk] PHP Quebec
In-Reply-To: <769e4ce050325162472dfd273@mail.gmail.com>
References: <4b18871105032507481f408c1e@mail.gmail.com>
<42445D88.7000000@php.net> <4a67dc3905032512091e27f34d@mail.gmail.com>
<4b18871105032513427b32b7cc@mail.gmail.com>
<769e4ce050325162472dfd273@mail.gmail.com>
Message-ID: <94658648050325225479efe7e7@mail.gmail.com>
On Fri, 25 Mar 2005 19:24:59 -0500, Christopher Hendry
wrote:
> Though I'm still convinced that there is something wrong with the beer
> up there, because as hard as Hans Z and I tried, we could barely catch
> a buzz.
Molson XXX. When I lived in Vermont ('95 - '97), this beer was
domestic only (I've heard that they started exporting it since).
Something like 8.5% ABV, where most beers are 4 or 5%. Enjoy!
--
cmerlo441 at gmail.com
http://www.theyellowbox.com/
From hans at cyberxdesigns.com Sat Mar 26 19:28:55 2005
From: hans at cyberxdesigns.com (Hans Kaspersetz)
Date: Sat, 26 Mar 2005 19:28:55 -0500
Subject: [nycphp-talk] PHP Quebec
In-Reply-To:
References: <4b18871105032507481f408c1e@mail.gmail.com> <42445D88.7000000@php.net>
Message-ID: <4245FE47.6050003@cyberxdesigns.com>
You are correct. We are here to pump you up.
Hans K
Adam Maccabee Trachtenberg wrote:
>On Fri, 25 Mar 2005, Chris Shiflett wrote:
>
>
>
>>>I believe Chris and Chris (Hendry and Shiflett) will be there.
>>>
>>>
>>As will Hans and Hans (Kaspersetz and Zaunere).
>>
>>There has to be a good joke in here somewhere...
>>
>>
>
>And they are here to pump you up.
>
>-adam
>
>
>
From lists at zaunere.com Sat Mar 26 21:25:45 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Sat, 26 Mar 2005 21:25:45 -0500
Subject: [nycphp-talk] PHP Quebec
In-Reply-To: <42445D88.7000000@php.net>
Message-ID: <0MKz1m-1DFNTK2jzF-0006BS@mrelay.perfora.net>
> As will Hans and Hans (Kaspersetz and Zaunere).
>
> There has to be a good joke in here somewhere...
What is going to Montreal, has two Hans', two Chris', three airplane seats, 8 laptops and doesn't speak any French?
The NYPHP convoy to PHP Quebec of course!
Kaspersetz, Shiflett and Hendry are giving presentations, and I believe are flying up. I'll likely be going (although not 100% yet) and if I do will likely take the train up (8 hours, but it's not bad and has power outlets).
Jeff, if you're planning on heading up, let me know if you'd rather take the train, or even if not, let's touch base.
---
Hans Zaunere
President, Founder
New York PHP
http://www.nyphp.org
AMP Technology
Supporting Apache, MySQL and PHP
From 1j0lkq002 at sneakemail.com Sat Mar 26 23:57:23 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Sat, 26 Mar 2005 23:57:23 -0500
Subject: [nycphp-talk] PHP Quebec
In-Reply-To: <0MKz1m-1DFNTK2jzF-0006BS@mrelay.perfora.net>
References: <0MKz1m-1DFNTK2jzF-0006BS@mrelay.perfora.net>
Message-ID: <11783-84726@sneakemail.com>
Hans Zaunere lists-at-zaunere.com |nyphp dev/internal group use| wrote:
>>As will Hans and Hans (Kaspersetz and Zaunere).
>>
>>There has to be a good joke in here somewhere...
>>
>>
>
>What is going to Montreal, has two Hans', two Chris', three airplane seats, 8 laptops and doesn't speak any French?
>
>The NYPHP convoy to PHP Quebec of course!
>
>Kaspersetz, Shiflett and Hendry are giving presentations, and I believe are flying up. I'll likely be going (although not 100% yet) and if I do will likely take the train up (8 hours, but it's not bad and has power outlets).
>
>Jeff, if you're planning on heading up, let me know if you'd rather take the train, or even if not, let's touch base.
>
>
>---
>Hans Zaunere
>President, Founder
>
>
Any of you going to be blogging the conference?
-=john andrews
From shiflett at php.net Sun Mar 27 13:37:32 2005
From: shiflett at php.net (Chris Shiflett)
Date: Sun, 27 Mar 2005 13:37:32 -0500
Subject: [nycphp-talk] PHP Quebec
In-Reply-To: <11783-84726@sneakemail.com>
References: <0MKz1m-1DFNTK2jzF-0006BS@mrelay.perfora.net>
<11783-84726@sneakemail.com>
Message-ID: <4246FD6C.9080106@php.net>
inforequest wrote:
> Any of you going to be blogging the conference?
I plan to. At the very least, I'll blog after the conference and link to
all of the coverage I know about.
I'll also take lots of pictures, so maybe I can catch the NYPHP
"Canadian beer can't get us drunk" gang after a dozen of that XXX stuff
someone mentioned. :-)
Chris
--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/
From lists at zaunere.com Sun Mar 27 14:06:51 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Sun, 27 Mar 2005 14:06:51 -0500
Subject: [nycphp-talk] PHP Quebec
In-Reply-To: <4246FD6C.9080106@php.net>
Message-ID: <20050327190206.0FAA299D8@mailrelay.t-mobile.com>
> > Any of you going to be blogging the conference?
>
> I plan to. At the very least, I'll blog after the conference and link to
> all of the coverage I know about.
>
> I'll also take lots of pictures, so maybe I can catch the NYPHP
> "Canadian beer can't get us drunk" gang after a dozen of that XXX stuff
> someone mentioned. :-)
Haha... I used to live only 40 minutes south of the border with Canada so I know all about that beer - and it's very good. But, what's very strange, is that we couldn't find any in Montreal! Even the Heineken was strange tasting! Maybe it's just that clear northern air....
H
From lists at zaunere.com Sun Mar 27 14:54:24 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Sun, 27 Mar 2005 14:54:24 -0500
Subject: [nycphp-talk] say it ain't so RE mysqli_stmt_bind_param()
In-Reply-To:
Message-ID: <20050327194939.463E899DF@mailrelay.t-mobile.com>
> Is it correct that you have to do something like this:
>
> mysqli_stmt_bind_param($stmt, "ssssssss",
> $student['lastname'],
> $student['firstname'],
> $student['middle_initial'],
> $student['address1'],
> $student['city'],
> $student['state'],
> $student['postal_code'],
> $student['email']
> );
Correct - that's typical prepared statement syntax. It's really not too bad once you get used to it - it's also trivial to write a wrapper function.
H
From lists at zaunere.com Sun Mar 27 14:56:22 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Sun, 27 Mar 2005 14:56:22 -0500
Subject: [nycphp-talk] say it ain't so RE mysqli_stmt_bind_param()
In-Reply-To:
Message-ID: <20050327195136.8780E99DF@mailrelay.t-mobile.com>
> Since flattery will get me everywhere, another question: What's the
> benefit of binding output parameters? My guess would be speed.
Speed, yeah - especially when dealing with large sets of data - and memory consumption. It's important to keep in mind the basic data flow between client (PHP) and the MySQL server. There's storage on both endpoints, and with large data sets, memory can become a real premium. The prepared statement syntax allows finer control over how/when to transfer data from the server, to the client, and finally into a PHP variable.
H
From tgales at tgaconnect.com Sun Mar 27 15:25:33 2005
From: tgales at tgaconnect.com (Tim Gales)
Date: Sun, 27 Mar 2005 15:25:33 -0500
Subject: [nycphp-talk] openssl not being picked up by configure
Message-ID: <007501c5330b$2128b560$d0893818@oberon1>
I recently rebuilt Apache 2.0.53 with:
...
"--enable-ssl" \
"--with-ssl=/usr/local" \
...
and php 5.0.3 with:
'--with-openssl=/usr/local' \
I was trying to use openssl 0.9.7f
(also recently built)
when I enter:
/usr/local/ssl/bin/openssl version
I get:
OpenSSL 0.9.7f 22 Mar 2005
but phpinfo() reports:
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.7e 25 Oct 2004
I tried running 'make clean' 'make distclean'
and then executing ./config.nice before rebuilding
but it seems like the new openssl is not
being picked up.
Can someone shed some light on this for me?
Thanks in advance.
T. Gales & Associates
'Helping People Connect with Technology'
http://www.tgaconnect.com
From lists at zaunere.com Sun Mar 27 17:07:11 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Sun, 27 Mar 2005 17:07:11 -0500
Subject: [nycphp-talk] openssl not being picked up by configure
In-Reply-To: <007501c5330b$2128b560$d0893818@oberon1>
Message-ID: <0MKz1m-1DFfuZ0tq2-0004I0@mrelay.perfora.net>
> I recently rebuilt Apache 2.0.53 with:
> ...
> "--enable-ssl" \
> "--with-ssl=/usr/local" \
> ...
> and php 5.0.3 with:
> '--with-openssl=/usr/local' \
>
> I was trying to use openssl 0.9.7f
> (also recently built)
>
> when I enter:
> /usr/local/ssl/bin/openssl version
Looks like /usr/local/ssl is your base directory for the version of OpenSSL you want. Give --with-openssl=/usr/local/ssl a shot....
If that works (or even if it doesn't) see what ldconfig has to say about where your libs are. If Linux:
ldconfig -p | grep -i ssl
or, on a BSD:
ldconfig -r | grep -i ssl
And unless you have other dependencies (for instance, the old version of OpenSSL was probably installed using an RPM or some package system), I always remove the other versions of libs I don't want. Having multiple lib versions can become quite confusing.
H
From chendry at gmail.com Sun Mar 27 18:09:58 2005
From: chendry at gmail.com (Christopher Hendry)
Date: Sun, 27 Mar 2005 18:09:58 -0500
Subject: [nycphp-talk] PHP Quebec
In-Reply-To: <20050327190206.0FAA299D8@mailrelay.t-mobile.com>
References: <4246FD6C.9080106@php.net>
<20050327190206.0FAA299D8@mailrelay.t-mobile.com>
Message-ID: <769e4ce05032715091f653bc@mail.gmail.com>
>
> Haha... I used to live only 40 minutes south of the border with Canada so I know all about that beer - and it's very good. But, what's very strange, is that we couldn't find any in Montreal! Even the Heineken was strange tasting! Maybe it's just that clear northern air....
>
Give me my smog, my traffic, my working beer...
--
"When you do things right, people won't be sure you've done anything at all."
From tgales at tgaconnect.com Sun Mar 27 18:36:42 2005
From: tgales at tgaconnect.com (Tim Gales)
Date: Sun, 27 Mar 2005 18:36:42 -0500
Subject: [nycphp-talk] openssl not being picked up by configure
In-Reply-To: <0MKz1m-1DFfuZ0tq2-0004I0@mrelay.perfora.net>
Message-ID: <000001c53325$d4a5cf50$d0893818@oberon1>
> From: talk-bounces at lists.nyphp.org
> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Hans Zaunere
> Sent: Sunday, March 27, 2005 5:07 PM
> To: 'NYPHP Talk'
> Subject: RE: [nycphp-talk] openssl not being picked up by configure
>
>
> Looks like /usr/local/ssl is your base directory for the
> version of OpenSSL you want. Give
> --with-openssl=/usr/local/ssl a shot....
>
> If that works (or even if it doesn't) see what ldconfig has
> to say about where your libs are. If Linux:
>
> ldconfig -p | grep -i ssl
>
ldconfig -p | grep -i ssl
libssl.so.0.9.7 (libc6) => /usr/lib/libssl.so.0.9.7
libssl.so (libc6) => /usr/lib/libssl.so
libgnutls-openssl.so.11 (libc6) =>
/usr/lib/libgnutls-openssl.so.11
ls -l --time-style=long-iso /usr/lib/libssl.*
-rw-r--r-- 1 root root 303232 2004-12-03 14:03 /usr/lib/libssl.a
...
ls -l --time-style=long-iso /usr/local/ssl/lib
drwxr-xr-x 3 root root 136 2005-03-27 10:40 .
drwxr-xr-x 9 root root 248 2005-03-27 14:16 ..
-rw-r--r-- 1 root root 1813360 2005-03-27 10:40 libcrypto.a
-rw-r--r-- 1 root root 268380 2005-03-27 10:40 libssl.a
(this is the 0.9.7f I built earlier)
> or, on a BSD:
>
> ldconfig -r | grep -i ssl
>
Thanks for the BSD-style command -- I will safe store that somewhere...
> And unless you have other dependencies (for instance, the old
> version of OpenSSL was probably installed using an RPM or
> some package system), I always remove the other versions of
> libs I don't want. Having multiple lib versions can become
> quite confusing.
Yeah, I often get lost about what runs with what...
I thought it might be good to keep the other openssl as is.
(figuring I can look into it later)
So I went with your suggestion to try "--with-openssl=/usr/local/ssl"
Hey, whadda ya know -- phpinfo now reports the server running
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.7f 22 Mar 2005
Thanks a million Hans..
T. Gales & Associates
'Helping People Connect with Technology'
http://www.tgaconnect.com
From lists at zaunere.com Sun Mar 27 19:56:08 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Sun, 27 Mar 2005 19:56:08 -0500
Subject: [nycphp-talk] openssl not being picked up by configure
In-Reply-To: <000001c53325$d4a5cf50$d0893818@oberon1>
Message-ID: <0MKz1m-1DFiY41Vyp-0000O0@mrelay.perfora.net>
> > Looks like /usr/local/ssl is your base directory for the
> > version of OpenSSL you want. Give
> > --with-openssl=/usr/local/ssl a shot....
> >
> > If that works (or even if it doesn't) see what ldconfig has
> > to say about where your libs are. If Linux:
> >
> > ldconfig -p | grep -i ssl
> >
>
> ldconfig -p | grep -i ssl
> libssl.so.0.9.7 (libc6) => /usr/lib/libssl.so.0.9.7
> libssl.so (libc6) => /usr/lib/libssl.so
> libgnutls-openssl.so.11 (libc6) =>
> /usr/lib/libgnutls-openssl.so.11
>
> ls -l --time-style=long-iso /usr/lib/libssl.*
> -rw-r--r-- 1 root root 303232 2004-12-03 14:03 /usr/lib/libssl.a
> ...
>
> ls -l --time-style=long-iso /usr/local/ssl/lib
>
> drwxr-xr-x 3 root root 136 2005-03-27 10:40 .
> drwxr-xr-x 9 root root 248 2005-03-27 14:16 ..
> -rw-r--r-- 1 root root 1813360 2005-03-27 10:40 libcrypto.a
> -rw-r--r-- 1 root root 268380 2005-03-27 10:40 libssl.a
>
> (this is the 0.9.7f I built earlier)
>
> > or, on a BSD:
> >
> > ldconfig -r | grep -i ssl
> >
> Thanks for the BSD-style command -- I will safe store that somewhere...
>
> > And unless you have other dependencies (for instance, the old
> > version of OpenSSL was probably installed using an RPM or
> > some package system), I always remove the other versions of
> > libs I don't want. Having multiple lib versions can become
> > quite confusing.
>
> Yeah, I often get lost about what runs with what...
>
> I thought it might be good to keep the other openssl as is.
> (figuring I can look into it later)
>
> So I went with your suggestion to try "--with-openssl=/usr/local/ssl"
>
> Hey, whadda ya know -- phpinfo now reports the server running
>
> OpenSSL support enabled
> OpenSSL Version OpenSSL 0.9.7f 22 Mar 2005
>
>
> Thanks a million Hans..
No problem - happy it worked.
I'm a little scared that ldconfig reports the other, older lib. Depending on the build tools you're using, and the version, platform, and more voodoo, what ldconfig reports can count more or less.
G... N... U... do that voodoo that you do
---
Hans Zaunere
President, Founder
New York PHP
http://www.nyphp.org
AMP Technology
Supporting Apache, MySQL and PHP
From tgales at tgaconnect.com Sun Mar 27 20:54:24 2005
From: tgales at tgaconnect.com (Tim Gales)
Date: Sun, 27 Mar 2005 20:54:24 -0500
Subject: [nycphp-talk] openssl not being picked up by configure
In-Reply-To: <0MKz1m-1DFiY41Vyp-0000O0@mrelay.perfora.net>
Message-ID: <003301c53339$1146c410$d0893818@oberon1>
> > So I went with your suggestion to try
> "--with-openssl=/usr/local/ssl"
...
> > Thanks a million Hans..
>
> No problem - happy it worked.
>
> I'm a little scared that ldconfig reports the other, older
> lib. Depending on the build tools you're using, and the
> version, platform, and more voodoo, what ldconfig reports can
> count more or less.
>
> G... N... U... do that voodoo that you do
>
Funny you should call it voodoo --
making some of this stuff still seems rather mystical to me.
And having a 'config.guess' in my directory doesn't do much
to instill a lot of confidence in my builds. A lot of the
time, for me, its sort of like 'Wheel of Fortune' building
( Vanna, is there a 'libxml' directory -- oh! oh! I think I
can solve the puzzle now )
I at least feel a little better when the makefile has a
'check' or 'test' target I can try...
T. Gales & Associates
'Helping People Connect with Technology'
http://www.tgaconnect.com
From Cbielanski at inta.org Mon Mar 28 13:02:29 2005
From: Cbielanski at inta.org (Chris Bielanski)
Date: Mon, 28 Mar 2005 13:02:29 -0500
Subject: [nycphp-talk] MySQL throwing silent warnings?
Message-ID: <328AA5243F20DA4DABDC022745BF3A0713141D@INTAMAIL2k3.ny.inta.org>
This one seems unusual to me. I'm using PHP 4.3.2 with MySQL.
I'm getting a bomb when I use flush() and mysql_fetch_object().
When I set my server to E_ALL & ~E_WARN & ~E_NOTICE, the operation
completes as expected. The operation is also successful if I use any
WHERE or LIMIT clauses in my SQL query or comment out flush().
However, when I leave E_WARN in the config or use flush(), I get no
output and I can't get the warning to appear in the browser or error
logs.
This sounds like mysql_fetch_object() is throwing some kind of warning?
Perhaps akin to "no more rows" or some such?
*headdesk-headdesk-headdesk*
Thanks,
Chris Bielanski
Web Programmer,
International Trademark Association,
655 Third Avenue, 10th Floor
New York, NY 10017-5617 USA
+1 (212) 642-1745, f: +1 (212) 768-7796
mailto:cbielanski at inta.org, www.inta.org
INTA -- 125 Years of Excellence
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From jayeshsh at ceruleansky.com Tue Mar 29 12:57:48 2005
From: jayeshsh at ceruleansky.com (Jayesh Sheth)
Date: Tue, 29 Mar 2005 12:57:48 -0500 (EST)
Subject: [nycphp-talk] PHP PayPal IPN Class
Message-ID: <56521.69.86.84.233.1112119068.spork@webmail.ceruleansky.com>
Hello everyone,
I have been looking for a PHP class to process PayPal payments using
PayPal's IPN API for some time now.
I just came across this, which seems to do just that:
http://www.geniegate.com/other/paypal/
I have not looked at its code in detail yet, or tried it out yet, but it
looks promising, and might be useful to others.
Best regards,
- Jay Sheth
From codebowl at gmail.com Tue Mar 29 13:02:05 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Tue, 29 Mar 2005 13:02:05 -0500
Subject: [nycphp-talk] PHP PayPal IPN Class
In-Reply-To: <56521.69.86.84.233.1112119068.spork@webmail.ceruleansky.com>
References: <56521.69.86.84.233.1112119068.spork@webmail.ceruleansky.com>
Message-ID: <8d9a4280050329100211125435@mail.gmail.com>
thanks i was going to start looking for something to accomplish these tasks ;)
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From stephen at musgrave.org Tue Mar 29 13:13:15 2005
From: stephen at musgrave.org (Stephen Musgrave)
Date: Tue, 29 Mar 2005 13:13:15 -0500
Subject: [nycphp-talk] Server Path for HTML IMG SRC?
Message-ID:
Hello List -
Is there a way, maybe an Apache directive in .htaccess, to instruct an
HTML page to look for an image resource if multiple directories without
using PHP?
I have an issue where there is a file that sits in /events/file.php and
it includes images that sit in /events/images/. File.php is also
included in /otherevents/ and the paths to image assets are relative in
file.php, causing the images to 404 because they are looking for the
images in an images directory that doesn't have that particular asset.
Is there a way to instruct Apache to serve up images from another
directory should it not be found at the path that is defined as the img
src?
Thanks,
Stephen
From chsnyder at gmail.com Tue Mar 29 13:18:51 2005
From: chsnyder at gmail.com (csnyder)
Date: Tue, 29 Mar 2005 13:18:51 -0500
Subject: [nycphp-talk] Server Path for HTML IMG SRC?
In-Reply-To:
References:
Message-ID:
On Tue, 29 Mar 2005 13:13:15 -0500, Stephen Musgrave
wrote:
> Is there a way to instruct Apache to serve up images from another
> directory should it not be found at the path that is defined as the img
> src?
Symbolic link to the image directory?
From danielc at analysisandsolutions.com Tue Mar 29 13:26:50 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Tue, 29 Mar 2005 13:26:50 -0500
Subject: [nycphp-talk] Server Path for HTML IMG SRC?
In-Reply-To:
References:
Message-ID: <20050329182650.GA17529@panix.com>
On Tue, Mar 29, 2005 at 01:13:15PM -0500, Stephen Musgrave wrote:
>
> I have an issue where there is a file that sits in /events/file.php and
> it includes images that sit in /events/images/. File.php is also
> included in /otherevents/ and the paths to image assets are relative in
> file.php, causing the images to 404 because they are looking for the
> images in an images directory that doesn't have that particular asset.
You could use symbolic links on the file system.
Or make file.php smarter. Use a variable for the path in the img src's
and have the variable determined according to where the calling file is.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From andrew at plexpod.com Tue Mar 29 16:08:38 2005
From: andrew at plexpod.com (Andrew Yochum)
Date: Tue, 29 Mar 2005 16:08:38 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
Message-ID: <20050329210822.GV16672@zoidberg.digitalpulp.com>
I thought I'd ping the list about this before I dive into this idea.
Has anyone ever tried to set the PHP module as a handler for images?
I have something like this in mind:
AddType application/x-httpd-php .gif
AddType application/x-httpd-php .jpg
AddType application/x-httpd-php .png
Did you have actual binaries behind the requests or scripts? Google
turned up some of the latter, though nothing terribly interesting. I'm
interested in the former - binaries. Were you successful? Any hiccups
or pointers?
Yeah, I'm probably crazy.
Andrew
From danielc at analysisandsolutions.com Tue Mar 29 16:13:10 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Tue, 29 Mar 2005 16:13:10 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
In-Reply-To: <20050329210822.GV16672@zoidberg.digitalpulp.com>
References: <20050329210822.GV16672@zoidberg.digitalpulp.com>
Message-ID: <20050329211310.GA16513@panix.com>
Heya:
On Tue, Mar 29, 2005 at 04:08:38PM -0500, Andrew Yochum wrote:
> I thought I'd ping the list about this before I dive into this idea.
> Has anyone ever tried to set the PHP module as a handler for images?
...snip...
> Did you have actual binaries behind the requests or scripts?
While not exactly what you're talking about, I have used PHP scripts to
dynamically generate images via gd on the fly. Pretty easy.
> Yeah, I'm probably crazy.
Depends. What's the goal?
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From fields at hedge.net Tue Mar 29 16:13:39 2005
From: fields at hedge.net (Adam Fields)
Date: Tue, 29 Mar 2005 16:13:39 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
In-Reply-To: <20050329210822.GV16672@zoidberg.digitalpulp.com>
References: <20050329210822.GV16672@zoidberg.digitalpulp.com>
Message-ID: <20050329211339.GB24516@lola.aquick.org>
On Tue, Mar 29, 2005 at 04:08:38PM -0500, Andrew Yochum wrote:
> I thought I'd ping the list about this before I dive into this idea.
> Has anyone ever tried to set the PHP module as a handler for images?
>
> I have something like this in mind:
> AddType application/x-httpd-php .gif
> AddType application/x-httpd-php .jpg
> AddType application/x-httpd-php .png
>
> Did you have actual binaries behind the requests or scripts? Google
> turned up some of the latter, though nothing terribly interesting. I'm
> interested in the former - binaries. Were you successful? Any hiccups
> or pointers?
>
> Yeah, I'm probably crazy.
I've never done this with php, but we used to do it all the time in
Vignette. You can use this technique to do some cookie get/set for
custom images.
I see no reason why it wouldn't work with php, although I don't
understand your question about binaries.
Also, you can put the AddType in the .htaccess, obviously.
--
- Adam
** I can fix your database problems: http://www.everylastounce.com/mysql.html **
Blog............... [ http://www.aquick.org/blog ]
Links.............. [ http://del.icio.us/fields ]
Photos............. [ http://www.aquick.org/photoblog ]
Experience......... [ http://www.adamfields.com/resume.html ]
Product Reviews: .. [ http://www.buyadam.com/blog ]
From mitch.pirtle at gmail.com Tue Mar 29 16:13:48 2005
From: mitch.pirtle at gmail.com (Mitch Pirtle)
Date: Tue, 29 Mar 2005 16:13:48 -0500
Subject: [nycphp-talk] Server Path for HTML IMG SRC?
In-Reply-To: <20050329182650.GA17529@panix.com>
References:
<20050329182650.GA17529@panix.com>
Message-ID: <330532b605032913137933f423@mail.gmail.com>
On Tue, 29 Mar 2005 13:26:50 -0500, Daniel Convissor
wrote:
>
> You could use symbolic links on the file system.
>
> Or make file.php smarter. Use a variable for the path in the img src's
> and have the variable determined according to where the calling file is.
Or just whip out some regexp-fu with mod_rewrite.
-- Mitch, with an evil grin
From andrew at plexpod.com Tue Mar 29 16:46:23 2005
From: andrew at plexpod.com (Andrew Yochum)
Date: Tue, 29 Mar 2005 16:46:23 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
In-Reply-To: <20050329211310.GA16513@panix.com>
Message-ID: <20050329214556.GW16672@zoidberg.digitalpulp.com>
On Tue, Mar 29, 2005 at 04:13:10PM -0500, Daniel Convissor wrote:
> > Did you have actual binaries behind the requests or scripts?
>
> While not exactly what you're talking about, I have used PHP scripts
> to
> dynamically generate images via gd on the fly. Pretty easy.
Yep, that's fun stuff.
> > Yeah, I'm probably crazy.
>
> Depends. What's the goal?
I'm thinking something along the lines of setting the PHP module as a
handler for image files + a prepend script w/ output bufffering +
sessions + auth (both) + good ol' caching. The goal is to have a
relatively non-invasive way to control access to and modify existing
images in the docroot on-the-fly w/ PHP.
Andrew
From andrew at plexpod.com Tue Mar 29 16:48:49 2005
From: andrew at plexpod.com (Andrew Yochum)
Date: Tue, 29 Mar 2005 16:48:49 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
In-Reply-To: <20050329214556.GW16672@zoidberg.digitalpulp.com>
References: <20050329211310.GA16513@panix.com>
<20050329214556.GW16672@zoidberg.digitalpulp.com>
Message-ID: <20050329214849.GH25473@zoidberg.digitalpulp.com>
On Tue, Mar 29, 2005 at 04:46:23PM -0500, Andrew Yochum wrote:
> > > Yeah, I'm probably crazy.
> >
> > Depends. What's the goal?
>
> I'm thinking something along the lines of setting the PHP module as a
> handler for image files + a prepend script w/ output bufffering +
> sessions + auth (both) + good ol' caching. The goal is to have a
> relatively non-invasive way to control access to and modify existing
> images in the docroot on-the-fly w/ PHP.
Oh, yeah ... throw GD in there, too.
Andrew
From chsnyder at gmail.com Tue Mar 29 16:48:55 2005
From: chsnyder at gmail.com (csnyder)
Date: Tue, 29 Mar 2005 16:48:55 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
In-Reply-To: <20050329210822.GV16672@zoidberg.digitalpulp.com>
References: <20050329210822.GV16672@zoidberg.digitalpulp.com>
Message-ID:
On Tue, 29 Mar 2005 16:08:38 -0500, Andrew Yochum wrote:
> I'm
> interested in the former - binaries. Were you successful? Any hiccups
> or pointers?
>
> Yeah, I'm probably crazy.
>
Like others I ask, why?
If you mean, just putting image binaries in place and running them
through the PHP handler, it could work but will the right Content-Type
header be sent? No, prolly not.
You could use an auto_prepend to handle headers. If you have an
accelerator in place it shouldn't be *that* much slower than Apache,
although I would worry about memory usage on BIG images.
From chsnyder at gmail.com Tue Mar 29 16:48:55 2005
From: chsnyder at gmail.com (csnyder)
Date: Tue, 29 Mar 2005 16:48:55 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
In-Reply-To: <20050329210822.GV16672@zoidberg.digitalpulp.com>
References: <20050329210822.GV16672@zoidberg.digitalpulp.com>
Message-ID:
On Tue, 29 Mar 2005 16:08:38 -0500, Andrew Yochum wrote:
> I'm
> interested in the former - binaries. Were you successful? Any hiccups
> or pointers?
>
> Yeah, I'm probably crazy.
>
Like others I ask, why?
If you mean, just putting image binaries in place and running them
through the PHP handler, it could work but will the right Content-Type
header be sent? No, prolly not.
You could use an auto_prepend to handle headers. If you have an
accelerator in place it shouldn't be *that* much slower than Apache,
although I would worry about memory usage on BIG images.
From andrew at plexpod.com Tue Mar 29 17:04:40 2005
From: andrew at plexpod.com (Andrew Yochum)
Date: Tue, 29 Mar 2005 17:04:40 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
In-Reply-To: <20050329211339.GB24516@lola.aquick.org>
References: <20050329210822.GV16672@zoidberg.digitalpulp.com>
<20050329211339.GB24516@lola.aquick.org>
Message-ID: <20050329220440.GI25473@zoidberg.digitalpulp.com>
On Tue, Mar 29, 2005 at 04:13:39PM -0500, Adam Fields wrote:
> On Tue, Mar 29, 2005 at 04:08:38PM -0500, Andrew Yochum wrote:
> > I thought I'd ping the list about this before I dive into this idea.
> > Has anyone ever tried to set the PHP module as a handler for images?
> >
> > I have something like this in mind:
> > AddType application/x-httpd-php .gif
> > AddType application/x-httpd-php .jpg
> > AddType application/x-httpd-php .png
> >
> > Did you have actual binaries behind the requests or scripts? Google
> > turned up some of the latter, though nothing terribly interesting. I'm
> > interested in the former - binaries. Were you successful? Any hiccups
> > or pointers?
> >
> > Yeah, I'm probably crazy.
>
> I've never done this with php, but we used to do it all the time in
> Vignette. You can use this technique to do some cookie get/set for
> custom images.
I did some of that in Vignette StoryServer waaay back, too. IIRC they
went so far as to call them "chips".
> I see no reason why it wouldn't work with php, although I don't
> understand your question about binaries.
Well, basically I want to insert PHP before and after an image is served
with a prepend / postpend script. I had output buffering in my mind
because I figured the script flow at some point would be turned to the
image itself and this is where I think some possible quirkiness may
arise. I imagined something like this:
- prepend script runs
- sets up session
- checks auth
- output might be sent and script execution stopped for some
reason
- starts output buffering
- requested "script" runs (the image!)
- postpend script runs
- grabs output buffer
- modifies, replaces, etc the image
- caches the result given context
- sends image to the browser
I can see not actually having to do the output buffering by having the
execution always stop in the prepend. If the image itself is to be used
in the output, you can grab it from REUQUEST_URI and read it off the
filesystem. Something like:
- prepend script runs
- sets up session
- checks auth
- generate output, might modify, replace, etc the image
- caches the result given context
- sends image to the browser
- exit()
- requested "script" never runs (the image!)
This is probably the more sane approach to this.
The end-game is to insert some functionality in place of images without
moving them/replacing them in the docroot.
Andrew
From andrew at digitalpulp.com Tue Mar 29 17:08:20 2005
From: andrew at digitalpulp.com (Andrew Yochum)
Date: Tue, 29 Mar 2005 17:08:20 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
In-Reply-To:
References: <20050329210822.GV16672@zoidberg.digitalpulp.com>
Message-ID: <20050329220819.GJ25473@zoidberg.digitalpulp.com>
On Tue, Mar 29, 2005 at 04:48:55PM -0500, csnyder wrote:
> On Tue, 29 Mar 2005 16:08:38 -0500, Andrew Yochum wrote:
> > I'm
> > interested in the former - binaries. Were you successful? Any hiccups
> > or pointers?
> >
> > Yeah, I'm probably crazy.
> >
>
> Like others I ask, why?
>
> If you mean, just putting image binaries in place and running them
> through the PHP handler, it could work but will the right Content-Type
> header be sent? No, prolly not.
>
> You could use an auto_prepend to handle headers. If you have an
Yeah, thats what I had in mind. See my last post.
> accelerator in place it shouldn't be *that* much slower than Apache,
> although I would worry about memory usage on BIG images.
Hmph, good point. Hadn't thought about the accelerators. Might be able
to turn off the caching for some scripts? I'm pretty sure Zend's can.
Andrew
From andrew at plexpod.com Tue Mar 29 17:10:55 2005
From: andrew at plexpod.com (Andrew Yochum)
Date: Tue, 29 Mar 2005 17:10:55 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
In-Reply-To: <20050329220819.GJ25473@zoidberg.digitalpulp.com>
References: <20050329210822.GV16672@zoidberg.digitalpulp.com>
<20050329220819.GJ25473@zoidberg.digitalpulp.com>
Message-ID: <20050329221055.GK25473@zoidberg.digitalpulp.com>
On Tue, Mar 29, 2005 at 05:08:20PM -0500, Andrew Yochum wrote:
> On Tue, Mar 29, 2005 at 04:48:55PM -0500, csnyder wrote:
> > accelerator in place it shouldn't be *that* much slower than Apache,
> > although I would worry about memory usage on BIG images.
>
> Hmph, good point. Hadn't thought about the accelerators. Might be able
> to turn off the caching for some scripts? I'm pretty sure Zend's can.
Actually, if the execution ends in the prepend like I described in a
previous post, does the binary ever get hit by the accelerator? Is this
accelerator-specific?
Andrew
From chsnyder at gmail.com Tue Mar 29 17:16:06 2005
From: chsnyder at gmail.com (csnyder)
Date: Tue, 29 Mar 2005 17:16:06 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
In-Reply-To: <20050329221055.GK25473@zoidberg.digitalpulp.com>
References: <20050329210822.GV16672@zoidberg.digitalpulp.com>
<20050329220819.GJ25473@zoidberg.digitalpulp.com>
<20050329221055.GK25473@zoidberg.digitalpulp.com>
Message-ID:
On Tue, 29 Mar 2005 17:10:55 -0500, Andrew Yochum wrote:
> Actually, if the execution ends in the prepend like I described in a
> previous post, does the binary ever get hit by the accelerator? Is this
> accelerator-specific?
My only point was that the prepend would be opcode. If there aren't
any filename resolution won't you? Maybe not that much
time, never mind.
--
Chris Snyder
http://chxo.com/
From andrew at plexpod.com Tue Mar 29 17:17:05 2005
From: andrew at plexpod.com (Andrew Yochum)
Date: Tue, 29 Mar 2005 17:17:05 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
In-Reply-To: <20050329220440.GI25473@zoidberg.digitalpulp.com>
References: <20050329210822.GV16672@zoidberg.digitalpulp.com>
<20050329211339.GB24516@lola.aquick.org>
<20050329220440.GI25473@zoidberg.digitalpulp.com>
Message-ID: <20050329221705.GL25473@zoidberg.digitalpulp.com>
On Tue, Mar 29, 2005 at 05:04:40PM -0500, Andrew Yochum wrote:
> - postpend script runs
I said postpend? Yeah... er.. append.
I'm tired. I blame it on the twins.
Andrew
From andrew at digitalpulp.com Tue Mar 29 17:29:23 2005
From: andrew at digitalpulp.com (Andrew Yochum)
Date: Tue, 29 Mar 2005 17:29:23 -0500
Subject: [nycphp-talk] AddType application/x-httpd-php .gif .jpg .etc
In-Reply-To:
References: <20050329210822.GV16672@zoidberg.digitalpulp.com>
<20050329220819.GJ25473@zoidberg.digitalpulp.com>
<20050329221055.GK25473@zoidberg.digitalpulp.com>
Message-ID: <20050329222923.GM25473@zoidberg.digitalpulp.com>
On Tue, Mar 29, 2005 at 05:16:06PM -0500, csnyder wrote:
> On Tue, 29 Mar 2005 17:10:55 -0500, Andrew Yochum wrote:
>
> > Actually, if the execution ends in the prepend like I described in a
> > previous post, does the binary ever get hit by the accelerator? Is this
> > accelerator-specific?
>
> My only point was that the prepend would be opcode. If there aren't
> any right?
Does anyone know if the accelerators are smart enough to 'pass through'
flat content like this and not stuff a bloated binary or even a good ol'
text/plain file in memory?
> If you use just the prepend you'll spend some time second-guessing
> Apache's request -> filename resolution won't you? Maybe not that much
> time, never mind.
Possibly. Quite likely if theres some rewrite stuff in there. However,
I believe one of the magic $_SERVER values would have the post request
-> filename resolution to-be-run script path in it? Unsure which off
the top of my head.
Andrew
From andrew at plexpod.com Tue Mar 29 17:34:52 2005
From: andrew at plexpod.com (Andrew Yochum)
Date: Tue, 29 Mar 2005 17:34:52 -0500
Subject: [nycphp-talk] Server Path for HTML IMG SRC?
In-Reply-To: <330532b605032913137933f423@mail.gmail.com>
References:
<20050329182650.GA17529@panix.com>
<330532b605032913137933f423@mail.gmail.com>
Message-ID: <20050329223452.GN25473@zoidberg.digitalpulp.com>
On Tue, Mar 29, 2005 at 04:13:48PM -0500, Mitch Pirtle wrote:
> On Tue, 29 Mar 2005 13:26:50 -0500, Daniel Convissor
> wrote:
> >
> > You could use symbolic links on the file system.
> >
> > Or make file.php smarter. Use a variable for the path in the img src's
> > and have the variable determined according to where the calling file is.
>
> Or just whip out some regexp-fu with mod_rewrite.
Or a smart 404 script?
Andrew
From 1j0lkq002 at sneakemail.com Tue Mar 29 18:46:40 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Tue, 29 Mar 2005 15:46:40 -0800 (PST)
Subject: [nycphp-talk] Server Path for HTML IMG SRC?
Message-ID: <27639-83654@sneakemail.com>
Yeah, I was waiting to see if that got suggested, or a more generic handler.
Actually I think Apache could handle it with a Files container, perhaps inside a directory if needed to protect the rest of the site. SetHandler GoodFile and that can go into htaccess as well.
Working out the details is a-trivial for me because my brain starting hurting on this specific example:
? are all images in /events/images or are some in /otherevent/images
? why name a script file.php... and why copy it to multiple locations.... SetHandler File it is soo confusing :-D Go ahead and try it and accidentally set yourself into a recursive loop.... like I did. Bleh.
This is an example of how a site designed around the filesystem can start to get in its own way, although this specific example is especially "difficult"
-=john andrews
-----Original Message-----
From:
"Andrew Yochum andrew-at-plexpod.com |nyphp dev/internal group use|" <...>
Sent: Mar 29, 2005 2:34 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Server Path for HTML IMG SRC?
On Tue, Mar 29, 2005 at 04:13:48PM -0500, Mitch Pirtle wrote:
> On Tue, 29 Mar 2005 13:26:50 -0500, Daniel Convissor
> wrote:
> >
> > You could use symbolic links on the file system.
> >
> > Or make file.php smarter. Use a variable for the path in the img src's
> > and have the variable determined according to where the calling file is.
>
> Or just whip out some regexp-fu with mod_rewrite.
Or a smart 404 script?
Andrew
_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org
From 1j0lkq002 at sneakemail.com Tue Mar 29 19:45:15 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Tue, 29 Mar 2005 16:45:15 -0800 (PST)
Subject: [nycphp-talk] Server Path for HTML IMG SRC?
Message-ID: <12898-12758@sneakemail.com>
recall that trash. I don't know what I was thinking... I'll be quiet now.
-----Original Message-----
From:
"inforequest 1j0lkq002-at-sneakemail.com |nyphp dev/internal group use|" <...>
Sent: Mar 29, 2005 3:46 PM
To: talk at lists.nyphp.org
Subject: Re: [nycphp-talk] Server Path for HTML IMG SRC?
Yeah, I was waiting to see if that got suggested, or a more generic handler.
Actually I think Apache could handle it with a Files container, perhaps inside a directory if needed to protect the rest of the site. SetHandler GoodFile and that can go into htaccess as well.
Working out the details is a-trivial for me because my brain starting hurting on this specific example:
From nyphp at aspl.in Tue Mar 29 23:29:42 2005
From: nyphp at aspl.in (Anirudh Zala)
Date: Wed, 30 Mar 2005 09:59:42 +0530
Subject: [nycphp-talk] Server Path for HTML IMG SRC?
References:
Message-ID: <009201c534e1$193c5f00$10cc000a@aum1>
I may not be answering what exactly you are looking for, but on the 1 hand
you want to use non PHP method to solve your problem, while on other hand
you describe your problem as part of "file.php". I suggest that if you
already have control over your "file.php" then why do u want to use non PHP
method to server images dynamically? Why not to use "file.php" it self for
searching images at multiple locations?
Thanks
Anirudh Zala
----- Original Message -----
From: "Stephen Musgrave"
To:
Sent: Tuesday, March 29, 2005 11:43 PM
Subject: [nycphp-talk] Server Path for HTML IMG SRC?
> Hello List -
>
> Is there a way, maybe an Apache directive in .htaccess, to instruct an
> HTML page to look for an image resource if multiple directories without
> using PHP?
>
> I have an issue where there is a file that sits in /events/file.php and
> it includes images that sit in /events/images/. File.php is also
> included in /otherevents/ and the paths to image assets are relative in
> file.php, causing the images to 404 because they are looking for the
> images in an images directory that doesn't have that particular asset.
>
> Is there a way to instruct Apache to serve up images from another
> directory should it not be found at the path that is defined as the img
> src?
>
> Thanks,
>
> Stephen
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From john at cyber-ny.com Wed Mar 30 09:58:04 2005
From: john at cyber-ny.com (John Nunez)
Date: Wed, 30 Mar 2005 09:58:04 -0500
Subject: [nycphp-talk] How can I import accented characters into MySQL?
Message-ID: <9ef529bcd599eae4067a387eafc3373a@cyber-ny.com>
Hi Guys,
How can I export a file from Excel which has 1000's of names that uses
German, French, Spanish accented characters to MySQL 3.23.58? I know
that MySQL 4 has unicode but upgrading this database is not possible
right now.
Thanks,
John Nunez
From woodwort at agritec.net Wed Mar 30 10:08:22 2005
From: woodwort at agritec.net (woodwort)
Date: Wed, 30 Mar 2005 10:08:22 -0500
Subject: [nycphp-talk] How can I import accented characters into MySQL?
In-Reply-To: <9ef529bcd599eae4067a387eafc3373a@cyber-ny.com>
References: <9ef529bcd599eae4067a387eafc3373a@cyber-ny.com>
Message-ID: <424AC0E6.4080006@agritec.net>
I think the easiest way is to save the excel sheet as csv.
Then you can create a quick script that explodes the data.
Run the data through htmlentities and output a SQL statement for each line.
I could probably organize a sample script if you need it.
Good Luck.
Garrett
John Nunez wrote:
> Hi Guys,
>
> How can I export a file from Excel which has 1000's of names that uses
> German, French, Spanish accented characters to MySQL 3.23.58? I know
> that MySQL 4 has unicode but upgrading this database is not possible
> right now.
>
> Thanks,
> John Nunez
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
>
From john at cyber-ny.com Wed Mar 30 10:11:23 2005
From: john at cyber-ny.com (John Nunez)
Date: Wed, 30 Mar 2005 10:11:23 -0500
Subject: [nycphp-talk] How can I import accented characters into MySQL?
In-Reply-To: <424AC0E6.4080006@agritec.net>
References: <9ef529bcd599eae4067a387eafc3373a@cyber-ny.com>
<424AC0E6.4080006@agritec.net>
Message-ID: <0d8b1d5394d78944100e907eedfcc945@cyber-ny.com>
Hey Garrett,
Thanks, I can write the script but will htmlentities handle all types
of accented characters?
Thanks Again,
John
On Mar 30, 2005, at 10:08 AM, woodwort wrote:
> I think the easiest way is to save the excel sheet as csv.
> Then you can create a quick script that explodes the data.
> Run the data through htmlentities and output a SQL statement for each
> line.
> I could probably organize a sample script if you need it.
>
> Good Luck.
> Garrett
>
>
> John Nunez wrote:
>
>> Hi Guys,
>>
>> How can I export a file from Excel which has 1000's of names that
>> uses German, French, Spanish accented characters to MySQL 3.23.58? I
>> know that MySQL 4 has unicode but upgrading this database is not
>> possible right now.
>>
>> Thanks,
>> John Nunez
>>
>> _______________________________________________
>> New York PHP Talk Mailing List
>> AMP Technology
>> Supporting Apache, MySQL and PHP
>> http://lists.nyphp.org/mailman/listinfo/talk
>> http://www.nyphp.org
>>
>>
>
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From brian at vermonster.com Wed Mar 30 10:21:15 2005
From: brian at vermonster.com (Brian Kaney)
Date: Wed, 30 Mar 2005 10:21:15 -0500
Subject: [nycphp-talk] How can I import accented characters into MySQL?
In-Reply-To: <0d8b1d5394d78944100e907eedfcc945@cyber-ny.com>
References: <9ef529bcd599eae4067a387eafc3373a@cyber-ny.com>
<424AC0E6.4080006@agritec.net>
<0d8b1d5394d78944100e907eedfcc945@cyber-ny.com>
Message-ID: <1112196075.15095.7.camel@brian.vermonster.com>
On Wed, 2005-03-30 at 10:11, John Nunez wrote:
> Hey Garrett,
>
> Thanks, I can write the script but will htmlentities handle all types
> of accented characters?
>
John,
It should if you make sure your table collation is using the correct
character set.
http://dev.mysql.com/doc/mysql/en/charset-defaults.html
- Brian
From woodwort at agritec.net Wed Mar 30 10:20:56 2005
From: woodwort at agritec.net (woodwort)
Date: Wed, 30 Mar 2005 10:20:56 -0500
Subject: [nycphp-talk] How can I import accented characters into MySQL?
In-Reply-To: <0d8b1d5394d78944100e907eedfcc945@cyber-ny.com>
References: <9ef529bcd599eae4067a387eafc3373a@cyber-ny.com> <424AC0E6.4080006@agritec.net>
<0d8b1d5394d78944100e907eedfcc945@cyber-ny.com>
Message-ID: <424AC3D8.9090606@agritec.net>
I think it will, depending on the charset. But if one of the accents is
not handle properly, you could use preg_replace, changing it to
something that you can convert back later when you output.
have fun,
Garrett
John Nunez wrote:
> Hey Garrett,
>
> Thanks, I can write the script but will htmlentities handle all types
> of accented characters?
>
>
> Thanks Again,
> John
>
> On Mar 30, 2005, at 10:08 AM, woodwort wrote:
>
>> I think the easiest way is to save the excel sheet as csv.
>> Then you can create a quick script that explodes the data.
>> Run the data through htmlentities and output a SQL statement for each
>> line.
>> I could probably organize a sample script if you need it.
>>
>> Good Luck.
>> Garrett
>>
>>
>> John Nunez wrote:
>>
>>> Hi Guys,
>>>
>>> How can I export a file from Excel which has 1000's of names that
>>> uses German, French, Spanish accented characters to MySQL 3.23.58?
>>> I know that MySQL 4 has unicode but upgrading this database is not
>>> possible right now.
>>>
>>> Thanks,
>>> John Nunez
>>>
>>> _______________________________________________
>>> New York PHP Talk Mailing List
>>> AMP Technology
>>> Supporting Apache, MySQL and PHP
>>> http://lists.nyphp.org/mailman/listinfo/talk
>>> http://www.nyphp.org
>>>
>>>
>>
>>
>> _______________________________________________
>> New York PHP Talk Mailing List
>> AMP Technology
>> Supporting Apache, MySQL and PHP
>> http://lists.nyphp.org/mailman/listinfo/talk
>> http://www.nyphp.org
>>
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
>
From Cbielanski at inta.org Wed Mar 30 10:59:18 2005
From: Cbielanski at inta.org (Chris Bielanski)
Date: Wed, 30 Mar 2005 10:59:18 -0500
Subject: [nycphp-talk] How can I import accented characters into MySQL?
Message-ID: <328AA5243F20DA4DABDC022745BF3A0713186D@INTAMAIL2k3.ny.inta.org>
Alternately, you could try urlencode() on your data before insertion. It
may not work perfectly, but I think it's worth a shot.
Thanks,
Chris Bielanski
Web Programmer,
International Trademark Association,
655 Third Avenue, 10th Floor
New York, NY 10017-5617 USA
+1 (212) 642-1745, f: +1 (212) 768-7796
mailto:cbielanski at inta.org, www.inta.org
INTA -- 125 Years of Excellence
> -----Original Message-----
> From: talk-bounces at lists.nyphp.org
> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of woodwort
> Sent: Wednesday, March 30, 2005 10:08 AM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] How can I import accented
> characters into MySQL?
>
> I think the easiest way is to save the excel sheet as csv.
> Then you can create a quick script that explodes the data.
> Run the data through htmlentities and output a SQL statement
> for each line.
> I could probably organize a sample script if you need it.
>
> Good Luck.
> Garrett
>
>
> John Nunez wrote:
>
> > Hi Guys,
> >
> > How can I export a file from Excel which has 1000's of
> names that uses
> > German, French, Spanish accented characters to MySQL
> 3.23.58? I know
> > that MySQL 4 has unicode but upgrading this database is not
> possible
> > right now.
> >
> > Thanks,
> > John Nunez
> >
> > _______________________________________________
> > New York PHP Talk Mailing List
> > AMP Technology
> > Supporting Apache, MySQL and PHP
> > http://lists.nyphp.org/mailman/listinfo/talk
> > http://www.nyphp.org
> >
> >
>
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From alexchan.1976 at gmail.com Wed Mar 30 13:53:04 2005
From: alexchan.1976 at gmail.com (Alex C)
Date: Wed, 30 Mar 2005 13:53:04 -0500
Subject: [nycphp-talk] PHP 5 soap extension...
Message-ID: <8f494f7605033010535516b34f@mail.gmail.com>
Hi everybody,
I am posting here in hopes somebody can help me. I am using the PHP 5 extension.
i would like to know if i can do the following.
include 'clasname.inc';
$server = new SoapServer('some.wsdl');
$server->setClass('classname');
$server->handle();
thanks in advance,
alex
From adam at trachtenberg.com Wed Mar 30 13:58:23 2005
From: adam at trachtenberg.com (Adam Maccabee Trachtenberg)
Date: Wed, 30 Mar 2005 13:58:23 -0500 (EST)
Subject: [nycphp-talk] PHP 5 soap extension...
In-Reply-To: <8f494f7605033010535516b34f@mail.gmail.com>
References: <8f494f7605033010535516b34f@mail.gmail.com>
Message-ID:
On Wed, 30 Mar 2005, Alex C wrote:
> include 'clasname.inc';
>
> $server = new SoapServer('some.wsdl');
> $server->setClass('classname');
> $server->handle();
Are you asking if you can make SoapServer bind to an included class?
If so, yes. It doesn't matter if the class is included or embedded in
the file.
If I'm misunderstanding, please try again. :)
-adam
--
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!
From alexchan.1976 at gmail.com Wed Mar 30 14:12:44 2005
From: alexchan.1976 at gmail.com (Alex C)
Date: Wed, 30 Mar 2005 14:12:44 -0500
Subject: [nycphp-talk] PHP 5 soap extension...
In-Reply-To:
References: <8f494f7605033010535516b34f@mail.gmail.com>
Message-ID: <8f494f7605033011122cbe591e@mail.gmail.com>
sorry for the vagness..what i want to do is bind various member
functions to a single class. Will that make nice with the WSDL ?
On Wed, 30 Mar 2005 13:58:23 -0500 (EST), Adam Maccabee Trachtenberg
wrote:
> On Wed, 30 Mar 2005, Alex C wrote:
>
> > include 'clasname.inc';
> >
> > $server = new SoapServer('some.wsdl');
> > $server->setClass('classname');
> > $server->handle();
>
> Are you asking if you can make SoapServer bind to an included class?
> If so, yes. It doesn't matter if the class is included or embedded in
> the file.
>
> If I'm misunderstanding, please try again. :)
>
> -adam
>
> --
> adam at trachtenberg.com | http://www.trachtenberg.com
> author of o'reilly's "upgrading to php 5" and "php cookbook"
> avoid the holiday rush, buy your copies today!
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
From adam at trachtenberg.com Wed Mar 30 14:40:50 2005
From: adam at trachtenberg.com (Adam Maccabee Trachtenberg)
Date: Wed, 30 Mar 2005 14:40:50 -0500 (EST)
Subject: [nycphp-talk] PHP 5 soap extension...
In-Reply-To: <8f494f7605033011122cbe591e@mail.gmail.com>
References: <8f494f7605033010535516b34f@mail.gmail.com>
<8f494f7605033011122cbe591e@mail.gmail.com>
Message-ID:
On Wed, 30 Mar 2005, Alex C wrote:
> sorry for the vagness..what i want to do is bind various member
> functions to a single class. Will that make nice with the WSDL ?
Depending on the WSDL, yes. I would try it and see.
-adam
--
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!
From danielc at analysisandsolutions.com Wed Mar 30 18:23:40 2005
From: danielc at analysisandsolutions.com (Daniel Convissor)
Date: Wed, 30 Mar 2005 18:23:40 -0500
Subject: [nycphp-talk] my mysql tutorial page
Message-ID: <20050330232339.GA9768@panix.com>
Hey Folks:
Wow. A recent developmnt. My "MySQL Basics -- A MySQL Tutorial" page is
now the number one hit on google for the search "mysql tutorial"!
http://www.google.com/search?q=mysql+tutorial
http://www.analysisandsolutions.com/code/mybasic.htm
Hmm... maybe it's time to consider getting an advertiser on the page...
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
From lists at zaunere.com Wed Mar 30 18:53:59 2005
From: lists at zaunere.com (Hans Zaunere)
Date: Wed, 30 Mar 2005 18:53:59 -0500
Subject: [nycphp-talk] FW: Report: P-Languages Better For Enterprise
Message-ID: <20050330234912.DF71A99E0@mailrelay.t-mobile.com>
> Report: P-Languages Better For Enterprise
> By Michael Singer
> March 25, 2005
>
> http://internetnews.com/dev-news/article.php/3492771
---
Hans Zaunere
President, Founder
New York PHP
http://www.nyphp.org
AMP Technology
Supporting Apache, MySQL and PHP
From fields at hedge.net Wed Mar 30 19:15:15 2005
From: fields at hedge.net (Adam Fields)
Date: Wed, 30 Mar 2005 19:15:15 -0500
Subject: [nycphp-talk] FW: Report: P-Languages Better For Enterprise
In-Reply-To: <20050330234912.DF71A99E0@mailrelay.t-mobile.com>
References: <20050330234912.DF71A99E0@mailrelay.t-mobile.com>
Message-ID: <20050331001514.GH30454@lola.aquick.org>
On Wed, Mar 30, 2005 at 06:53:59PM -0500, Hans Zaunere wrote:
>
> > Report: P-Languages Better For Enterprise
> > By Michael Singer
> > March 25, 2005
> >
> > http://internetnews.com/dev-news/article.php/3492771
There's a big section in this article about security. I think the
assessment included is misleading in a number of ways (for one - not
discussing the total number of apps, just the number of exploits), but
it does have an important conclusion - which is still true - it's
still pretty easy to write code that falls prey to common security
holes, regardless of what platform you're on. Be careful out there.
--
- Adam
** I can fix your database problems: http://www.everylastounce.com/mysql.html **
Blog............... [ http://www.aquick.org/blog ]
Links.............. [ http://del.icio.us/fields ]
Photos............. [ http://www.aquick.org/photoblog ]
Experience......... [ http://www.adamfields.com/resume.html ]
Product Reviews: .. [ http://www.buyadam.com/blog ]
From 1j0lkq002 at sneakemail.com Wed Mar 30 19:46:33 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Wed, 30 Mar 2005 19:46:33 -0500 (GMT-05:00)
Subject: [nycphp-talk] my mysql tutorial page
Message-ID: <3251-26140@sneakemail.com>
Good work, Dan. Did you have doubts you could do it?
(I seem to recall you did a wee bit of optimization at the end of January?)
I hope you'll share a little stats down the road, like the relative difference between #1 and where you were before (I think it was 2 or 3?)
-=john
-----Original Message-----
From:
"Daniel Convissor danielc-at-analysisandsolutions.com |nyphp dev/internal group use|" <...>
Sent: Mar 30, 2005 6:23 PM
To: NYPHP Talk
Subject: [nycphp-talk] my mysql tutorial page
Hey Folks:
Wow. A recent developmnt. My "MySQL Basics -- A MySQL Tutorial" page is
now the number one hit on google for the search "mysql tutorial"!
http://www.google.com/search?q=mysql+tutorial
http://www.analysisandsolutions.com/code/mybasic.htm
Hmm... maybe it's time to consider getting an advertiser on the page...
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org
From 1j0lkq002 at sneakemail.com Wed Mar 30 19:52:37 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Wed, 30 Mar 2005 19:52:37 -0500 (GMT-05:00)
Subject: [nycphp-talk] FW: Report: P-Languages Better For Enterprise
Message-ID: <7895-29896@sneakemail.com>
I knew they should have named that other one "Pubie". Now their choice will go down as a classic mistake as they are left out of the P-club ;-)
-=john
-----Original Message-----
From:
"Hans Zaunere lists-at-zaunere.com |nyphp dev/internal group use|" <...>
Sent: Mar 30, 2005 6:53 PM
To: 'NYPHP Talk'
Subject: [nycphp-talk] FW: Report: P-Languages Better For Enterprise
> Report: P-Languages Better For Enterprise
> By Michael Singer
> March 25, 2005
>
> http://internetnews.com/dev-news/article.php/3492771
---
Hans Zaunere
President, Founder
New York PHP
http://www.nyphp.org
AMP Technology
Supporting Apache, MySQL and PHP
_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org
From jeff.loiselle at gmail.com Wed Mar 30 21:19:02 2005
From: jeff.loiselle at gmail.com (Jeff Loiselle)
Date: Wed, 30 Mar 2005 21:19:02 -0500
Subject: [nycphp-talk] my mysql tutorial page
In-Reply-To: <3251-26140@sneakemail.com>
References: <3251-26140@sneakemail.com>
Message-ID: <4b18871105033018193191042f@mail.gmail.com>
Maybe Dan was arguing less and paying more attention at your January
talk John. ;-) Good work Dan.
On Mar 30, 2005 7:46 PM, inforequest <1j0lkq002 at sneakemail.com> wrote:
>
> Good work, Dan. Did you have doubts you could do it?
>
> (I seem to recall you did a wee bit of optimization at the end of January?)
>
> I hope you'll share a little stats down the road, like the relative difference between #1 and where you were before (I think it was 2 or 3?)
>
> -=john
>
> -----Original Message-----
> From:
> "Daniel Convissor danielc-at-analysisandsolutions.com |nyphp dev/internal group use|" <...>
> Sent: Mar 30, 2005 6:23 PM
> To: NYPHP Talk
> Subject: [nycphp-talk] my mysql tutorial page
>
> Hey Folks:
>
> Wow. A recent developmnt. My "MySQL Basics -- A MySQL Tutorial" page is
> now the number one hit on google for the search "mysql tutorial"!
> http://www.google.com/search?q=mysql+tutorial
> http://www.analysisandsolutions.com/code/mybasic.htm
>
> Hmm... maybe it's time to consider getting an advertiser on the page...
>
> --Dan
>
> --
> T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
> data intensive web and database programming
> http://www.AnalysisAndSolutions.com/
> 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
--
---
Jeff Loiselle
Web Developer, Musician, and Observer
http://jeff.loiselles.com
From 1j0lkq002 at sneakemail.com Thu Mar 31 00:06:27 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Thu, 31 Mar 2005 00:06:27 -0500
Subject: [nycphp-talk] my mysql tutorial page
In-Reply-To: <20050330232339.GA9768@panix.com>
References: <20050330232339.GA9768@panix.com>
Message-ID: <24258-82962@sneakemail.com>
Daniel Convissor danielc-at-analysisandsolutions.com |nyphp dev/internal
group use| wrote:
>Hey Folks:
>
>Wow. A recent developmnt. My "MySQL Basics -- A MySQL Tutorial" page is
>now the number one hit on google for the search "mysql tutorial"!
>http://www.google.com/search?q=mysql+tutorial
>http://www.analysisandsolutions.com/code/mybasic.htm
>
>Hmm... maybe it's time to consider getting an advertiser on the page...
>
>--Dan
>
For those interested the start of a Google index update was reported
late March 23 (last Wednesday night) and is still propagating. A page
rank update is expected this weekend as well.
Many people seem to think the impact of "no follow" will show in this
update. One analysis showed 5% of the sites in DMOZ had nofollows on
them, suggesting "no follow" it would have a very large impact on rankings.
There are also many reports of changes to the way back links are valued.
I would wait another week before assuming anything was stable.
-=john andrews
From 1j0lkq002 at sneakemail.com Thu Mar 31 12:13:39 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Thu, 31 Mar 2005 12:13:39 -0500
Subject: [nycphp-talk] [OT] Yahoo! 360 invites available
In-Reply-To: <24258-82962@sneakemail.com>
References: <20050330232339.GA9768@panix.com> <24258-82962@sneakemail.com>
Message-ID: <29957-53376@sneakemail.com>
Yahoo! 360 is in beta and looking good. Flickr integration, blog, nice
UI. . Let me know OFF LIST if you want an invite. http://360.yahoo.com
-=john
From rolan at omnistep.com Thu Mar 31 13:10:14 2005
From: rolan at omnistep.com (Rolan Yang)
Date: Thu, 31 Mar 2005 13:10:14 -0500
Subject: [nycphp-talk] [OT] Yahoo! 360 invites available
In-Reply-To: <29957-53376@sneakemail.com>
References: <20050330232339.GA9768@panix.com> <24258-82962@sneakemail.com>
<29957-53376@sneakemail.com>
Message-ID: <424C3D06.3050204@omnistep.com>
i want an invite!
inforequest wrote:
> Yahoo! 360 is in beta and looking good. Flickr integration, blog, nice
> UI. . Let me know OFF LIST if you want an invite. http://360.yahoo.com
>
> -=john
>
>
From rolan at omnistep.com Thu Mar 31 13:12:05 2005
From: rolan at omnistep.com (Rolan Yang)
Date: Thu, 31 Mar 2005 13:12:05 -0500
Subject: [nycphp-talk] [OT] Yahoo! 360 invites available
In-Reply-To: <29957-53376@sneakemail.com>
References: <20050330232339.GA9768@panix.com> <24258-82962@sneakemail.com>
<29957-53376@sneakemail.com>
Message-ID: <424C3D75.4070309@omnistep.com>
Yipes! Sorry about that! My itchy trigger finger fired off the send
before I could change the To: address.
From 1j0lkq002 at sneakemail.com Thu Mar 31 13:29:58 2005
From: 1j0lkq002 at sneakemail.com (inforequest)
Date: Thu, 31 Mar 2005 13:29:58 -0500
Subject: [nycphp-talk] [OT] Yahoo! 360 invites OFF LIST
In-Reply-To: <29957-53376@sneakemail.com>
References: <20050330232339.GA9768@panix.com> <24258-82962@sneakemail.com>
<29957-53376@sneakemail.com>
Message-ID: <392-51928@sneakemail.com>
inforequest 1j0lkq002-at-sneakemail.com |nyphp dev/internal group use|
wrote:
> Yahoo! 360 is in beta and looking good. Flickr integration, blog, nice
> UI. . Let me know OFF LIST if you want an invite. http://360.yahoo.com
>
> -=john
Hmmm.. so as NOT to reward sloppiness, I will spond promptly to all
requests sent to me OFF LIST. (that's a clue, for any one who might be
clue-less)
From codebowl at gmail.com Thu Mar 31 15:20:47 2005
From: codebowl at gmail.com (Joseph Crawford)
Date: Thu, 31 Mar 2005 15:20:47 -0500
Subject: [nycphp-talk] PHP Mysql Function Help
Message-ID: <8d9a42800503311220717e1cbc@mail.gmail.com>
Can anyone here tell me why i am getting these results.
public function Query( $sql = "" ) {
$this->_result = mysql_query( $sql, $this->_link );
if( $this->_result == false ) throw new MySqlEx( 'MySQL Error:
'.mysql_error() );
return $this->_result;
}
if i pass that a query trying to query a table that does not exist
then the exception is actually thrown but without an error so it
seems. If i do or die on the mysql query function it dies with the
error message but isnt passing it to my exception constructor.
--
Joseph Crawford Jr.
Codebowl Solutions
codebowl at gmail.com
From dmintz at davidmintz.org Thu Mar 31 16:27:26 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Thu, 31 Mar 2005 16:27:26 -0500 (EST)
Subject: [nycphp-talk] PHP 5 singleton/destructor question
Message-ID:
I can't seem to get my destructor to run and I wonder if somebody can help
me see what I am doing wrong. The goal is simply to have a single instance
of this db connection object and have its close() method called
automatically before the script exits.
class MyDatabase extends mysqli {
private static $db = false;
private function __construct() {
printf("constructing %s... ",__CLASS__);
parent::__construct("host", "user", "password",
"database");
}
public static function getInstance() {
if (self::$db === false) {
self::$db = new MyDatabase();
}
return self::$db;
}
function __destruct() { echo "closing..."; self::$db->close();}
}
$db = MyDatabase::getInstance();
print $db->host_info;
---
OUTPUT
constructing MyDatabase...
localhost via TCP/IP
---
---
David Mintz
http://davidmintz.org/
From chsnyder at gmail.com Thu Mar 31 16:49:01 2005
From: chsnyder at gmail.com (csnyder)
Date: Thu, 31 Mar 2005 16:49:01 -0500
Subject: [nycphp-talk] PHP 5 singleton/destructor question
In-Reply-To:
References:
Message-ID:
On Thu, 31 Mar 2005 16:27:26 -0500 (EST), David Mintz
wrote:
> $db = MyDatabase::getInstance();
> print $db->host_info;
> ---
>
> OUTPUT
> constructing MyDatabase...
> localhost via TCP/IP
> ---
>
... and you expect to see "closing..." after the localhost line, right?
Have you tried unset($db); to after print $db->host_info;?
From dmintz at davidmintz.org Thu Mar 31 16:54:20 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Thu, 31 Mar 2005 16:54:20 -0500 (EST)
Subject: [nycphp-talk] PHP 5 singleton/destructor question
In-Reply-To:
References:
Message-ID:
On Thu, 31 Mar 2005, csnyder wrote:
> On Thu, 31 Mar 2005 16:27:26 -0500 (EST), David Mintz
> wrote:
>
> > $db = MyDatabase::getInstance();
> > print $db->host_info;
> > ---
> >
> > OUTPUT
> > constructing MyDatabase...
> > localhost via TCP/IP
> ... and you expect to see "closing..." after the localhost line, right?
>
Aye, sir.
> Have you tried unset($db); to after print $db->host_info;?
I have indeed (as of just now). Same story.
Thanks,
---
David Mintz
http://davidmintz.org/
From dmintz at davidmintz.org Thu Mar 31 17:02:06 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Thu, 31 Mar 2005 17:02:06 -0500 (EST)
Subject: [nycphp-talk] PHP 5 singleton/destructor question
In-Reply-To:
References:
Message-ID:
OK, here is the ugliest workaround you've seen all day. A pint of beer for
anyone who can explain why I am having to do this. I added to my
constructor:
register_shutdown_function(array($this, '__destruct'));
and it works, so to speak.
---
David Mintz
http://davidmintz.org/
From chsnyder at gmail.com Thu Mar 31 17:14:47 2005
From: chsnyder at gmail.com (csnyder)
Date: Thu, 31 Mar 2005 17:14:47 -0500
Subject: [nycphp-talk] PHP 5 singleton/destructor question
In-Reply-To:
References:
Message-ID:
On Thu, 31 Mar 2005 17:02:06 -0500 (EST), David Mintz
wrote:
>
> OK, here is the ugliest workaround you've seen all day.
Testing your code on my server, I have a few observations.
1) it worked for me BUT I don't have mysqli compiled into this server,
so I wrote a dummy mysqli class
2) PHP complained that the __construct() function was private -- why
is it private?
So I'm guessing that mysqli steps on your destruct() function, and/or
the private construct() is weird-making.
From dmintz at davidmintz.org Thu Mar 31 17:59:01 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Thu, 31 Mar 2005 17:59:01 -0500 (EST)
Subject: [nycphp-talk] PHP 5 singleton/destructor question
In-Reply-To:
References:
Message-ID:
On Thu, 31 Mar 2005, csnyder wrote:
> On Thu, 31 Mar 2005 17:02:06 -0500 (EST), David Mintz
> wrote:
> >
> > OK, here is the ugliest workaround you've seen all day.
>
> Testing your code on my server, I have a few observations.
>
> 1) it worked for me BUT I don't have mysqli compiled into this server,
> so I wrote a dummy mysqli class
>
> 2) PHP complained that the __construct() function was private -- why
> is it private?
>
I am stealing liberally from G. Schlossnagle's "Advanced PHP Programming."
The private constructor is to prevent everyone except my class from
instantiating it, and thus make sure the singleton is truly single.
> So I'm guessing that mysqli steps on your destruct() function, and/or
> the private construct() is weird-making.
Let's see what happens when I make the constructor public... nope, same
story.
I have also tried having a mysqli as a static member variable rather than
extending mysqli, and various variations -- in some of which, the
destructor worked too well, i.e., it destroyed the object before all my
code was done using it, because the singleton thing is working.
OK, let's try it with a non-mysqli parent... hmmm. I don't get any
complaints about private constructor in my mysqli subclass, but I do
in this example:
class MySingleton extends ParentClass {
private static $db = false;
private function __construct() {
printf("constructing %s... ",__CLASS__);
parent::__construct();
}
public static function getInstance() {
if (self::$db === false) {
self::$db = new MySingleton();
}
return self::$db;
}
function __destruct() {
// ParentClass has a close() method
self::$db->close();
}
}
$instance = MySingleton::getInstance();
...with an nice informative error message. You can't override a method and
give it more restrictive access than the parent method (as w/ Java). I
make the constructor public and it runs fine, destructor and all.
I wonder why I get away with a private constructor in my mysqli subclass.
Thanks,
---
David Mintz
http://davidmintz.org/
From dan at cain.sh Thu Mar 31 19:29:07 2005
From: dan at cain.sh (Daniel J Cain Jr.)
Date: Thu, 31 Mar 2005 18:29:07 -0600
Subject: [nycphp-talk] PHP 5 singleton/destructor question
In-Reply-To:
References:
Message-ID: <424C95D3.1040808@cain.sh>
I would think that your static $db inside the MyDatabase class is why
your not having your destructor called prior to the script ending.
When you do:
$outsideDB = MyDatabase::getInstance();
$outsideDB should be a reference to the private static $db inside
MyDatabase. So you can unset that in the script, but it only removes
the reference to the hidden $db. And being that internal $db still
references the object you created __destruct() won't be called.
It will be called when the script terminates, but I believe the output
buffers are closed by this point--so echo in the __destruct() won't be seen.
You could try another method that unsets the $db inside the class to
prove or disprove my theory.
David Mintz wrote:
> OK, here is the ugliest workaround you've seen all day. A pint of beer for
> anyone who can explain why I am having to do this. I added to my
> constructor:
>
> register_shutdown_function(array($this, '__destruct'));
>
> and it works, so to speak.
>
> ---
> David Mintz
> http://davidmintz.org/
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
From dmintz at davidmintz.org Thu Mar 31 22:00:23 2005
From: dmintz at davidmintz.org (David Mintz)
Date: Thu, 31 Mar 2005 22:00:23 -0500 (EST)
Subject: [nycphp-talk] PHP 5 singleton/destructor question
In-Reply-To: <424C95D3.1040808@cain.sh>
References:
<424C95D3.1040808@cain.sh>
Message-ID:
On Thu, 31 Mar 2005, Daniel J Cain Jr. wrote:
> I would think that your static $db inside the MyDatabase class is why
> your not having your destructor called prior to the script ending.
>
> When you do:
>
> $outsideDB = MyDatabase::getInstance();
>
> $outsideDB should be a reference to the private static $db inside
> MyDatabase. So you can unset that in the script, but it only removes
> the reference to the hidden $db. And being that internal $db still
> references the object you created __destruct() won't be called.
I don't really follow, but maybe that's because I'm a little dense.
>
> It will be called when the script terminates, but I believe the output
> buffers are closed by this point--so echo in the __destruct() won't be seen.
I thought of that and tried writing a string to a file. That worked
whenever echo worked and it failed whenever echo failed.
>
> You could try another method that unsets the $db inside the class to
> prove or disprove my theory.
I added this to the class:
static function unsetConnection() { self::$db=NULL; }
because PHP didn't much care for unset(self::$db). Then from outside the
class I did:
MyDatabase::unsetConnection();
at the end of the script, and the destructor did not execute. Can't say
whether that proves or disproves anything since I'm not quite sure I'm on
the right page.
Thanks,
David
---
David Mintz
http://davidmintz.org/