[PHP] Problem with DATE 2010-10-31

2010-10-12 Thread Rado Oršula
I do not know good English.
In the attached source code.
Here is erroneous statement:

date: 2010-10-31 00:00:00
date+*0*h: 2010-10-31 *00*:00:00
date+*1*h: 2010-10-31 *01*:00:00
*date+2h: 2010-10-31 02:00:00  <<<
date+3h: 2010-10-31 02:00:00  <<<*
date+*4*h: 2010-10-31 *03*:00:00
date+5h: 2010-10-31 04:00:00
date+6h: 2010-10-31 05:00:00
date+7h: 2010-10-31 06:00:00
date+8h: 2010-10-31 07:00:00
date+9h: 2010-10-31 08:00:00
date+10h: 2010-10-31 09:00:00
date+11h: 2010-10-31 10:00:00
date+12h: 2010-10-31 11:00:00
date+13h: 2010-10-31 12:00:00
date+14h: 2010-10-31 13:00:00
date+15h: 2010-10-31 14:00:00
date+16h: 2010-10-31 15:00:00
date+17h: 2010-10-31 16:00:00
date+18h: 2010-10-31 17:00:00
date+19h: 2010-10-31 18:00:00
date+20h: 2010-10-31 19:00:00
date+21h: 2010-10-31 20:00:00
date+22h: 2010-10-31 21:00:00
date+23h: 2010-10-31 22:00:00
date+24h: 2010-10-31 23:00:00
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Scripts running twice

2010-10-12 Thread Richard Quadling
On 11 October 2010 21:37, Alexis  wrote:
> Thanks for perservingnope just the two entries per script..one start and
> one stopalso checked the multi tab and that is set to just the once as
> well.
> One thing I forgot to say before is that even if I run the scripts manually,
> then they still run the twice.sorry about missing that bit out...
>
> On 11/10/10 14:27, Richard Quadling wrote:
>>
>> On 11 October 2010 21:20, Alexis  wrote:
>>>
>>> Thanks for the quick response...checked and no duplicates Richard
>>>
>>> On 11/10/10 14:14, Richard Quadling wrote:

 On 11 October 2010 21:10, Alexis    wrote:
>
> Hi,
>
> A very vague question here I am afraidI have quite a number of php
> scripts running on a WinXp box using the built in Scheduler.
>
> Everything worked fine for years until one day an update was
> done...cannot
> remember if it was on PHP, Apache, Mysql or the firefox browser, but
> now
> most but not all, of the scripts run twice!
>
> I was going to say any help would be appreciated, but due to the nature
> of
> my vagueness as to what was updated, that question becomes a little
> moot.Or
> does it?
>
> Is there any way of finding out what exactly is triggering the scripts
> to
> run, specifically the second trigger.
>
> I am not even sure if the script finishes running and then restarts, or
> whether two instances of it are started at the same time.
>
> Cheers
> Alexis
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

 Take a look in C:\windows\tasks.

 Do you have a load of "Copy of " versions?

 If you see multiple versions, just delete them.

 You may need to do this via a command prompt to see the copies.

>>
>> OK. When they run, are they running at the same time? If you check the
>> scheduled task log file ... C:\WINDOWS\SchedLgu.TXT
>>
>> Take a look through the task setup. See if it has been set to run
>> twice. On the Schedule tab, there is an option at the bottom - "Show
>> multiple schedules".
>>
>> If this option is set, then the top of the page has a drop down/list
>> showing the scheduled versions. Are there more than 1? Is the checkbox
>> checked?
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Can you cut and paste the command you are using for the task?

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] Problem with DATE 2010-10-31

2010-10-12 Thread richard gray

 On 12/10/2010 11:52, Rado Oršula wrote:

I do not know good English.
In the attached source code.
Here is erroneous statement:

