RE: FW: [PHP] Accessing a Char in an Array

2004-12-21 Thread Justin Palmer
Why is substr all over the board in how fast it processes the same
string?  Is it the server?

Kind regards,

Justin

> -Original Message-
> From: Robert Cummings [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, December 21, 2004 8:58 PM
> To: [EMAIL PROTECTED]
> Cc: PHP-General; 'Curt Zirzow'
> Subject: Re: FW: [PHP] Accessing a Char in an Array
> 
> 
> On Tue, 2004-12-21 at 23:47, Justin Palmer wrote:
> > *Sorry Curt for sending this to you.*
> > 
> > Hi,
> > 
> > Well if any one is interested in the speed I set up an example that 
> > you can go to.  Though, when I run the example substr() is very 
> > neurotic (or it seems that it is to me). It can process the 
> same line 
> > of code at a lot of different intervals, while accessing it 
> with {} is 
> > pretty consistant.
> > 
> > What is the cause of this?
> > 
> > I thought it might be the server, but would that not effect it for 
> > both tests (two others tests with objects)?
> > 
> > By the by, during my testing I found that using {} to 
> access the first 
> > char in a string was anywhere from .5 to 4 times faster.
> 
> {} is an operator whereas substr() is a function. Operators 
> are generally an order of magnitude faster than functions and 
> if all you want is the first character then {0} is much more 
> efficient than substr().
> 
> 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.  |
> `'
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



FW: [PHP] Accessing a Char in an Array

2004-12-21 Thread Justin Palmer
*Sorry Curt for sending this to you.*

Hi,

Well if any one is interested in the speed I set up an example that you
can go to.  Though, when I run the example substr() is very neurotic (or
it seems that it is to me). It can process the same line of code at a
lot of different intervals, while accessing it with {} is pretty
consistant.

What is the cause of this?

I thought it might be the server, but would that not effect it for both
tests (two others tests with objects)?

By the by, during my testing I found that using {} to access the first
char in a string was anywhere from .5 to 4 times faster.

Please let me know if I did the testing wrong, I don't believe I did but
I was at work when I did it.

http://dev.jepaonline.com/php/strings/substr/

Kind regards,

Justin Palmer


> -Original Message-
> From: Curt Zirzow [mailto:[EMAIL PROTECTED]
> Sent: Monday, December 20, 2004 7:27 PM
> To: 'PHP General'
> Subject: Re: [PHP] Accessing a Char in an Array
> 
> 
> * Thus wrote Justin Palmer:
> > In an earlier thread labeled "first letter", it was suggested that
> > substr() be used.
> 
> Just for the record the usage of
> 
>   $str = 'a string';
>   $str[0];
> 
> Is strongly discouraged, it is recommended to use:
> 
>   $str{0};
> 
> See Section (String access and modification by character):
>   http://php.net/language.types.string
> 
> > 
> > >Check this out... http://us2.php.net/manual/en/function.substr.php.
> > 
> > So my question is:
> > 
> > What is faster using substr or accessing the string like an array?
> > 
> > I know I could test this myself, but I thought someone may
> have done
> > this already.
>  
> Speed is probably negligible. It probably comes down to readablity.
> 
> 
> Curt
> --
> Quoth the Raven, "Nevermore."
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] can I compile php source

2004-12-21 Thread Justin Palmer
[quote]
>> On Wednesday 22 December 2004 01:37, Paul Aviles wrote:
>>> Guys, this is trivial. It takes the same effort to provide the
answer 
>>> to whoever this guy was, than to lecture him on how to think.
>>
>> "Teach a person to fish ..."
>>
>> --
>> Jason Wong -> Gremlins Associates -> www.gremlins.biz

You know, I bet that man is getting sick of eating fish all the time.

"Teach a man to shoot a cow..."  
[/quote]

Not to start flame war about meat, but:

Do people still eat beef? Yuk.

"Teach a man to pick soy beans..." :) -- much healthier alternative...

(Da** I told myself not to post on this thread, thanks Matthew ;) )

Regards,

Justin

-Original Message-
From: Matthew Sims [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 21, 2004 1:35 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] can I compile php source


> On Wednesday 22 December 2004 01:37, Paul Aviles wrote:
>> Guys, this is trivial. It takes the same effort to provide the answer

>> to whoever this guy was, than to lecture him on how to think.
>
> "Teach a person to fish ..."
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz

You know, I bet that man is getting sick of eating fish all the time.

"Teach a man to shoot a cow..."

-- 
--Matthew Sims
--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Accessing a Char in an Array

2004-12-20 Thread Justin Palmer
In an earlier thread labeled "first letter", it was suggested that
substr() be used.

>Check this out... http://us2.php.net/manual/en/function.substr.php.

So my question is:

What is faster using substr or accessing the string like an array?

I know I could test this myself, but I thought someone may have done
this already.

Regards,

Justin Palmer
__
KISS (Keep It Simple, SEARCH)!
Google::getUri( http://www.google.com );
Archives::getUri( http://marc.theaimsgroup.com/?l=php-general );

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] user password managment

2004-12-10 Thread Justin Palmer

> if($thisRow % 2 == "0"){


Should be: if(($thisRow % 2) == 0){

Regards,

Justin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



FW: [PHP] Multiple Inheritance

2004-12-10 Thread Justin Palmer
Sorry, Greg for sending this to you personally.

I also forgot to leave a link of a PHP Unit Testing Suite.

www.lastcraft.com/simple_test.php - Simple Test

Regards,

Justin
 


-Original Message-
From: Justin Palmer [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 10, 2004 7:51 PM
To: 'Greg Donald'
Subject: RE: [PHP] Multiple Inheritance


Hi,

What do you do for Unit Testing in procedural world?

I think that this is a nice addition to the OO world.  I have not heard
of a tool for procedural, is there any?

Kind regards,

Justin Palmer



-Original Message-
From: Greg Donald [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 10, 2004 7:42 PM
To: PHP general
Subject: Re: [PHP] Multiple Inheritance


On Fri, 10 Dec 2004 18:27:12 -0600, Ryan King <[EMAIL PROTECTED]> wrote:
> Yeah, but in the case of the Linux kernel there's no programming
> language that is both OO and close enough to the metal to program a 
> kernel (other than maybe Forth??).

C++, being a superset of C, would certainly be 'close enough to the
metal' and is indeed OO, yet the Linux kernel developers have chosen not
to use it.

> That means that we can't make a judgment as to the
> relative merits of procedural and object-based programming in kernel
> development.

Sure we can, but we don't have to since they already made it.  No OO in
the kernel was the verdict many times over:

http://marc.theaimsgroup.com/?l=linux-kernel


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Multiple Inheritance

2004-12-10 Thread Justin Palmer
Hi,

Have you ever written a project and then moved to the next noticing that
you are doing some of the same things from last project (connecting to a
database, reading a file, writing to a file, etc...)?

Have either of you ever written a for loop? Of course, you have.

Have you ever written the for loop and then noticed (after you uploaded
the script to the server) that you wrote the loop with syntax errors?

If so, why not use an ArrayIterator?  If not, then you are a master in
the PHP realm.  I would have to assume that even the most experienced
php developer has done this once or twice in there life. It all amounts
to a waste of precious programming time. When this occurs.  Especially
when TIME = MONEY.

What if you were to build an application around the MySQL database.  You
have just finished the project and you are taking it to your boss.  You
get there and then your boss says, "you know what I would rather use
Oracle as our database".  With this situation you have, potentially,
wasted many hours writing the MySQL version.  What are you going to do
now, say something like, "Sorry boss, my application I designed is not
flexible enough for me to switch db's at this time.", as your promotion
for completing the project goes down the drain.

There are large arguments about both, I grew up on OO so that is how I
program and that is what I know.  Procedural does not even make sense to
me.  Using low-level functions and process over and over again, when the
functions and process can be written once and used on many projects over
and over again.

Also, do you ever go back and maintain projects that you have worked on
a year later.  If you used objects you would know exactly what you are
walking into, I doubt you can say that with a procedural state of mind.

Resources to learn more:

www.phppatterns.com
wact.sf.net
http://www.sitepoint.com/forums/forumdisplay.php?f=147
www.martinfowler.com

There are more resources: -> google is your friend.

I would put Pear, but personally I think that it started out to be a
good idea and has turned into a disaster, IMO. (Sorry to any Pear
lovers, I still think Pear is better than procedural).

I don't care if you program in procedural or oo, but I would like you to
educate yourself in the pluses and minuses of both.  If you have not
learned oo and know nothing about it, then learn it might surprise you.

I think the main problem is that PHP is still young in the OO world, it
grew up on procedural.  With this in mind there is no OO Standard that
people follow, like in Java, or .NET.  Pear is trying to address this
issue, but if you are not a Pear believer then you use some other
Standard, and so the cycle of NO STANDARD revolves.

And after saying all that, I will say that there are times on very small
projects that procedural does make more sense.

Regards,

Justin Palmer
__
KISS (Keep It Simple, SEARCH)!
Google::getUri( http://www.google.com );
Archives::getUri( http://marc.theaimsgroup.com/?l=php-general );


-Original Message-
From: Mike [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 10, 2004 11:08 AM
To: 'PHP General'
Subject: RE: [PHP] Multiple Inheritance


Richard,

Thank you for that.

I've been writing PHP apps for a while now but would not concider myself
an "expert". I just enjoy doing it and I know a fair bit about what I'm
doing. One thing I never quite got into (with PHP) is OO. Why - because
nothing I ever did really seemed to make sense as OO. I could easily
write a function that'd get called one or a few times and that was about
it. There didn't seem to be a need for objects to be used and re-used
and my scripts shouldn't ever run long enough for me to take advantage
of OO's abilities.

I was worried that I "didn't get it" (and I still might not... But
that's another issue) but maybe I'm not too far off the mark. It's just
useful to see other people's opinions on this topic. 

Maybe I'll be burned at the stake along with you... ;)

-M


> > What are some of the things you guys do to get around the fact that
> > classes in php4 can't do multiple inheritance?
> 
> What I do is not use classes.
> 
> At all.
> 
[snip] 
> I will probably be reviled as a heretic, but there it is.
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Multiple Inheritance

2004-12-10 Thread Justin Palmer
I am sorry for you, Richard, for the vast miss-understanding of OO.

Regards,

Justin Palmer
__
KISS (Keep It Simple, SEARCH)!
Google::getUri( http://www.google.com );
Archives::getUri( http://marc.theaimsgroup.com/?l=php-general );



-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 10, 2004 10:33 AM
To: Chris Boget
Cc: PHP General
Subject: Re: [PHP] Multiple Inheritance


> What are some of the things you guys do to get around the fact that
> classes in php4 can't do multiple inheritance?

What I do is not use classes.

At all.

:-)

As a Lisp programmer of over a decade, I think I can safely say I am an
OO proponent.

Yet, every time I sit down to program a web application in PHP, I find
very little (read: nothing) that I want to use OO *for*.

I'm not creating a whole bunch of anything, so the ability to make lots
of the same object never seems useful.

I'm not trying to solve an AI problem. :-)

I've already got simpler and more clear tools to write good code, such
as include and functions.

The overhead of OO is particularly ill-suited to a web environment where
run-times need to be in seconds or less.

I rarely have anything that wants to inheret a lot of behaviour from
something else, and then do something just a bit different.

I mostly just want to grab some data, massage it a bit, format it
nicely, and present it in HTML format.

To tell the truth, 95% of the "OO" code I run into written in PHP is
[bleep].

It seems like very very very little thought has gone into the Design of
the classes to be used -- Only the most straight-forward mapping of
everything under the sun into a class is utilized.

Inheritence is seldom used, even when it would be appropriate.

None of the power of OO is used.

OO seems to be used, badly, to separate chunks of code that would be
better served as simple straight-forward functions, include files, or
just plain old one-line PHP rather than 20 lines of a 'class' that does
nothing much.

I find myself digging through 5 files to un-wrap something that turns
out to be a whole lot of nothing when all is said and done.  Ugh!

How is that "Good Code"?!

I'm sure there must be some better PHP OO code out there.  Maybe that 1%
is worth all my pain trying to dig through the maundering mess most PHP
coders make of their application.

But to me, it feels like our profession has decided to force everybody
to use OO, no matter how inappropriate OO might be for the task at hand,
or how inexperienced the lead developer.

In a crude analogy, this would be like forcing every contruction company
to be their own architect, and to write their own blueprints.

OO code written by an inexperienced programmer usually ends up being
convoluted and buggy, rather than the clean, well-organized ideal it
strives for -- Worse, it seems TO ME that this code ends up being even
more convoluted and buggy than it would have been if the same
inexperienced programmer just wrote the code as straight-forward
procedural PHP with a few includes and functions.

*GOOD* OO code requires the experience and analysis of an expert to
build a sensible framework, leveraging the common behaviours and
properties of similar code -- or, more rarely but often more
spectacular, what seems like DIS-similar behaviours and properties that,
with a shift in view-point, turn out to be "the same"

Alas, what seems to be "de reguire" is for some beginner to sit down and
write the very first thing that comes into their mind as a 'class' and
just keep doing that over and over, but never actually *USING* OO for
its benefits.

I will probably be reviled as a heretic, but there it is.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Multiple Inheritance

2004-12-10 Thread Justin Palmer
I am sorry for you Richard for the vast miss-understanding of OO.

Regards,

Justin Palmer
__
KISS (Keep It Simple, SEARCH)!
Google::getUri( http://www.google.com );
Archives::getUri( http://marc.theaimsgroup.com/?l=php-general );



-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 10, 2004 10:33 AM
To: Chris Boget
Cc: PHP General
Subject: Re: [PHP] Multiple Inheritance


> What are some of the things you guys do to get around the fact that 
> classes in php4 can't do multiple inheritance?

What I do is not use classes.

At all.

:-)

As a Lisp programmer of over a decade, I think I can safely say I am an
OO proponent.

Yet, every time I sit down to program a web application in PHP, I find
very little (read: nothing) that I want to use OO *for*.

I'm not creating a whole bunch of anything, so the ability to make lots
of the same object never seems useful.

I'm not trying to solve an AI problem. :-)

I've already got simpler and more clear tools to write good code, such
as include and functions.

The overhead of OO is particularly ill-suited to a web environment where
run-times need to be in seconds or less.

I rarely have anything that wants to inheret a lot of behaviour from
something else, and then do something just a bit different.

I mostly just want to grab some data, massage it a bit, format it
nicely, and present it in HTML format.

To tell the truth, 95% of the "OO" code I run into written in PHP is
[bleep].

It seems like very very very little thought has gone into the Design of
the classes to be used -- Only the most straight-forward mapping of
everything under the sun into a class is utilized.

Inheritence is seldom used, even when it would be appropriate.

None of the power of OO is used.

OO seems to be used, badly, to separate chunks of code that would be
better served as simple straight-forward functions, include files, or
just plain old one-line PHP rather than 20 lines of a 'class' that does
nothing much.

I find myself digging through 5 files to un-wrap something that turns
out to be a whole lot of nothing when all is said and done.  Ugh!

How is that "Good Code"?!

I'm sure there must be some better PHP OO code out there.  Maybe that 1%
is worth all my pain trying to dig through the maundering mess most PHP
coders make of their application.

But to me, it feels like our profession has decided to force everybody
to use OO, no matter how inappropriate OO might be for the task at hand,
or how inexperienced the lead developer.

In a crude analogy, this would be like forcing every contruction company
to be their own architect, and to write their own blueprints.

OO code written by an inexperienced programmer usually ends up being
convoluted and buggy, rather than the clean, well-organized ideal it
strives for -- Worse, it seems TO ME that this code ends up being even
more convoluted and buggy than it would have been if the same
inexperienced programmer just wrote the code as straight-forward
procedural PHP with a few includes and functions.

*GOOD* OO code requires the experience and analysis of an expert to
build a sensible framework, leveraging the common behaviours and
properties of similar code -- or, more rarely but often more
spectacular, what seems like DIS-similar behaviours and properties that,
with a shift in view-point, turn out to be "the same"

Alas, what seems to be "de reguire" is for some beginner to sit down and
write the very first thing that comes into their mind as a 'class' and
just keep doing that over and over, but never actually *USING* OO for
its benefits.

I will probably be reviled as a heretic, but there it is.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Unsubscribing Junk Emails From the List: requests@firstustrading.com

2004-12-09 Thread Justin Palmer
Hi,

Every time I send a response to the list I get a auto-reply from:
[EMAIL PROTECTED]

Is there someone that I could email that can delete this user from the
list?

Thanks for any information.

Regards,

Justin Palmer
__
KISS (Keep It Simple, SEARCH)!
Google::getUri( http://www.google.com );
Archives::getUri( http://marc.theaimsgroup.com/?l=php-general );

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] a question about the PHP manual

2004-12-09 Thread Justin Palmer
Hi,

Richard is spot on, but learning (PHP, ASP, Java, ...) programming is
not all about reading.  Set up small examples that better enforce the
ideas in your mind about specific topics that you are having a hard time
with.  You will loose, roughly, 90% of the information by just reading.
Examples help solidify the theories.

Regards,

Justin Palmer
__
KISS (Keep It Simple, SEARCH)!
Google::getUri( http://www.google.com );
Archives::getUri( http://marc.theaimsgroup.com/?l=php-general );



-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 09, 2004 9:15 AM
To: Eakin, W
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] a question about the PHP manual


Eakin, W wrote:
> Hello,
> As I'm studying, and learning, PHP, I use certain resources again 
> and again. A few books I've bought, some web sites, this mailing list,

> and the PHP manual. I've taken the often repeated 'RTFM' to heart, and

> I attempt to google or RTFM before considering a post to the list with

> a question, but now I have a question about the manual itself. I've 
> noticed that most of the replies to the questions on this list, when 
> they refer to a part of the manual,  point to the same few sections 
> over and over. Such as arrays, strings, sessions, objects, and a few 
> others. My question is this, when I'm reading the manual, is just that

> I should be concentrating on a few sections (and if so, which?), or 
> should I be giving equal attention to all the sections, including some

> (I suppose) I might never use.

I would recommend reading EVERYTHING in the PHP manual UP TO "Section
VI: Function Reference"

All of that stuff is what defines the core PHP Language, and if you
don't know it, you're going to waste a lot of time on Voodoo
Programming.

Voodoo Programming: You do things that "work" but you have completely
erroneous beliefs about *why* and *how* they work.

If you know the jargon for what you are looking for, Google is your
buddy; But if you don't, and can only describe what you want in a
paragraph of a question, then re-read all of that, plus the FAQs.

You then want to skim through the main page of each "function reference"
section.  Currently that's 135 (!) pages.  Some of them you can quickly
dismiss as "irrelevant for all time to me" :-)  Others, you'll find out
that there's an entire science to something you thought you'd have to
invent for yourself.

Yes, that's a lot of reading.

No, you won't remember all of it.

Hell, you might not even understand all of it when you read it.

Once upon a time, I even posted an FAQ to the list, way back when,
because while I had *read* the FAQ initially, there were FAQs I didn't
even understand the Question to, much less the Answer.

Six months later, of course, I ran into the question in my own needs,
and, well, didn't *RE*-read the FAQ.

Take note of the stuff you don't understand at all, and try to memorize
the buzz-words or what you think they might be all about.

The hair you save may be your own. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] fread()

2004-12-08 Thread Justin Palmer
I believe that fread uses the handle pointer from when it was opened
so...

None of the code is tested, I just typed it in.

class FileReader
{
//private
var $handle;

function FileReader($filePath)
{
$this->handle = fopen($filePath,'r');
}

/*public*/function read($bytes)
{
return fread($this->handle,$bytes);
}

/*public*/function isEndOfFile()
{
return feof($this->handle);
}

//...
}

USAGE:
$strFile = "";
$fr =& new FileReader("example.txt");
While(!$fr->isEndOfFile())
{
$strPartialFile = $fr->read(1000);
$strFile .= $strPartialFile;
}

More at: php.net/fread

Regards,

Justin Palmer
__
KISS (Keep It Simple, SEARCH)!
Google::getUri( http://www.google.com );
Archives::getUri( http://marc.theaimsgroup.com/?l=php-general );



-Original Message-
From: Russell P Jones [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 08, 2004 12:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP] fread()


Is there any way to use fread() or a similar function to read a section
of a document NOT starting at the beginning...

for example, I can read the first 1000 bytes of a document with

fread($doc, 1000);

Is there any way to read the second 1000 bytes?

perhaps, fread($doc, 1000, 2000); who knows

or would substr work?

russ

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] FPDF output to a variable

2004-11-24 Thread Justin Palmer
Hi List,

I have done some searching on Google and the Archives for what I am
trying to do, but it seems I am searching up the wrong avenues.  Here is
my situation:

I generate pdf files with fpdf (fpdf.org) and I would like to catch the
output of the pdf stream into a variable so that I can attach it to an
email.  The email and attaching the file to the email is working great,
but when I get the email adobe can not open the pdf.  It seems that it
is not being decoded properly.  I attach another pdf that is in the file
system already, but sense this one is created dynamically it is not
saved anywhere.  I just am trying to get the ouput in a variable instead
of outputing it to the browser.  Below is some code for the pdf and what
I was trying to do to send it.

The below code may have errors, I just typed it quickly in the email.
The concept is there though.

//Creating the pdf  [create_pdf.php]
http://www.cetusa.org/temp/fpdf_protection.phps]
session_cache_limiter('private');
session_start();
header("Cache-Control: no-store, no-cache, must-revalidate");
define('FPDF_FONTPATH','font/');


$pdf =& new FPDF_Protection();
$pdf->Open();
$pdf->SetMargins(3,3);
$pdf->AddPage();
$pdf->Cell(100,0,'This is the text to be put into the pdf.' );
$pdf->SetProtection(array('print'),'','87df9dfn43*%^uskaid');
$pdf->Close();
$pdf->Output();
exit();
?>

http://www.cetusa.org/temp/MIME.class.phps)
//WARNING I know that this is not how it is intended to be used, 
//but this is the what I want to accomplish.
$fp = fopen(create_pdf.php);
$pdf = fpassthru($fp);//actually returns the number of characters read,
I want the content of the executed path.
fclose($fp);
//END WARNING
$from='[EMAIL PROTECTED]';
$to='[EMAIL PROTECTED]';
$subject='PDF FILE';
$message='Attached is the PDF file.';
$mail =& new MIME_mail($from, $to, $subject,$message);
$mail->attach($pdf, 'Profile', OCTET,BASE64,'attachment;
filename="Profile.pdf"');
$mail->send_mail();
?>

Any help on this would be great.  If you know of some search terms that
would get me going in the right direction that would be great also (I
don't mind doing the research).

If you need more clarification please let me know.

Regards,

Justin Palmer
__
KISS (Keep It Simple, SEARCH)!
Google::getUri( http://www.google.com );
Archives::getUri( http://marc.theaimsgroup.com/?l=php-general );

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] URL verification

2004-10-08 Thread Justin Palmer
>how can i check in the page if the user is accessing the the site via
SSL ??

if(!$_server['https'])
{
//redirect to secure page.
}

There are probably better ways, maybe through apache, but I think that
will work.

-Justin

-Original Message-
From: Bruno Santos [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 08, 2004 7:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP] URL verification


Hello all.

I have a login page  where users have to authenticate themselves to 
access some site areas.
Apache is configured to use https.

the user when is typing the URL in the browser, i know that it will not 
put the https protocol.

how can i check in the page if the user is accessing the the site via
SSL ?? or i have to put a redirect in the page anyway, whether the user
is 
alredy accessing the page via SSL?

cheers

Bruno Santos

-- 
[EMAIL PROTECTED]
--
Divisao de Informatica
[EMAIL PROTECTED]
Tel: +351 272 000 155
Fax: +351 272 000 257

--
Hospital Amato Lusitano
Av. Pedro Alvares Cabral
6000-085 Castelo Branco
[EMAIL PROTECTED]
Tel: +351 272 000 272
Fax: +351 272 000 257

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Loop within Loop help please

2004-09-28 Thread Justin Palmer
 

How might i do that?
Something like that.

Justin

Much thanks...
-- 
Nick W

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Barcodes ?

2004-09-10 Thread Justin Palmer
Hi,

Google Search: Code 39 Barcode Generation PHP

Found this here:

http://www.hotscripts.com/Detailed/9608.html

Justin

-Original Message-
From: Dave Carrera [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 10, 2004 9:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Barcodes ?


Hi List,

Anyone have any pointers to examples of Code 39 barcode generation using
php please.

Thanks for any help

Dave Carrera


-- 
UK Web Hosting @ http://www.ephgroup.com  

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.754 / Virus Database: 504 - Release Date: 06/09/2004
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Assigning one var to multiple vars

2004-09-09 Thread Justin Palmer
How about: 

' . $var2 . '' . $var3 . '';
?>

Regards,

Justin

-Original Message-
From: Matthew Sims [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 09, 2004 1:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Assigning one var to multiple vars



Just mostly curious but is there a way to assign one variable to
multiple variables in one single line?

Rather than do this:

$var2 = $var1;
$var3 = $var1;

Is there a method to perform a:

($var2,$var3) = $var1;

-- 
--Matthew Sims
--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Regex for Validating URL OT

2004-09-02 Thread Justin Palmer
At the time I had sent the email it was right in line with what was
going on at the time.  Sorry if the message did not get through in a
timely matter.

I just think that if someone has the time to give a snide remark then
they have the time to do it in a nice way, or just don't respond.  If
people don't respond then the person will do more research or find
another way.

And I am not just talking about this one item.  All over the list there
are "mighty" people, and that goes the same for life.

I love this list, I like to read and reason peoples problems and see
what others are doing.  I would never leave.

Maybe the list signature at the bottom should include a line that talks
about checking the archives with a link, maybe that would help.

Enough said.

Justin
Happy, Happy. Joy, Joy.
All is well.

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 02, 2004 10:16 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] Regex for Validating URL OT


[snip]
I agree Nick for an open source community this list is not very open.
Quite a few "I am better than you" type people on the list.  

How does that make the beginner feel?  I better not ask a question, for
I fear that I will get flamed.  What a joke!

There are many other places to go and get good answers without the bull
shit that you get here. [/snip]

Feeling a little high and mighty there Justin? 

If you get better answers somewhere else then the general advice would
be to go there regularly. There are several fine folks here who spend a
lot of time helping. And you have to admit, because you have been here
for a while, that there are several questions repeated over and over,
questions that do not make sense, questions that have not been
researched at all, etc., etc., etc. Those who have received help here,
including yourself, have been grateful. Those who have dispensed help
here, including yourself, have been happy to do so.

However, your post above would be a pot calling the kettle black as it
is full of judgemental schmegma which is just not required. These little
flame wars crop up from time-to-time and then everyone settles down.
Personal attacks, such as the one posted earlier, have no place on what
is ostensibly a "self-policed' list. 

My advice, if you don't like it here and don't feel compelled to help
others, don't let the header hit you on your ass on the way out. Other
than that, continuuing a flame war that had all but ceased is way out of
line on your part.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Regex for Validating URL

2004-09-02 Thread Justin Palmer
Is PHP not open source.

What a joke.

Justin

-Original Message-
From: raditha dissanayake [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 02, 2004 10:24 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Regex for Validating URL


Justin Palmer wrote:

>I agree Nick for an open source community this list is not very open. 
>Quite a few "I am better than you" type people on the list.
>  
>
This is not an open source list. this is a php list.

-- 
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Regex for Validating URL

2004-09-02 Thread Justin Palmer
Maybe what this community needs is an advanced mailing list.

I think that these types of attitudes just make the new user to php
stray away. If we had a section beginners list that if people asked dumb
questions, or questions that are stated dumb, some people would take the
time to help the newbie out and show him the right way and then answer
his question for him.

This way the "Arrogants" don't have to be in the newbie list and people
that are more down to earth can help the php community grow.

My 2 cents.

Regards,

Justin

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 02, 2004 7:16 AM
To: Nick Wilson
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Regex for Validating URL


On 02/09/2004, at 11:27 PM, Nick Wilson wrote:

> * and then Jason Wong declared
>> It would be nice when asking a question to summarise what research
>> you have
>> done. Instead of just saying I've looked and found nothing (or words 
>> to that
>> effect).
>
> bugger off jason, if you dont understand the question dont bore me 
> with your silliness.

No, Jason was right (in his usual, abrupt, rude kinda way). Good
questions get good answers.

---
Justin French
http://indent.com.au

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Regex for Validating URL

2004-09-02 Thread Justin Palmer
I agree Nick for an open source community this list is not very open.
Quite a few "I am better than you" type people on the list.  

How does that make the beginner feel?  I better not ask a question, for
I fear that I will get flamed.  What a joke!

There are many other places to go and get good answers without the bull
shit that you get here.

Regards,

Justin

-Original Message-
From: Nick Wilson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 02, 2004 7:15 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Regex for Validating URL



* and then John Holmes declared
> From: "Nick Wilson" <[EMAIL PROTECTED]>
> >* and then Jason Wong declared

besides, i will not be treated that way by anyone without saying
somthing. IMO some on this list need to get out a bit more, meet some
people, aquire some manners and social skills.

I asked the same quesiton elsewhere and got 2 answers with exactly what
i needed. Nobody asked anybody to any research/homework for them, i just
hoped someone might have it handy and be happy to post it.

thanks..

-- 
Nick W

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] xml tags interfere with php tags

2004-09-01 Thread Justin Palmer
Hi,

print '';

Regards,

Justin

-Original Message-
From: Josh Close [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 01, 2004 11:08 AM
To: PHP
Subject: [PHP] xml tags interfere with php tags


How do I get an xml tag to work with a php script?



php is trying to parse that.

-Josh

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Weblog -Blog software wrtten in PHP and My SQL

2004-08-31 Thread Justin Palmer
WordPress
Wordpress.org - PHP/MySQL Lots of skins and support.

Justin


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 31, 2004 10:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Weblog -Blog software wrtten in PHP and My SQL


Does anyone know of Blog sw available in the marketplace written in PHP
and 
maybe MySQL?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] is_object($_SESSION['dagobertduck']);

2004-05-26 Thread Justin Palmer
Hi,

Make sure you include the Class file in every consecutive page that you
would like to use the object in.

Regards,

Justin Palmer


-Original Message-
From: Matthias H. Risse [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 26, 2004 12:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] is_object($_SESSION['dagobertduck']);


hi:

i wonder why...

if(!is_object($_SESSION['xmlModel']))
echo "there is no obj present, juppa**";

at my place always results in TRUE or
echoing the "there is no.. ", even if var_dump
reports that $_SESSION['xmlModel'] is an
object.

did i screw something up or are there
special policies with the beloved session
variables?

i thought $_SESSION is just mapped
into memory from the session-container
during init on every request and at the end of the
script serialized back to the container?

maybe i missed special policies for
referencing objects stored in the
session-variable?

thanks!
/m

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] 0 == null ?

2004-05-10 Thread Justin Palmer
Hi Robert,

Thanks.

Regards,

Justin Palmer

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 10, 2004 12:22 PM
To: [EMAIL PROTECTED]
Cc: PHP-General
Subject: Re: [PHP] 0 == null ?


On Mon, 2004-05-10 at 15:17, Justin Palmer wrote:
> Hi,
> 
> Does 0(zero) really equate to null?
> 
> if( 0 == null )
> {
>   echo 'true';
> }
> else echo 'false';
> 
> Result echo's: true
> 
> This can not be right, can it?  I have never heard of such a thing.  
> As far as I recall from any language null is of no value equaling 
> nothing? So how can it equal 0?
> 
> Any help or explanation would be greatly appreciated.

In C the NULL macro is equal to 0. In PHP null is equivalent to 0. The
test will fail if you use === instead.

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.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] 0 == null ?

2004-05-10 Thread Justin Palmer
Hi,

Does 0(zero) really equate to null?

if( 0 == null )
{
echo 'true';
}
else echo 'false';

Result echo's: true

This can not be right, can it?  I have never heard of such a thing.  As
far as I recall from any language null is of no value equaling nothing?
So how can it equal 0?

Any help or explanation would be greatly appreciated.

Regards,

Justin Palmer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] why doesn't this work ?

2004-04-20 Thread Justin Palmer
I don't think that you have to request anything.  I think you can do
this with a .htaccess file. Like so:

AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm  

This would go in your root .htaccess file.  Mine allows this
anyways(hostrocket.com).

Also if you have a control panel that you can add MIME type, you can do
the following:

application/x-httpd-php

Here is the link with the information:

http://support.hostrocket.com/index.php?page=index_v2&id=110&c=15

NOTE:

This might be hosting provider specific, I have not run any tests on
other providers.

Kind regards,

Justin.

P.S. WOW, this is a late response...sorry.

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 17, 2004 12:20 PM
To: Pooya Eslami
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] why doesn't this work ?


Pooya Eslami wrote:

> I took out the scrip tags and put in   at

> the end, but it returns this:
> 
> $file
> "; } } closedir($handle); } echo "
> "; ?>
> 
> Any ideas how to fix this?

Use a .php extension on your file. Or you can ask your hosting company 
to have .html files processed as PHP, but they won't.

-- 
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP Web Hosting

2004-04-19 Thread Justin Palmer
I have used hostrocket.com and ipowerweb.com with good success.  I don't
think that it is my place per say to tell you who to host with, for I
don't want to give bad advise, if it does not work for you.  I do have a
resource that might be helpful. Here it is http://webhostingforums.com/

Regards,

Justin Palmer



-Original Message-
From: Russell P Jones [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 19, 2004 2:37 PM
To: Daniel Clark
Cc: [EMAIL PROTECTED]; Martin, Stanley G [Contractor for Sprint];
[EMAIL PROTECTED]
Subject: Re: [PHP] PHP Web Hosting


http://www.networkeleven.com

I have been using these folks for about a year and a half now. They have
done numerous custom builds for me and will do it within 15 minutes of
your request. Pretty amazing customer service.

Russ Jones

On Mon, 19 Apr 2004, Daniel Clark wrote:

> I'm using www.phpwebhosting.com
>
>
> > On Mon, 2004-04-19 at 15:14, Martin, Stanley G [Contractor for 
> > Sprint]
> > wrote:
> >> Some time ago I put up a web site on Domehost.com.  Everything has 
> >> been working great and I had a couple questions for their Tech 
> >> Support but haven't received any feedback from them, they don't 
> >> answer their phones. Also, it is stated on their site that a 
> >> company called Wintek Computing took them over last year.  I can't 
> >> contact them either.  Does anyone know anything that may have 
> >> happened here?  I suspect I need to find another web hosting 
> >> company before my site just goes away.
> >>
> >> Stanley G. Martin
> >> System Administrator
> >> Sprint - EAS Business Intelligence [EMAIL PROTECTED]
> > --
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] OT- Namespaces in PHP

2004-03-30 Thread Justin Palmer
Wow this post has really stirred up the pot.

Regards,

Justin Palmer


-Original Message-
From: Justin Patrin [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 30, 2004 10:29 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Namespaces in PHP


Jason Barnett wrote:

> Richard Davey wrote:
> 
>> Hello Justin,
>>
>> Tuesday, March 30, 2004, 6:27:20 PM, you wrote:
>>
>> JP> I also have no idea what Agent 2 is
>>
>> It's a Windows based news-reader (the free version is called
>> FreeAgent) - think tin with knobs on.
>>
>> Oh and to the OP: Agent 2 is OUT and available, has been for a short 
>> while now
>>
> 
> I can understand personal preferences, but I can tell you that I'm 
> using
> Thunderbird right now on my windows laptop to post to this newsgroup
:)

As am I.

-- 
paperCrane 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Namespaces in PHP

2004-03-29 Thread Justin Palmer
Hey listen Rob,

I was not trying to give you a hard time (or split hairs).  In fact I am
grateful for your answer and your want to explain even more in depth
than some of the one line answers on the list.  The reason that I was
splitting hairs was because I got 3 or 4 emails to my personal account
regarding namespaces and what they were used for.  Also, one of them
quoted you and how you used "namespace ideology" in a object example.  I
should of explained more about the other emails and you would have seen
up front that I was not giving you a hard time.

I am once again sorry to offend you and offend the list (if I did so).

My apologies,

Justin Palmer

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 29, 2004 4:34 PM
To: [EMAIL PROTECTED]
Cc: PHP-General
Subject: RE: [PHP] Namespaces in PHP


On Mon, 2004-03-29 at 18:42, Justin Palmer wrote:
> Hi,
> 
> I just don't see it as a "namespace ideology", it is just how objects 
> work.  I know that he knows that it is encapsulation.  My point being 
> that it should not really be called that because it has nothing really

> to do with namespaces.  Which is what my original post/question was 
> about.  I also think that people should use correct terminology so 
> that people that are newer to programming start off right.  I guess 
> that this is just a personal preference.
> 
> Sorry for the confusion and any offence taken by anyone.

In you original post you state:

On Mon, 2004-03-29 at 17:01, Justin Palmer wrote:
> Hi,
> 
> I did not think that PHP supported namespaces?  I would love to see it

> if it is possible.  What sparked my interest was this post:
> 
> http://news.php.net/article.php?group=php.general&article=181728
> 

I gave you a response on topic with this question. I explicitly declare
in my original response, at the beginning nonetheless, that PHP does not
have namespaces, then I went on to explain what was meant in the link
you had quoted. Since you didn't seem to understand, I thought using
less technical language, and simplistic examples would help. It appears
however, you weren't really interested in the answer, rather you were
interested in splitting hairs with respect to the definition of
"namespace". My humble apologies for wasting your time.

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.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Namespaces in PHP

2004-03-29 Thread Justin Palmer
Hi,

I just don't see it as a "namespace ideology", it is just how objects
work.  I know that he knows that it is encapsulation.  My point being
that it should not really be called that because it has nothing really
to do with namespaces.  Which is what my original post/question was
about.  I also think that people should use correct terminology so that
people that are newer to programming start off right.  I guess that this
is just a personal preference.

Sorry for the confusion and any offence taken by anyone.

P.S. Why do a lot of people email off list?  I get doubles.

Regards,

Justin Palmer
IT Administrator
___
Council for Educational Travel, USA
1403 View Avenue
Centralia, WA 98531
USA



-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 29, 2004 3:10 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] Namespaces in PHP


--- Justin Palmer <[EMAIL PROTECTED]> wrote:
> Your statement of:
> 
> > PHP doesn't support namespaces; however, functions defined within a 
> > class definition are essentially conform to namespace ideology since

> > the function would need to be defined twice in the same class to 
> > cause an collision.
> 
> Does not make sense this is not a namespace ideology at all it is 
> called encapsulation.

It makes perfect sense to me. Robert knows that this is called
encapsulation. Don't let fancy terms make you lose sight of what's being
discussed.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Namespaces in PHP

2004-03-29 Thread Justin Palmer
Robert, please keep it on list, no need to email me personally.

You would most likely not be both using a Session class but more over
what if we made to different classes that performed quite different
tasks, but for some reason or another we called named them the same.
That is the true reason for Namespaces.  Your statement of:

PHP doesn't support namespaces; however, functions defined within a 
> class definition are essentially conform to namespace ideology since 
> the function would need to be defined twice in the same class to cause

> an collision.

Does not make sense this is not a namespace ideology at all it is called
encapsulation.  This is what threw me off.  Sorry to affend you:


If they don't help clarify my point, then I'm afraid that I can't
clarify it any better for you and wish you luck in the future :)


Regards,

Justin Palmer
IT Administrator
___
Council for Educational Travel, USA
1403 View Avenue
Centralia, WA 98531
USA



-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 29, 2004 2:42 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Namespaces in PHP


On Mon, 2004-03-29 at 17:35, Justin Palmer wrote:
> Hi,
> 
> I don't see how you are saving any sort of collision at all with the 
> below, unless it is by chance.  Say that you and I are on different 
> teams within the same company.  Then you and I are put onto the same 
> team.  Both of us use our Session Class, named Session, out of our 
> toolkits. To build different pieces of a project that we are working 
> on. When we go to put it together our software blows up with 
> conflicting Object names.  The function within the class CAN have the 
> same names it is all about what you call the class.
> 
> I am confused into what you wrote below.  Please explain.

If you are working in your company and BOTH you and someone else are
both implementing a session class then you have an ifficient company.
That said my example was to illustrate how the functions defined within
classes avoid naming collisions with functions of the same name in other
classes. For instance:

class Session
{
function getData( $key )
{
// Some code.
}
}

class Cache
{
function getData( $key )
{
// Some code.
}
}

Obviously here the getData() functions don't collide because they are
encapsulated within their respective classes. These probably aren't the
best exmaples, but they should illustrate the point I was making. If
they don't help clarify my point, then I'm afraid that I can't clarify
it any better for you and wish you luck in the future :) As I said in my
original response this doesn't solve collisions with class names.

Cheers,
Rob.

> 
> Regards,
> 
> Justin Palmer
> IT Administrator
> ___
> Council for Educational Travel, USA
> 1403 View Avenue
> Centralia, WA 98531
> USA
> 
> 
> 
> -Original Message-
> From: Robert Cummings [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 29, 2004 2:14 PM
> To: [EMAIL PROTECTED]
> Cc: PHP-General
> Subject: Re: [PHP] Namespaces in PHP
> 
> 
> On Mon, 2004-03-29 at 17:01, Justin Palmer wrote:
> > Hi,
> > 
> > I did not think that PHP supported namespaces?  I would love to see 
> > it
> 
> > if it is possible.  What sparked my interest was this post:
> > 
> > http://news.php.net/article.php?group=php.general&article=181728
> > 
> > 
> > There are lots of other things, of course. One method of learning
> > about this would be to take every OO term (encapsulation,
namespacing,
> 
> > etc.) and find a really good explanation of the term. 
> > 
> > Let me know.
> 
> PHP doesn't support namespaces; however, functions defined within a 
> class definition are essentially conform to namespace ideology since 
> the function would need to be defined twice in the same class to cause

> an collision. In practice this doesn't happen, hwoever the possiblity 
> for class names to collide is still an issue. Class names generally 
> collide less than raw functions. It is also useful to point out that a

> heirarchical naming scheme for functions provides the same benefit. 
> For instance contrast:
> 
> class Session
> {
> function getData( $key )
> {
> // Some code.
> }
> 
> function setData( $key, $value )
> {
> // Some code.
> }
> }
> 
> Versus the following function naming scheme:
> 
> function Session_getData( $sessResource, $key )
> {
> // Some code.
> }
> 
> function Session_setData( $sessResource, $key, $value )
> {
> // Some code.
> }
> 
> HTH and HAND a

RE: [PHP] Namespaces in PHP

2004-03-29 Thread Justin Palmer
Rene, no need to email me personally, please keep it on list.

If you have worked with Java then you should know the true reason for
using namespaces.  See my previous email to this topic for my
explanation.  Namespace collision is a large cause for software blowing
up when multiple programmers use their own objects from their toolkits
into one large project.

Namespaces are only for the use of Classes.  Unless we are talking XML
or other technologies.  As far as PHP, Java, VB(which uses namespaces
now), C++.

Regards,

Justin Palmer
IT Administrator
___
Council for Educational Travel, USA
1403 View Avenue
Centralia, WA 98531
USA


-Original Message-
From: -{ Rene Brehmer }- [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 29, 2004 3:11 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Namespaces in PHP


PHP don't, it don't even have variable scope unless you write everything
as 
classes ...

I'm learning C++ ... and I've yet to figure out what sensible point
there 
is in having namespaces ... coming from Basic and Java, it's just
pointless 
waste of time  (I'm new to C++, but have been programming for 20
years 
in Basic, for 2 years in Java, 1½ year in PHP, and besides that
JavaScript, 
various LISP languages, and a little Pascal, so feel free to flame me
for 
something I just don't see the point it...)


Rene

At 23:01 29-03-2004, you wrote:
>Hi,
>
>I did not think that PHP supported namespaces?  I would love to see it 
>if it is possible.  What sparked my interest was this post:
>
>http://news.php.net/article.php?group=php.general&article=181728
>
>
>There are lots of other things, of course. One method of learning about

>this would be to take every OO term (encapsulation, namespacing, etc.) 
>and find a really good explanation of the term.
>
>
>Let me know.
>
>Kind regards,
>
>Justin Palmer

-- 
Rene Brehmer
aka Metalbunny

~ If you don't like what I have to say ... don't read it ~

http://metalbunny.net/
References, tools, and other useful stuff...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Namespaces in PHP

2004-03-29 Thread Justin Palmer
Hi,

I did not think that PHP supported namespaces?  I would love to see it
if it is possible.  What sparked my interest was this post:

http://news.php.net/article.php?group=php.general&article=181728


There are lots of other things, of course. One method of learning about
this would be to take every OO term (encapsulation, namespacing, etc.)
and
find a really good explanation of the term.


Let me know.

Kind regards,

Justin Palmer
IT Administrator
___
Council for Educational Travel, USA
1403 View Avenue
Centralia, WA 98531
USA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] features in PHP

2002-02-08 Thread Justin Palmer

Hi all,

Since I couldn't find solid docs on the web about this...

I was curious if PHP in Apache 2.0 implements a couple features that I'm 
used to using in the AOLserver world:

-- Can PHP hold a global cache that's accessible for all threads?

-- How well do persistent database connections work in PHP?  I recall 
some tests saying that persistent connections with MySQL were actually 
slower in PHP 4.0.x than building and tearing down a MySQL connection 
each time you wanted to query info from the database.

-- What are the performance differences (if any) between pooled 
connections to MySQL vs Postgres?

Thanks!

Justin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php