php-general Digest 1 Oct 2007 00:08:27 -0000 Issue 5047

Topics (messages 262594 through 262602):

Re: counting with leading zeros
        262594 by: Robert Cummings
        262595 by: Jeffery Fernandez
        262596 by: tedd

Re: Classes and access to outside variables
        262597 by: Martin Alterisio

Re: Session problem
        262598 by: Dušan Novaković
        262599 by: Jim Lucas

PHP and daylight savings
        262600 by: Bruce Cowin
        262601 by: Bruce Cowin
        262602 by: Bruce Cowin

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 Sat, 2007-09-29 at 23:47 -0400, brian wrote:
>
> It's not so much that i disrespect Rob. It's just that i felt i had to 
> call him out for being a dickhead by taking my statement out of context.

Ok, so I'm a dickhead. What does that make you? A vagina?

Name calling really is the lowest form of argumentation. It was fun when
I was 7. So were swear words.

Cheers,
Rob.
-- 
...........................................................
SwarmBuy.com - http://www.swarmbuy.com

    Leveraging the buying power of the masses!
...........................................................

--- End Message ---
--- Begin Message ---
gee you guys behave like kids. don't you all have other things to do than 
whinge, swear  and blame each other on the list? Take it elsewhere and sort 
it out. This is bad for the PHP community in general. It doesn't reflect what 
the community is about.

my 2c.

On Sunday 30 September 2007 13:47, brian wrote:
> tedd wrote:
> > At 8:30 PM -0400 9/27/07, brian wrote:
> >> I wasn't bitching! And i *thought* that my numerous attempts at
> >> explaining such would have been enough. Obviously not, but wtf can you
> >> do with people who seem to want only to stir up shit?
> >
> > It sure sounded like you were bitching.
>
> Gee, thanks for pointing that out, Jeeves. I'd say it's pretty damned
> obvious now that Rob thought i was bitching about his response to my
> query. However, if you'd have bothered to note my replies since, you
> might have twigged to the fact that i'd been trying to set that
> straight. But you just *had* to send off your own dickish response.
>
> > And, your off-list "fuck you, too, asswipe" to me certainly seems to
> > support that -- don't you think?
>
> How so? Had it crossed your little mind that maybe--just maybe--i was
> becoming not a little frustrated with the fact that my reply had been
> taken the wrong way? That, instead of accepting that and moving on, this
> had become far too OT with bullshit comments such as yours? So, yeah,
> you might say that i'm bitching *now*.
>
> You and i have had our run-ins on this list on more than one occasion.
> Until now, i've chosen to take your crap in stride. If you have nothing
> constructive to add then STFU.
>
> > Look, there's nothing you can say to me that hasn't been said before
> > (some of it deserving), so my advice is for you to refrain from such
> > conduct and at least try to look professional. That way you'll hide your
> > ignorance a little longer -- it's always worked for me.
>
> This is me laughing. I'm sure you have no bloody idea how funny that
> statement looks from where i'm sitting. See the paragraph above.
>
> > Dan Parry wrote:
> >> Can I please interject and say that I vastly respect Tedd(ddd) and
> >> Rob(bb?) and their opinions
>
> It's not so much that i disrespect Rob. It's just that i felt i had to
> call him out for being a dickhead by taking my statement out of context.
>
> Tedd ... not so very much at all.
>
> Robert Cummings wrote:
>  > On Fri, 2007-09-28 at 12:05 -0400, tedd wrote:
>  >>>>At 10:39 PM -0400 9/26/07, brian wrote:
>  >>>
>  >>>fuck you, too, asswipe
>  >
>  > Seems to be, an extra, comma, in the phrase. It reads, like Captain
>  > Kirk, saying, it.
>
> Funny. Reminds of a Capt. Kirk quote:
> "No more blah, blah, blah!"
>
> brian

-- 
Powered by openSUSE 10.2 (i586) Kernel: 2.6.18.8-0.5-default
KDE: 3.5.5 "release 45.4"
 10:55pm  up 10 days  2:22,  3 users,  load average: 0.13, 0.18, 0.17

