php-general Digest 29 Jun 2011 21:07:21 -0000 Issue 7382

Topics (messages 313804 through 313812):

ApiGen - a tool for generating source code documentation
        313804 by: Ondøej Ne¹por
        313805 by: Adam Richardson

Time zones are spinning my brain
        313806 by: Brian Dunning
        313808 by: Richard Quadling
        313809 by: Geoff Shang
        313810 by: Tim Streater
        313811 by: Geoff Shang

Re: [PHP-DB] Re: radio form submission
        313807 by: Richard Quadling

PDO_INFOMIX connection problem...
        313812 by: Steve Staples

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi everybody!

We'd like to introduce you our documentation generator - ApiGen 2. We use it as a replacement for PhpDocumentor (that is not being developed for more than 3 years). You can find it on Github https://github.com/apigen/apigen along with a comprehensive readme (describing its features and command line options). Compared to PhpDocumentor, ApiGen si significantly faster and more flexible. Currently we are preparing PHP 5.4 support (mainly traits).


An interesting feature is that it describes the source using reflection, however not the PHP's reflection as you know it. We have developed our own library that emulates reflection using the tokenized source code. This library may be useful everywhere you need to process the PHP source code and don't want to include/require it. You can find it in a separate repository: https://github.com/Andrewsville/PHP-Token-Reflection


You can see some examples here:
http://andrewsville.github.com/PHP-Token-Reflection/
http://api.nella-project.org/framework/
http://jyxo.github.com/php/
http://doc.kukulich.cz/doctrine/
http://doc.kukulich.cz/phpunit/
http://doc.kukulich.cz/zend/


To install it you can either use our PEAR channel (as described in the readme) or simple download it from GitHub.


We'd be grateful for any feedback, so if you're interested please give it a try a let us know what you think :) Thanks.



Ondřej Nešpor (and...@andrewsville.cz)
Jaroslav Hanslík (kukul...@kukulich.cz)

--- End Message ---
--- Begin Message ---
I'll try it on my PHP 5.3 web framework later today. Thanks for working on
this project!

Adam

2011/6/29 Ondřej Nešpor <kon...@andrewsville.cz>

> Hi everybody!
>
> We'd like to introduce you our documentation generator - ApiGen 2. We use
> it as a replacement for PhpDocumentor (that is not being developed for more
> than 3 years). You can find it on Github https://github.com/apigen/**
> apigen <https://github.com/apigen/apigen> along with a comprehensive
> readme (describing its features and command line options). Compared to
> PhpDocumentor, ApiGen si significantly faster and more flexible. Currently
> we are preparing PHP 5.4 support (mainly traits).
>
>
> An interesting feature is that it describes the source using reflection,
> however not the PHP's reflection as you know it. We have developed our own
> library that emulates reflection using the tokenized source code. This
> library may be useful everywhere you need to process the PHP source code and
> don't want to include/require it. You can find it in a separate repository:
> https://github.com/**Andrewsville/PHP-Token-**Reflection<https://github.com/Andrewsville/PHP-Token-Reflection>
>
>
> You can see some examples here:
> http://andrewsville.github.**com/PHP-Token-Reflection/<http://andrewsville.github.com/PHP-Token-Reflection/>
> http://api.nella-project.org/**framework/<http://api.nella-project.org/framework/>
> http://jyxo.github.com/php/
> http://doc.kukulich.cz/**doctrine/ <http://doc.kukulich.cz/doctrine/>
> http://doc.kukulich.cz/**phpunit/ <http://doc.kukulich.cz/phpunit/>
> http://doc.kukulich.cz/zend/
>
>
> To install it you can either use our PEAR channel (as described in the
> readme) or simple download it from GitHub.
>
>
> We'd be grateful for any feedback, so if you're interested please give it a
> try a let us know what you think :) Thanks.
>
>
>
> Ondřej Nešpor (and...@andrewsville.cz)
> Jaroslav Hanslík (kukul...@kukulich.cz)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

--- End Message ---
--- Begin Message ---
Help. I'm using PayPal's API to get a report of all the yesterday's 
transactions. I'm in California, and I define "yesterday" as California's 
yesterday, midnight to midnight.

