php-general Digest 29 Sep 2006 21:22:24 -0000 Issue 4375
Topics (messages 242388 through 242407):
Re: Changing values in .htaccess
242388 by: Google Kreme
242392 by: Martin Marques
242396 by: tedd
242402 by: Richard Lynch
242406 by: Google Kreme
class usage
242389 by: benifactor
242390 by: M.Sokolewicz
242391 by: Brad Bonkoski
242395 by: Ray Hauge
242397 by: Martin Alterisio
242398 by: Martin Alterisio
242399 by: Martin Alterisio
242400 by: Richard Lynch
242405 by: Robert Cummings
Re: mysql_real_escape_string() question
242393 by: Eric Butera
242394 by: tedd
242403 by: Richard Lynch
Re: Custom Session Handler
242401 by: Richard Lynch
Re: problem with email characters
242404 by: Richard Lynch
phing + phpunit relative path.
242407 by: Wesley Acheson
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On 28 Sep 2006, at 22:23 , Curt Zirzow wrote:
As i mentioned using .htaccess should be your last resort; there is a
big performance hit
big? You're joking. It's a miniscule hit in all but the most
contrived of circumstances. Even the most complex websites are
rarely more than 4 or 5 levels below DOcumentRoot.
with using .htaccess and if you have the ability dont use it and
turn it off if you arn't using it.
I have to disagree. I thin the convenience of it is well worth the
effort. I can edit my htaccess via a webdav mount, for example.
That's rather harder to do to /etc/httpd/vhosts/domain.tld.conf
I also prefer to put custom php directives into htaccess, but that's
probably just my personal preference. It's nice to know that if I
backup a site though, I have ALL of the site and don't have to go
check what the virtualhost configuration says.
--
Hi, I'm Gary Cooper, but not the Gary Cooper that's dead.
--- End Message ---
--- Begin Message ---
On Thu, 28 Sep 2006, Curt Zirzow wrote:
On 9/28/06, Google Kreme <[EMAIL PROTECTED]> wrote:
On 28 Sep 2006, at 14:30 , Curt Zirzow wrote:
> If you can, set this on a per directory setting in your virtualhost
> setting within a <Directory> or <Location>, instead of turning on
> .htaccess.
Er... why? So you have to get root privs to edit your virtual conf?
You dont need to have root, just the proper privs to modify the
paticular virtual conf file.
And how do you reload the apache configuration?
--
21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18
---------------------------------------------------------
Lic. Martín Marqués | SELECT 'mmarques' ||
Centro de Telemática | '@' || 'unl.edu.ar';
Universidad Nacional | DBA, Programador,
del Litoral | Administrador
---------------------------------------------------------
--- End Message ---
--- Begin Message ---
At 2:53 AM -0600 9/29/06, Google Kreme wrote:
I also prefer to put custom php directives into htaccess, but that's
probably just my personal preference.
I agree, I just found several uses for .htaccess that I can not live
without -- it's great.
What references would you recommend?
Thanks.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On Thu, September 28, 2006 3:15 pm, Martin Marques wrote:
> I'm trying helplessly to get session.use_trans_sid to true in one
> directory that needs it. So I put this in an .htaccess file:
>
> php_value session.use_trans_sid 1
If both Cookies and trans_sid are "on" and if your browser accepts
cookies, you won't see the SID in the URL, I don't think...
So are you SURE it's not on, or you just think it's not?
What does <?php phpinfo();?> say in that directory for Master/Local
values of trans_sid (Local == in that dir)
If that's not it, then you need to be sure .htaccess is enabled in
httpd.conf (performance penalty -- be sure you understand this on
high-volume server)
There are probably more esoteric things that can go wrong, but that's
all I can think of right now.
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
On 29 Sep 2006, at 08:24 , tedd wrote:
At 2:53 AM -0600 9/29/06, Google Kreme wrote:
I also prefer to put custom php directives into htaccess, but
that's probably just my personal preference.
I agree, I just found several uses for .htaccess that I can not
live without -- it's great.
What references would you recommend?
Well, I've really just used the apache docs, myself.
I've had quite a lot of fun getting pages looking a certain way with
no html code (using htaccess to customize the index page).
For example, on my intranet web server I have some episode summaries
for a few TV shows, and the .htacess for the root folder of those
summaries is:
Options All MultiViews
IndexOptions +IconsAreLinks +IconHeight=12 +IconWidth=12 +NameWidth=*
+ScanHTMLTitles +SuppressLastModified +SuppressSize
IndexOrderDefault Descending Name
HeaderName header.html
IndexIgnore header.html
The combination of the custom header and having just a name and
description means most people don't even realize it's an index page.
+ScanHTMLTitles means that each episode's title shows up in the index
page automatically without my having to AddDescription manually for
each one.
And that's all before even thinking about adding php code to the
htaccess file.
But, this is OT to the list.
--
A: You can never go too far. B: If I'm gonna get busted, it is *not*
gonna be by a guy like *that*.
--- End Message ---
--- Begin Message ---
ok, about five minutes ago i decided to learn classes and delve into php's oop
side.
what i came up with was this...
//start example code
class newsletter {
function send ($email,$subject,$message) {
if ($email) {
echo("the following message was sent to: $email <br> subject:
$subject<br><br> $message");
}
else {
echo("failure");
}
}
}
$new = new newsletter();
$new->send("[EMAIL PROTECTED]", "test class", "test class worked, i have passed
and failed the test.");
//end code example
..and this seems to work fine, i could easily add the mail function and insert
real variables into send() but what i don't understand is i could also easily
do this without a class... so i guess the real question is what are some real
life examples of class usage and why is it used as opposed to regular non oop?
thank you for any input into the subject that you may have.
--- End Message ---
--- Begin Message ---
Well, you could say that there is no difference really. Classes are
mainly used as collections; They're a collection of functions (methods)
sharing a common goal/dataset/whatever. One real world example is with
database abstraction layers. Say you have a script like:
<?php
// [... crap ...]
mysql_connect();
mysql_query('SELECT a FROM b');
mysql_close();
// [... more crap ...]
?>
Now, if you suddenly decided you didn't want to use mysql anymore, but
instead would like it to use the mysqli extension, you'd need to change
all of those to:
<?php
// [... crap ...]
$db = mysqli_init();
$db->connect();
$db->real_query('SELECT a FROM b');
$db->close();
// [... more crap ...]
?>
Now; of course you don't want to have to change all your code each time
something like this changes, so you're abstracting it. Your code could
become:
$db = new databaseLayer;
$db->connect();
$db->query('SELECT a FROM b');
$db->close();
and before that, you add a
class databaseLayer {
function __construct() {
}
function connect($username, $host, $etc) {
// do the connection to the db
}
function query($query) {
// etc
}
}
then instead of having to replace mysql_* with their mysqli variants,
you simply change them in the class and it'll be done. Of course the
same thing could've been done with normal procedural functions, but
imagine now that you'd need to tie some data to this specific
connection. i.e. you want to be able to find out the exact database name
for each of your active connections. Using an object, you can store that
in that object's properties. If you were using procedural style
programming, you'd need to store it in a separate structure, not
directly linked to the group of functions working on that database.
Basically, using OOP here makes the functions and their data one
coherent whole instead of simply a collection of .* (whatever).
You could now do
$db1 = new databaseLayer;
$db2 = new databaseLayer;
$db1->query();
$db2->query();
and #1 would not impact #2 because they're entirely separate, whereas
using normal functions you'd have to pass in extra arguments, telling
them they have to work on different datasets, etc.
Of course, this is only one of many ways to make a distinction between
the OOP and the procedural style of programming. Each has its merits and
drawbacks; ie. having multiple functions which have nothing to do with
eachother, have no common dataset, the only thing they share is that
they're used in the same script doesn't mean they need to be together in
the same class; right?
Well, I'm sure others will try to explaing it a bit better than I
have... at least I hope they will :P
gl!
- tul
benifactor wrote:
ok, about five minutes ago i decided to learn classes and delve into php's oop
side.
what i came up with was this...
//start example code
class newsletter {
function send ($email,$subject,$message) {
if ($email) {
echo("the following message was sent to: $email <br> subject:
$subject<br><br> $message");
}
else {
echo("failure");
}
}
}
$new = new newsletter();
$new->send("[EMAIL PROTECTED]", "test class", "test class worked, i have passed and
failed the test.");
//end code example
..and this seems to work fine, i could easily add the mail function and insert
real variables into send() but what i don't understand is i could also easily
do this without a class... so i guess the real question is what are some real
life examples of class usage and why is it used as opposed to regular non oop?
thank you for any input into the subject that you may have.
--- End Message ---
--- Begin Message ---
benifactor wrote:
ok, about five minutes ago i decided to learn classes and delve into php's oop
side.
what i came up with was this...
//start example code
class newsletter {
function send ($email,$subject,$message) {
if ($email) {
echo("the following message was sent to: $email <br> subject:
$subject<br><br> $message");
}
else {
echo("failure");
}
}
}
$new = new newsletter();
$new->send("[EMAIL PROTECTED]", "test class", "test class worked, i have passed and
failed the test.");
//end code example
..and this seems to work fine, i could easily add the mail function and insert
real variables into send() but what i don't understand is i could also easily
do this without a class... so i guess the real question is what are some real
life examples of class usage and why is it used as opposed to regular non oop?
thank you for any input into the subject that you may have.
Pick up a general book on OOA/D development. IMHO, the advantage of OO
is to modularize your code with encapsulation(buzz word). Basically
meaning that as long as your interface to an object does not change, it
does not matter to the *outside world* what you do behind the scenes.
This is especially beneficial for abstracting layers (as someone else
pointed out with the DB abstraction), as well as working within teams of
developers.
Done right it enhances all the *ilities* of software development, done
wrong it is a horrific mess of spaghetti!
Another advantage could be design *might* be easier because UML exists
as a nicely featured modeling language which maps very nicely to classes
in OO.
When all is said and done it is another tool in software development.
It has its purposes and when wielded by persons who know how best to use
it, it is quite a good method. But be your own judge, and read some
about it!
Another *real world* example might be taking the DB abstraction a little
further.
Represent all your tables as classes. This gives you the ability to
properly scrub, validate data before assigning it, allows you to
automatically persist the data (if you choose) when the class goes out
of scope, gives easy access of data to people who need not concern
themselves with the DB schema, etc..
Really a nice tool for this case, especially when you inherit a schema
which is less the obvious ;-)
-B
--- End Message ---
--- Begin Message ---
On Friday 29 September 2006 4:35 am, benifactor wrote:
> the real question is what
> are some real life examples of class usage and why is it used as opposed
> to regular non oop? thank you for any input into the subject that you may
> have.
I think people have pretty much hit the nail on the head with OOP. One thing
that I would like to point out is that OOP isn't necessarily needed in every
case. There are times when making a class to abstract a certain
feature/process is a good idea, and there there are times where it can go a
bit too far. This is definitely a very simple example, but the usual "Hello
World" script doesn't exactly need to be writen in a class structure.
I usually try to ask myself this question when I'm designing something:
"What are the benefits of using OOP?"
If the answer is simply "To use OOP" then you're probably headed in the wrong
direction, at which point I step back and look at the big picture again.
In short, OOP is something to be used to your advantage, but if overused can
just cause unnecessary overhead and confusion (IMO)
--
Ray Hauge
Application Development Lead
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099
--- End Message ---
--- Begin Message ---
2006/9/29, benifactor <[EMAIL PROTECTED]>:
ok, about five minutes ago i decided to learn classes and delve into php's
oop side.
what i came up with was this...
//start example code
class newsletter {
function send ($email,$subject,$message) {
if ($email) {
echo("the following message was sent to: $email <br>
subject: $subject<br><br> $message");
}
else {
echo("failure");
}
}
}
$new = new newsletter();
$new->send("[EMAIL PROTECTED]", "test class", "test class worked, i have
passed and failed the test.");
//end code example
Why does your newsletter class have mailing logic?
Is your newsletter an abstraction of a newsletter or an abstraction of a
mailing system?
I would expect from a newsletter object the following:
* A way to indicate the format of the newsletter (plain text/html)
* That it asks me for the newsletter template
* A way to provide it with specific client data to create the newsletter for
that client
* A common interface to interact with mailing system abstraction (to send
the newsletter)
IMHO: this is not OOP, objects ARE NOT function repositories.
..and this seems to work fine, i could easily add the mail function and
insert real variables into send() but what i don't understand is i could
also easily do this without a class... so i guess the real question is what
are some real life examples of class usage and why is it used as opposed to
regular non oop? thank you for any input into the subject that you may have.
Whatever you do in OOP could have been easily done without. OOP doesn't add
anything in terms of functionality, on the contrary, OOP takes away your
freedom to do many things you can do without it, but that's the whole point
of it: the coder putting contraints on himself or other coders so that we
don't mess up.
But having only that is not real OOP. Real OOP is reusability on steroids.
If you code thinking how your objects could be used for something more that
what you're doing right now, you'll have your current problem solved and
future problems will be easier to solve.
--- End Message ---
--- Begin Message ---
2006/9/29, M.Sokolewicz <[EMAIL PROTECTED]>:
Well, you could say that there is no difference really. Classes are
mainly used as collections; They're a collection of functions (methods)
sharing a common goal/dataset/whatever.
That's a module, my friend, not a class:
http://en.wikipedia.org/wiki/Module_%28programming%29
Modularity was good, but OOP is better... IMO.
--- End Message ---
--- Begin Message ---
2006/9/29, Ray Hauge <[EMAIL PROTECTED]>:
I think people have pretty much hit the nail on the head with OOP. One
thing
that I would like to point out is that OOP isn't necessarily needed in
every
case.
Actually there's never a need to use OOP. As I said before OOP doesn't
provide anything in terms of functionality. The client will give a shit if
you use OOP, AOP, Modularity, Structural Programming, Functional Programming
or anything else there's out there. It's not about if we need it or not,
because we don't. It's about if we prefer to use OOP or not.
Real OOP is not just being able to code classes. Real OOP is about designing
useful classes.
There are times when making a class to abstract a certain
feature/process is a good idea, and there there are times where it can go
a
bit too far. This is definitely a very simple example, but the usual
"Hello
World" script doesn't exactly need to be writen in a class structure.
Why not? If you're simply thinking of a class that does an echo, then there
is no point in using classes or not, but if you start thinking the problem
in terms of object abtraction there is a whole bunch of things that can be
shown with a simple "Hello World".
I usually try to ask myself this question when I'm designing something:
"What are the benefits of using OOP?"
If the answer is simply "To use OOP" then you're probably headed in the
wrong
direction, at which point I step back and look at the big picture again.
You're right: if you don't know how you can benefit with OOP then you
definetely shouldn't be using OOP.
In short, OOP is something to be used to your advantage, but if overused can
just cause unnecessary overhead and confusion (IMO)
I think *overused* is misleading, I would say *misused*.
--- End Message ---
--- Begin Message ---
On Fri, September 29, 2006 4:35 am, benifactor wrote:
> ..and this seems to work fine, i could easily add the mail function
> and insert real variables into send() but what i don't understand is i
> could also easily do this without a class... so i guess the real
> question is what are some real life examples of class usage and why is
> it used as opposed to regular non oop? thank you for any input into
> the subject that you may have.
For something that small, using a class is ridiculous, bloated,
over-engineered pointless exercise.
Rather than type "ridiculous, bloated, over-engineered pointless
exercise" in this email again, I'll simply dub that "Wrong Answer" and
type that a lot.
In fact, for almost *ANY* small/simple problem OOP is the "Wrong Answer".
OOP shines, however, in some large-scale usage:
#1. One architect, many developers
If you have ONE project architect cleanly map out a Plan in the form
of a large class structure, with a clear and clean internal API, and a
bunch of junior programmers to fill in the details, the Architect can
use OOP with stub functions, just like you wrote above, to build the
framework, and the junior programmers can fill in all the stubs.
#2 Real-world parallels
Sometimes when modeling real-world parallels (or even Virtual World
parallels like game prototyping, windowing systems, etc) having OOP
leads to a very natural readable maintainable code-base, as the
operations and variables and the interaction between them mirrors to a
large extent the operation and interaction between their real-world
counterparts.
The biggest problem in OOP, in my experience, is that you have many
developers, like yourself, who begin using OOP solely because they are
told that "it's better"
Many of these developers then go on to write *BAD* OOP code, for all
the wrong reasons, in all the wrong places, to solve trivial problems
with the "Wrong Answer".
Many of these developers continue to use the "Wrong Answer" over and
over, and never actually utilize any of the strengths of OOP, but
instead train themselves to misapply OOP. Their code "works" it's
just oftentimes the "Wrong Answer"
Unfortunately, learning to use OOP correctly is a long-term process,
and you have to do a bunch of trivial things with the "Wrong Answer"
just to figure out how it works -- Which means you really should re-do
them as non OOP, or be doing them solely as a means of learning and
not throwing them into Production.
Alas, this is not how 99% of OOP code in Production ends up in
Production... All too often, it's the "Wrong Answer" that gets thrown
into Production.
This is not meant as a "dis" of the great OOP code out there. I've
seen some very very very nice OOP systems in the past -- in Lisp, to
solve large-scale problems.
In PHP, to spit out a web page in under 1.7 seconds, not so much. :-)
I'm sure somebody out there has a GREAT PHP web application with a
complex backend all in OOP. So far, all I've seen is "Wrong Answer".
YMMV
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
On Fri, 2006-09-29 at 11:07 -0500, Richard Lynch wrote:
> On Fri, September 29, 2006 4:35 am, benifactor wrote:
> > ..and this seems to work fine, i could easily add the mail function
> > and insert real variables into send() but what i don't understand is i
> > could also easily do this without a class... so i guess the real
> > question is what are some real life examples of class usage and why is
> > it used as opposed to regular non oop? thank you for any input into
> > the subject that you may have.
>
> For something that small, using a class is ridiculous, bloated,
> over-engineered pointless exercise.
>
> Rather than type "ridiculous, bloated, over-engineered pointless
> exercise" in this email again, I'll simply dub that "Wrong Answer" and
> type that a lot.
>
> In fact, for almost *ANY* small/simple problem OOP is the "Wrong Answer".
>
> OOP shines, however, in some large-scale usage:
>
> #1. One architect, many developers
> If you have ONE project architect cleanly map out a Plan in the form
> of a large class structure, with a clear and clean internal API, and a
> bunch of junior programmers to fill in the details, the Architect can
> use OOP with stub functions, just like you wrote above, to build the
> framework, and the junior programmers can fill in all the stubs.
>
> #2 Real-world parallels
> Sometimes when modeling real-world parallels (or even Virtual World
> parallels like game prototyping, windowing systems, etc) having OOP
> leads to a very natural readable maintainable code-base, as the
> operations and variables and the interaction between them mirrors to a
> large extent the operation and interaction between their real-world
> counterparts.
#3 In PHP
PHP has no namespaces, use classes to improve your chances of avoiding
namespace collisions.
And I realize Richard will call this the wrong answer, but when you
don't have the tools you need, you make use of the ones you do have.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
On 9/29/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote:
On Thu, 28 Sep 2006 11:33:06 -0400, Eric Butera wrote:
He's not actually *putting* it in a database, so isn't it useless to use a
mysql_ function for this...? Maybe I misunderstand Tedd and he does use a
database, as I don't see why he would need mysql_real_escape_string() for
cleaning input...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ivo,
If that is the case then I am sorry for posting an irrelevant comment.
I just figured somebody using mysql escaping was putting it in the
DB.
Tedd,
Not to make a big deal out of this but are you aware of the
differences on filtering input and escaping output?
mysql_real_escape_string is for escaping something for the database.
It doesn't filter or clean anything. Just like htmlentities escapes
for html output.
Use regexes for cleaning user input. A good example of this would be
Zend_Filter on the Zend framework. They made methods such as getAlpha
for only returning alphabetical characters. This way you clean your
data to make it exactly what you want versus escaping it to make sure
where you are putting it accepts it.
--- End Message ---
--- Begin Message ---
At 9:52 AM -0400 9/29/06, Eric Butera wrote:
Tedd,
Not to make a big deal out of this but are you aware of the
differences on filtering input and escaping output?
mysql_real_escape_string is for escaping something for the database.
It doesn't filter or clean anything. Just like htmlentities escapes
for html output.
Not to make a big deal out of it either, but what you said above is
not germane to the question presented in the post.
I said in two post now that I had cut/pasted the code from another
script without noticing it was a mysql statement.
What my question was, why did it work for a while (i.e., weeks) and then fail?
In any event, I think I know what happened.
Thanks for your time.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On Thu, September 28, 2006 2:06 pm, tedd wrote:
> I realize that you are not asking for an answer, but for a guide --
> however -- isn't the real problem here simply one of injection? Just
> stop the user from injecting stuff in the subject and that would fix
> it right? Or, am I underestimating the problem?
Underestimating.
Stopping header injection is only one step of a potential world of
problems.
Consider that the user could provide *ANY* string, of any size, of any
composition, for their "Subject"
Maybe they POST a worm in Subject, and it has no newlines, but still
manages to propogate through Outlook.
Or maybe it's just a nice subject in Japanese.
I know nada about Unicode, uuencode, and all that crap.
Or, maybe, it's not even a VALID subject for SMTP, for whatever the
arcana rules of SMTP-ness are.
My contention is that the lowly application developer (me) should not
need a degree in i18n nor SMTP just to pass on a valid SMTP subject in
an email.
For *any* data that PHP has to pass back and forth in its "glue" there
are potentials for the kind of problems we've seen with spam, site
defacing, viruses, etc.
What I'm suggesting is that in addition to mysql_escape[_real]_string,
maybe there needs to be more "escape" string functions.
I believe JSON is one such in the pipeline, for Javascript string
escaping? Or am I mis-remembering?
It just seems to me that if we manage to lock down email and MySQL,
the Bad Guys are just gonna turn to the next biggest (most-used)
extension and look for exploits there.
So with all these potential issues, I'm wondering if there isn't a
more systemic approach to this.
Plus, for the functions that we *DO* have, a grid of "from" and "to"
and the appropriate converter function seems like it would be a Good
Idea.
It's all to easy to find a problem like ' where addslashes seems like
the "right answer" but, in reality, what I do not know is that ~ is
also a special character to the [mumble] extension/protocol/whatever
and I'm using the wrong escape function.
There are 2 reasons why I'm not using the right escape function.
#1. The right one just plain doesn't exist.
#2. The docs, wonderful as they are, don't really lay out something as
fundamental as the right escape function for situation X, because you
need a degree in CS just to "know" that X is really a Y so the right
function is Z.
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
On Thu, September 28, 2006 8:37 pm, Glenn Richmond wrote:
> As for open sourcing it, that call's up to my employer, but it may
> actually be a requirement (not that familiar with the license on php
> source).
Unless I'm very mistaken, there is no requirement for them to
OpenSource it!
> Anyway, they're fairly pro-open souce, so it's likely that
> it'll get released back into the source tree. I'd say the biggest
> benefit from my point of view is not having to re-merge the changes in
> for every release of PHP :)
There is that too.
> Who do I talk to about becoming a developer on the php source?
For adding an extension, I believe the process is:
Introduce yourself and suggested extension name on pecl-dev AT lists
DOT php DOT net
Providing access to the source is probably also good at that point.
They bat around your suggestion for awhile, and argue about the name,
hopefully briefly, and the relative merits of the extension, hopefully
even more briefly.
Then you apply for an account on http://pecl.php.net/
You upload your project, and bob's yer uncle, as I understand it.
You can also just publish the extension on your own site as
OpenSource, in the meantime, being prepared to 302 redirect (303?) to
PECL at a later date -- That may be the fastest way to market if
you're in the usual "fire drill" mode of work. :-)
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
On Thu, September 28, 2006 12:27 pm, Ross wrote:
> Is there a function that sorts out all the dodgy characters in an
> email...
Maybe.
Sometimes those dodgy characters are UTF-8, Unicode, or some sort of
codepage in some language other than the one your server is configured
to use (which is probably English in Latin-1 or similar). In that
case, you would need to handle International Email with charsets and
all that.
Sometimes those dodgy characters are just people copy pasting MS Word
and believing that somehow the entire World is going to "see" what
they see, because their email reader happens to be Outlook and happens
to grok proprietary character-codes for MS Word stylings. There are
User Contributed Notes for str_replace that explain how to convert
Word proprietary characters to their closest text-only equivalents.
It's also entirely possible that the user is pasting in text from some
*other* application (gasp! not everybody uses Word?!) and then you're
on your own.
Identifying which mess you have on your hands, or possibly a
combination of messes, or even, in some cases, specific users who are
causing what look like similar problems but are completely different
messes, is going to be the "fun" part...
PS This is the kind of thing I mean in the other thread about escaping
data. I realize that maybe PHP cannot possibly have a function to
magically do what needs to be done to escape/convert this data, but I
sure wish it had one, cuz an awful lot of people need it...
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
Hi,
I'm not really sure if this question belongs on these lists - please
forgive if it isn't. I've got a project running locally.
I've got a phing build.xml in the root directory and a document
structure based like this.
webroot/incudes/package/fileToBeTested.inc
webroot/includes/package/t/FileToBeTestedTest.php
FileToBeTestedTest.php includes fileToBeTested.inc via the
require_once("../fileToBeTested.inc"); method, i.e. it uses a relative
path.
This works well in phpeclipse and for running phpunit from the command line.
However when I try to include the test file via phing.
<target name="test">
<includepath classpath="${project.basedir}/includes/Errors" />
<phpunit2 haltonfailure="true" printsummary="true">
<batchtest>
<fileset
dir="${project.basedir}/includes/Errors/t">
<include name="*Test.php" />
</fileset>
</batchtest>
</phpunit2>
</target>
backing out of the include directory using the .. opperator doesn't
seem to work. This leave me to use an absolute path for include,
however if I do this phpunit and eclipse both don't like this. Eclipse
warns that the include isn't in the current directory.
Is there any solution to this problem that gives the expected result
for all three applications. Is it true you can't use the ../ syntax
to step out of an include directory specified in the php.ini
Regards,
Wes
--- End Message ---