php-general Digest 28 Sep 2010 22:29:58 -0000 Issue 6964

Topics (messages 308340 through 308347):

php - mysql tandem and multi core performance
        308340 by: Giulio Mastrosanti

Re: Php Newsletter script
        308341 by: Richard Quadling
        308344 by: [email protected]
        308345 by: Richard Quadling

ssh2_exec line width problem
        308342 by: Radek Krejèa
        308343 by: Radek Krejèa

Re: Domain Controller Discovery in PHP
        308346 by: Robert Cummings

SimpleXML/array duality (like particles & waves)
        308347 by: Brian Dunning

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 ---
Hi all,
I have to setup a new dedicated server for my job,
it will need to host some mysql databases with php accessing them,
for a number of reasons it need to be a Windows server ( 2008 )

the amount of data will not be very great ( the biggest table will contain 
between 100.000 and 200.000 rows ), but php will perform some complex, 
full-text queries to the databases.

now I have a couple of choices about server configuration:

1) Bi Xeon E5504 - it has 8 cores at 2.4 Ghz, with 24 GB RAM

2) Xeon i7 W3520 - it has 4 cores ar 2.66 Ghz with  12 GB RAM

obviously the second choice is quite cheaper than the first;

my question is:

on your experience, how do php / mySQL behave on multicores?

maybe its better a lesser_core / highest frequency system than a more_core / 
lower frequency?

can a 12 GB / 24 GB RAM configuration make the difference? in which terms?

thank you for your answer,

    Giulio

Giulio Mastrosanti
[email protected]






--- End Message ---
--- Begin Message ---
On 27 September 2010 23:40, [email protected]
<[email protected]> wrote:
> It's probably worth noting that very few email clients in use actually 
> observe xhtml. When creating html emails you have to step back a half dozen 
> years for outlook, which is the current dominant client because of offices.
>
> Essentially, its back to basics, with tables for layout, font tags, and 
> little, if any, css. Images for layout are also hit and miss because of spam 
> protection.
>
> If you can't create a template yourself, you're best off looking for one 
> online that can be used in an email marketing system.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
> ----- Reply message -----
> From: "David Mehler" <[email protected]>
> Date: Mon, Sep 27, 2010 20:25
> Subject: [PHP] Php Newsletter script
> To: "php-general" <[email protected]>
>
> Hello,
> I'm wondering if anyone could recommend a newsletter script they use
> and like? Some requirements I have are:
>
> 1. Free preferred
> 2. Can be used via a web browser
> 3. Can put the newsletter submission on a web page
> 4. Can use rss to feed that web page
> 5. Produce Xhtml compliant code and integrate well with a site's existing css
> 6. can optionally send that newsletter out as plain text or html
>
> Googling has not helped in this matter.
> Thanks.
> Dave.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

You can embed images in emails and these are correctly shown in Outlook.



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

--- End Message ---
--- Begin Message ---
Still hit and miss though, outlook is just one if many email clients out there.

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

----- Reply message -----
From: "Richard Quadling" <[email protected]>
Date: Tue, Sep 28, 2010 10:17
Subject: [PHP] Php Newsletter script
To: "[email protected]" <[email protected]>
Cc: "David Mehler" <[email protected]>, "php-general" 
<[email protected]>


On 27 September 2010 23:40, [email protected]
<[email protected]> wrote:
> It's probably worth noting that very few email clients in use actually 
> observe xhtml. When creating html emails you have to step back a half dozen 
> years for outlook, which is the current dominant client because of offices.
>
> Essentially, its back to basics, with tables for layout, font tags, and 
> little, if any, css. Images for layout are also hit and miss because of spam 
> protection.
>
> If you can't create a template yourself, you're best off looking for one 
> online that can be used in an email marketing system.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
> ----- Reply message -----
> From: "David Mehler" <[email protected]>
> Date: Mon, Sep 27, 2010 20:25
> Subject: [PHP] Php Newsletter script
> To: "php-general" <[email protected]>
>
> Hello,
> I'm wondering if anyone could recommend a newsletter script they use
> and like? Some requirements I have are:
>
> 1. Free preferred
> 2. Can be used via a web browser
> 3. Can put the newsletter submission on a web page
> 4. Can use rss to feed that web page
> 5. Produce Xhtml compliant code and integrate well with a site's existing css
> 6. can optionally send that newsletter out as plain text or html
>
> Googling has not helped in this matter.
> Thanks.
> Dave.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

