Re: [PHP] require_once dying silently

2008-04-09 Thread Zoltán Németh

Richard S. Crawford írta:

Hi, everyone.

This one's been driving me bonkers for an hour now.  Anyone have any idea
why require_once would be dying silently in the script below?



$CFG-dirroot   = /home/rcrawford/public_html/tanktrunk/tanktrunk;
$CFG-dataroot  = $CFG-dirroot.'/moodledata';

require_once($CFG-dirroot/lib/setup.php);


the above won't work, as the parser will try to interpret $CFG and put 
it in the string first, then go ahead.

try this:
require_once($CFG-dirroot./lib/setup.php);
or this:
require_once({$CFG-dirroot}/lib/setup.php);

greets,
Zoltán Németh




I've confirmed that the file setup.php exists and is readable.  I've got
error_reporting in php.ini set to E_ALL.  I'm running Apache 2 and PHP5 on
Kubuntu 7.10.  Nothing shows up in my apache error log, and PHP itself
produces absolutely no output, even though it will produce output galore
when I put in a deliberate syntax error.

I've also tried:


require_once($CFG-dirroot./lib/setup.php);


but this didn't help.

Any assistance at all would be greatly appreciated.




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



Re: [PHP] require_once dying silently

2008-04-09 Thread Aschwin Wesselius

Richard S. Crawford wrote:

Hi, everyone.

This one's been driving me bonkers for an hour now.  Anyone have any idea
why require_once would be dying silently in the script below?



$CFG-dirroot   = /home/rcrawford/public_html/tanktrunk/tanktrunk;
$CFG-dataroot  = $CFG-dirroot.'/moodledata';

require_once($CFG-dirroot/lib/setup.php);
  


Hi,

It reads as if $CFG is an object and -dirroot is not a public property 
of that object. So, I don't know what $CFG is, but I think the problem 
lays there.


Also, OOP is nice and all (not to start a thread about OOP again), but 
putting your config into an object seems a bit overdo to me.


--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other'/


Re: [PHP] require_once dying silently

2008-04-09 Thread Zoltán Németh

Aschwin Wesselius írta:

Richard S. Crawford wrote:

Hi, everyone.

This one's been driving me bonkers for an hour now.  Anyone have any idea
why require_once would be dying silently in the script below?



$CFG-dirroot   = /home/rcrawford/public_html/tanktrunk/tanktrunk;
$CFG-dataroot  = $CFG-dirroot.'/moodledata';

require_once($CFG-dirroot/lib/setup.php);
  


Hi,

It reads as if $CFG is an object and -dirroot is not a public property 
of that object. So, I don't know what $CFG is, but I think the problem 
lays there.


if that property is not public but protected or private it would throw a 
fatal error.




Also, OOP is nice and all (not to start a thread about OOP again), but 
putting your config into an object seems a bit overdo to me.




I think you know I don't agree with that, but I too don't want to start 
this over ;)


greets,
Zoltán Németh

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



Re: [PHP] require_once dying silently

2008-04-09 Thread Greg Bowser
the above won't work, as the parser will try to interpret $CFG and
put it in the string first,

In that case, $CFG is either null, or it is indeed an object. If it is
a standard object, which I it appears to be, then a fatal error will
be thrown because there is no __tostring() function.  If it's null,
then require_once is referencing a directory beginning with '-',
again, there *should* be an error. Anyway..

I've seen $obj-property used many times in double quotes, and never
had a problem with that working. Personally though, I always use the
curly braces though because it highlights better in VIM :p

Also, OOP is nice and all (not to start a thread about OOP again),
but putting your config into an object seems a bit overdo to me.

Me too!! (not to continue the unstarted OOP discussion) It's a
practice I've seen used more than once.  I think people find that
syntax attractive.

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



Re: [PHP] require_once dying silently

2008-04-09 Thread Andrew Ballard
On Wed, Apr 9, 2008 at 2:40 AM, Zoltán Németh [EMAIL PROTECTED] wrote:
 Richard S. Crawford írta:

  Hi, everyone.
 
  This one's been driving me bonkers for an hour now.  Anyone have any idea
  why require_once would be dying silently in the script below?
 
  
 
  $CFG-dirroot   = /home/rcrawford/public_html/tanktrunk/tanktrunk;
  $CFG-dataroot  = $CFG-dirroot.'/moodledata';
 
  require_once($CFG-dirroot/lib/setup.php);
 

  the above won't work, as the parser will try to interpret $CFG and put it
 in the string first, then go ahead.
  try this:
  require_once($CFG-dirroot./lib/setup.php);
  or this:
  require_once({$CFG-dirroot}/lib/setup.php);

  greets,
  Zoltán Németh


  
 
  I've confirmed that the file setup.php exists and is readable.  I've got
  error_reporting in php.ini set to E_ALL.  I'm running Apache 2 and PHP5 on
  Kubuntu 7.10.  Nothing shows up in my apache error log, and PHP itself
  produces absolutely no output, even though it will produce output galore
  when I put in a deliberate syntax error.
 
  I've also tried:
 
  
  require_once($CFG-dirroot./lib/setup.php);
  
 
  but this didn't help.
 
  Any assistance at all would be greatly appreciated.
 
 

?php

header('Content-type: text/plain; charset=utf-8');
echo 'Zoltán, you forgot the PHP tags to get credit for your answer. :-)';
exit;