--- End Message ---
--- Begin Message ---
At 11:47 PM -0400 9/29/07, brian wrote:
You and i have had our run-ins on this list on more than one occasion. Until now, i've chosen to take your crap in stride.

brian

I haven't noticed any "run-ins". I don't care if you've been the biggest prick on the net -- if you ask a question and it's within my scope to answer, I'll try to answer -- that's what this list is about. I seldom remember who said what, nor do I keep score -- I haven't got time for that.

As for taking "crap", that's your perception for I don't dish any out. If you take offense to anything I say, then say so and I'll explain myself -- I'm not here to insult anyone. I haven't got time for that either.

 If you have nothing constructive to add then STFU.

If I do shut up, or not, will be my decision and not your's. You seem to have an attitude that the net is yours and our time is here for you to use and abuse at your will. Clearly, you have some unrealized issues -- but, that's your problem to work out.

However, when I see someone try to help another and see that it's not appreciated, then I can make comment if I want because it IS constructive to point out civility on the net. Telling someone to fuck-off or calling someone a dick-head is certainly not constructive and degrades the professionalism of the list. That should be obvious.

If you want to be treated fairly, then treat others that way. Don't always assume that you're right and everyone else is wrong and thus you have liberty to call people names because that doesn't promote an exchange of information, which is what this list is about. It's clear, at least to me, that you have problems with that as well.

So, why don't we let this thread drop -- you called everyone names and used whatever language you thought appropriate and I hope you feel better now. Hopefully next time, we can all be more civil to each other.

Cheers,

tedd


Look, there's nothing you can say to me that hasn't been said before (some of it deserving), so my advice is for you to refrain from such conduct and at least try to look professional. That way you'll hide your ignorance a little longer -- it's always worked for me.

This is me laughing. I'm sure you have no bloody idea how funny that statement looks from where i'm sitting. See the paragraph above.

Dan Parry wrote:
Can I please interject and say that I vastly respect Tedd(ddd) and Rob(bb?)
and their opinions


It's not so much that i disrespect Rob. It's just that i felt i had to call him out for being a dickhead by taking my statement out of context.

Tedd ... not so very much at all.

Robert Cummings wrote:
 On Fri, 2007-09-28 at 12:05 -0400, tedd wrote:

At 10:39 PM -0400 9/26/07, brian wrote:

fuck you, too, asswipe

 Seems to be, an extra, comma, in the phrase. It reads, like Captain
 Kirk, saying, it.


Funny. Reminds of a Capt. Kirk quote:
"No more blah, blah, blah!"

brian

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


--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
That's incorrectly syntactically. Won't run.

----

Ok, let's write some code to show how this can be done:

class SearchHelper extends AjaxACApplication {
  private $dbh;
  public function __construct() {
    $this->dbh = $GLOBALS['dbh'];
  }
}

----

Better yet, pass the database host in the construction:

class SearchHelper extends AjaxACApplication {
  private $dbh;
  public function __construct($dbh) {
    $this->dbh = $dbh;
  }
}

$searchHelper = new SearchHelper($dbh);

----

Even better, DON'T use globals:

class DatabaseConnectionInfo {
  private var $host;
  ...
  public function getHost() {
    return $this->host();
  }
  ...
  private static $defaultConnectionInfo;
  public static function getDefault() {
    if (self::$defaultConnectionInfo === null) {
    ...build default connection...
    }
    return self::$defaultConnectionInfo;
  }
}

class SearchHelper extends AjaxACApplication {
  private $dbh;
  public function __construct(DatabaseConnectionInfo $connectionInfo = null)
{
    if ($connectionInfo === null) {
      $connectionInfo = DatabaseConnectionInfo::getDefault();
    }
    $this->dbh = $connectionInfo->getHost();
  }
}

Yes, I know what you're thinking, too much more code for just a stupid
thing. Trust me, refactoring it's easier when the code was written right the
first time.