PayPal wants the STARTDATE and ENDDATE provided in UTC/GMT. I'm building and 
testing my report using this:

$start = gmdate('Y-m-d\TH:i:s.00\Z', strtotime("yesterday 00:00:00"));
$end = gmdate('Y-m-d\TH:i:s.00\Z', strtotime("yesterday 23:59:59"));

which produces:

2011-06-28T07:00:00.00Z
2011-06-29T06:59:59.00Z

I think this is right, since it's 7 hours off California time, but I just need 
someone to double check my spinning head. Will this give me the PayPal 
transactions that arrived during California's yesterday, or do I need to change 
something?

--- End Message ---
--- Begin Message ---
On 29 June 2011 17:09, Brian Dunning <br...@briandunning.com> wrote:
> Help. I'm using PayPal's API to get a report of all the yesterday's 
> transactions. I'm in California, and I define "yesterday" as California's 
> yesterday, midnight to midnight.
>
> PayPal wants the STARTDATE and ENDDATE provided in UTC/GMT. I'm building and 
> testing my report using this:
>
> $start = gmdate('Y-m-d\TH:i:s.00\Z', strtotime("yesterday 00:00:00"));
> $end = gmdate('Y-m-d\TH:i:s.00\Z', strtotime("yesterday 23:59:59"));
>
> which produces:
>
> 2011-06-28T07:00:00.00Z
> 2011-06-29T06:59:59.00Z
>
> I think this is right, since it's 7 hours off California time, but I just 
> need someone to double check my spinning head. Will this give me the PayPal 
> transactions that arrived during California's yesterday, or do I need to 
> change something?
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Something like this ?

<?php
$o_Start = new DateTime('00:00:00.000', $o_CalifTZ = new
DateTimeZone('America/Los_Angeles'));
$o_End   = new DateTime('23:59:59.999', $o_CalifTZ);
echo date('Y-m-d\TH:i:s.00\Z', $o_Start->getTimestamp()), ' to ',
date('Y-m-d\TH:i:s.99\Z', $o_End->getTimestamp()), PHP_EOL;


And UTC is not the same as GMT. Ish.

GMT is only valid for 6 months of the year. Then, due to DST, it becomes BST.

UTC is just UTC.

Also, your DST may not be on the same day as GMT->BST.

Using the timezone America/Los_Angeles holds all the various shifts in
DST and offset that have been recorded, so you can use current local
time (shifted with DST just like you would read off your watch of PC)
with that timezone and PHP can work out what the timestamp is.

It sounds a little messy, but the TLA timezones aren't always sufficient.

Derick did a really good talk about this a couple of years ago for
php|Architect. I'm sure there's a video somewhere of it.

All makes perfect sense in the end.

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

--- End Message ---
--- Begin Message ---
On Wed, 29 Jun 2011, Brian Dunning wrote:

$start = gmdate('Y-m-d\TH:i:s.00\Z', strtotime("yesterday 00:00:00"));
$end = gmdate('Y-m-d\TH:i:s.00\Z', strtotime("yesterday 23:59:59"));

I think this is right, since it's 7 hours off California time, but I just need someone to double check my spinning head. Will this give me the PayPal transactions that arrived during California's yesterday, or do I need to change something?

Assuming your timezone is set to California time ( date_default_timezone_set ('America/Los_Angeles') ), then yes.

Geoff.


--- End Message ---
--- Begin Message ---
On 29 Jun 2011 at 17:25, Richard Quadling <rquadl...@gmail.com> wrote: 

> And UTC is not the same as GMT. Ish.

Yes it is.

> GMT is only valid for 6 months of the year. Then, due to DST, it becomes BST.

No, the UK is on GMT for 5 months a year and then on BST (GMT+1) for 7 months.


--
Cheers  --  Tim

--- End Message ---
--- Begin Message ---
On Wed, 29 Jun 2011, Richard Quadling wrote:

And UTC is not the same as GMT. Ish.

GMT is only valid for 6 months of the year. Then, due to DST, it becomes BST.

