php-general Digest 9 Mar 2006 23:26:46 -0000 Issue 4007
Topics (messages 231710 through 231737):
Re: include not working properly?
231710 by: Jochem Maas
SVN PHP
231711 by: Jon Morgan
231712 by: Jon Morgan
231713 by: Jens Kleikamp
PHP + MMS Live Streaming + Protect URL.
231714 by: Gentil de Bortoli Júnior
231715 by: David Tulloh
231716 by: Gentil de Bortoli Júnior
231717 by: Barry
231718 by: Gentil de Bortoli Júnior
X-Mailer and headers when sending mail
231719 by: Angelo Zanetti
231726 by: Paul Scott
Re: Zoomable map
231720 by: Lester Caine
session handling
231721 by: suresh kumar
231723 by: João Cândido de Souza Neto
231727 by: tedd
231730 by: Gerry Danen
the best way to get Apache/PHP to handle *all* requests
231722 by: Nic
setting vhost or directory based options to php when using apache with php4-cgi
231724 by: Christoph Anton Mitterer
Understanding system multiple steps
231725 by: Mark Steudel
Re: Calling Curt Z, Curt Z to the white courtesy phone please
231728 by: Max Schwanekamp
php-cgi limitations
231729 by: Max Schwanekamp
231734 by: El Bekko
231735 by: Max Schwanekamp
Sockets ot smth like this
231731 by: _-=MealstroM=-_
Re: Building php-pcre extension on windows
231732 by: Manish Marathe
What is the effect of --enable-memory-limit
231733 by: Khai
Extending a class with a static constructur (like PEAR::DB)
231736 by: weston.leary.csoft.net
Re: Random permission strangeness
231737 by: Chris
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 ---
robert mena wrote:
Hi,
Thanks. it worked.
Since I have a common server where various virtualhosts reside what
would you recommend in terms of security?
1. don't let assholes on your box.
2. read http://phpsec.org
safemode and openbase_dir are primarily designed to protected
legitimate users of a server from screwing around with each others stuff...
if you are the only user (or only team/company) putting stuff on the
given box then it would be fair to say that setting up security in order
to protect yourself from [malicious] yourself is rather silly. i.e.
it's attacks from outside (sql injection, XSS, session spoofing/fixation)
you should be more worried about.
and if your managing lots of paying (hosting) customers - heck buy something
like Plesk and save yourself lots of grief. JMO
PHP 6.0.0 seems to be at least a year ahead and frankly I would probably
only upgrade after a couple of .0.x releases.
yeah but you might as well keep your code as forward compatible as possible -
saves headaches further down the road.
rgds,
--- End Message ---
--- Begin Message ---
Hi.
I'm trying to access SVN from PHP and as there seems to be no direct binding
for it yet i've had a look at WebSVN source to try and list directories in a
repository with the following code but it just doesn't return anything. It
doesn't return anything whether re-directing or not (i..e. using >2&1).
If I use the same method to call "svnlook author", etc. it work fine, the
only problem is when using the "svn" command line program.
$output = array ();
$err = false;
$cmd = "svn info http://172.16.0.32/svn/java/trunk >2&1";
if ($handle = popen($cmd, "r"))
{
$firstline = true;
while(!feof($handle))
{
$line = fgets($handle);
if($firstline && $line == "")
{
$err = true;
}
$firstline = false;
$output[] = rtrim($line);
}
pclose($handle);
if(!$err)
print $output;
}
Any help would be appreciated.
Cheers,
J.
--- End Message ---
--- Begin Message ---
Hi.
I'm trying to access SVN from PHP and as there seems to be no direct binding
for it yet i've had a look at WebSVN source to try and list directories in a
repository with the following code but it just doesn't return anything. It
doesn't return anything whether re-directing or not (i..e. using >2&1).
If I use the same method to call "svnlook author", etc. it work fine, the
only problem is when using the "svn" command line program.
$output = array ();
$err = false;
$cmd = "svn info http://172.16.0.32/svn/java/trunk >2&1";
if ($handle = popen($cmd, "r"))
{
$firstline = true;
while(!feof($handle))
{
$line = fgets($handle);
if($firstline && $line == "")
{
$err = true;
}
$firstline = false;
$output[] = rtrim($line);
}
pclose($handle);
if(!$err)
print $output;
}
Any help would be appreciated.
Cheers,
J.
--- End Message ---
--- Begin Message ---
Jon Morgan wrote:
Hi.
I'm trying to access SVN from PHP and as there seems to be no direct binding
for it yet i've had a look at WebSVN source to try and list directories in a
repository with the following code but it just doesn't return anything. It
doesn't return anything whether re-directing or not (i..e. using >2&1).
If I use the same method to call "svnlook author", etc. it work fine, the
only problem is when using the "svn" command line program.
$output = array ();
$err = false;
$cmd = "svn info http://172.16.0.32/svn/java/trunk >2&1";
if ($handle = popen($cmd, "r"))
{
$firstline = true;
while(!feof($handle))
{
$line = fgets($handle);
if($firstline && $line == "")
{
$err = true;
}
$firstline = false;
$output[] = rtrim($line);
}
pclose($handle);
if(!$err)
print $output;
}
Any help would be appreciated.
Cheers,
J.
Maybe the svn pecl extension can help,
http://pecl.php.net/package/svn
cheers,
Jens
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello, guys.
I have a little problem here and I would like to know if you
have any idea about how to handle it.
I have an URL which is streaming a live TV channel and I need to
implement, using PHP, some kind of validation to allow that only
one person (login) watch it. I mean, multiple logins are not allowed.
So far, so good.
My problem is that the URL can be copied and pasted. I'm trying to
figure it out how to hide and/or protect this URL to permit only
logged in people can see the streaming.
Do you have any idea?
Thanks in advance and excuse me about my English.
- --
Gentil de Bortoli Júnior
Chave GPG: http://gentil.bortoli.com.br/gpg
"There Is No Gene For The Human Spirit"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFEEDUDR/xCJbtXupkRAnp8AJsHqC9QKWGEY/UEYf7eexyO719msACdEJJ1
93swUZjs1RZlpgmDpotXh5k=
=/Mqa
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
It's a fairly standard authentication problem.
I would solve it by using sessions.
In the page and video stream start by checking for an authenticated flag
in the session array.
If the flag is present, display the content.
If not, show a login page. When they login, set the authenticated flag
and redirect them back to their original page.
As you want to have people copy and paste the url, make sure that you
set the use_only_cookies flag in the php config. Otherwise the session
id may be part of the URL and defeat your authentication.
David
Gentil de Bortoli Júnior wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello, guys.
>
> I have a little problem here and I would like to know if you
> have any idea about how to handle it.
>
> I have an URL which is streaming a live TV channel and I need to
> implement, using PHP, some kind of validation to allow that only
> one person (login) watch it. I mean, multiple logins are not allowed.
>
> So far, so good.
>
> My problem is that the URL can be copied and pasted. I'm trying to
> figure it out how to hide and/or protect this URL to permit only
> logged in people can see the streaming.
>
> Do you have any idea?
>
> Thanks in advance and excuse me about my English.
>
> - --
> Gentil de Bortoli Júnior
> Chave GPG: http://gentil.bortoli.com.br/gpg
>
> "There Is No Gene For The Human Spirit"
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (GNU/Linux)
>
> iD8DBQFEEDUDR/xCJbtXupkRAnp8AJsHqC9QKWGEY/UEYf7eexyO719msACdEJJ1
> 93swUZjs1RZlpgmDpotXh5k=
> =/Mqa
> -----END PGP SIGNATURE-----
>
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
>> -----Original Message-----
>> From: Gentil de Bortoli Júnior [mailto:[EMAIL PROTECTED]
>> Sent: 9 March 2006 2:01 pm
>> To: [email protected]
>> Subject: [PHP] PHP + MMS Live Streaming + Protect URL.
>>
>>
>> Hello, guys.
>>
>> I have a little problem here and I would like to know if you
>> have any idea about how to handle it.
>>
>> I have an URL which is streaming a live TV channel and I need to
>> implement, using PHP, some kind of validation to allow that only
>> one person (login) watch it. I mean, multiple logins are not allowed.
>>
>> So far, so good.
>>
>> My problem is that the URL can be copied and pasted. I'm trying to
>> figure it out how to hide and/or protect this URL to permit only
>> logged in people can see the streaming.
>>
>> Do you have any idea?
>>
>> Thanks in advance and excuse me about my English.
George Pitcher wrote:
> Hi,
>
> I would use a cookie. That cookie is set on an earlier page (during
> login validation?). On the page that streams the broadcast, check
> for the contents of the cookie and if not valid, redirect browser to
> log-in page.
>
> I do this for some copyright material on my sites.
Thanks, George. But I think I should give you more information about
my situation.
This URL is being provided by a Windows server.
Let's suppose that it is something like "mms://my.windows.server/live".
So, my job is to avoid this URL can be copied and pasted by someone
which is not authorized (logged in).
The main problem is that I don't have any kind of control over
Windows server or over that URL.
Even using cookies or some kind of session control, someone will still
be able to see this URL and simply paste it in another browser and
starts to watch the streaming.
Actually I don't know if what I'm trying to do is possible.
That's why I'm asking you.
- --
Gentil de Bortoli Júnior
Chave GPG: http://gentil.bortoli.com.br/gpg
"There Is No Gene For The Human Spirit"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFEEDs2R/xCJbtXupkRAvkvAJ0URH8NOKWg7eE/mmJQl8EOVpqSYACfRS5v
3j17iPwHheT6pgOYklI+wGw=
=4sUZ
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Gentil de Bortoli Júnior wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-----Original Message-----
From: Gentil de Bortoli Júnior [mailto:[EMAIL PROTECTED]
Sent: 9 March 2006 2:01 pm
To: [email protected]
Subject: [PHP] PHP + MMS Live Streaming + Protect URL.
Hello, guys.
I have a little problem here and I would like to know if you
have any idea about how to handle it.
I have an URL which is streaming a live TV channel and I need to
implement, using PHP, some kind of validation to allow that only
one person (login) watch it. I mean, multiple logins are not allowed.
So far, so good.
My problem is that the URL can be copied and pasted. I'm trying to
figure it out how to hide and/or protect this URL to permit only
logged in people can see the streaming.
Do you have any idea?
Thanks in advance and excuse me about my English.
George Pitcher wrote:
Hi,
I would use a cookie. That cookie is set on an earlier page (during
login validation?). On the page that streams the broadcast, check
for the contents of the cookie and if not valid, redirect browser to
log-in page.
I do this for some copyright material on my sites.
Thanks, George. But I think I should give you more information about
my situation.
This URL is being provided by a Windows server.
Let's suppose that it is something like "mms://my.windows.server/live".
So, my job is to avoid this URL can be copied and pasted by someone
which is not authorized (logged in).
The main problem is that I don't have any kind of control over
Windows server or over that URL.
Even using cookies or some kind of session control, someone will still
be able to see this URL and simply paste it in another browser and
starts to watch the streaming.
Actually I don't know if what I'm trying to do is possible.
That's why I'm asking you.
Use htaccess?
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Gentil de Bortoli Júnior wrote:
> I have a little problem here and I would like to know if you
> have any idea about how to handle it.
>
> I have an URL which is streaming a live TV channel and I need to
> implement, using PHP, some kind of validation to allow that only
> one person (login) watch it. I mean, multiple logins are not allowed.
>
> So far, so good.
>
> My problem is that the URL can be copied and pasted. I'm trying to
> figure it out how to hide and/or protect this URL to permit only
> logged in people can see the streaming.
>
> Do you have any idea?
David Tulloh wrote:
> It's a fairly standard authentication problem.
> I would solve it by using sessions.
>
> In the page and video stream start by checking for an authenticated
> flag in the session array. If the flag is present, display the
> content.
> If not, show a login page. When they login, set the authenticated
> flag and redirect them back to their original page.
>
> As you want to have people copy and paste the url, make sure that
> you set the use_only_cookies flag in the php config. Otherwise the
> session id may be part of the URL and defeat your authentication.
>
> David
Hi, David.
Excuse me. I'll try to explain it better.
Let's suppose my URL is "mms://my.windows.server/live".
I got your point. In fact, if I had control over that URL, it would be
nice. But the problem is that once someone starts to watch the
streaming, a right click on the video will reveal the original address
from which that transmission is being made.
I'm trying to find a way to "encapsulate" this address and show only
something like http://my.linux.server/live.php?auth_code=1238478653.
I mean, the script live.php should be responsible to deliver the
streaming instead of "mms://my.windows.server/live".
In that way I can easily control everything.
- --
Gentil de Bortoli Júnior
Chave GPG: http://gentil.bortoli.com.br/gpg
"There Is No Gene For The Human Spirit"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFEEEO9R/xCJbtXupkRAohmAJ4jnMOWEuRqp8wTwEEcH0nvWCtB5QCfWcIL
Cgm+uCySeBp+QpqqoCMEv4w=
=7R/g
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Hi guys.
When adding additional headers to an email that gets sent from the mail
function. What purpose does the X-Mailer have?
Also are the following linked:
-X-Priority
-Importance
-X-MSMail-Priority
Another question is can I omit the Message-ID for the email? or will this result in some mail servers viewing the mail
as spam? What criteria do I use to generate the Message-ID?
I've seen:
$headers .= "Message-ID:
<".date("YmdHis")."you@".$_SERVER['SERVER_NAME'].">\n";
is this ok?
Perhaps if someone has a link on the headers for a mail that could help me it
would be much appreciated.
Thanks in advance
--
Angelo Zanetti
Z Logic
www.zlogic.co.za
[c] +27 72 441 3355
[t] +27 21 469 1052
[f] +27 86 681 5885
--- End Message ---
--- Begin Message ---
On Thu, 2006-03-09 at 17:27 -0800, Angelo Zanetti wrote:
> When adding additional headers to an email that gets sent from the mail
> function. What purpose does the X-Mailer have?
>
It identifies the mail client. So I normally set X-Mailer = "MySite
Mailer"; or something. This directive won't normally cause problems with
servers, but the Reply-To header will. Some servers reject mail without
a valid return address, mainly because this is a spam trick. Its a
reverse lookup of sorts on the mail server side.
> Also are the following linked:
>
> -X-Priority
> -Importance
> -X-MSMail-Priority
Yes, MSMail-Priority is for Microsoft clients, Importance is for Mac
clients (I think) and X-Priority is for the rest of the known universe
that adheres to standards.
>
> Another question is can I omit the Message-ID for the email? or will this
> result in some mail servers viewing the mail
> as spam? What criteria do I use to generate the Message-ID?
>
Message-ID is OK to omit In my experience, but see above for Reply-To
> I've seen:
> $headers .= "Message-ID:
> <".date("YmdHis")."you@".$_SERVER['SERVER_NAME'].">\n";
>
> is this ok?
I would do a date("r") for a nice RFC format date and time, but it
should be OK.
>
> Perhaps if someone has a link on the headers for a mail that could help me it
> would be much appreciated.
>
http://za2.php.net/ mail function.
--Paul
--- End Message ---
--- Begin Message ---
Paul Scott wrote:
On Wed, 2006-03-08 at 13:12 -0600, Philip Hallstrom wrote:
I have been searching for this, but maybe one of you has seen it before
and can save me some time. I need a class that will allow me to create a
zoomable map application. I have a map, I just need folks to be able to
zoom and scroll,etc. TIA!
http://script.aculo.us/
might have what you need...
I would also suggest having a look at the UMN Mapserver.
http://mapserver.gis.umn.edu/ There is a pretty decent PHP_Mapscript API
that is really easy to use to create quite excellent mapping
applications. Then again, this may be overkill, and google maps API may
be your best bet.
Something like
http://home.lsces.co.uk/bitweaver/mapper/display_map.php
This is built with Mapserver
--
Lester Caine - G8HFL
-----------------------------
L.S.Caine Electronic Services
Treasurer - Firebird Foundation Inc.
--- End Message ---
--- Begin Message ---
i am having one problem in session handling.
I am having 2 files,login page and hame page.
when user enterd user name and password in login page
.i used session to store the user id .in my second
home page.i retrieve the user id.now i want the user
id to be availble in my thrid page.plz help me.this is
my code.
login.php
session_start();
$ID=$userid;
session_register("ID");
homepage.php
session_start():
echo $ID //this is working fine
thirdpage.php
session_start();
echo $ID //not working
i am looking reply from u
__________________________________________________________
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com
--- End Message ---
--- Begin Message ---
One important question is:
You're using register_globals equal on or off?
suresh kumar wrote:
> i am having one problem in session handling.
> I am having 2 files,login page and hame page.
> when user enterd user name and password in login page
> .i used session to store the user id .in my second
> home page.i retrieve the user id.now i want the user
> id to be availble in my thrid page.plz help me.this is
> my code.
>
> login.php
> session_start();
> $ID=$userid;
> session_register("ID");
>
> homepage.php
> session_start():
> echo $ID //this is working fine
>
>
>
> thirdpage.php
> session_start();
> echo $ID //not working
>
>
>
> i am looking reply from u
>
>
>
>
>
> __________________________________________________________
> Yahoo! India Matrimony: Find your partner now. Go to
> http://yahoo.shaadi.com
--- End Message ---
--- Begin Message ---
i am having one problem in session handling.
I am having 2 files,login page and hame page.
when user enterd user name and password in login page
.i used session to store the user id .in my second
home page.i retrieve the user id.now i want the user
id to be availble in my thrid page.plz help me.this is
my code.
login.php
session_start();
$ID=$userid;
session_register("ID");
homepage.php
session_start():
echo $ID //this is working fine
thirdpage.php
session_start();
echo $ID //not working
i am looking reply from u
Try: session_register("ID");
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
--- End Message ---
--- Begin Message ---
$ID is not a global, but $_SESSION["ID"] would be...
Gerry
http://groups.yahoo.com/group/php_and_mysql/
On 3/9/06, suresh kumar <[EMAIL PROTECTED]> wrote:
>
> i am having one problem in session handling.
> I am having 2 files,login page and hame page.
> when user enterd user name and password in login page
> .i used session to store the user id .in my second
> home page.i retrieve the user id.now i want the user
> id to be availble in my thrid page.plz help me.this is
> my code.
>
> login.php
> session_start();
> $ID=$userid;
> session_register("ID");
>
> homepage.php
> session_start():
> echo $ID //this is working fine
>
>
>
> thirdpage.php
> session_start();
> echo $ID //not working
>
--- End Message ---
--- Begin Message ---
Hi
I've got apache2/mod_php4 and I want to pass all requests to a vhost
through to a single PHP script.
I've tried this config:
<VirtualHost *>
ServerName yyy
DocumentRoot /var/local/yyy
<LocationMatch ".*">
ForceType application/x-httpd-php
</LocationMatch>
</VirtualHost>
with a PHP script called "store" I can get most of the requests to go
through the script by asking for:
http://yyy/store/something/or/other
However, RANGE requests don't go through the PHP handler.
Anyone know why?
Nic Ferrier
--- End Message ---
--- Begin Message ---
Hi.
I'm using Debian sarge with php4-cgi and I'm looking for a way to set php
settings like open_basedir or disable_functions at a per virtual_host or
directry level from apache.
This seems to be possible when using libapache2-mod-php4 using stuff like
"php_admin_value", but not with my php over cgi setup.
Is it possible to achive the same thing with php-cgi, and if so how?
Thanks in advance,
Chris.
--- End Message ---
--- Begin Message ---
So I am using system() to try and access sftp from my php scripts. How do I
do multiple steps once I've initiated my command
e.g.
$file = 'filname.txt';
system( "C:\sftp\sftp.exe <login flags> | put ".$file );
Im on a windows box, so I don't know if I can do something like this ...
anyway any help would be ppreciated
THanks
--- End Message ---
--- Begin Message ---
Curt Zirzow wrote:
I'm including the list in this reply in case any wants to give some
feedback.
http://zirzow.dyndns.org/php-general/NEWBIE
http://www.thelinuxconsultancy.co.uk/phpeditors.php is no longer valid.
I mean, the list is no longer there, though the URL is still valid.
It got pretty out of date anyhow. php-editors.com is a good alternative
suggestion.
--
Max Schwanekamp
http://www.neptunewebworks.com/
--- End Message ---
--- Begin Message ---
Can anyone offer or point me to a summary of differences between running
php as an Apache module vs as a cgi executable? Specifically, I'm
wanting to upgrade our servers to php 5 but there is one crucial
third-party app we're using that still needs php 4, so I'm hoping I can
run just that app under php 4 cgi until the vendor updates to support
php 5. Google is unusually laconic on this, but perhaps I just offended
it with too many daft queries on the subject... :)
--
Max Schwanekamp
http://www.neptunewebworks.com/
--- End Message ---
--- Begin Message ---
Max Schwanekamp wrote:
Can anyone offer or point me to a summary of differences between running
php as an Apache module vs as a cgi executable? Specifically, I'm
wanting to upgrade our servers to php 5 but there is one crucial
third-party app we're using that still needs php 4, so I'm hoping I can
run just that app under php 4 cgi until the vendor updates to support
php 5. Google is unusually laconic on this, but perhaps I just offended
it with too many daft queries on the subject... :)
Are you sure that app won't work under PHP5?
--- End Message ---
--- Begin Message ---
El Bekko wrote:
Max Schwanekamp wrote:
Can anyone offer or point me to a summary of differences between
running php as an Apache module vs as a cgi executable? Specifically,
I'm wanting to upgrade our servers to php 5 but there is one crucial
third-party app we're using that still needs php 4,
Are you sure that app won't work under PHP5?
Thanks for the reply. The app in question is FogBugz, and they state
emphatically that it does not yet work under PHP5. I guess there's only
one way to find out, really - test test test.
--
Max Schwanekamp
http://www.neptunewebworks.com/
--- End Message ---
--- Begin Message ---
Hello php-general,
Hi. I ve found one interesting thing, but i
really don't know how can i realize it.
Problem is with some PHP functions. Such as ftp_pwd()
or ftp_chdir() and ftp_cdup(). They are unavailable
on some FTP servers. So i ve decided to remake them
on socket's level. I am new at this field. So please,
can you advice me how to do it? (For example Total Commander
works with sockets and doesn't have any problems.) tnx.
--
Best regards,
_-=MealstroM=-_ mailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
On 3/7/06, Manish Marathe <[EMAIL PROTECTED]> wrote:
>
> PHP experts everywhere!!
>
> I am building PHP 5.1.2 on windows without pcre-regex extension. I am
> building building pcre independently and then I am building the extension
> php_pcre.dll.
>
> I build few other extensions too. I keep the extensions in
> c:\php\extensions which is set in php.ini.
>
> I am getting an error that php_pcre.dll extension is invalid or corrupt
> whenever php call is being invoked.
>
> I believe I am not building php_pcre.dll extension properly, although any
> insights as to what could be the problem. Also is OK to build php
> --without-pcre-regex extension at all?
>
Any inputs on this ???
--
Manish Marathe
SpikeSource, Inc.
http://developer.spikesource.com
--- End Message ---
--- Begin Message ---
If I compile php with --enable-memory-limit and set a memory limit in
php.ini, what will this do ?
Thanks
Khai
--- End Message ---
--- Begin Message ---
So... I'm trying to extend PEAR::DB. It'd be great to keep everything it offers
and just add a few more perhaps unconventional functions.
Intuitively, it seemed like this approach might work:
<?PHP
require_once("DB.php");
# Toy Extension of DB Class
class DBToyExt extends DB
{
var $foo = 1;
var $bar = 2;
function testext($x)
{
echo "\nHEY: $x";
}
}
$dte = DBToyExt::connect("mysql://weston_tssa:[EMAIL
PROTECTED]/weston_tssa");
$dte->testext('testing');
$dte->testext($dte->moo);
$dte->testext($dte->bar);
?>
However, it doesn't seem to understand that the method "testext" exists, and
gives me a fatal error to that effect, as you can see:
http://weston.canncentral.org/web_lab/mlib/DBToyExt.php
I'm guessing this is a side effect of the static constructor -- apparently
using the "extends" keyword is enough to help the engine know that the class
DBToyExt is supposed to inherit the static function "connct", but it's not
enough to bless the return value of connect from the class DB to DBToyExt....
How do I get around this and extend DB?
Thanks,
Weston
--- End Message ---
--- Begin Message ---
Paul Scott wrote:
On Thu, 2006-03-09 at 16:05 +1100, Chris wrote:
What's the whole error message (ie context)? Is it coming from cron or
randomly in your scripts?
From Xdebug...
Its random. I am just thinking though that what it *might* be is that
the initial session is timing out between the app launch and the user
logging in. I start the session beforehand, and simply add/delete from
it as the user moves through the system.
Notice: session_start()
[function.session-start]: ps_files_cleanup_dir: opendir(/var/lib/php5) failed:
Permission denied (13) in /var/www/5ive/app/classes/core/engine_class_inc.php
on line 967
<snip>
If you leave your browser open for 20 mins or something and then try to
log in, does that replicate it?
My first guess is garbage collection..
What are the permissions on that folder? If it's randomly in your
scripts, which user is your webserver running as?
www-data, permissions are drwx-wx-wt owner root.
Would it not be a little unsafe to change those permissions to anything
less secure? I certainly wouldn't think it OK to chown to the webserver
user...?
Should be ok to leave it as it is.
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---