2007/9/30, 潘志彬 <[EMAIL PROTECTED]>:
>
> $dbh = 'test';
>
> class search_helper extends AjaxACApplication
>     {
>         /**
>          * Database connection details
>          */
>
>        // announce global variable before use it
>        global $dbh;
>
>         $db_hostname = $dbh;
>
>
>        ...
>
> Regards,
> Ryu
>
>
>
> 2007/9/29, Merlin <[EMAIL PROTECTED]>:
> >
> > Hi there,
> >
> > I am new to PHP classes and I do want to access a variable outside the
> > class, but somehow that does not work. global also does not have any
> > effect.
> >
> > In the following example I would like to be able to access $dbh from
> > inside the class like I did in that example. This does not work. Can
> > somebody please give me a hint on the right syntax?
> >
> > $dbh = 'test';
> >
> > class search_helper extends AjaxACApplication
> >     {
> >         /**
> >          * Database connection details
> >          */
> >
> >         var $db_hostname = $dbh;
> >
> > Thank you for any help,
> >
> > Merlin
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

--- End Message ---
--- Begin Message ---
Does no one have some solution or suggestion?

Dušan


On 9/29/07, Dušan Novaković <[EMAIL PROTECTED]> wrote:
> Hm..
>
> I don't know that. I have also another application on the same server,
> and I haven't encountered problems of the same kind. I don't know
> whether these problems don't happend at all on this other application,
> or I just haven't come across one. :-(
>
> Dušan
>
>
> On 9/28/07, Jim Lucas <[EMAIL PROTECTED]> wrote:
> > Dušan Novaković wrote:
> > > Hi,
> > >
> > > I have two problems with sessions.
> > >
> > > Firstly, even though session limit is set on default value on server,
> > > which is about 5 hours, if I don't take any action for about 15 mins I
> > > am thrown out and I have to log in again. Are there any addition
> > > functions which I can use in order to explicitly specify session
> > > lifetime?
> > >
> > > Secondly, after a certain period of time, while I am logged in, page
> > > just freezes and it indicates that it is trying to load. Page stays
> > > frozen all the time. At that moment, the only solution is to clear
> > > private data in the browser. After that, I am logged out and I can
> > > regulary log in and procede to work normally. It doesn't happend evry
> > > time I log in, but once in while.
> > >
> > > I have only used functions such as session_start()  and session_destroy.
> > >
> > > Thanks for your help,
> > > Dušan
> > >
> > > - -
> > > made by Dusan
> >
> > sounds like a problem with the hosting provider.
> >
> > Is this a single server that you have your web site on, or is it a farm of 
> > servers?
> >
> > --
> > Jim Lucas
> >
> >     "Some men are born to greatness, some achieve greatness,
> >         and some have greatness thrust upon them."
> >
> > Twelfth Night, Act II, Scene V
> >      by William Shakespeare
> >
> >
>
>
> --
> made by Dusan
>


-- 
made by Dusan

--- End Message ---
--- Begin Message ---
Dušan Novaković wrote:
Does no one have some solution or suggestion?

Dušan


On 9/29/07, Dušan Novaković <[EMAIL PROTECTED]> wrote:
Hm..

I don't know that. I have also another application on the same server,
and I haven't encountered problems of the same kind. I don't know
whether these problems don't happend at all on this other application,
or I just haven't come across one. :-(

Dušan


On 9/28/07, Jim Lucas <[EMAIL PROTECTED]> wrote:
Dušan Novaković wrote:
Hi,

I have two problems with sessions.

Firstly, even though session limit is set on default value on server,
which is about 5 hours, if I don't take any action for about 15 mins I
am thrown out and I have to log in again. Are there any addition
functions which I can use in order to explicitly specify session
lifetime?

Secondly, after a certain period of time, while I am logged in, page
just freezes and it indicates that it is trying to load. Page stays
frozen all the time. At that moment, the only solution is to clear
private data in the browser. After that, I am logged out and I can
regulary log in and procede to work normally. It doesn't happend evry
time I log in, but once in while.

I have only used functions such as session_start()  and session_destroy.

Thanks for your help,
Dušan

- -
made by Dusan
sounds like a problem with the hosting provider.

Is this a single server that you have your web site on, or is it a farm of 
servers?

--
Jim Lucas

    "Some men are born to greatness, some achieve greatness,
        and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
     by William Shakespeare



--
made by Dusan




I would have the host then double check the config. Make sure the location where the session files are being written to is writable by the php user.

Have them compare the two configs between the different sites. See if anything besides the document root is different.

Or, upgrade to a dedicated host and run the web server your self.

--
Jim Lucas


    "Perseverance is not a long race;
        it is many short races one after the other"

Walter Elliot



    "Some men are born to greatness, some achieve greatness,
        and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

--- End Message ---
--- Begin Message ---
I'm using PHP 5.1.2 on IIS.  Here in New Zealand, our daylight savings started 
a week earlier than usual and went into affect this past weekend.  The time on 
my machine is correct.  The timezone settings on my machine are correct.  But 
if I display the time on a PHP page, it is 1 hour behind.  Setting the timezone 
with date_default_timezone_set() doesn't make any difference.  If I display the 
time on an ASP page, it shows the correct time so it can't be an IIS problem I 
don't think.

Why would PHP be showing the time as if it hadn't changed?  Where is it getting 
the time from?  Here is the code I'm using:

        date_default_timezone_set('Pacific/Auckland');
        echo "time is " . date("h:i:s");




Regards,

Bruce

--- End Message ---
--- Begin Message ---
I discovered that we needed to update the php_timezonedb.dll.  This worked fine 
on our servers and time is now correct.  But in my dev environment on my 
machine, when I put the same dll in (with the same version of PHP), I get a CGI 
error when PHP tries to do anything.  Anyone know why?



Regards,

Bruce

>>> "Bruce Cowin" <[EMAIL PROTECTED]> 1/10/2007 11:02 a.m. >>>
I'm using PHP 5.1.2 on IIS.  Here in New Zealand, our daylight savings started 
a week earlier than usual and went into affect this past weekend.  The time on 
my machine is correct.  The timezone settings on my machine are correct.  But 
if I display the time on a PHP page, it is 1 hour behind.  Setting the timezone 
with date_default_timezone_set() doesn't make any difference.  If I display the 
time on an ASP page, it shows the correct time so it can't be an IIS problem I 
don't think.

Why would PHP be showing the time as if it hadn't changed?  Where is it getting 
the time from?  Here is the code I'm using:

        date_default_timezone_set('Pacific/Auckland');
        echo "time is " . date("h:i:s");




Regards,

Bruce

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

--- End Message ---
--- Begin Message ---
Yet another update!  I managed to get rid of the CGI error by turning off error 
logging to the syslog.  But now I get this message:

PHP Warning: PHP Startup: Unable to load dynamic library 
'c:\php\ext\php_timezonedb.dll' - Access is denied. in Unknown on line 0

As I say, this same dll works fine on a server running the same PHP version 
(5.1.2).  Any ideas?



Regards,

Bruce

>>> "Bruce Cowin" <[EMAIL PROTECTED]> 1/10/2007 12:13 p.m. >>>
I discovered that we needed to update the php_timezonedb.dll.  This worked fine 
on our servers and time is now correct.  But in my dev environment on my 
machine, when I put the same dll in (with the same version of PHP), I get a CGI 
error when PHP tries to do anything.  Anyone know why?



Regards,

Bruce

>>> "Bruce Cowin" <[EMAIL PROTECTED]> 1/10/2007 11:02 a.m. >>>
I'm using PHP 5.1.2 on IIS.  Here in New Zealand, our daylight savings started 
a week earlier than usual and went into affect this past weekend.  The time on 
my machine is correct.  The timezone settings on my machine are correct.  But 
if I display the time on a PHP page, it is 1 hour behind.  Setting the timezone 
with date_default_timezone_set() doesn't make any difference.  If I display the 
time on an ASP page, it shows the correct time so it can't be an IIS problem I 
don't think.

Why would PHP be showing the time as if it hadn't changed?  Where is it getting 
the time from?  Here is the code I'm using:

        date_default_timezone_set('Pacific/Auckland');
        echo "time is " . date("h:i:s");




Regards,

Bruce

--
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 

--- End Message ---

Reply via email to