php-general Digest 10 Aug 2010 09:17:48 -0000 Issue 6887

2010-08-10 Thread php-general-digest-help

php-general Digest 10 Aug 2010 09:17:48 - Issue 6887

Topics (messages 307371 through 307389):

Re: Google spreadsheet curl
307371 by: ioannes.btinternet.com
307388 by: ioannes.btinternet.com
307389 by: ioannes.btinternet.com

Limit failed logins attempts
307372 by: Juan Rodriguez Monti
307374 by: Peter Lind
307375 by: Richard Quadling
307376 by: Bob McConnell
307377 by: Richard Quadling
307378 by: Peter Lind

Re: question about compiling a portable web server for linux
307373 by: Bob McConnell

Re: how do you upload to a 3rd-party remote server?
307379 by: Govinda

Snoopy port using PHP cURL library
307380 by: Marc Guay
307383 by: Marc Guay

[ERROR LOG FORMATTER] - any recommendations for web viewable error log 
formatters?
307381 by: Tristan
307382 by: Peter Lind
307384 by: Tristan
307385 by: Bastien Koert
307387 by: Tristan

Test - Ignore
307386 by: SED

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 a new message, not an existing thread.  I don't know where the 
Re: got into the subject.  Perhaps I sent it to myself first.


Anyway, answer may have something to do with getting Zend installed.

John
---End Message---
---BeginMessage---
I have uploaded Zend to my site but the files within the package do not 
seem to find each other:


Warning: include_once(Zend/Gdata.php) [function.include-once]: failed to 
open stream: No such file or directory in 
/home/mysite/Zend/library/Zend/Loader.php on line 146


The line 146 is;