date: 2010-10-31 00:00:00
date+*0*h: 2010-10-31 *00*:00:00
date+*1*h: 2010-10-31 *01*:00:00
*date+2h: 2010-10-31 02:00:00 <<<
date+3h: 2010-10-31 02:00:00 <<<*
date+*4*h: 2010-10-31 *03*:00:00

[snip]

probably at that time the Daylight Savings Time change kicks in ...


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



Re: [PHP] Problem with DATE 2010-10-31

2010-10-12 Thread Richard Quadling
On 12 October 2010 10:52, Rado Oršula  wrote:
> I do not know good English.
> In the attached source code.
> Here is erroneous statement:
>
> date: 2010-10-31 00:00:00
> date+0h: 2010-10-31 00:00:00
> date+1h: 2010-10-31 01:00:00
> date+2h: 2010-10-31 02:00:00  <<<
> date+3h: 2010-10-31 02:00:00  <<<
> date+4h: 2010-10-31 03:00:00
> date+5h: 2010-10-31 04:00:00
> date+6h: 2010-10-31 05:00:00
> date+7h: 2010-10-31 06:00:00
> date+8h: 2010-10-31 07:00:00
> date+9h: 2010-10-31 08:00:00
> date+10h: 2010-10-31 09:00:00
> date+11h: 2010-10-31 10:00:00
> date+12h: 2010-10-31 11:00:00
> date+13h: 2010-10-31 12:00:00
> date+14h: 2010-10-31 13:00:00
> date+15h: 2010-10-31 14:00:00
> date+16h: 2010-10-31 15:00:00
> date+17h: 2010-10-31 16:00:00
> date+18h: 2010-10-31 17:00:00
> date+19h: 2010-10-31 18:00:00
> date+20h: 2010-10-31 19:00:00
> date+21h: 2010-10-31 20:00:00
> date+22h: 2010-10-31 21:00:00
> date+23h: 2010-10-31 22:00:00
> date+24h: 2010-10-31 23:00:00

What timezone are you in?

In the UK GMT's BST is about to end and revert to standard GMT (If
D.R. reads this I apologize for the wishy washy explanation).

So, if you were to include the DST, the output would look right.

date+0h: 2010-10-31 00:00:00 BST
date+1h: 2010-10-31 01:00:00 BST
date+2h: 2010-10-31 02:00:00  BST<<<
date+3h: 2010-10-31 02:00:00 GMT<<<
date+4h: 2010-10-31 03:00:00 GMT
date+5h: 2010-10-31 04:00:00 GMT
date+6h: 2010-10-31 05:00:00 GMT



-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] class object vs array for db table model

2010-10-12 Thread chris h
On Tue, Oct 12, 2010 at 2:38 AM, Tommy Pham  wrote:

> Hi everyone,
>
> It's been a couple years since I've did a project in PHP.  The current
> project I'm working on is for PHP 5.3 and I noticed a performance issue.
>  Is
> it just me or is there a BIG difference in performance between class object
> vs array for PHP 5.3?  Below is the sample:
>
> class MyTable
> {
>private $_id; // int
>private $_name; // varchar
>private $_description; // text
>
>public  function __construct() {}
>
>public function getId()
>{
>return $this->_id;
>}
>public function getName()
>{
>return $this->_name;
>}
>public function getDescription()
>{
>return $this->_description;
>}
>
>public function setId($id)
>{
>$this->_id = $id;
>}
>public function setName($name)
>{
>$this->_name = $name;
>}
>public function setDescription($description)
>{
>$this->_description = $description;
>}
> }
>
> $my_table = array ('id' => 'id value', 'name' => 'name value',
> 'description'
> => 'long description text');
>
> The above are representations for my table as class and as array,
> respectively.  The only difference is how I represent the results from db:
>
> 1) as class object
> $list = array();
> while ($row = $db->fetch($result))
> {
>$my_table = new MyTable();
>$my_table->setId($row['id']);
>$my_table->setName($row['name']);
>$my_table->setDescription($row['description']);
>
>$list[$my_table->getId()] = $my_table;
> }
>
> 2) as table
> $list = array();
> while ($row = $db->fetch($result))
> {
>$my_table['id'] = $row['id'];
>$my_table['name'] = $row['name'];
>$my_table['description'] = $row['description'];
>
>$list[$my_table['id'] = $my_table;
> }
>
> The performance difference I get is about 1.4 seconds with the array in the
> lead!!!  Does anyone have the same problem?
>
> Thanks,
> Tommy
>
> PS: The above executed in 4.2 sec and 1.8 sec (on average) respectively w/o
> actually showing the results to html, while my ASP.NET project executes it
> and displays in html in about 2 seconds for all 3684 rows, using class
> similar to the MyTable.  All codes, PHP & ASP.NET C#, access the same
> MySQL
> DB on the same development box.
>
>
When you are adding a row as an object you are calling 4 user
functions: MyTable::__construct(), MyTable::setId(),
MyTable::setName(),
and MyTable::setDescription().  This adds some overhead for sure, so you
might want to think about passing the row array into the construct and doing
away with the setters (at least for the initial instantiations).

Something like this...

-
public  function __construct($dataArray=null)
{
  foreach ((array)$dataArray as $rowKey => $rowValue)
  {
$this->$rowKey = $rowValue;
  }
}
==OR==
public  function __construct($dataArray=null)
{
  // maybe add casting here as well?
  $this->_id  = isset($dataArray['id'])?
  $dataArray['id']: null;
  $this->_name = isset($dataArray['name'])?
$dataArray['name']: null;
  $this->_description  = isset($dataArray['description'])?
 $dataArray['description']: null;

}
==And instantiate like this==
$list = array();
while ($row = $db->fetch($result))
{
  // I also changed setting the $list's key with "$row['id']" instead of
using the MyTable getter.
  $list[$row['id']] = new MyTable($row);
}
---

I don't know how much faster that will run for you (if at all) but using
your method you were calling 5 user functions per result set from the db
(that's the construct, the getter to set the $list key, and 1 for each of
the 3 properties of the result) for a total of 18,420 user function calls.
 With my method I'm calling 1 user function (the construct) for each set,
for a total of 3,684 calls.  Of course a down-side is that if there's any
logic in your setters then that needs to be replicated in your construct.

Another method is to use a single object for all 3684 records.  Perhaps you
can use the built in Iterator interface which lets your class's objects be
used as if they were an array for the purposes of foreach loops.
http://php.net/manual/en/language.oop5.iterations.php
You would set a pointer to the record you wish to use, and your getters and
setters would key off that element of the master array.  This should be a
fast solution, while still giving you the power of encapsulation, getters
and setters.


Hope that helps!
Chris.


Re: [PHP] class object vs array for db table model

2010-10-12 Thread Tommy Pham
On Tue, Oct 12, 2010 at 4:45 AM, chris h  wrote:
>



>
>
> When you are adding a row as an object you are calling 4 user
> functions: MyTable::__construct(), MyTable::setId(), MyTable::setName(), and
> MyTable::setDescription().  This adds some overhead for sure, so you might
> want to think about passing the row array into the construct and doing away
> with the setters (at least for the initial instantiations).
> Something like this...
> -
> public  function __construct($dataArray=null)
> {
>   foreach ((array)$dataArray as $rowKey => $rowValue)
>   {
>     $this->$rowKey = $rowValue;
>   }
> }
> ==OR==
> public  function __construct($dataArray=null)
> {
>   // maybe add casting here as well?
>   $this->_id              = isset($dataArray['id'])?
>   $dataArray['id']: null;
>   $this->_name         = isset($dataArray['name'])?
> $dataArray['name']: null;
>   $this->_description  = isset($dataArray['description'])?
>  $dataArray['description']: null;
> }
> ==And instantiate like this==
> $list = array();
> while ($row = $db->fetch($result))
> {
>   // I also changed setting the $list's key with "$row['id']" instead of
> using the MyTable getter.
>   $list[$row['id']] = new MyTable($row);
> }
> ---
> I don't know how much faster that will run for you (if at all) but using
> your method you were calling 5 user functions per result set from the db
> (that's the construct, the getter to set the $list key, and 1 for each of
> the 3 properties of the result) for a total of 18,420 user function calls.
>  With my method I'm calling 1 user function (the construct) for each set,
> for a total of 3,684 calls.  Of course a down-side is that if there's any
> logic in your setters then that needs to be replicated in your construct.
> Another method is to use a single object for all 3684 records.  Perhaps you
> can use the built in Iterator interface which lets your class's objects be
> used as if they were an array for the purposes of foreach loops.
> http://php.net/manual/en/language.oop5.iterations.php
> You would set a pointer to the record you wish to use, and your getters and
> setters would key off that element of the master array.  This should be a
> fast solution, while still giving you the power of encapsulation, getters
> and setters.
>
> Hope that helps!
> Chris.
>

Hi Chris,

Thanks for the reply.  The sample I made is just for simplicity and
comparison.  As for function calling 'get's, I think the speed would
come out to be same in your sample since you're doing isset()
checking.  My actual class is more sophisticated having the psuedo
overloading as you mentioned.  The class is generated from a PHP class
builder - to save on typing - I made a long time ago with some minor
update.

Anyway, I was frustrated as to why my code took so long to execute and
had to dig deep.  As it turns out, I had xdebug loaded with all
options on ... lol.  Removed the extension and all is good in the
world.  The script runs in less than 150ms :D!!!

Thanks,
Tommy

PS:  This is what I get for not coding in PHP so long ...

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



Re: [PHP] class object vs array for db table model

2010-10-12 Thread chris h
hehe that's pretty funny; also funny oversight of mine in regards to
isset()... so I guess we're both comedians today?  ;-)

Glad you got that worked out Tommy!

Chris.


On Tue, Oct 12, 2010 at 8:46 AM, Tommy Pham  wrote:

> On Tue, Oct 12, 2010 at 4:45 AM, chris h  wrote:
> >
>
> 
>
> >
> >
> > When you are adding a row as an object you are calling 4 user
> > functions: MyTable::__construct(), MyTable::setId(), MyTable::setName(),
> and
> > MyTable::setDescription().  This adds some overhead for sure, so you
> might
> > want to think about passing the row array into the construct and doing
> away
> > with the setters (at least for the initial instantiations).
> > Something like this...
> > -
> > public  function __construct($dataArray=null)
> > {
> >   foreach ((array)$dataArray as $rowKey => $rowValue)
> >   {
> > $this->$rowKey = $rowValue;
> >   }
> > }
> > ==OR==
> > public  function __construct($dataArray=null)
> > {
> >   // maybe add casting here as well?
> >   $this->_id  = isset($dataArray['id'])?
> >   $dataArray['id']: null;
> >   $this->_name = isset($dataArray['name'])?
> > $dataArray['name']: null;
> >   $this->_description  = isset($dataArray['description'])?
> >  $dataArray['description']: null;
> > }
> > ==And instantiate like this==
> > $list = array();
> > while ($row = $db->fetch($result))
> > {
> >   // I also changed setting the $list's key with "$row['id']" instead of
> > using the MyTable getter.
> >   $list[$row['id']] = new MyTable($row);
> > }
> > ---
> > I don't know how much faster that will run for you (if at all) but using
> > your method you were calling 5 user functions per result set from the db
> > (that's the construct, the getter to set the $list key, and 1 for each of
> > the 3 properties of the result) for a total of 18,420 user function
> calls.
> >  With my method I'm calling 1 user function (the construct) for each set,
> > for a total of 3,684 calls.  Of course a down-side is that if there's any
> > logic in your setters then that needs to be replicated in your construct.
> > Another method is to use a single object for all 3684 records.  Perhaps
> you
> > can use the built in Iterator interface which lets your class's objects
> be
> > used as if they were an array for the purposes of foreach loops.
> > http://php.net/manual/en/language.oop5.iterations.php
> > You would set a pointer to the record you wish to use, and your getters
> and
> > setters would key off that element of the master array.  This should be a
> > fast solution, while still giving you the power of encapsulation, getters
> > and setters.
> >
> > Hope that helps!
> > Chris.
> >
>
> Hi Chris,
>
> Thanks for the reply.  The sample I made is just for simplicity and
> comparison.  As for function calling 'get's, I think the speed would
> come out to be same in your sample since you're doing isset()
> checking.  My actual class is more sophisticated having the psuedo
> overloading as you mentioned.  The class is generated from a PHP class
> builder - to save on typing - I made a long time ago with some minor
> update.
>
> Anyway, I was frustrated as to why my code took so long to execute and
> had to dig deep.  As it turns out, I had xdebug loaded with all
> options on ... lol.  Removed the extension and all is good in the
> world.  The script runs in less than 150ms :D!!!
>
> Thanks,
> Tommy
>
> PS:  This is what I get for not coding in PHP so long ...
>


Re: [PHP] Scripts running twice

2010-10-12 Thread Alexis
If you mean how am I triggering the script, then I am simply opening it 
up in my web browser...


On 12/10/10 04:21, Richard Quadling wrote:

On 11 October 2010 21:37, Alexis  wrote:

Thanks for perservingnope just the two entries per script..one start and
one stopalso checked the multi tab and that is set to just the once as
well.
One thing I forgot to say before is that even if I run the scripts manually,
then they still run the twice.sorry about missing that bit out...

On 11/10/10 14:27, Richard Quadling wrote:


On 11 October 2010 21:20, Alexiswrote:


Thanks for the quick response...checked and no duplicates Richard

On 11/10/10 14:14, Richard Quadling wrote:


On 11 October 2010 21:10, Alexis  wrote:


Hi,

A very vague question here I am afraidI have quite a number of php
scripts running on a WinXp box using the built in Scheduler.

Everything worked fine for years until one day an update was
done...cannot
remember if it was on PHP, Apache, Mysql or the firefox browser, but
now
most but not all, of the scripts run twice!

I was going to say any help would be appreciated, but due to the nature
of
my vagueness as to what was updated, that question becomes a little
moot.Or
does it?

Is there any way of finding out what exactly is triggering the scripts
to
run, specifically the second trigger.

I am not even sure if the script finishes running and then restarts, or
whether two instances of it are started at the same time.

Cheers
Alexis

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




Take a look in C:\windows\tasks.

Do you have a load of "Copy of " versions?

If you see multiple versions, just delete them.

You may need to do this via a command prompt to see the copies.



OK. When they run, are they running at the same time? If you check the
scheduled task log file ... C:\WINDOWS\SchedLgu.TXT

Take a look through the task setup. See if it has been set to run
twice. On the Schedule tab, there is an option at the bottom - "Show
multiple schedules".

If this option is set, then the top of the page has a drop down/list
showing the scheduled versions. Are there more than 1? Is the checkbox
checked?




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




Can you cut and paste the command you are using for the task?



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



Re: [PHP] Scripts running twice

2010-10-12 Thread Kranthi Krishna
apache log files will be of help

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



Re: [PHP] Scripts running twice

2010-10-12 Thread Richard Quadling
On 12 October 2010 17:16, Alexis  wrote:
> If you mean how am I triggering the script, then I am simply opening it up
> in my web browser...
>
> On 12/10/10 04:21, Richard Quadling wrote:
>>
>> On 11 October 2010 21:37, Alexis  wrote:
>>>
>>> Thanks for perservingnope just the two entries per script..one start
>>> and
>>> one stopalso checked the multi tab and that is set to just the once
>>> as
>>> well.
>>> One thing I forgot to say before is that even if I run the scripts
>>> manually,
>>> then they still run the twice.sorry about missing that bit out...
>>>
>>> On 11/10/10 14:27, Richard Quadling wrote:

 On 11 October 2010 21:20, Alexis    wrote:
>
> Thanks for the quick response...checked and no duplicates Richard
>
> On 11/10/10 14:14, Richard Quadling wrote:
>>
>> On 11 October 2010 21:10, Alexis
>>  wrote:
>>>
>>> Hi,
>>>
>>> A very vague question here I am afraidI have quite a number of
>>> php
>>> scripts running on a WinXp box using the built in Scheduler.
>>>
>>> Everything worked fine for years until one day an update was
>>> done...cannot
>>> remember if it was on PHP, Apache, Mysql or the firefox browser, but
>>> now
>>> most but not all, of the scripts run twice!
>>>
>>> I was going to say any help would be appreciated, but due to the
>>> nature
>>> of
>>> my vagueness as to what was updated, that question becomes a little
>>> moot.Or
>>> does it?
>>>
>>> Is there any way of finding out what exactly is triggering the
>>> scripts
>>> to
>>> run, specifically the second trigger.
>>>
>>> I am not even sure if the script finishes running and then restarts,
>>> or
>>> whether two instances of it are started at the same time.
>>>
>>> Cheers
>>> Alexis
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>> Take a look in C:\windows\tasks.
>>
>> Do you have a load of "Copy of " versions?
>>
>> If you see multiple versions, just delete them.
>>
>> You may need to do this via a command prompt to see the copies.
>>

 OK. When they run, are they running at the same time? If you check the
 scheduled task log file ... C:\WINDOWS\SchedLgu.TXT

 Take a look through the task setup. See if it has been set to run
 twice. On the Schedule tab, there is an option at the bottom - "Show
 multiple schedules".

 If this option is set, then the top of the page has a drop down/list
 showing the scheduled versions. Are there more than 1? Is the checkbox
 checked?


>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>> Can you cut and paste the command you are using for the task?


Now I'm confused. You said you are using the windows scheduler and now
you say you are opening them in a browser?

Which is it?

Can b64 one of the problem .job files from C:\Windows\Tasks so I can
see what it is doing?

php -n -r "echo
chunk_split(base64_encode(file_get_contents('C:\Windows\Tasks\something.job')));"

You'll get a nice block of data back. Should only be a few lines.

Alternatively, the output from ...

schtasks /query /v



-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] Scripts running twice

