Re: [PHP] Procedural Autoloader?

2010-11-23 Thread Steve Staples
On Mon, 2010-11-22 at 15:26 -0800, David Harkness wrote:
> On Mon, Nov 22, 2010 at 3:05 PM, Richard Quadling wrote:
> 
> > Would it be overboard to use a namespace? Aren't namespaces handled by
> > the autoloader? If not autoload(), how about spl_autoloading?
> >
> 
> Autoloading is for determining the path and filename where a named item is
> defined. Namespaces only give you the path. Even with namespaces, you'd
> still need to require the files that contain the functions. Plus you'd also
> need to use the namespace everywhere you use the function because you cannot
> alias functions--only classes. :(
> 
> David

can I maybe make a suggestion?   If I have been following this
correctly, it seems as if the OP has a bunch of "non specific class"
functions, that he doesn't want in 1 big gigantic file, and include that
one huge file ALL the time...   what if the OP put some naming
conventions into the function names, and then did some kind of error
trapping on the function calls, and if the function does not exist (yet)
then call some other function to rip apart the name of the function that
was called, and then include that "file"?   I am just offering some kind
of hypothetical solution, and off the top of my head can't think exactly
how it could be accomplished.

you could always wrap all your "non class"/"custom" functions in a
function...


function checkFunction($file, $function, $args)
{
  $filename = "./function_{$file}.php";
  if(file_exists($filename))
  {
include_once($filename);
  }
  else
  {
return 'function file not exist';
  }

  if(function_exists($file .'_'. $function))
  {
return call_user_func_array($file .'_'. $function, $args);
  }
  else
  {
return "Function: {$function}() does not exist";
  }

  return 'Fire and brimstone coming down from the skies! Rivers and seas
boiling! Forty years of darkness! Earthquakes, volcanoes... The dead
rising from the grave! Human sacrifice, dogs and cats living together...
mass hysteria!!';
}

$temp = checkFunction('test', 'somefunction', array('var1', 'var2'));

then create the functions file- functions_test.php that holds all the
functions you would "group" together... 

function test_somefunction($var1, $var2, $var3 = '')
{
return $var1 .' - '. $var2;
}


This is just a thought, and yeah, it would require some rewrites, and
some forward thinking...  but could solve your issue... maybe

steve


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



[PHP] is this thing on??

2010-11-23 Thread Steve Staples
tap tap tap... testing testing... 1, 2, 3

Hello?No activity since yesterday at like 6pm EST... am i not
getting messages, or has there not been any activity?

Just curious... carry on about your business... :P


Steve


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



Re: [PHP] is this thing on??

2010-11-23 Thread Peter Lind
On 23 November 2010 20:52, Steve Staples  wrote:
> tap tap tap... testing testing... 1, 2, 3
>
> Hello?    No activity since yesterday at like 6pm EST... am i not
> getting messages, or has there not been any activity?
>
> Just curious... carry on about your business... :P
>

http://news.php.net/php.general - please, next time, don't spam tons of people.

-- 

WWW: plphp.dk / plind.dk
LinkedIn: plind
BeWelcome/Couchsurfing: Fake51
Twitter: kafe15


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



Re: [PHP] is this thing on??

2010-11-23 Thread Steve Staples
On Tue, 2010-11-23 at 20:55 +0100, Peter Lind wrote:
> On 23 November 2010 20:52, Steve Staples  wrote:
> > tap tap tap... testing testing... 1, 2, 3
> >
> > Hello?No activity since yesterday at like 6pm EST... am i not
> > getting messages, or has there not been any activity?
> >
> > Just curious... carry on about your business... :P
> >
> 
> http://news.php.net/php.general - please, next time, don't spam tons of 
> people.
> 
> -- 
> 
> WWW: plphp.dk / plind.dk
> LinkedIn: plind
> BeWelcome/Couchsurfing: Fake51
> Twitter: kafe15
> 
> 

My apologies to you, and to everyone else on the list.

Peter,  I didn't know that page/site existed.  I will check there from
now on when there seems to be a lull in messages (usually seems to be at
least a few every day).

Steve.


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



Re: [PHP] is this thing on??

2010-11-23 Thread Daniel Brown
On Tue, Nov 23, 2010 at 14:55, Peter Lind  wrote:
>
> http://news.php.net/php.general - please, next time, don't spam tons of 
> people.

We've never really minded the occasional list-ping.  In fact, if
you check those same archives through the decade, you'll see that even
the most senior members of the list and community have done it from
time to time.  Though, while it's certainly not SPAM, it's good that
you pointed out the archives.  I'm afraid it seems that many folks
don't realize they're there.  Might be worthwhile to add it in to the
signature of each list message sometime in the future.

-- 

Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/

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



Re: [PHP] is this thing on??

2010-11-23 Thread Daniel P. Brown
On Tue, Nov 23, 2010 at 14:52, Steve Staples  wrote:
> tap tap tap... testing testing... 1, 2, 3
>
> Hello?    No activity since yesterday at like 6pm EST... am i not
> getting messages, or has there not been any activity?
>
> Just curious... carry on about your business... :P

Some of the lull is likely due in part to the American
Thanksgiving holiday this week.  Historically, the list has always
calmed down over the years during major holidays or events in North
America, the UK, and Northern Europe.

-- 

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

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



Re: [PHP] is this thing on??

2010-11-23 Thread Nicholas Kell

Whitetail hunting season, for most of the American Midwest anyway.  :)


