php-general Digest 21 Dec 2010 03:45:41 -0000 Issue 7096

Topics (messages 310157 through 310169):

Re: Problem with Include
        310157 by: Daniel P. Brown

Re: Performance Improvement on Calling C++ executable from PHP
        310158 by: Daniel P. Brown

Re: [PHP-DB] Re: [PHP] Problems w/ goto
        310159 by: David Hutto

[SOLVED] Re: Upgraded system and now $_SERVER['SERVER_NAME'] is not more working
        310160 by: Michelle Konzack

Re: PHPmailer.. best way to send to many recipients?
        310161 by: Govinda

Re: Problems w/ goto
        310162 by: David Harkness
        310169 by: David Hutto

Re: Does ReflectionMethod::setAccessible() do anything?
        310163 by: David Harkness
        310164 by: David Harkness
        310165 by: David Harkness
        310166 by: David Harkness

Common session for all subdomains?
        310167 by: Andre Polykanine
        310168 by: Jonathan Tapicer

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 Mon, Dec 20, 2010 at 02:49, Simcha Younger <[email protected]> wrote:
>
> Since it is being included by PHP, and not served by Apache, the extension is 
> not important.

    Correct, but keep in mind that it will likely be served as plain
text if accessed directly, if the web server is not properly
configured (which, by default, it isn't).

-- 
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

--- End Message ---
--- Begin Message ---
On Sun, Dec 19, 2010 at 15:35, Shiplu <[email protected]> wrote:
> ===============================================================================
> Recently I  my this php-general doesn't accept my mail for some
> reason. So I send it again from anther email
> ===============================================================================

    No, actually, you sent it from the exact same address --- but both
came through anyway.

> I am developing a php application that interfaces with an external
> executable binary. The program is written in C++.
> I open the program (say a.out) using proc_open. Write some command at
> its stdin and fetch data stdout. Then close the program.
>
> The timing of only "a.out" is
> real 490ms
> usr 160ms
> sys 290ms
>
> When I invoke it using proc_open in php-cli, the timing becomes
> real 530ms
> usr 50ms
> sys 450ms
>
> Look closely, the cpu time and the real elapsed time increases. I run
> the php version from command line. As an apache handler this will
> surly take more time.

    Is this just the processing time of the a.out file, or is this
considering the PHP script's execution time including the a.out
processing?  If so, this increase is, of course, to be completely
expected.  Also, were the input and output exactly the same size in
bytes as the direct test?

> The program a.out can not be converted in php unless I write an
> extension. But this will need a lot of effort to write it in PHP.

    Extensions aren't written in PHP, they're binary packages.

> Some of my ideas are,
> 1. Create a standalone multi-threaded server that calls a.out and php
> calls that server.

    This is the same basic idea that Facebook's HipHop project uses.

> 2. Call a.out as a CGI and convert it that way.

    This would likely be your best bet, as you're stripping away all
of the excess interfacing by PHP (or another scripting language), and
would instead just be accessing it directly via the web server.  That
said, it would depend on whether or not your program is (or could be)
written to handle everything itself, so that PHP - or any capable
language, for that matter - would no longer be necessary.

-- 
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

--- End Message ---
--- Begin Message ---
On Mon, Dec 20, 2010 at 7:37 AM, Daniel Brown <[email protected]> wrote:
> On Sat, Dec 18, 2010 at 17:02, David Hutto <[email protected]> wrote:
>> or maybe it's saturday morning and i'm drunk?
>
>    This seems to be the most likely, and considering how all messages
> are permanently and independently archived and propagate throughout
> the Internet, it might be a good reason not to go nuts in sending
> unrelated and unintelligible messages of this nature in the future.

Yeah, that hindsights 20/20 ain't it?

>
> --
> </Daniel P. Brown>
> Network Infrastructure Manager
> Documentation, Webmaster Teams
> http://www.php.net/
>



-- 
They're installing the breathalyzer on my email account next week.

--- End Message ---
--- Begin Message ---
I do not know HOW, but it wors again...

Thanks, Greetings and nice Day/Evening
    Michelle Konzack

-- 
##################### Debian GNU/Linux Consultant ######################
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsyst...@tdnet France EURL       itsyst...@tdnet UG (limited liability)
Owner Michelle Konzack            Owner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz                 Kinzigstraße 17
67100 Strasbourg/France           77694 Kehl/Germany
Tel: +33-6-61925193 mobil         Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

<http://www.itsystems.tamay-dogan.net/>  <http://www.flexray4linux.org/>
<http://www.debian.tamay-dogan.net/>         <http://www.can4linux.org/>

Jabber [email protected]
ICQ    #328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/

Attachment: signature.pgp
Description: Digital signature


--- End Message ---
--- Begin Message ---
followup question, please see below the OP:

I just started using PHPmailer for one project that requires SMTP authentication (if I said that right).. and all is well.. but I want to ask now before it might get outta hand later:

How many comma-delim'ed addresses can I stuff in $BCC_recipients before I have problems (need to restructure the design)?

------------------------------------------------------
require("php_inc/class.phpmailer.php");
$mail = new PHPMailer();
$BCC_recipients = "[email protected],[email protected]"; // <---just an example
$arrBCC_recipients = explode(",", $BCC_recipients);
foreach ($arrBCC_recipients as $email2stuffInBCC) {
        $mail->AddBcc($email2stuffInBCC);
}
if(!$mail->Send()) { // problem ....
------------------------------------------------------

For now there will be less than 100 Bcc recipients.. but later, more. I don't know if/when it will ever grow past 1,000.

I see from reading on a PHPmailer list that the main concern people expressed from this (above) approach is to not go over limits set by the host/server as to how many emails can go out before being marked as spam. OK, understood. Here I am just asking about the code. I mean does it make any difference in terms of code reliability whether I loop on $mail- >Send() -versus- looping on/concatenating the Bcc addresses?

------------
Govinda





--- End Message ---
--- Begin Message ---
On Fri, Dec 17, 2010 at 10:05 AM, [email protected] <
[email protected]> wrote:

> What PHP has implemented is "named break statements", as I understand it.
>

Not exactly. You can jump to arbitrary (labeled) lines within the same
context (method/function), but you cannot enter loop constructs--only exit
them. While the last bit implies they are only "named break statements," you
can use them outside of loops as a normal goto statement.

    firingSequence:
        if (!acquireTarget())
            goto done;
        fireMainCannon();
        fireMissiles();
        if (enemiesInView()):
            goto firingSequence;
    done:

The above implements a convoluted do...while loop using goto. Recommended?
Certainly not!

David

--- End Message ---
--- Begin Message ---
On Mon, Dec 20, 2010 at 4:47 PM, David Harkness
<[email protected]> wrote:
> On Fri, Dec 17, 2010 at 10:05 AM, [email protected] <
> [email protected]> wrote:
>
>> What PHP has implemented is "named break statements", as I understand it.
>>
>
> Not exactly. You can jump to arbitrary (labeled) lines within the same
> context (method/function), but you cannot enter loop constructs--only exit
> them. While the last bit implies they are only "named break statements," you
> can use them outside of loops as a normal goto statement.
>
>    firingSequence:
>        if (!acquireTarget())
>            goto done;
>        fireMainCannon();
>        fireMissiles();
>        if (enemiesInView()):
>            goto firingSequence;
>    done:
>
> The above implements a convoluted do...while loop using goto. Recommended?

Is the problem with using the goto convolutedness(as I've seen other
senior programmers in other languages when explaining, or 'showing
off'), or is their an actual functional problem with it? Is it just
the 'sphagetti code' aspect that it can lead to, meaning confusing
another programmer? Not to hijack from the op, or dilute the
conversation any further than I did over the weekend.

> Certainly not!
>
> David
>



-- 
They're installing the breathalyzer on my email account next week.

--- End Message ---
--- Begin Message ---
On Thu, Dec 16, 2010 at 6:09 PM, Nathan Nobbe <[email protected]>wrote:

> you just have to invoke the function from the context of the
> ReflectionMethod instance
>
> <?php
> class Foo { protected function bar() { echo "foobar\n"; } }
> $m = new ReflectionMethod('Foo', 'bar');
> $m->setAccessible(true);
> $m->invokeArgs(new Foo(), array());
> ?>
>

Thank you, Nathan. That makes perfect sense and would be a good addition to
the documentation page for setAccessible(). Even better, I may even be able
to make use of it in my testing framework since I only want the method to be
exposed for one call from the test method.

David

--
David Harkness
Senior Software Engineer
High Gear Media

--- End Message ---
--- Begin Message ---
On Thu, Dec 16, 2010 at 6:09 PM, Nathan Nobbe <[email protected]>wrote:

> you just have to invoke the function from the context of the
> ReflectionMethod instance
>
> <?php
> class Foo { protected function bar() { echo "foobar\n"; } }
> $m = new ReflectionMethod('Foo', 'bar');
> $m->setAccessible(true);
> $m->invokeArgs(new Foo(), array());
> ?>
>

Thank you, Nathan. That makes perfect sense and would be a good addition to
the documentation page for setAccessible(). Even better, I may even be able
to make use of it in my testing framework since I only want the method to be
exposed for one call from the test method.

David

--
David Harkness
Senior Software Engineer
High Gear Media

--- End Message ---
--- Begin Message ---
On Thu, Dec 16, 2010 at 6:09 PM, Nathan Nobbe <[email protected]>wrote:

> you just have to invoke the function from the context of the
> ReflectionMethod instance
>
> <?php
> class Foo { protected function bar() { echo "foobar\n"; } }
> $m = new ReflectionMethod('Foo', 'bar');
> $m->setAccessible(true);
> $m->invokeArgs(new Foo(), array());
> ?>
>

Thank you, Nathan. That makes perfect sense and would be a good addition to
the documentation page for setAccessible(). Even better, I may even be able
to make use of it in my testing framework since I only want the method to be
exposed for one call from the test method.

David

--
David Harkness
Senior Software Engineer
High Gear Media

--- End Message ---
--- Begin Message ---
On Thu, Dec 16, 2010 at 6:09 PM, Nathan Nobbe <[email protected]>wrote:

> you just have to invoke the function from the context of the
> ReflectionMethod instance
>
> <?php
> class Foo { protected function bar() { echo "foobar\n"; } }
> $m = new ReflectionMethod('Foo', 'bar');
> $m->setAccessible(true);
> $m->invokeArgs(new Foo(), array());
> ?>
>

Thank you, Nathan. That makes perfect sense and would be a good addition to
the documentation page for setAccessible(). Even better, I may even be able
to make use of it in my testing framework since I only want the method to be
exposed for one call from the test method.

David

--
David Harkness
Senior Software Engineer
High Gear Media

--- End Message ---
--- Begin Message ---
Hello php-general,
I've got a question: I have a site http://oire.org/. Then we started
developing some applications at http://apps.oire.org/.
How can I manage it in the way so the session valid at
http://oire.org/ would be also valid at http://apps.oire.org/?
Thanks!
-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


--- End Message ---
--- Begin Message ---
Hi!

You should use the function session_set_cookie_params to set the
session cookie domain to ".oire.org" like this comment explains:
php.net/manual/en/function.session-set-cookie-params.php#94961

Regards,
Jonathan

On Mon, Dec 20, 2010 at 7:18 PM, Andre Polykanine <[email protected]> wrote:
> Hello php-general,
> I've got a question: I have a site http://oire.org/. Then we started
> developing some applications at http://apps.oire.org/.
> How can I manage it in the way so the session valid at
> http://oire.org/ would be also valid at http://apps.oire.org/?
> Thanks!
> --
> With best regards from Ukraine,
> Andre
> Skype: Francophile
> Twitter: http://twitter.com/m_elensule
> Facebook: http://facebook.com/menelion
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---

Reply via email to