?

Andrew


Re: [PHP] require_once dying silently

2008-04-09 Thread Zoltán Németh

Greg Bowser írta:

the above won't work, as the parser will try to interpret $CFG and

put it in the string first,

In that case, $CFG is either null, or it is indeed an object. If it is
a standard object, which I it appears to be, then a fatal error will
be thrown because there is no __tostring() function.  If it's null,
then require_once is referencing a directory beginning with '-',
again, there *should* be an error. Anyway..

I've seen $obj-property used many times in double quotes, and never
had a problem with that working. Personally though, I always use the
curly braces though because it highlights better in VIM :p


I stand corrected, I just tried putting an object property into double 
quotes and it works


greets,
Zoltán Németh




Also, OOP is nice and all (not to start a thread about OOP again),

but putting your config into an object seems a bit overdo to me.

Me too!! (not to continue the unstarted OOP discussion) It's a
practice I've seen used more than once.  I think people find that
syntax attractive.




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



[PHP] require_once dying silently

2008-04-08 Thread Richard S. Crawford
Hi, everyone.

This one's been driving me bonkers for an hour now.  Anyone have any idea
why require_once would be dying silently in the script below?



$CFG-dirroot   = /home/rcrawford/public_html/tanktrunk/tanktrunk;
$CFG-dataroot  = $CFG-dirroot.'/moodledata';

require_once($CFG-dirroot/lib/setup.php);


I've confirmed that the file setup.php exists and is readable.  I've got
error_reporting in php.ini set to E_ALL.  I'm running Apache 2 and PHP5 on
Kubuntu 7.10.  Nothing shows up in my apache error log, and PHP itself
produces absolutely no output, even though it will produce output galore
when I put in a deliberate syntax error.

I've also tried:


require_once($CFG-dirroot./lib/setup.php);


but this didn't help.

Any assistance at all would be greatly appreciated.

-- 
Richard S. Crawford ([EMAIL PROTECTED])
http://www.mossroot.com
Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)


Re: [PHP] require_once dying silently

2008-04-08 Thread Chris

Richard S. Crawford wrote:

Hi, everyone.

This one's been driving me bonkers for an hour now.  Anyone have any idea
why require_once would be dying silently in the script below?



$CFG-dirroot   = /home/rcrawford/public_html/tanktrunk/tanktrunk;
$CFG-dataroot  = $CFG-dirroot.'/moodledata';

require_once($CFG-dirroot/lib/setup.php);


I've confirmed that the file setup.php exists and is readable.  I've got
error_reporting in php.ini set to E_ALL.  I'm running Apache 2 and PHP5 on
Kubuntu 7.10.  Nothing shows up in my apache error log, and PHP itself
produces absolutely no output, even though it will produce output galore
when I put in a deliberate syntax error.


Syntax errors in which file? The calling one (where you have the 
require_once) or the lib/setup.php file?


Maybe something in your code is disabling your error reporting, I'd put 
both:


error_reporting(E_ALL);
ini_set('display_errors', true);

in before the require_once and see what happens.

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] require_once dying silently

2008-04-08 Thread Greg Bowser
?php echo 'begin brainstorm.'; ?

Is it possible that something is going wrong between the definition
of $CFG-foo and when you require that could cause $CFG-dirroot to be
null? Then it would point to /lib/setup.php, which definitely
shouldn't exist and should thus throw an error, but maybe it's worth
looking into.

?php require_once('Have you tried including a file that definitely
does not exist?'); ? That would rule out any error reporting problems
anyway.

Have you tried something to the effect of ?php echo __FILE__ . '
included'; ? on the first line of setup.php?  Adding ?php
print_r(get_included_files()); ? after the require_once() might also
help.

 I've confirmed that the file setup.php exists and is readable.
I apologize if this seems obvious, but for the sake of
brainstorming... it's readable by the user running apache, right? And
even if it weren't, that should have thrown an error *shrugs*

That's all I can think of. I hope it is of some use to you.

?php echo 'end brainstorm.'; ?

?php signature('GREG'); ?

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



Re: [PHP] require_once dying silently

2008-04-08 Thread Casey
On Tue, Apr 8, 2008 at 8:27 PM, Greg Bowser [EMAIL PROTECTED] wrote:
 ?php echo 'begin brainstorm.'; ?

  Is it possible that something is going wrong between the definition
  of $CFG-foo and when you require that could cause $CFG-dirroot to be
  null? Then it would point to /lib/setup.php, which definitely
  shouldn't exist and should thus throw an error, but maybe it's worth
  looking into.

  ?php require_once('Have you tried including a file that definitely
  does not exist?'); ? That would rule out any error reporting problems
  anyway.

  Have you tried something to the effect of ?php echo __FILE__ . '
  included'; ? on the first line of setup.php?  Adding ?php
  print_r(get_included_files()); ? after the require_once() might also
  help.


   I've confirmed that the file setup.php exists and is readable.
  I apologize if this seems obvious, but for the sake of
  brainstorming... it's readable by the user running apache, right? And
  even if it weren't, that should have thrown an error *shrugs*

  That's all I can think of. I hope it is of some use to you.

  ?php echo 'end brainstorm.'; ?

  ?php signature('GREG'); ?



You should try:
?php
require_once(/home/rcrawford/public_html/tanktrunk/tanktrunk/lib/setup.php);
?

-- 
-Casey

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