2010-10-12 Thread a...@ashleysheridan.co.uk
That's probably it then! Some browsers make multiple requests to speed up 
rendering of a page.

Thanks,
Ash
http://www.ashleysheridan.co.uk

- Reply message -
From: "Alexis" 
Date: Tue, Oct 12, 2010 17:16
Subject: [PHP] Scripts running twice
To: 

If you mean how am I triggering the script, then I am simply opening it 
up in my web browser...

On 12/10/10 04:21, Richard Quadling wrote:
> On 11 October 2010 21:37, Alexis  wrote:
>> Thanks for perservingnope just the two entries per script..one start and
>> one stopalso checked the multi tab and that is set to just the once as
>> well.
>> One thing I forgot to say before is that even if I run the scripts manually,
>> then they still run the twice.sorry about missing that bit out...
>>
>> On 11/10/10 14:27, Richard Quadling wrote:
>>>
>>> On 11 October 2010 21:20, Alexiswrote:

 Thanks for the quick response...checked and no duplicates Richard

 On 11/10/10 14:14, Richard Quadling wrote:
>
> On 11 October 2010 21:10, Alexis  wrote:
>>
>> Hi,
>>
>> A very vague question here I am afraidI have quite a number of php
>> scripts running on a WinXp box using the built in Scheduler.
>>
>> Everything worked fine for years until one day an update was
>> done...cannot
>> remember if it was on PHP, Apache, Mysql or the firefox browser, but
>> now
>> most but not all, of the scripts run twice!
>>
>> I was going to say any help would be appreciated, but due to the nature
>> of
>> my vagueness as to what was updated, that question becomes a little
>> moot.Or
>> does it?
>>
>> Is there any way of finding out what exactly is triggering the scripts
>> to
>> run, specifically the second trigger.
>>
>> I am not even sure if the script finishes running and then restarts, or
>> whether two instances of it are started at the same time.
>>
>> Cheers
>> Alexis
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> Take a look in C:\windows\tasks.
>
> Do you have a load of "Copy of " versions?
>
> If you see multiple versions, just delete them.
>
> You may need to do this via a command prompt to see the copies.
>
>>>
>>> OK. When they run, are they running at the same time? If you check the
>>> scheduled task log file ... C:\WINDOWS\SchedLgu.TXT
>>>
>>> Take a look through the task setup. See if it has been set to run
>>> twice. On the Schedule tab, there is an option at the bottom - "Show
>>> multiple schedules".
>>>
>>> If this option is set, then the top of the page has a drop down/list
>>> showing the scheduled versions. Are there more than 1? Is the checkbox
>>> checked?
>>>
>>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> Can you cut and paste the command you are using for the task?
>

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