UTC is just UTC.

This is incorrect. For all practical purposes, GMT and UTC are the same. The fact that the time in Greenwich is not GMT/UTC for half the year is not relevant.

http://www.diffen.com/difference/GMT_vs_UTC

All the GM* functions (gmdate, gmstrftime, etc) are intended for dealing with Universal Co-ordinated Time.

As a side note, there is (or at least was) no gmstrtotime function. I get around this by putting " +0000" at the end of the string.

HTH,
Geoff.


--- End Message ---
--- Begin Message ---
On 29 June 2011 08:37, Tamara Temple <tamouse.li...@gmail.com> wrote:
>
> On Jun 27, 2011, at 7:18 AM, Steve Staples wrote:
>
>> On Sat, 2011-06-25 at 16:11 -0500, Tamara Temple wrote:
>>>
>>> On Jun 24, 2011, at 1:35 PM, Richard Quadling wrote:
>>>>
>>>> On 24 June 2011 18:23, Tamara Temple <tamouse.li...@gmail.com> wrote:
>>>>>
>>>>> On Jun 24, 2011, at 10:28 AM, Richard Quadling wrote:
>>>>>>
>>>>>> On 24 June 2011 15:44, Vitalii Demianets <vi...@nppfactor.kiev.ua>
>>>>>> wrote:
>>>>>>>
>>>>>>> And furthermore, I think Carthage must be destroyed.
>>>>>
>>>>> Let's haul out the PHP war wagons!
>>>>>>
>>>>>> http://xkcd.com/327/
>>>>>
>>>>> I so wanted to rename my daughter "Little Chelsea Tables" after I
>>>>> read that one. Randall is one mean mofo.
>>>>
>>>> And because it is so relevant, I added it to the docs...
>>>>
>>>> http://docs.php.net/manual/en/security.database.sql-injection.php
>>>
>>> Well played, sir, well played. I think we should go through all the
>>> xkcd comics that relate to programming somehow and insert them in the
>>> php.net documentation :)
>>>
>>>
>> Tamara, kind of like this one?
>>
>> http://ca3.php.net/manual/en/control-structures.goto.php
>>
>> I love that comic :)
>>
>
> Yes, exactly like that one. Between Richard's gambit and that GOTO comic is
> what gave me the idea! :)
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

http://xkcd.com/376/ for
http://docs.php.net/manual/en/function.date.php#refsect1-function.date-changelog

maybe.



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

--- End Message ---
--- Begin Message ---
I am trying to connect to an informix database, and using excel and odbc
it works fine.

I installed the PDO_INFORMIX via:
pecl download pdo_informix
phpize
./configure --with-pdo-informix=/opt/IBM/informix
make
make install

and it all appeard to work... phpinfo()  shows that it's enabled, and
active... and when i do my PDO connection, it fails with this error:

I also installed the CSDK prior to installing the pecl pdo_informix (as
the php.net docs said)

Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE=HY000, SQLDriverConnect: -23101 [Informix][Informix ODBC
Driver][Informix]Unspecified System Error = -23101.' 

all the values in my code, i was given from my boss, which he used to
get in with excel and the odbc.  the $database has to be the full path
of the informix table

Also, we cannot even see my local machine hitting the server, yet when i
try telnet to it, i can connect no issues... so it's not a firewall from
my machine to it.

Any ideas?  or thoughts on how to get this working??

-- code --
<?php
$host = "[ipaddress of machine]";
$port = "[port number]";
$database = "[actual path of database]";
$server = "[server]";
$protocol = "sesoctcp";
$username = "[username]";
$password = "[password]";
$tablename = "[name of the table]";

$db = new PDO("informix:host={$host}; service={$port};
database={$database}; server={$server}; protocol={$protocol};
EnableScrollableCursors=1;", $username, $password);

print "Connection Established!\n\n";

$stmt = $db->query("select * from {$tablename}");
$res = $stmt->fetch( PDO::FETCH_BOTH );
$rows = $res[0];
echo "Table contents: $rows.\n";

?>



--- End Message ---

Reply via email to