You can embed images in emails and these are correctly shown in Outlook.



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


--- End Message ---
--- Begin Message ---
On 28 September 2010 11:29, [email protected]
<[email protected]> wrote:
> Still hit and miss though, outlook is just one if many email clients out
> there.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
> ----- Reply message -----
> From: "Richard Quadling" <[email protected]>
> Date: Tue, Sep 28, 2010 10:17
> Subject: [PHP] Php Newsletter script
> To: "[email protected]" <[email protected]>
> Cc: "David Mehler" <[email protected]>, "php-general"
> <[email protected]>
>
>
> On 27 September 2010 23:40, [email protected]
> <[email protected]> wrote:
>> It's probably worth noting that very few email clients in use actually
>> observe xhtml. When creating html emails you have to step back a half dozen
>> years for outlook, which is the current dominant client because of offices.
>>
>> Essentially, its back to basics, with tables for layout, font tags, and
>> little, if any, css. Images for layout are also hit and miss because of spam
>> protection.
>>
>> If you can't create a template yourself, you're best off looking for one
>> online that can be used in an email marketing system.
>>
>> Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
>>
>> ----- Reply message -----
>> From: "David Mehler" <[email protected]>
>> Date: Mon, Sep 27, 2010 20:25
>> Subject: [PHP] Php Newsletter script
>> To: "php-general" <[email protected]>
>>
>> Hello,
>> I'm wondering if anyone could recommend a newsletter script they use
>> and like? Some requirements I have are:
>>
>> 1. Free preferred
>> 2. Can be used via a web browser
>> 3. Can put the newsletter submission on a web page
>> 4. Can use rss to feed that web page
>> 5. Produce Xhtml compliant code and integrate well with a site's existing
>> css
>> 6. can optionally send that newsletter out as plain text or html
>>
>> Googling has not helped in this matter.
>> Thanks.
>> Dave.
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> You can embed images in emails and these are correctly shown in Outlook.

I send around 200 emails a day to our clients. The message is a bill
laid out to allow the recipient to enter some additional details and
then forward it to their client.

The images are a combination of company logo and of photos of work
we've undertaken.

The work I had to do to make it work for Outlook was as described
(HTML Tables with limited CSS). It works nicely in Outlook 2003+,
Thunderbird, Outlook Express.

For those with a problem, I have a link to the online version.

I use PHPGuru's RMail (similar to PHPMailer).

But hit and miss would certainly be how I'd describe getting it
working for Outlook 2007.


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

--- End Message ---
--- Begin Message ---
Hi,

I need to get about 500 chars over ssh2_exec, but this doesnt work:

$stream = ssh2_Exec($this->_connection, "system identity print;ip address print 
detail;system routerboard print;interface wireless print", false, NULL, 500);

Where could be a problem? Its connection to Mikrotik.
php5-5.3.3_1
libssh2-1.2.7,2
pecl-ssh2-0.11

Thank you
Radek

--- End Message ---
--- Begin Message ---
Hi,

I need to get about 500 chars over ssh2_exec, but this doesnt work:

$stream = ssh2_Exec($this->_connection, "system identity print;ip address print 
detail;system routerboard print;interface wireless print", false, NULL, 500);

Where could be a problem? Its connection to Mikrotik.
php5-5.3.3_1
libssh2-1.2.7,2
pecl-ssh2-0.11

Thank you
Radek

--- End Message ---
--- Begin Message ---
On 10-09-28 04:03 AM, Jason wrote:
> Hi Rob,
>
> I've checked a couple of windows machines (which I admit I had assumed you were running php on) and the ENV variable "USERDNSDOMAIN" is definitely what you need. If your php is running on linux, you'll need to find out the target windows domain some other way (user input/config file maybe?).
>
> The article is a Win2k based one - there is a link to the XP one in the top-right corner. However I read both and things haven't changed from a DNS point of view.
>
> Here's a code snippet for you (run on my network from a windows workstation)...
>
> <?php
> # assume $_SERVER["USERDNSDOMAIN"] is equal to "xxx.local".
>
> print_r( dns_get_record("_ldap._tcp.dc._msdcs.".$_SERVER["USERDNSDOMAIN"],DNS_SRV) );
> ?>
>
> And the output (edited for obvious reasons):
>
> Array
> (
>     [0] => Array
>         (
>             [host] => _ldap._tcp.dc._msdcs.xxx.local
>             [type] => SRV
>             [pri] => 0
>             [weight] => 100
>             [port] => 389
>             [target] => dc2.xxx.local
>             [class] => IN
>             [ttl] => 545
>         )
>
>     [1] => Array
>         (
>             [host] => _ldap._tcp.dc._msdcs.xxx.local
>             [type] => SRV
>             [pri] => 0
>             [weight] => 100
>             [port] => 389
>             [target] => dc1.xxx.local
>             [class] => IN
>             [ttl] => 545
>         )
>
> )

Hi Jason,

Your assumption was right, I am on a windows machine, Windows Server 2003. I think I understand the problem better now though from your example. We're currently using PHP 5.2.12 (with an update imminent), but this doesn't come with dns_get_record() which became available for Windows with the 5.3.0 branch. That may account for the missing USERDNSDOMAIN entry. I'm currently pulling the info using an exec() and nslookup:

    nslookup -type=SRV _ldap._tcp.dc._msdcs.%userdnsdomain%

It's not optimal, but it appears to suffice until we upgrade to the 5.3 branch.

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--- End Message ---
--- Begin Message ---
I am kind of jacked here. I have a SimpleXML object that's been converted to an 
array. In one of the nodes, for no reason I can see, the array is populated 
differently if there is only one <order_item> than if there are multiple 
<order_item>s.

If there is just one, my $order_item array looks like this:
Array
(
    [order_item_product_code] => 1300
    [order_item_description] => 4x8 photo cards (set of 20)
)

But if there are multiple items, I get this:
Array
(
    [0] => SimpleXMLElement Object
        (
            [order_item_product_code] => 1060
            [order_item_description] => 4x5.3 trueDigital print(s)
        )

    [1] => SimpleXMLElement Object
        (
            [order_item_product_code] => 1300
            [order_item_description] => 4x8 photo cards (set of 20)
        )
)

See my problem? I can't foreach through those and process the items in the same 
way.

In case it matters, here is that snip of what the original XML looks like, it's 
all good:
<?xml version="1.0" encoding="UTF-8"?>
<order xmlns="http://xxxx.com/xxxx"; version="1.0">
  <order_items>
    <order_item>
      <order_item_product_code finish="glossy">1060</order_item_product_code>
      <order_item_description>4x5.3 trueDigital 
print(s)</order_item_description>
    </order_item>
    <order_item>
      <order_item_product_code finish="glossy">1300</order_item_product_code>
      <order_item_description>4x8 photo cards (set of 
20)</order_item_description>
    </order_item>
  </order_items>
</order>

And here is the function I'm using to convert the XML to an array:
function xmlToArray($xml, $isChild = false) {
        if($xml instanceof SimpleXMLElement) {
                $xmlObject = $xml;
        } elseif($isChild) {
                return $xml;
        } else {
                try {
                        $xmlObject = new SimpleXMLElement($xml);
                } catch(Exception $e) {
                        $string = $e->getMessage();
                        throw new Exception('Invalid XML found in ' . 
__FUNCTION__ . ' function on line '.__LINE__.'.');
                }
        }
        $children = (array)$xmlObject->children();
        if(is_array($children)) {
                if(count($children) == 0) {
                        $children = '';
                } else {
                        foreach($children as $element => $value) {
                                $children[$element] = xmlToArray($value, true);
                        }
                }
        }
        return $children;
}

Any suggestions?

--- End Message ---

Reply via email to