Re: [PHP] Scripts running twice

2010-10-12 Thread Ashley Sheridan
On Tue, 2010-10-12 at 20:45 +0200, Alexander Schrijver wrote:

> On Tue, Oct 12, 2010 at 05:29:39PM +0100, a...@ashleysheridan.co.uk wrote:
> > That's probably it then! Some browsers make multiple requests to speed up 
> > rendering of a page.
> 
> Do you have any examples of browsers which do this? Because that kind of
> behaviour would be wrong.



I just know that a couple of years ago, I was working on a website that
removed credits from a clients account upon a page visit. When the page
was accessed via a link, two credits were always taken. We did all sorts
of tests, from writing to the DB in a single call from that page, and
every time, it was coming up with two hits. This was happening on all
the main browsers: Fx, IE, Opera & Safari.

It's not the wrong behaviour, this is allowed behaviour when using the
GET protocol, which most general page requests are I believe.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Scripts running twice

2010-10-12 Thread Alexander Schrijver
On Tue, Oct 12, 2010 at 07:52:46PM +0100, Ashley Sheridan wrote:
> 
>On Tue, 2010-10-12 at 20:45 +0200, Alexander Schrijver wrote:
> 
> On Tue, Oct 12, 2010 at 05:29:39PM +0100, [1]...@ashleysheridan.co.uk wrote:
> > That's probably it then! Some browsers make multiple requests to speed up 
> > rend
> ering of a page.
> 
> Do you have any examples of browsers which do this? Because that kind of
> behaviour would be wrong.
> 
>I just know that a couple of years ago, I was working on a website that
>removed credits from a clients account upon a page visit. When the page
>was accessed via a link, two credits were always taken. We did all
>sorts of tests, from writing to the DB in a single call from that page,
>and every time, it was coming up with two hits. This was happening on
>all the main browsers: Fx, IE, Opera & Safari.
>It's not the wrong behaviour, this is allowed behaviour when using the
>GET protocol, which most general page requests are I believe.