On Nov 23, 2010, at 2:01 PM, Steve Staples wrote:

> On Tue, 2010-11-23 at 20:55 +0100, Peter Lind wrote:
>> On 23 November 2010 20:52, Steve Staples  wrote:
>>> tap tap tap... testing testing... 1, 2, 3
>>> 
>>> Hello?No activity since yesterday at like 6pm EST... am i not
>>> getting messages, or has there not been any activity?
>>> 
>>> Just curious... carry on about your business... :P
>>> 
>> 
>> http://news.php.net/php.general - please, next time, don't spam tons of 
>> people.
>> 
>> -- 
>> 
>> WWW: plphp.dk / plind.dk
>> LinkedIn: plind
>> BeWelcome/Couchsurfing: Fake51
>> Twitter: kafe15
>> 
>> 
> 
> My apologies to you, and to everyone else on the list.
> 
> Peter,  I didn't know that page/site existed.  I will check there from
> now on when there seems to be a lull in messages (usually seems to be at
> least a few every day).
> 
> Steve.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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



[PHP] curl and variable parameters in hyperlink

2010-11-23 Thread Bob Keightley
First use of Curl so probably a very simple problem - I have a script which 
loads a third party web page into my site.  That page contains links which 
have variable parameters i.e. www.blahblah.asp?param1=xxx¶m2=yyy.

Any clues as to what I need to do to pass these parameters in a curl script 
appreciated. 



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



RE: [PHP] curl and variable parameters in hyperlink

2010-11-23 Thread admin
Depending on how the website is setup you can curl or soap parameters.

http://www.php.net/manual/en/book.curl.php
http://www.php.net/manual/en/book.soap.php




Richard L. Buskirk

-Original Message-
From: Bob Keightley [mailto:bob.keight...@virgin.net] 
Sent: Tuesday, November 23, 2010 9:12 PM
To: php-general@lists.php.net
Subject: [PHP] curl and variable parameters in hyperlink

First use of Curl so probably a very simple problem - I have a script which 
loads a third party web page into my site.  That page contains links which 
have variable parameters i.e. www.blahblah.asp?param1=xxx¶m2=yyy.

Any clues as to what I need to do to pass these parameters in a curl script 
appreciated. 



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


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



RE: [PHP] curl and variable parameters in hyperlink

2010-11-23 Thread Bob Keightley

I already have a curl script that gets the web page, but it doesn't pass the
parameters

Being new to PHP I haven't the first idea how to modify it so that it does.

Script is as follows:

$url = "http://www.xx.com/query.asp?param1=val1¶m2=val2";;

foreach ($_POST as $key=>$post) {
$post=str_replace(" ", "+", $post);
$url.=$key."=".$post."&";
}

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
$data = curl_exec($ch);
curl_close($ch);

$data=str_replace('.asp', '.php', $data);
echo $data;

This returns the web page, but ignores val1 and val2 which are necessary to
execute the query.



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