if ($once) {
include_once $filename;

The code goes as below and I am wondering what is this trying to say 
about $filename, it says: * @param  string$filename as a 
comment, and then uses $filename without defining it. Am I supposed to 
provide this?


This seems a lot of effort just to download a google spreadsheet with curl.

===
/**
 * Loads a PHP file.  This is a wrapper for PHP's include() function.
 *
 * $filename must be the complete filename, including any
 * extension such as .php.  Note that a security check is 
performed that

 * does not permit extended characters in the filename.  This method is
 * intended for loading Zend Framework files.
 *
 * If $dirs is a string or an array, it will search the directories
 * in the order supplied, and attempt to load the first matching file.
 *
 * If the file was not found in the $dirs, or if no $dirs were 
specified,

 * it will attempt to load it from PHP's include_path.
 *
 * If $once is TRUE, it will use include_once() instead of include().
 *
 * @param  string$filename
 * @param  string|array  $dirs - OPTIONAL either a path or array of 
paths

 *   to search.
 * @param  boolean   $once
 * @return boolean
 * @throws Zend_Exception
 */
public static function loadFile(c, $dirs = null, $once = false)
{
self::_securityCheck($filename);

/**
 * Search in provided directories, as well as include_path
 */
$incPath = false;
if (!empty($dirs)  (is_array($dirs) || is_string($dirs))) {
if (is_array($dirs)) {
$dirs = implode(PATH_SEPARATOR, $dirs);
}
$incPath = get_include_path();
set_include_path($dirs . PATH_SEPARATOR . $incPath);
}

/**
 * Try finding for the plain filename in the include_path.
 */
if ($once) {
include_once $filename;
===
---End Message---
---BeginMessage---



On 2010/08/10 6:24, ioan...@btinternet.com wrote:

I have uploaded Zend to my site but the files within the package do not
seem to find each other:



I solved this by correcting the include path (should be to the library 
folder (with no trailing slash)).  I get as far as a menu offering to 
list docs, query or upload.  However, clicking these options doesn't do 
anything, but I will take up the issue with a Zend group.  Unless anyone 
here knows an easier way to curl download a google spreadsheet...?


John
---End Message---
---BeginMessage---
Hi guys,
I would like to know what do you suggest to implement a limit for
failed login attempts.

I thought that might be a good idea, to define a session variable
called ( failedattempts ), then check and if $failedattempts is
greater than, suppose, 4 write to a Database ( ip, username and

Re: [PHP] Re: Google spreadsheet curl

2010-08-10 Thread ioan...@btinternet.com



On 2010/08/10 6:24, ioan...@btinternet.com wrote:

I have uploaded Zend to my site but the files within the package do not
seem to find each other:



I solved this by correcting the include path (should be to the library 
folder (with no trailing slash)).  I get as far as a menu offering to 
list docs, query or upload.  However, clicking these options doesn't do 
anything, but I will take up the issue with a Zend group.  Unless anyone 
here knows an easier way to curl download a google spreadsheet...?


John

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



[PHP] Variable variables into an array.

2010-08-10 Thread Richard Quadling
Hi.

Quick set of eyes needed to see what I've done wrong...

The following is a reduced example ...

?php
$Set = array();
$Entry = 'Set[1]';
$Value = 'Assigned';
$$Entry = $Value;
print_r($Set);
?

The output is an empty array.

Examining $GLOBALS, I end up with an entries ...

[Set] = Array
(
)

[Entry] = Set[1]
[Value] = Assigned
[Set[1]] = Assigned


According to http://docs.php.net/manual/en/language.variables.basics.php,
a variable named Set[1] is not a valid variable name. The [ and ] are
not part of the set of valid characters.

In testing all the working V4 and V5 releases I have, the output is
always an empty array, so it looks like it is me, but the invalid
variable name is an issue I think.

Regards,

Richard.

NOTE: The above is a simple test. I'm trying to map in nested data to
over 10 levels.
-- 
Richard Quadling.

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



[PHP] /status page of php-fpm 5.3.3

2010-08-10 Thread Martin Minka
Hello,
I am using PHP 5.3.3 compiled as PHP-FPM.
My Apache is using mod_fastcgi to connect to PHP-FPM and everything works as
expected.

Unfortunately I don't know how to forward request http://localhost/status to
PHP-FPM so that I will see the status page of PHP-FPM.
I found only NGINX configuration
http://forum.nginx.org/read.php?3,56426,56578.
Could you pls. help me to fix this configuration ?

FastCgiExternalServer /opt/php-5.3.3/bin/www -socket /dev/shm/fpm-www.socket
-idle-timeout 900
ScriptAlias /php-bin/ /opt/php-5.3.3/bin/
Directory /var/www
IfModule mod_fastcgi.c
FilesMatch \.php$
SetHandler php-fastcgi
Action php-fastcgi /php-bin/www
/FilesMatch
/IfModule
/Directory


I was trying something like:
Location /status
SetHandler php-fastcgi
Action php-fastcgi /php-bin/www
/Location


Re: [PHP] Variable variables into an array.

2010-08-10 Thread Jim Lucas

Richard Quadling wrote:

Hi.

Quick set of eyes needed to see what I've done wrong...

The following is a reduced example ...

?php
$Set = array();
$Entry = 'Set[1]';
$Value = 'Assigned';
$$Entry = $Value;
print_r($Set);
?

The output is an empty array.

Examining $GLOBALS, I end up with an entries ...

[Set] = Array
(
)

[Entry] = Set[1]
[Value] = Assigned
[Set[1]] = Assigned


According to http://docs.php.net/manual/en/language.variables.basics.php,
a variable named Set[1] is not a valid variable name. The [ and ] are
not part of the set of valid characters.

In testing all the working V4 and V5 releases I have, the output is
always an empty array, so it looks like it is me, but the invalid
variable name is an issue I think.

Regards,

Richard.

NOTE: The above is a simple test. I'm trying to map in nested data to
over 10 levels.


For something like this, a string that looks like a nested array 
reference, you might need to involve eval for it to derive that nested 
array.


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



Re: [PHP] Variable variables into an array.

2010-08-10 Thread Richard Quadling
On 10 August 2010 16:49, Jim Lucas li...@cmsws.com wrote:
 Richard Quadling wrote:

 Hi.

 Quick set of eyes needed to see what I've done wrong...

 The following is a reduced example ...

 ?php
 $Set = array();
 $Entry = 'Set[1]';
 $Value = 'Assigned';
 $$Entry = $Value;
 print_r($Set);
 ?

 The output is an empty array.

 Examining $GLOBALS, I end up with an entries ...

    [Set] = Array
        (
        )

    [Entry] = Set[1]
    [Value] = Assigned
    [Set[1]] = Assigned


 According to http://docs.php.net/manual/en/language.variables.basics.php,
 a variable named Set[1] is not a valid variable name. The [ and ] are
 not part of the set of valid characters.

 In testing all the working V4 and V5 releases I have, the output is
 always an empty array, so it looks like it is me, but the invalid
 variable name is an issue I think.

 Regards,

 Richard.

 NOTE: The above is a simple test. I'm trying to map in nested data to
 over 10 levels.

 For something like this, a string that looks like a nested array reference,
 you might need to involve eval for it to derive that nested array.


I'm happy with that.

It seems variable variables can produce variables that do not follow
the same naming limitations as normal variables.



-- 
Richard Quadling.

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



Re: [PHP] Variable variables into an array.

2010-08-10 Thread Andrew Ballard
On Tue, Aug 10, 2010 at 12:23 PM, Richard Quadling rquadl...@gmail.com wrote:
 On 10 August 2010 16:49, Jim Lucas li...@cmsws.com wrote:
 Richard Quadling wrote:

 Hi.

 Quick set of eyes needed to see what I've done wrong...

 The following is a reduced example ...

 ?php
 $Set = array();
 $Entry = 'Set[1]';
 $Value = 'Assigned';
 $$Entry = $Value;
 print_r($Set);
 ?

 The output is an empty array.

 Examining $GLOBALS, I end up with an entries ...

    [Set] = Array
        (
        )

    [Entry] = Set[1]
    [Value] = Assigned
    [Set[1]] = Assigned


 According to http://docs.php.net/manual/en/language.variables.basics.php,
 a variable named Set[1] is not a valid variable name. The [ and ] are
 not part of the set of valid characters.

 In testing all the working V4 and V5 releases I have, the output is
 always an empty array, so it looks like it is me, but the invalid
 variable name is an issue I think.

 Regards,

 Richard.

 NOTE: The above is a simple test. I'm trying to map in nested data to
 over 10 levels.

 For something like this, a string that looks like a nested array reference,
 you might need to involve eval for it to derive that nested array.


 I'm happy with that.

 It seems variable variables can produce variables that do not follow
 the same naming limitations as normal variables.


It would seem so. If eval() works, can you rearrange the strings a
little to make use of parse_str() and avoid the use of eval()?

Andrew

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



[PHP] Mail_Mime: undefined method Mail_mimePart::encodeHeader()

2010-08-10 Thread René Santis
Hello everyone.

I'm developing a mailing list manager, using the package Mail_Mime.

Everything works fine, but when I try sending an e-mail get the following
error:

Fatal error: Call to undefined method Mail_mimePart:: encodeHeader () in /
home / devised / php / Mail / mime.php on line 1316

I don't know if it's a bug or error in my own code, I don't think it's so,
because the error comes from the library mime.php and I dare not to modify
the code.

I hope and give me a quick solution. Thank you.