Re: [PHP] Making sure an include file works

2008-02-28 Thread Dan Joseph
On Thu, Feb 28, 2008 at 9:58 PM, Richard S. Crawford <
[EMAIL PROTECTED]> wrote:

> I'm trying to figure out a way to make sure an included PHP file has no
> syntax
> errors before actually including it as a part of project. Is this even
> possible?  I'm running into brick walls.
>
>

The include itself or the contents in the include file?  If you use
require() instead of include(), your script will error out if there are any
issues with the inclusion of the file.

-- 
-Dan Joseph

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."


Re: [PHP] Making sure an include file works

2008-02-28 Thread Robert Cummings

On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote:
> I'm trying to figure out a way to make sure an included PHP file has no 
> syntax 
> errors before actually including it as a part of project. Is this even 
> possible?  I'm running into brick walls.

I don't believe there is a function to do this. What can be done though
is to call the cli binary with the -l flag and have the file syntax
checked that way.

php -l /path/to/the/source

It wouldn't be very fast though as a solution.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Making sure an include file works

2008-02-28 Thread Casey
On Thu, Feb 28, 2008 at 7:50 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
>  On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote:
>  > I'm trying to figure out a way to make sure an included PHP file has no 
> syntax
>  > errors before actually including it as a part of project. Is this even
>  > possible?  I'm running into brick walls.
>
>  I don't believe there is a function to do this. What can be done though
>  is to call the cli binary with the -l flag and have the file syntax
>  checked that way.
>
> php -l /path/to/the/source
>
>  It wouldn't be very fast though as a solution.
>
>  Cheers,
>  Rob.
>  --
>  ..
>  | InterJinn Application Framework - http://www.interjinn.com |
>  ::
>  | An application and templating framework for PHP. Boasting  |
>  | a powerful, scalable system for accessing system services  |
>  | such as forms, properties, sessions, and caches. InterJinn |
>  | also provides an extremely flexible architecture for   |
>  | creating re-usable components quickly and easily.  |
>  `'
>
>
>

http://us.php.net/manual/en/function.php-check-syntax.php

-- 
-Casey

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



Re: [PHP] Making sure an include file works

2008-02-28 Thread Robert Cummings

On Thu, 2008-02-28 at 20:17 -0800, Casey wrote:
> On Thu, Feb 28, 2008 at 7:50 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:
> >
> >  On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote:
> >  > I'm trying to figure out a way to make sure an included PHP file has no 
> > syntax
> >  > errors before actually including it as a part of project. Is this even
> >  > possible?  I'm running into brick walls.
> >
> >  I don't believe there is a function to do this. What can be done though
> >  is to call the cli binary with the -l flag and have the file syntax
> >  checked that way.
> >
> > php -l /path/to/the/source
> >
> >  It wouldn't be very fast though as a solution.
>
> http://us.php.net/manual/en/function.php-check-syntax.php

Doh! Time for me to start trawling the PHP site again to acquaint myself
with all the new functions :) I probably would have found it though if
searching the site's functions for syntax didn't take me directly to the
documentation for soundex().

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Making sure an include file works

2008-02-28 Thread Jim Lucas

Robert Cummings wrote:

On Thu, 2008-02-28 at 20:17 -0800, Casey wrote:

On Thu, Feb 28, 2008 at 7:50 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:

 On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote:
 > I'm trying to figure out a way to make sure an included PHP file has no 
syntax
 > errors before actually including it as a part of project. Is this even
 > possible?  I'm running into brick walls.

 I don't believe there is a function to do this. What can be done though
 is to call the cli binary with the -l flag and have the file syntax
 checked that way.

php -l /path/to/the/source

 It wouldn't be very fast though as a solution.

http://us.php.net/manual/en/function.php-check-syntax.php


Doh! Time for me to start trawling the PHP site again to acquaint myself
with all the new functions :) I probably would have found it though if
searching the site's functions for syntax didn't take me directly to the
documentation for soundex().

Cheers,
Rob.


Point to be noted.  Check the first note.

Note: For technical reasons, this function is deprecated and removed 
from PHP. Instead, use php -l somefile.php from the commandline.


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



Re: [PHP] Making sure an include file works

2008-02-28 Thread Robert Cummings

On Thu, 2008-02-28 at 20:46 -0800, Jim Lucas wrote:
> Robert Cummings wrote:
> > On Thu, 2008-02-28 at 20:17 -0800, Casey wrote:
> >> On Thu, Feb 28, 2008 at 7:50 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:
> >>>  On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote:
> >>>  > I'm trying to figure out a way to make sure an included PHP file has 
> >>> no syntax
> >>>  > errors before actually including it as a part of project. Is this even
> >>>  > possible?  I'm running into brick walls.
> >>>
> >>>  I don't believe there is a function to do this. What can be done though
> >>>  is to call the cli binary with the -l flag and have the file syntax
> >>>  checked that way.
> >>>
> >>> php -l /path/to/the/source
> >>>
> >>>  It wouldn't be very fast though as a solution.
> >> http://us.php.net/manual/en/function.php-check-syntax.php
> > 
> > Doh! Time for me to start trawling the PHP site again to acquaint myself
> > with all the new functions :) I probably would have found it though if
> > searching the site's functions for syntax didn't take me directly to the
> > documentation for soundex().
> > 
> > Cheers,
> > Rob.
> 
> Point to be noted.  Check the first note.
> 
> Note: For technical reasons, this function is deprecated and removed 
> from PHP. Instead, use php -l somefile.php from the commandline.

That's funny given the thread so far :D

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Making sure an include file works

2008-02-28 Thread Jim Lucas

Robert Cummings wrote:

On Thu, 2008-02-28 at 20:46 -0800, Jim Lucas wrote:

Robert Cummings wrote:

On Thu, 2008-02-28 at 20:17 -0800, Casey wrote:

On Thu, Feb 28, 2008 at 7:50 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:

 On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote:
 > I'm trying to figure out a way to make sure an included PHP file has no 
syntax
 > errors before actually including it as a part of project. Is this even
 > possible?  I'm running into brick walls.

 I don't believe there is a function to do this. What can be done though
 is to call the cli binary with the -l flag and have the file syntax
 checked that way.

php -l /path/to/the/source

 It wouldn't be very fast though as a solution.

http://us.php.net/manual/en/function.php-check-syntax.php

Doh! Time for me to start trawling the PHP site again to acquaint myself
with all the new functions :) I probably would have found it though if
searching the site's functions for syntax didn't take me directly to the
documentation for soundex().

Cheers,
Rob.

Point to be noted.  Check the first note.

Note: For technical reasons, this function is deprecated and removed 
from PHP. Instead, use php -l somefile.php from the commandline.


That's funny given the thread so far :D

Cheers,
Rob.


It isn't my words.  Look at the versions the function is available for.

PHP 5 <= 5.0.4

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



Re: [PHP] Making sure an include file works

2008-02-28 Thread Robert Cummings

On Thu, 2008-02-28 at 20:53 -0800, Jim Lucas wrote:
> Robert Cummings wrote:
> > On Thu, 2008-02-28 at 20:46 -0800, Jim Lucas wrote:
> >> Robert Cummings wrote:
> >>> On Thu, 2008-02-28 at 20:17 -0800, Casey wrote:
>  On Thu, Feb 28, 2008 at 7:50 PM, Robert Cummings <[EMAIL PROTECTED]> 
>  wrote:
> >  On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote:
> >  > I'm trying to figure out a way to make sure an included PHP file has 
> > no syntax
> >  > errors before actually including it as a part of project. Is this 
> > even
> >  > possible?  I'm running into brick walls.
> >
> >  I don't believe there is a function to do this. What can be done though
> >  is to call the cli binary with the -l flag and have the file syntax
> >  checked that way.
> >
> > php -l /path/to/the/source
> >
> >  It wouldn't be very fast though as a solution.
>  http://us.php.net/manual/en/function.php-check-syntax.php
> >>> Doh! Time for me to start trawling the PHP site again to acquaint myself
> >>> with all the new functions :) I probably would have found it though if
> >>> searching the site's functions for syntax didn't take me directly to the
> >>> documentation for soundex().
> >>>
> >>> Cheers,
> >>> Rob.
> >> Point to be noted.  Check the first note.
> >>
> >> Note: For technical reasons, this function is deprecated and removed 
> >> from PHP. Instead, use php -l somefile.php from the commandline.
> > 
> > That's funny given the thread so far :D
> > 
> > Cheers,
> > Rob.
> 
> It isn't my words.  Look at the versions the function is available for.
> 
> PHP 5 <= 5.0.4

I meant funny, in that the solution goes back to what I offered
originally :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Making sure an include file works

2008-02-29 Thread Richard S. Crawford
Thanks to everyone for the suggestions.  Unfortunately, I'm up against a
couple of major hurdles:

1.  My host does not allow command line access and has disabled shell
execution of PHP;

2.  Error reporting has been turned off and I can't seem to turn that on
with ini_set or error_reporting (which is fun when I have minor syntax
errors to fix); and

3.  My host is also stuck in PHP 4.3, so the check_syntax function isn't
available to me either (although I understand that this function has been
deprecated in the most recent builds of PHP).

At this point, I'll just use file_exists and is_readable for some basic
checking, and hope that the included files have no syntax errors.

On Fri, Feb 29, 2008 at 11:25 AM, Daniel Brown <[EMAIL PROTECTED]> wrote:

> On Thu, Feb 28, 2008 at 9:58 PM, Richard S. Crawford
> <[EMAIL PROTECTED]> wrote:
> > I'm trying to figure out a way to make sure an included PHP file has no
> syntax
> >  errors before actually including it as a part of project. Is this even
> >  possible?  I'm running into brick walls.
>
>As far as I know, the only way to do that is via the CLI (or
> accessing the include file directly in the browser).
>
>Make sure that error_reporting is enabled and that it's set to
> report E_ALL if you want to really be sure your code is clean (i.e. -
> reporting unused, undefined, and uninstantiated variables, et cetera).
>
>Then, if done from a *nix command line, just type:
>php -l /path/to/include/file.php
>
> --
> 
>
> Daniel P. Brown
> Senior Unix Geek
> 
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Richard S. Crawford ([EMAIL PROTECTED])
http://www.mossroot.com
Publisher and Editor in Chief, Daikaijuzine (http://www.daikaijuzine.com)
Support me in Write-a-thon 2007:
http://www.firstgiving.com/richardscrawford


Re: [PHP] Making sure an include file works

2008-02-29 Thread Daniel Brown
On Thu, Feb 28, 2008 at 9:58 PM, Richard S. Crawford
<[EMAIL PROTECTED]> wrote:
> I'm trying to figure out a way to make sure an included PHP file has no syntax
>  errors before actually including it as a part of project. Is this even
>  possible?  I'm running into brick walls.

As far as I know, the only way to do that is via the CLI (or
accessing the include file directly in the browser).

Make sure that error_reporting is enabled and that it's set to
report E_ALL if you want to really be sure your code is clean (i.e. -
reporting unused, undefined, and uninstantiated variables, et cetera).

Then, if done from a *nix command line, just type:
php -l /path/to/include/file.php

-- 


Daniel P. Brown
Senior Unix Geek


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



Re: [PHP] Making sure an include file works

2008-02-29 Thread Richard Heyes

1.  My host does not allow command line access and has disabled shell
execution of PHP;

2.  Error reporting has been turned off and I can't seem to turn that on
with ini_set or error_reporting (which is fun when I have minor syntax
errors to fix); and

3.  My host is also stuck in PHP 4.3, so the check_syntax function isn't
available to me either (although I understand that this function has been
deprecated in the most recent builds of PHP).


To be quite honest, your host sounds like it sucks donkey dick. Get 
another if you can.



At this point, I'll just use file_exists and is_readable for some basic
checking, and hope that the included files have no syntax errors.


Hoping something works leads you down the path of severely broken code.

--
Richard Heyes
Employ me:
http://www.phpguru.org/cv

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



Re: [PHP] Making sure an include file works

2008-02-29 Thread Daniel Brown
On Fri, Feb 29, 2008 at 2:32 PM, Richard S. Crawford
<[EMAIL PROTECTED]> wrote:
> Thanks to everyone for the suggestions.  Unfortunately, I'm up against a
> couple of major hurdles:

Not to be a smartass with my responses here

> 1.  My host does not allow command line access and has disabled shell 
> execution of PHP;

Get a new host that will allow commands and offers access to
people who know how to correctly use it.

> 2.  Error reporting has been turned off and I can't seem to turn that on
> with ini_set or error_reporting (which is fun when I have minor syntax
> errors to fix); and

Get a new host that understands that - while they may want to hide
their own errors - disabling error_reporting for all customer websites
by default is asinine.

> 3.  My host is also stuck in PHP 4.3, so the check_syntax function isn't
> available to me either (although I understand that this function has been
> deprecated in the most recent builds of PHP).

Get a new host that knows how to administer a web server.  PHP 4.3
was released 27 December, 2002, with the latest from the 4.3 branch
(4.3.11) being released 31 March, 2005.  The CHANGELOG should give you
an idea of how *horrible* this is: http://www.php.net/ChangeLog-4.php

All of PHP4 reached its EOL the last day of 2007, but at the very
least, try to find a host that uses a version of PHP newer than three
to five years old.

-- 


Daniel P. Brown
Senior Unix Geek


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



Re: [PHP] Making sure an include file works

2008-02-29 Thread Jochem Maas

Richard S. Crawford schreef:

Thanks to everyone for the suggestions.  Unfortunately, I'm up against a
couple of major hurdles:

1.  My host does not allow command line access and has disabled shell
execution of PHP;

2.  Error reporting has been turned off and I can't seem to turn that on
with ini_set or error_reporting (which is fun when I have minor syntax
errors to fix); and


which ini setting? if you want to see your errors in the browser you need
 display_errors set to On. error_reporting only sets the level of reporting.



3.  My host is also stuck in PHP 4.3, so the check_syntax function isn't
available to me either (although I understand that this function has been
deprecated in the most recent builds of PHP).


make your host your ex-host.


At this point, I'll just use file_exists and is_readable for some basic
checking, and hope that the included files have no syntax errors.


it seems madness that you don't seem to test code before incorporating it
into a production system. at the very least anything you put on a website should
parse properly.

have you considered installing a local copy of php (and suitable webserver)
so you can test it there?



On Fri, Feb 29, 2008 at 11:25 AM, Daniel Brown <[EMAIL PROTECTED]> wrote:


On Thu, Feb 28, 2008 at 9:58 PM, Richard S. Crawford
<[EMAIL PROTECTED]> wrote:

I'm trying to figure out a way to make sure an included PHP file has no

syntax

 errors before actually including it as a part of project. Is this even
 possible?  I'm running into brick walls.

   As far as I know, the only way to do that is via the CLI (or
accessing the include file directly in the browser).

   Make sure that error_reporting is enabled and that it's set to
report E_ALL if you want to really be sure your code is clean (i.e. -
reporting unused, undefined, and uninstantiated variables, et cetera).

   Then, if done from a *nix command line, just type:
   php -l /path/to/include/file.php

--


Daniel P. Brown
Senior Unix Geek


--
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] Making sure an include file works

2008-02-29 Thread Daniel Brown
On Fri, Feb 29, 2008 at 3:42 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
>  have you considered installing a local copy of php (and suitable webserver)
>  so you can test it there?

Always good advice.  At the very least, a remote dev box on which
to work the code.  However, it's not going to be the Holy Grail (as I
know Jochem's already aware, but I'll point out for newbies), because
it's more work than is generally justifiable to mirror an entire
server's environment for a single project.  For example, why would you
want to limit yourself to such antiquated technology on your
development box (losing a lot of functionality, and re-creating
security vulnerabilities and system problems) just to match to a bad
web host?

More common, you may install Apache 2.0.48 with PHP as an ASPX2
module with the GD library, which has distinct differences from an
Apache 1.3.37 with PHP as CGI with bundled GD.

-- 


Daniel P. Brown
Senior Unix Geek


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



Re: [PHP] Making sure an include file works

2008-02-29 Thread Richard S. Crawford
On Friday 29 February 2008 11:58:16 Daniel Brown wrote:
>     Get a new host that knows how to administer a web server.  PHP 4.3
> was released 27 December, 2002, with the latest from the 4.3 branch
> (4.3.11) being released 31 March, 2005.  The CHANGELOG should give you
> an idea of how *horrible* this is: http://www.php.net/ChangeLog-4.php

Ah, if only I could.  The choice of host was made by my boss, and he loves 
them.

-- 
Slainte,
Richard S. Crawford
Editor-in-chief, Daikaijuzine (http://www.daikaijuzine.com)
Personal website: http://www.mossroot.com

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



Re: [PHP] Making sure an include file works

2008-03-01 Thread Daniel Brown
On Fri, Feb 29, 2008 at 10:02 PM, Richard S. Crawford
<[EMAIL PROTECTED]> wrote:
> On Friday 29 February 2008 11:58:16 Daniel Brown wrote:
>  > Get a new host that knows how to administer a web server.  PHP 4.3
>  > was released 27 December, 2002, with the latest from the 4.3 branch
>  > (4.3.11) being released 31 March, 2005.  The CHANGELOG should give you
>  > an idea of how *horrible* this is: http://www.php.net/ChangeLog-4.php
>
>  Ah, if only I could.  The choice of host was made by my boss, and he loves
>  them.

And if they truly love him in return, they'll let him go

-- 


Daniel P. Brown
Senior Unix Geek


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



Re: [PHP] Making sure an include file works

2008-03-02 Thread Chris



have you considered installing a local copy of php (and suitable webserver)
so you can test it there?


I'd also suggest using a revision control system (subversion or git) and 
have pre-commit hooks to check the syntax.


It's a bit of work to set up but once it's done you'll notice a 
difference - just knowing how often you're changing things can be 
surprising.


--
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] Making sure an include file works

2008-03-02 Thread Aschwin Wesselius

Chris wrote:


have you considered installing a local copy of php (and suitable 
webserver)

so you can test it there?


I'd also suggest using a revision control system (subversion or git) 
and have pre-commit hooks to check the syntax.


It's a bit of work to set up but once it's done you'll notice a 
difference - just knowing how often you're changing things can be 
surprising.


Hi,

Do you mind sharing a source where I can find more information about 
pre-commit hooks (and especially about syntax checking hooks)?


We use subversion here and it would be great to use such hooks.

Thanks.

Aschwin Wesselius

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



Re: [PHP] Making sure an include file works

2008-03-03 Thread Aschwin Wesselius

Aschwin Wesselius wrote:

Chris wrote:


have you considered installing a local copy of php (and suitable 
webserver)

so you can test it there?


I'd also suggest using a revision control system (subversion or git) 
and have pre-commit hooks to check the syntax.


It's a bit of work to set up but once it's done you'll notice a 
difference - just knowing how often you're changing things can be 
surprising.


Hi,

Do you mind sharing a source where I can find more information about 
pre-commit hooks (and especially about syntax checking hooks)?


We use subversion here and it would be great to use such hooks.

Thanks.

Aschwin Wesselius


Ah, never mind, I've found an howto myself:

http://www.gmta.info/publications/php-syntax-check-through-subversion-pre-commit-hook

Cheers,

Aschwin Wesselius

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



Re: [PHP] Making sure an include file works

2008-03-03 Thread Richard Lynch
On Thu, February 28, 2008 10:25 pm, Robert Cummings wrote:
> Doh! Time for me to start trawling the PHP site again to acquaint
> myself
> with all the new functions :) I probably would have found it though if
> searching the site's functions for syntax didn't take me directly to
> the
> documentation for soundex().

It's not a new function, really...

It's a new function that didn't work out well, and is deprecated and
only lived from PHP 5.0.0 to PHP 5.0.4

Probably not something you'll want to rely on.

Back to exec("php -l ...");

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?


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



Re: [PHP] Making sure an include file works

2008-03-04 Thread tedd

At 6:58 PM -0800 2/28/08, Richard S. Crawford wrote:

I'm trying to figure out a way to make sure an included PHP file has no syntax
errors before actually including it as a part of project. Is this even
possible?  I'm running into brick walls.


I'm not sure if this is what you are asking for, but occasionally I 
have an include file that just brings functions and sometimes I want 
to know if that file has any errors in it.


As such, I simply add echo('a'); at the beginning of the file. If I 
run the script that includes that include and see an 'a' printed at 
the top of the page, then I know that the include has no syntax 
errors. Then it's simple to comment out that line.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Making sure an include file works

2008-03-04 Thread tedd

At 7:52 PM + 2/29/08, Richard Heyes wrote:

1.  My host does not allow command line access and has disabled shell
execution of PHP;

2.  Error reporting has been turned off and I can't seem to turn that on
with ini_set or error_reporting (which is fun when I have minor syntax
errors to fix); and

3.  My host is also stuck in PHP 4.3, so the check_syntax function isn't
available to me either (although I understand that this function has been
deprecated in the most recent builds of PHP).


To be quite honest, your host sounds like it sucks donkey dick. Get 
another if you can.


Try:

http://www.pilotpig.com/

They do it much better (hosting, not the donkey thing). :-)

Cheers,

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Making sure an include file works

2008-03-04 Thread tedd

At 12:05 PM -0500 3/4/08, Daniel Brown wrote:

No, that would work fine in any case.  In fact, code should always
be thoroughly tested before going into production.


Yeah, but that rules out all the fun.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Making sure an include file works

2008-03-04 Thread Daniel Brown
On Tue, Mar 4, 2008 at 11:29 AM, Mike Potter <[EMAIL PROTECTED]> wrote:
> On Fri, Feb 29, 2008 at 2:25 PM, Daniel Brown wrote:
>  > On Thu, Feb 28, 2008 at 9:58 PM, Richard S. Crawford
> > > I'm trying to figure out a way to make sure an included PHP file has no 
> > > syntax
>  >  >  errors before actually including it as a part of project. Is this even
>  >  >  possible?  I'm running into brick walls.
>  >
>  > As far as I know, the only way to do that is via the CLI (or
>  >  accessing the include file directly in the browser).
>
>  I'm wondering why the include couldn't be given a dry run in a test
>  file, migrated to the live file if all goes well. Am I missing
>  something obvious?

No, that would work fine in any case.  In fact, code should always
be thoroughly tested before going into production.

-- 


Daniel P. Brown
Senior Unix Geek


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