Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #15925
| From | James Harris <james.harris.1@gmail.com> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | PHP boilerplate to appear at the top of any program |
| Date | 2015-12-19 10:03 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <n539sr$a82$1@dont-email.me> (permalink) |
In the interests of getting a consistent approach to developing PHP
programs do you guys have any guidelines you follow and/or boilerplate
you include when writing a new piece of PHP? For HTML output I mean
things like the following.
At the top of the code: setup such as error_reporting, ini_set etc and
constant definitions.
Use of ob_start before the code generates 'normal' output so that the
program can present custom error information if something goes wrong.
A fail() function which will ob_end_clean and then render a suitable
failure HTML page.
Some sort of debugging functions which will work with output buffer
capture to generate sensible debug output.
Is there anything else that should be present at the top of a piece of code?
Given the fact that some of the above may vary between environments such
as test and production is it feasible to pull in something like the
above with
require_once("preamble_code.php");
I have code such as the above at the moment but for various reasons it
is not completely satisfactory. I wondered if people who were more
familiar with PHP had come up with a better approach.
If some of the above can be parameterised might it even be possible to
come up with a universal module that can be pulled in with require_once
(and then the functions within it called with certain parameters)?
James
Back to comp.lang.php | Previous | Next — Next in thread | Find similar | Unroll thread
PHP boilerplate to appear at the top of any program James Harris <james.harris.1@gmail.com> - 2015-12-19 10:03 +0000
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-19 08:20 -0500
Re: PHP boilerplate to appear at the top of any program James Harris <james.harris.1@gmail.com> - 2015-12-20 10:16 +0000
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-20 09:31 -0500
Re: PHP boilerplate to appear at the top of any program James Harris <james.harris.1@gmail.com> - 2015-12-20 17:11 +0000
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-20 16:42 -0500
Re: PHP boilerplate to appear at the top of any program James Harris <james.harris.1@gmail.com> - 2015-12-25 15:56 +0000
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-25 11:23 -0500
Re: PHP boilerplate to appear at the top of any program James Harris <james.harris.1@gmail.com> - 2015-12-26 10:09 +0000
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-26 09:33 -0500
Re: PHP boilerplate to appear at the top of any program Denis McMahon <denismfmcmahon@gmail.com> - 2015-12-20 22:54 +0000
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-20 18:40 -0500
Re: PHP boilerplate to appear at the top of any program Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 10:38 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-21 08:41 -0500
Re: PHP boilerplate to appear at the top of any program Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 15:30 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-21 11:04 -0500
Re: PHP boilerplate to appear at the top of any program Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 23:24 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-21 19:16 -0500
Re: PHP boilerplate to appear at the top of any program Gregor Kofler <usenet@gregorkofler.com> - 2015-12-22 00:33 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-21 19:19 -0500
Re: PHP boilerplate to appear at the top of any program Gregor Kofler <usenet@gregorkofler.com> - 2015-12-22 10:27 +0100
Re: PHP boilerplate to appear at the top of any program Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-22 11:18 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-22 06:34 -0500
Re: PHP boilerplate to appear at the top of any program Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-22 16:00 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-22 10:56 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-22 15:56 +0100
OT: pre-PHP day (was: PHP boilerplate to appear at the top of any program) Gregor Kofler <usenet@gregorkofler.com> - 2015-12-22 16:57 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-22 11:03 -0500
Re: PHP boilerplate to appear at the top of any program Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-22 18:02 +0100
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-22 14:47 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-22 11:04 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-22 18:22 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-22 12:33 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-22 18:46 +0100
Re: PHP boilerplate to appear at the top of any program "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-12-21 17:25 +0100
Re: PHP boilerplate to appear at the top of any program Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-21 23:17 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-21 19:23 -0500
Re: PHP boilerplate to appear at the top of any program Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-28 15:26 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-28 10:02 -0500
Re: PHP boilerplate to appear at the top of any program Gregor Kofler <usenet@gregorkofler.com> - 2015-12-28 18:14 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-28 12:29 -0500
Re: PHP boilerplate to appear at the top of any program Gregor Kofler <usenet@gregorkofler.com> - 2015-12-28 18:54 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-28 14:15 -0500
Re: PHP boilerplate to appear at the top of any program Gregor Kofler <usenet@gregorkofler.com> - 2015-12-28 21:18 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-28 15:49 -0500
Re: PHP boilerplate to appear at the top of any program Richard Damon <Richard@Damon-Family.org> - 2015-12-28 20:31 -0500
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-28 20:48 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-30 11:26 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-30 12:33 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-30 18:57 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-30 15:14 -0500
Re: PHP boilerplate to appear at the top of any program Gregor Kofler <usenet@gregorkofler.com> - 2015-12-30 19:05 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-30 15:18 -0500
Re: PHP boilerplate to appear at the top of any program Richard Damon <Richard@Damon-Family.org> - 2015-12-30 21:55 -0500
Re: PHP boilerplate to appear at the top of any program Matthew Carter <m@ahungry.com> - 2015-12-30 22:14 -0500
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-30 22:43 -0500
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-30 22:46 -0500
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-30 22:42 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-31 09:07 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-31 07:47 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-31 16:11 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-31 10:47 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-31 17:43 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-31 13:49 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-31 20:35 +0100
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-30 11:18 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-30 12:36 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-30 19:09 +0100
Re: PHP boilerplate to appear at the top of any program Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2015-12-30 20:28 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-30 15:21 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-31 09:09 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-30 15:21 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-31 09:16 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-31 07:53 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-31 16:03 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-31 10:49 -0500
Re: PHP boilerplate to appear at the top of any program Gregor Kofler <usenet@gregorkofler.com> - 2015-12-31 17:16 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-31 13:54 -0500
Re: PHP boilerplate to appear at the top of any program Gregor Kofler <usenet@gregorkofler.com> - 2015-12-31 20:41 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-31 14:47 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-31 20:56 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-31 15:21 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-31 17:52 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-31 13:51 -0500
Re: PHP boilerplate to appear at the top of any program Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-28 19:35 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-28 14:17 -0500
Re: PHP boilerplate to appear at the top of any program Gregor Kofler <usenet@gregorkofler.com> - 2015-12-22 00:20 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-21 19:27 -0500
Re: PHP boilerplate to appear at the top of any program Gregor Kofler <usenet@gregorkofler.com> - 2015-12-22 10:12 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-22 06:36 -0500
Re: PHP boilerplate to appear at the top of any program Gregor Kofler <usenet@gregorkofler.com> - 2015-12-22 13:57 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-22 11:05 -0500
Re: PHP boilerplate to appear at the top of any program Gregor Kofler <usenet@gregorkofler.com> - 2015-12-22 17:22 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-22 12:01 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2015-12-22 18:25 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-22 12:34 -0500
Re: PHP boilerplate to appear at the top of any program Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2015-12-21 14:53 -0800
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-21 19:30 -0500
Re: PHP boilerplate to appear at the top of any program Matthew Carter <m@ahungry.com> - 2015-12-21 21:40 -0500
Re: PHP boilerplate to appear at the top of any program Matthew Carter <m@ahungry.com> - 2015-12-21 21:47 -0500
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-21 21:55 -0500
Re: PHP boilerplate to appear at the top of any program Matthew Carter <m@ahungry.com> - 2015-12-21 21:57 -0500
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-21 22:01 -0500
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-21 21:54 -0500
Re: PHP boilerplate to appear at the top of any program Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2015-12-22 11:54 -0800
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-22 15:42 -0500
Re: PHP boilerplate to appear at the top of any program Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2016-01-02 11:08 -0800
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-02 15:12 -0500
Re: PHP boilerplate to appear at the top of any program Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2016-01-04 10:41 -0800
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-04 14:39 -0500
Re: PHP boilerplate to appear at the top of any program Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2015-12-22 11:49 -0800
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2015-12-22 15:44 -0500
Re: PHP boilerplate to appear at the top of any program Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2016-01-02 11:09 -0800
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-02 15:14 -0500
Re: PHP boilerplate to appear at the top of any program Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2016-01-04 10:42 -0800
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-04 14:41 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-04 22:54 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-04 19:40 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-05 04:19 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-04 22:29 -0500
Re: PHP boilerplate to appear at the top of any program Matthew Carter <m@ahungry.com> - 2016-01-05 02:02 -0500
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-05 09:08 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-05 18:55 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-05 14:06 -0500
Re: PHP boilerplate to appear at the top of any program Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2016-01-04 15:51 -0800
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-04 19:41 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-05 04:27 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-04 22:31 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-05 04:48 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-04 22:52 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-05 09:16 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-05 09:08 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-05 18:59 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-05 14:07 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-06 01:13 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-05 20:52 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-06 08:53 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-06 09:15 -0500
Re: PHP boilerplate to appear at the top of any program Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2016-01-05 09:00 -0800
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-05 19:01 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-05 14:09 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-06 01:15 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-05 20:51 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-06 08:54 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-06 09:16 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-11 09:02 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-11 08:02 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-11 23:42 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-11 20:44 -0500
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-05 14:09 -0500
Re: PHP boilerplate to appear at the top of any program Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2016-01-06 09:27 -0800
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-06 15:25 -0500
Re: PHP boilerplate to appear at the top of any program Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2016-01-06 13:27 -0800
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-06 16:32 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-11 09:03 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-11 08:03 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-11 23:45 +0100
Re: PHP boilerplate to appear at the top of any program Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-11 20:48 -0500
Re: PHP boilerplate to appear at the top of any program Arno Welzel <usenet@arnowelzel.de> - 2016-01-12 05:34 +0100
csiph-web