Reading the HTTP RFC this is allowed for a GET request with a range specified.
I'm not sure how PHP deals with this.

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



[PHP] Google Calendar

2010-10-12 Thread Floyd Resler
I am attempting to use the Zend Gdata framework to communicate with Google 
Calendars and am having a problem.  If I start a new event like this:
$event=$gcal->newEventEntry(), nothing happens.  My code simply stops executing 
at that call.  If I replace it with this:
$event=new Zend_Gdata_Calendar_EventEntry() my code doesn't stop but I get the 
an error with this:
$event->title = $gcal->newTitle($row->title);  The error is 
"Zend/Gdata/Calendar/Extension/Title.php - no such file or directory".

I don't know enough about the Zend Framework to figure this one out!

Thanks!
Floyd


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



RE: [PHP] poll of 'public framework or roll your own'

2010-10-12 Thread Daevid Vincent
That was my poll! :)

Do you use a public framework or roll your own?
I personally find most frameworks to be either too generic or too
restricting. To do some tasks you have to jump through many hoops. I see
the benefit and certainly for prototypes they may have use, but I tend to
find that building a custom framework using some basic tools like a DB
wrapper, debug routines, selectbox routines, dynamic menu creation,
headers, footers, etc. gives all the MVC power I need. What do you do?

What's a framework? 
1   (1.9%)
I don't use any framework (by choice or policy).
9   (16.7%)
I use my own custom framework.  
33  (61.1%)
I use a public framework like Zend, Symfony, Cake, etc. 
11  (20.4% 

P.s. the link works fine for me...
http://www.rapidpoll.net/8opnt1e

And here are two more of interest maybe:
http://www.rapidpoll.net/show.aspx?id=awp1ocy
http://www.rapidpoll.net/show.aspx?id=arc1opy

> -Original Message-
> From: Tommy Pham [mailto:tommy...@gmail.com] 
> Sent: Friday, October 08, 2010 6:47 AM
> To: PHP
> Subject: [PHP] poll of 'public framework or roll your own'
> 
> Hi,
> 
> Does anyone know/remember what's the results of that old poll 
> back in mid(?)
> January?
> http://marc.info/?l=php-general&m=126455173203450&w=2
> 
> I can't seem to access http://www.rapidpoll.net/8opnt1e.
> 
> Thanks,
> Tommy
> 
> 
> -- 
> 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] Zend studio location Cross-Domain Scripting Vulnerability

