Re: [PHP] require_once

2010-10-19 Thread chris h
I see! Yes using an autoloader typically requires following a naming convention for your classes (though you can get around it by defining your own naming rules). I didn't care for it much at first, but it's nice that class names are explicit (less confusion when you have several) and not worryin

Re: [PHP] require_once

2010-10-19 Thread jim
I am following an example. Also, doesn't that require the class name to be something like models_members? Jim On 10/19/2010 09:40 AM, chris h wrote: I'm having a problem including files using Zend Framework. I have in a controller file this Jim why not use the Zend autoloader? C

Re: [PHP] require_once

2010-10-19 Thread chris h
> > I'm having a problem including files using Zend Framework. I have in a > controller file this > > Jim why not use the Zend autoloader? Chris.

Re: [PHP] require_once

2010-10-18 Thread 惠新宸
hi: print_r(get_include_path()); thanks; Best regards 惠新宸 Xinchen Hui http://www.laruence.com/ On 10/19/2010 10:46, jim wrote: I'm having a problem including files using Zend Framework. I have in a controller file this require_once "models/Member.php"; and it doesn't work ,nor does

Re: [PHP] require_once

2010-08-31 Thread Peter Lind
On 1 September 2010 08:00, David Mehler wrote: > Hello, > I've got probably a simple question on require_once. I've got a file > that has require_once at the top of it pulling in another file of > functions. Later on in this file I've got another require_once > bringing in a second file. In this s

Re: [PHP] require_once failure

2009-06-25 Thread Daniel Brown
On Thu, Jun 25, 2009 at 07:26, ste.paole...@tiscali.it wrote: > > Someone can help me? Why on Mac Os there are no problems? Start by making sure that the file is there and is readable by the user as which you are logged in. Execute the command: ls -l /usr/share/php/PHPUnit/Extensions

Re: [PHP] require_once failure

2009-06-25 Thread Michael A. Peters
ste.paole...@tiscali.it wrote: Hi all, I'm a php programmer an I found an anomaly.. it could be a bug. On Mac Os all goes right but on debian enviroment there are some problems: Suppose I've the file /home/ste/test.php containing the following line: also suppose that file /usr/share/php/PHPU

RE: [PHP] require_once failure

