php-general Digest 5 Feb 2012 14:54:42 -0000 Issue 7675

2012-02-05 Thread php-general-digest-help

php-general Digest 5 Feb 2012 14:54:42 - Issue 7675

Topics (messages 316459 through 316463):

Re: Function links on error and warningmessages
316459 by: Ford, Mike
316461 by: Matijn Woudt

Typecasting question
316460 by: jas
316462 by: Marco Behnke
316463 by: Shawn McKenzie

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


--
---BeginMessage---
 -Original Message-
 From: Florian Müller [mailto:florip...@hotmail.com]
 Sent: 03 February 2012 14:36
 
 Hi guys,
 
 I was wondering some time ago, why the links which are shown on
 error or warning (E_WARNING etc.) show relative links to an usually
 non-existing file.

Because you haven't set the docref_root configuration option?
(See http://php.net/errorfunc.configuration.php#ini.docref-root). 


Cheers!

Mike

-- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Portland PD507, City Campus, Leeds Metropolitan University,
Portland Way, LEEDS,  LS1 3HE,  United Kingdom 
E: m.f...@leedsmet.ac.uk T: +44 113 812 4730



To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm
---End Message---
---BeginMessage---
On Fri, Feb 3, 2012 at 4:35 PM, Ford, Mike m.f...@leedsmet.ac.uk wrote:
 -Original Message-
 From: Florian Müller [mailto:florip...@hotmail.com]
 Sent: 03 February 2012 14:36

 Hi guys,

 I was wondering some time ago, why the links which are shown on
 error or warning (E_WARNING etc.) show relative links to an usually
 non-existing file.

 Because you haven't set the docref_root configuration option?
 (See http://php.net/errorfunc.configuration.php#ini.docref-root).


 Cheers!

 Mike


While that's indeed correct, I wonder why the docref_root isn't set by
default (eg. www.php.net)?

- Matijn
---End Message---
---BeginMessage---

I am familiar with typecasting. Booleans, ints, strings, etc.

However while using an extension, more specifically the OpenSSL 
extension I have come across a problem I am not entirely familiar with.


I have an array that looks like...

array('config' = 'config/openssl.cnf',
  'encrypt_key'= true,
  'private_key_type'   = 'OPENSSL_KEYTYPE_RSA',
  'digest_algorithm'   = 'sha256',
  'private_key_bits'   = 512,
  'x509_extensions'= 'usr_cert',
  'encrypt_key_cipher' = 'OPENSSL_CIPHER_3DES');

And according to the current OpenSSL documentation regarding the 
configuration constants 
(http://www.php.net/manual/en/openssl.ciphers.php) the array needs to 
have the 'private_key_type' and 'encrypt_key_cipher' elements as an INT 
value vs the string they are currently. Like so.


array('private_key_type'   = OPENSSL_KEYTYPE_RSA,
  'encrypt_key_cipher' = OPENSSL_CIPHER_3DES);

I have tried to perform typecasting these two elements as an int but 
because they are specific to the extension I am not certain how I should 
go about doing this.


According to the source for php (the openssl.c) file is an internal 
attribute that I cannot find an integer value for to set it manually vs. 
using the pre-defined constant values mentioned in the docs.
---End Message---
---BeginMessage---
Am 03.02.12 17:11, schrieb jas:
 I am familiar with typecasting. Booleans, ints, strings, etc.

 However while using an extension, more specifically the OpenSSL
 extension I have come across a problem I am not entirely familiar with.

 I have an array that looks like...

 array('config' = 'config/openssl.cnf',
   'encrypt_key'= true,
   'private_key_type'   = 'OPENSSL_KEYTYPE_RSA',

remove the quotes around the constant, it must be

'private_key_type'   = OPENSSL_KEYTYPE_RSA,

   'digest_algorithm'   = 'sha256',
   'private_key_bits'   = 512,
   'x509_extensions'= 'usr_cert',
   'encrypt_key_cipher' = 'OPENSSL_CIPHER_3DES');

same here

-- 
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz




signature.asc
Description: OpenPGP digital signature
---End Message---
---BeginMessage---
On 02/03/2012 10:11 AM, jas wrote:
 array('private_key_type'   = OPENSSL_KEYTYPE_RSA,
   'encrypt_key_cipher' = OPENSSL_CIPHER_3DES);

Look like ints to me: var_dump():

array(2) {
  [private_key_type]=
  int(0)
  [encrypt_key_cipher]=
  int(4)
}


-- 
Thanks!
-Shawn
http://www.spidean.com
---End Message---


php-general Digest 6 Feb 2012 05:58:09 -0000 Issue 7676

2012-02-05 Thread php-general-digest-help

php-general Digest 6 Feb 2012 05:58:09 - Issue 7676

Topics (messages 316464 through 316464):

Headers on smart phone browsers
316464 by: Paul M Foster

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


--
---BeginMessage---
This is sort of obliquely related to PHP.

I don't have a smart phone, but I need to know a couple of things:

1) Do smart phones use the same browsers as the desktop, or do they have
their own stripped down versions of browsers?

2) When a browser broadcasts its header telling the server what kind of
browser is involved, do they broadcast anything in the header to
indicate that they're being run on a smart phone?

3) Bonus question: Is there a preferred method amongst coders to
determine what type of environment is being browsed from, so as to serve
up the proper type of page (desktop or smart phone version of a
webpage)?

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com
---End Message---


[PHP] Re: Typecasting question

2012-02-05 Thread Shawn McKenzie
On 02/03/2012 10:11 AM, jas wrote:
 array('private_key_type'   = OPENSSL_KEYTYPE_RSA,
   'encrypt_key_cipher' = OPENSSL_CIPHER_3DES);

Look like ints to me: var_dump():

array(2) {
  [private_key_type]=
  int(0)
  [encrypt_key_cipher]=
  int(4)
}


-- 
Thanks!
-Shawn
http://www.spidean.com

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



[PHP] Headers on smart phone browsers

2012-02-05 Thread Paul M Foster
This is sort of obliquely related to PHP.

I don't have a smart phone, but I need to know a couple of things:

1) Do smart phones use the same browsers as the desktop, or do they have
their own stripped down versions of browsers?

2) When a browser broadcasts its header telling the server what kind of
browser is involved, do they broadcast anything in the header to
indicate that they're being run on a smart phone?

3) Bonus question: Is there a preferred method amongst coders to
determine what type of environment is being browsed from, so as to serve
up the proper type of page (desktop or smart phone version of a
webpage)?

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com

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



Re: [PHP] Headers on smart phone browsers

2012-02-05 Thread Mari Masuda

On Feb 5, 2012, at 9:58 PM, Paul M Foster wrote:

[snip]

 3) Bonus question: Is there a preferred method amongst coders to
 determine what type of environment is being browsed from, so as to serve
 up the proper type of page (desktop or smart phone version of a
 webpage)?

[snip]

You should read up on responsive web design.  
http://www.alistapart.com/articles/responsive-web-design/ should get you 
started.  HTH!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Long Live GOTO

2012-02-05 Thread Adam Richardson
Hi,

While not purely focused on PHP, I toss this out to the group because I
believe there are some novel, interesting points regarding the potential
benefits of using the goto construct as implemented in PHP:

http://adamjonrichardson.com/2012/02/06/long-live-the-goto-statement/

Adam

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