2010-10-12 Thread Daevid Vincent
http://80vul.com/Zend%20studio/Zend%20studio%20location%20Cross.htm
 
Interesting. A co-worker and I were JUST noticing how our PHPDoc comments
were being parsed pretty much verbatim including  tags and links and
stuff and thought, "wow, that's stupid, that's just a XSS or injection
waiting to happen". LOL. Guess someone's ears were burning. ;-)


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



Re: [PHP] Google Calendar

2010-10-12 Thread Kranthi Krishna
The exact error message will help understand your situation

Most probable reason is Zend is not included in your include path

develop with error_reporting set to E_ALL & E_STRICT that will help
you understand many trivial errors

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



Re: [PHP] Google Calendar

2010-10-12 Thread Govinda

develop with error_reporting set to E_ALL & E_STRICT that will help
you understand many trivial errors


Krishna, allow me to jump in here and ask - is my understanding  
correct that some errors will never be reported... regardless of the  
setting for error_reporting?  ...like when I put a tab before the  
heredoc closing identifier on the same line.


-Govinda


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



Re: [PHP] Zend studio location Cross-Domain Scripting Vulnerability

2010-10-12 Thread Thijs Lensselink

 On 10/13/2010 12:19 AM, Daevid Vincent wrote:

http://80vul.com/Zend%20studio/Zend%20studio%20location%20Cross.htm

Interesting. A co-worker and I were JUST noticing how our PHPDoc comments
were being parsed pretty much verbatim including  tags and links and
stuff and thought, "wow, that's stupid, that's just a XSS or injection
waiting to happen". LOL. Guess someone's ears were burning. ;-)




Why didn't you inform Zend before you went full disclosure?

It's a nasty bug though!!

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



Re: [PHP] Google Calendar

2010-10-12 Thread Kranthi Krishna
in this case when you put a tab before the closing heredoc it is not
an error in itself. Its equivalent to removing the closing heredoc. so
PHP treats the rest of the code as part of the string.

A Parse error is reported when ?> OR end of the file is reached

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