2009-06-25 Thread Jay Blanchard
[snip] s...@debian:~$ php test.php Warning: require_once (PHPUnit/Extensions/Database/Testcase.php): failed to open stream: No such file or directory in /home/ste/test.php on line 3 Fatal error: require_once(): Failed opening required 'PHPUnit/Extensions/Database/Testcase.php' (include_path='

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()

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? > > > > --

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

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/tanktrun

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->datar

Re: [PHP] require_once dying silently

2008-04-08 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->dataro

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: > > > 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'

Re: [PHP] require_once dying silently

2008-04-08 Thread Greg Bowser
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. That woul

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->datar

RE: [PHP] require_once and E_WARNING?

2006-07-06 Thread KermodeBear
chris smith wrote: > try it with a call to an undefined function e.g.: > $foo = thisFunctionDoesNotExistAtLeastItHadBetterNot(); When this is done, the error handler doesn't get called at all, and the script simply dies with an error message (which could be a bug as well, but might also be consid

Re: [PHP] require_once and E_WARNING?

2006-07-06 Thread Martin Marques
On Thu, 6 Jul 2006, chris smith wrote: Have you tried this handler with something more fatal, like a missing semi-colon or a } missmatch? That will cause a parse error and the script won't even run. You're right. My wrong. :-( -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0

Re: [PHP] require_once and E_WARNING?

2006-07-06 Thread Jochem Maas
chris smith wrote: > On 7/6/06, Martin Marques wrote: >> On Wed, 5 Jul 2006, [EMAIL PROTECTED] wrote: >> >> > Hello all, >> > >> > According to the PHP Manual, when require or require_once failes, an >> > E_ERROR is triggered: "require() and include() are identical in >> every way >> > except how

Re: [PHP] require_once and E_WARNING?

2006-07-06 Thread chris smith
On 7/6/06, Martin Marques wrote: On Wed, 5 Jul 2006, [EMAIL PROTECTED] wrote: > Hello all, > > According to the PHP Manual, when require or require_once failes, an > E_ERROR is triggered: "require() and include() are identical in every way > except how they handle failure. include() produces a

Re: [PHP] require_once and E_WARNING?

2006-07-06 Thread Martin Marques
On Wed, 5 Jul 2006, [EMAIL PROTECTED] wrote: Hello all, According to the PHP Manual, when require or require_once failes, an E_ERROR is triggered: "require() and include() are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fata

Re: [PHP] require_once and E_WARNING?

2006-07-05 Thread php
>> Code: >> function default_error_handler($code, $error, $file, $line) { >>switch ($code) { >>case E_ERROR: >> die ("Error: $error"); >>case E_WARNING: >> die("Warning: $error"); >>default: >> die("Something else entirely: $error"); >>} >> } >> set_error_handl

Re: [PHP] require_once and E_WARNING?

2006-07-05 Thread Chris
[EMAIL PROTECTED] wrote: Hello all, According to the PHP Manual, when require or require_once failes, an E_ERROR is triggered: "require() and include() are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error." (With 'Fata

Re: [PHP] require_once hell

2006-03-29 Thread gustav
> Hi > > this may be a stupid moment but i cant find an help on google so.i > am including two classes in my code using the "require_once("path to > file")" method. this works fine for the first class but when including > the second it simply outputs the contents on to the page. I feel I mus

Re: [PHP] require_once hell

2006-03-29 Thread Thomas Munz
Forgot the Hi > > this may be a stupid moment but i cant find an help on google so.i > am including two classes in my code using the "require_once("path to > file")" method. this works fine for the first class but when including > the second it simply outputs the contents on to the page. I

Re: [PHP] Require_once return value on error?

2004-04-30 Thread Stuart
Vincent DUPONT wrote: I need to load various php files programatically and I use require_once($file_path) for this purpose. My question is : is there a way to know if the file was found or not? if the file generated an error or not? RTFM: http://php.net/include "require() and include() are ident

Re: [PHP] require_once('') relative path problem

2004-04-22 Thread Torsten Roehr
"Tyler Replogle" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hey, > i didn't quite get when you ment by that but have you tried using > $DOCUMENT_ROOT before your path, that might help it will be something like > this > require_once('$DOCUMENT_ROOT/test/db.php'); > $DOCUMENT_ROOT

Re: [PHP] require_once('') relative path problem

2004-04-22 Thread Nikolay Bachiyski
Hello, Just imagine you had just copied the file you want to include and then pasted it into the master file. PHP does not any path translation. For example if you have the following structure: - / -- a.php -- b.php -- /utils c.php d.php Let c.php is included in a.php. Then if you want

Re: [PHP] require_once('') relative path problem

2004-04-22 Thread Jordi Canals
Curt Zirzow wrote: * Thus wrote Sheeraz fazal ([EMAIL PROTECTED]): Hi, I have problem in undertanding the require_once/require/include/include_once functionality. Php files in my project are located in different folders. Some folders have common files for other files. And file layout is like this

Re: [PHP] require_once('') relative path problem

2004-04-22 Thread Richard Harb
did you check the online manual for those funcitons yet? I have found the user notes to be a wealthy ressource on that matter. This topic also came up very recently on this list so checking the archives might solve it. Richard Thursday, April 22, 2004, 10:34:23 PM, thus was written: > Hi, > I

Re: [PHP] require_once('') relative path problem

2004-04-22 Thread Curt Zirzow
* Thus wrote Sheeraz fazal ([EMAIL PROTECTED]): > Hi, > I have problem in undertanding the require_once/require/include/include_once > functionality. Php files in my project are located in different folders. > Some folders have common files for other files. And file layout is like this Include fil

RE: [PHP] require_once('') relative path problem

2004-04-22 Thread Tyler Replogle
hey, i didn't quite get when you ment by that but have you tried using $DOCUMENT_ROOT before your path, that might help it will be something like this require_once('$DOCUMENT_ROOT/test/db.php'); $DOCUMENT_ROOT goes to your first folder that shows up online (where your index page is) From: "Sh

Re: [PHP] require_once '../config.php'; doesn't work?

2004-04-09 Thread Marek Kilimajer
Mike Zornek wrote: Is it true I can't include a file up a dir like this: require_once '../config.php'; This seems to work though: require_once 'settings/db.php'; Strange. Both works as long as other settings permit it - file permission and owner, safe mode restrictions -- PHP General Mailing

Re: [PHP] require_once '../config.php'; doesn't work?

2004-04-09 Thread Richard Harb
Depends on where the executed script is located ... And it always depends on the script that is called - if you give a relative path like you did here. if the script you called would be http://www.example.com/news/2004-04-10/mypage.php then config.php would have to be in /news if your layout is

Re: [PHP] require_once '../config.php'; doesn't work?

2004-04-09 Thread Jason Giangrande
Mike Zornek wrote: Is it true I can't include a file up a dir like this: require_once '../config.php'; You should be able to include a file up one (or more) directories. Are you sure it's only up one directory from were your script is being called from? This seems to work though: require_once

RE: [PHP] require_once for php3

2003-03-24 Thread Don Read
On 24-Mar-2003 daniel wrote: > hi there is a way to include files once in php3 ? > I've always used function_exists(): if (! function_exists('debug')) include('common.inc');// get the basics if (! function_exists('array_pop')) include('libphp4.php3'); // get emulat

Re: [PHP] require_once for php3

2003-03-23 Thread Jason Sheets
You could write a wrapper around the include function that uses a global array, each time it is called it checks the global array to see if the file has been included, if it hasn't it includes the file and adds the file to the array. Jason daniel wrote: hi there is a way to include files once i

Re: [PHP] require_once adds a "1"

2003-03-08 Thread James
"Gary" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thanks for your response James! > but still I must be doing something wrong the "1" is a persistent little > bugger. Have you any tips on how to rewrite: > > echo @ require_once("topten.php"); > ?> > using the ob_methods? > A

Re: [PHP] require_once adds a "1"

2003-03-07 Thread Gary
Ernest E Vogelsinger wrote: > At 20:19 07.03.2003, Gary said: > Rewrite this to just > require_once('topten.php'); Thanx Ernest! that does the trick Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] require_once adds a "1"

2003-03-07 Thread Ernest E Vogelsinger
At 20:19 07.03.2003, Gary said: [snip] >Thanks for your response James! >but still I must be doing something wrong the "1" is a persistent little >bugger. Have you any tips on how to rewrite: > >echo @ require_once("topten.php"); > ?> >using the ob_methods? -

Re: [PHP] require_once adds a "1"

2003-03-07 Thread Gary
Thanks for your response James! but still I must be doing something wrong the "1" is a persistent little bugger. Have you any tips on how to rewrite: using the ob_methods? Again thanx for your response Gary James Holden wrote: > The '1' is received simply because your requirement clause echoed t

Re: [PHP] require_once adds a "1"

2003-03-07 Thread James Holden
The '1' is received simply because your requirement clause echoed the result to the page. include, require and include_once all return boolean results of 1 or 0 which indicates a successful loading of said include. If you want to suppress the output of an include use ob_ methods which prevent

Re: [PHP] require_once adds a "1"

2003-03-07 Thread Ernest E Vogelsinger
At 17:28 07.03.2003, Gary spoke out and said: [snip] >Hi >I've included the following in a php document: >echo @ require_once("anyfile.php") >> >and it works exactly as I expect except at the end of the included document >theres a single "1" displayed. I've n

Re: [PHP] require_once adds a "1"

2003-03-07 Thread Mincu Alexandru
On Fri, 2003-03-07 at 18:28, Gary wrote: > Hi > I've included the following in a php document: > echo @ require_once("anyfile.php") > > use only if you use echo require_once("somefile.php"); it will include the file and then echo 1 witch is the return value of require_once; > and it works exact

Re: [PHP] REQUIRE_ONCE AND CLASSES

2002-12-16 Thread Wico de Leeuw
Ofcourse there can only be one home function: require_once "HTML/IT.php"; class Home { var $tpl_home = NULL; function Home(){ $this->tpl_home = new IntegratedTemplate("../templates"); $this->tpl_hom

Re: [PHP] REQUIRE_ONCE AND CLASSES

2002-12-16 Thread Wico de Leeuw
Hiya Try it like this: require_once "HTML/IT.php"; class Home { var $tpl_home = NULL; function Home () { $this->tpl_home = new IntegratedTemplate("../templates"); } function Home(){

RE: [PHP] Require_once problem

2002-11-01 Thread Ford, Mike [LSS]
> -Original Message- > From: @ Darwin [mailto:superbus22@;attbi.com] > Sent: 01 November 2002 10:17 > > Well, the way I've read it is that if you use require within control > structures then all files are included, regardless of whether > the script > exits before it reaches its next if..

RE: [PHP] Require_once problem

2002-11-01 Thread @ Darwin
Well, the way I've read it is that if you use require within control structures then all files are included, regardless of whether the script exits before it reaches its next if...elseif...else or case statement. With include that does not happen. So the general rule of thumb would be to use requir

Re: [PHP] require_once(); questions

2001-07-07 Thread Chris Anderson
Try putting GLOBAL infront of the var to give it the greater scope - Original Message - From: "Chris Anderson" <[EMAIL PROTECTED]> To: "Inércia Sensorial" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, July 07, 2001 8:50 PM Subjec

Re: [PHP] require_once(); questions

2001-07-07 Thread Inércia Sensorial
I guess I know what may be wrong. My function that includes the files, it is called several times, with different arguments being passed. It is something like: function LoadPositionedModules ($posv, $posh) { // $posv is vertical position, and $posh is horizontal position // Inside it

Re: [PHP] require_once(); questions

2001-07-07 Thread Chris Anderson
Actually this does work: //First_File.php //Second_File.php //Active file That would produce the output of : I am the test variable An include or require just places the files' contents at the line you include it. So after the includes(requires) my parsed code was: Hope this helps