FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » request for error checking feature
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
request for error checking feature [message #184048] Tue, 03 December 2013 16:52 Go to next message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
How about making it so that when you check documents for errors, ALL of the
errors get listed in one shot!
I'm tired of having to correct errors one by one.
Correcting errors one at a time, uploading, and doing that a few hundred
times is tedious, time consuming, and damn boring.

And knowing more precisely what caused the error.
e.g. ""theme song"" generates
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting
')

WTF does that mean?
Why can't it just say "Double quotes not allowed here".
I've been spending nearly two hours correcting all the damn double quotes
I wound up with.
So use find and replace.
Can't. That would destroy the double quotes that legal.
As in a null srring.

Please dpn't give a long diatribe about what the error means.
I'm just using it as an example.

There ain't no such word as "encapsed".
Re: request for error checking feature [message #184049 is a reply to message #184048] Tue, 03 December 2013 17:21 Go to previous messageGo to next message
Beauregard T. Shagnas is currently offline  Beauregard T. Shagnas
Messages: 154
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
richard the sto0pid wrote:

> How about making it so my posts aren't tedious, time consuming, and damn
boring.

Then don't post. Find another hobby.

> I've been spending nearly two hours correcting all the damn double
> quotes I wound up with.

If you really do have "two hours" worth of [double-]double quotes, you've
already done something incredibly wrong. However, knowing how you "code"
that's to be expected.

> So use find and replace.
> Can't.

Sure you can. You just have to think for a moment. Oops.

> There ain't no such word as "encapsed".

Sure there is. It's like "legit." (Give it time.)

--
-bts
-This space for rent, but the price is high
Re: request for error checking feature [message #184054 is a reply to message #184048] Tue, 03 December 2013 18:32 Go to previous messageGo to next message
Christoph Michael Bec is currently offline  Christoph Michael Bec
Messages: 207
Registered: June 2013
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
richard wrote:

> Correcting errors one at a time, uploading, and doing that a few hundred
^^^^^^^^^
> times is tedious, time consuming, and damn boring.

Set up a development environment on your local machine -- that'll save
you a lot of time. No need to upload any files in this case -- just
edit them in place and refresh the browser window.

--
Christoph M. Becker
Re: request for error checking feature [message #184056 is a reply to message #184054] Tue, 03 December 2013 19:02 Go to previous messageGo to next message
Ben Bacarisse is currently offline  Ben Bacarisse
Messages: 82
Registered: November 2013
Karma: 0
Member
add to buddy list
ignore all messages by this user
Christoph Michael Becker <cmbecker69(at)arcor(dot)de> writes:

> richard wrote:
>
>> Correcting errors one at a time, uploading, and doing that a few hundred
> ^^^^^^^^^
>> times is tedious, time consuming, and damn boring.
>
> Set up a development environment on your local machine -- that'll save
> you a lot of time. No need to upload any files in this case -- just
> edit them in place and refresh the browser window.

For people doing a lot of development a full server + PHP + bells +
whistles is invaluable, but for simple stuff it is worth knowing that
recent PHP versions come with a built-in server mode.

--
Ben.
Re: request for error checking feature [message #184057 is a reply to message #184056] Tue, 03 December 2013 19:24 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Ben Bacarisse wrote:

> Christoph Michael Becker <cmbecker69(at)arcor(dot)de> writes:
>> richard wrote:
>>> Correcting errors one at a time, uploading, and doing that a few hundred
>> ^^^^^^^^^
>>> times is tedious, time consuming, and damn boring.
>>
>> Set up a development environment on your local machine -- that'll save
>> you a lot of time. No need to upload any files in this case -- just
>> edit them in place and refresh the browser window.
>
> For people doing a lot of development a full server + PHP + bells +
> whistles is invaluable, but for simple stuff it is worth knowing that
> recent PHP versions come with a built-in server mode.

Precisely, the PHP server was introduced with PHP 5.4.

$ php -h | grep -iw server
-S <addr>:<port> Run with built-in web server.
-t <docroot> Specify document root <docroot> for built-in web server.

$ php -v
PHP 5.4.4-14+deb7u4 (cli) (built: Aug 26 2013 07:40:51)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with XCache v2.0.0, Copyright (c) 2005-2012, by mOo
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans


PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7(at)news(dot)demon(dot)co(dot)uk> (2004)
Re: request for error checking feature [message #184062 is a reply to message #184056] Tue, 03 December 2013 20:39 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On 12/3/2013 7:02 PM, Ben Bacarisse wrote:
> Christoph Michael Becker <cmbecker69(at)arcor(dot)de> writes:
>
>> richard wrote:
>>
>>> Correcting errors one at a time, uploading, and doing that a few hundred
>> ^^^^^^^^^
>>> times is tedious, time consuming, and damn boring.
>>
>> Set up a development environment on your local machine -- that'll save
>> you a lot of time. No need to upload any files in this case -- just
>> edit them in place and refresh the browser window.
>
> For people doing a lot of development a full server + PHP + bells +
> whistles is invaluable, but for simple stuff it is worth knowing that
> recent PHP versions come with a built-in server mode.
>

Which may or may not operate the same as the production server. It
depends on a lot of factors, including the exact server being used, the
modules loaded and the server configuration, amongst other things.

It isn't all that hard to set up a development server pretty much
identical to the production server. And a lot more accurate in
duplicating the environment. Even for simple stuff it is invaluable.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: request for error checking feature [message #184065 is a reply to message #184062] Tue, 03 December 2013 21:42 Go to previous messageGo to next message
Ben Bacarisse is currently offline  Ben Bacarisse
Messages: 82
Registered: November 2013
Karma: 0
Member
add to buddy list
ignore all messages by this user
Jerry Stuckle <jstucklex(at)attglobal(dot)net> writes:

> On 12/3/2013 7:02 PM, Ben Bacarisse wrote:
>> Christoph Michael Becker <cmbecker69(at)arcor(dot)de> writes:
>>
>>> richard wrote:
>>>
>>>> Correcting errors one at a time, uploading, and doing that a few hundred
>>> ^^^^^^^^^
>>>> times is tedious, time consuming, and damn boring.
>>>
>>> Set up a development environment on your local machine -- that'll save
>>> you a lot of time. No need to upload any files in this case -- just
>>> edit them in place and refresh the browser window.
>>
>> For people doing a lot of development a full server + PHP + bells +
>> whistles is invaluable, but for simple stuff it is worth knowing that
>> recent PHP versions come with a built-in server mode.
>>
>
> Which may or may not operate the same as the production server. It
> depends on a lot of factors, including the exact server being used,
> the modules loaded and the server configuration, amongst other things.

Yes, it's main value is probably for learning PHP or early prototyping
where you should be able to avoid anything server specific. PHP modules
are not a problem -- you can add those in the usual way.

> It isn't all that hard to set up a development server pretty much
> identical to the production server. And a lot more accurate in
> duplicating the environment. Even for simple stuff it is invaluable.

Actually I've found it to be frustratingly difficult. I help out with
several sites with different PHP versions, each with a sightly different
sets of PHP modules and configurations. The server types and loaded
modules also vary a lot, and at least one site uses a module that I'd
have to buy if I wanted accurate duplication. Rather than have multiple
installs or virtual machines all over the place I've opted for a single
"typical" set-up that is probably not the same as any of the live ones.

--
Ben.
Re: request for error checking feature [message #184068 is a reply to message #184065] Tue, 03 December 2013 22:45 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On 12/3/2013 9:42 PM, Ben Bacarisse wrote:
> Jerry Stuckle <jstucklex(at)attglobal(dot)net> writes:
>
>> On 12/3/2013 7:02 PM, Ben Bacarisse wrote:
>>> Christoph Michael Becker <cmbecker69(at)arcor(dot)de> writes:
>>>
>>>> richard wrote:
>>>>
>>>> > Correcting errors one at a time, uploading, and doing that a few hundred
>>>> ^^^^^^^^^
>>>> > times is tedious, time consuming, and damn boring.
>>>>
>>>> Set up a development environment on your local machine -- that'll save
>>>> you a lot of time. No need to upload any files in this case -- just
>>>> edit them in place and refresh the browser window.
>>>
>>> For people doing a lot of development a full server + PHP + bells +
>>> whistles is invaluable, but for simple stuff it is worth knowing that
>>> recent PHP versions come with a built-in server mode.
>>>
>>
>> Which may or may not operate the same as the production server. It
>> depends on a lot of factors, including the exact server being used,
>> the modules loaded and the server configuration, amongst other things.
>
> Yes, it's main value is probably for learning PHP or early prototyping
> where you should be able to avoid anything server specific. PHP modules
> are not a problem -- you can add those in the usual way.
>

No, it's main value is for you to develop in an environment as close to
identical on the server as possible. Everything I do server-wise is
tested on my development systems first.

>> It isn't all that hard to set up a development server pretty much
>> identical to the production server. And a lot more accurate in
>> duplicating the environment. Even for simple stuff it is invaluable.
>
> Actually I've found it to be frustratingly difficult. I help out with
> several sites with different PHP versions, each with a sightly different
> sets of PHP modules and configurations. The server types and loaded
> modules also vary a lot, and at least one site uses a module that I'd
> have to buy if I wanted accurate duplication. Rather than have multiple
> installs or virtual machines all over the place I've opted for a single
> "typical" set-up that is probably not the same as any of the live ones.
>

I have a standard setup that I use on all my servers. If I need a
different setup for a client, I'll either create a separate
configuration file for my test systems or I create a new virtual
machine. It doesn't take me more than about 30 minutes to go from
nothing to a working virtual machine.

As far as paid modules go - if it's necessary for proper operation of
the website, I get it. It's a cost of doing business.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: request for error checking feature [message #184070 is a reply to message #184048] Wed, 04 December 2013 06:20 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Am 03.12.2013 22:52, schrieb richard:

> How about making it so that when you check documents for errors, ALL of the
> errors get listed in one shot!
> I'm tired of having to correct errors one by one.
> Correcting errors one at a time, uploading, and doing that a few hundred
> times is tedious, time consuming, and damn boring.

Why don't you use Apache with PHP on your computer - then you can test
your stuff before uploading anything. Having a test system is wise anyway.

Also see <http://www.apachefriends.org/en/xampp.html>.

I don't recommend using XAMPP in production, but for development it
should be fine.

> And knowing more precisely what caused the error.
> e.g. ""theme song"" generates
> Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting
> ')
>
> WTF does that mean?

Usually there is a line number as well, not just the error message.

> Why can't it just say "Double quotes not allowed here".

Because this is not the error. The double quotes just caused the error
but there is no thing like "double quotes not allowed".

> I've been spending nearly two hours correcting all the damn double quotes
> I wound up with.
> So use find and replace.
> Can't. That would destroy the double quotes that legal.
> As in a null srring.

Hopefully this will teach you to be more accurate in writing your code.



--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: request for error checking feature [message #184071 is a reply to message #184049] Wed, 04 December 2013 06:23 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Am 03.12.2013 23:21, schrieb Beauregard T. Shagnasty:
> richard the sto0pid wrote:
>
>> How about making it so my posts aren't tedious, time consuming, and damn
> boring.
>
> Then don't post. Find another hobby.
>
>> I've been spending nearly two hours correcting all the damn double
>> quotes I wound up with.
>
> If you really do have "two hours" worth of [double-]double quotes, you've
> already done something incredibly wrong. However, knowing how you "code"
> that's to be expected.
>
>> So use find and replace.
>> Can't.
>
> Sure you can. You just have to think for a moment. Oops.
>
>> There ain't no such word as "encapsed".
>
> Sure there is. It's like "legit." (Give it time.)

Hmmm...

<http://www.oxforddictionaries.com/definition/english/legit>
<http://www.oxforddictionaries.com/spellcheck/english/?q=encapsed>
<http://dictionary.cambridge.org/spellcheck/british/?q=encapsed>
<http://dictionary.cambridge.org/spellcheck/american-english/?q=encapsed>


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: request for error checking feature [message #184074 is a reply to message #184071] Wed, 04 December 2013 07:54 Go to previous messageGo to next message
Beauregard T. Shagnas is currently offline  Beauregard T. Shagnas
Messages: 154
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Arno Welzel wrote:

> Beauregard T. Shagnasty:
>> richard the sto0pid wrote:
>>> There ain't no such word as "encapsed".
>>
>> Sure there is. It's like "legit." (Give it time.)
>
> Hmmm...
>
> <http://www.oxforddictionaries.com/definition/english/legit>
> <http://www.oxforddictionaries.com/spellcheck/english/?q=encapsed>
> <http://dictionary.cambridge.org/spellcheck/british/?q=encapsed>
> <http://dictionary.cambridge.org/spellcheck/american-english/?q=encapsed>

I *knew* someone would follow up like that! <g> That's why I wrote
"(Give it time.)". The word "legit" came to be due to the spoken lazy
abbreviating of "legitimate" and made it into the dictionary some years
back. Look for "encapsed" for "encapsulated" to follow soon as language
deteriorates even further.

--
-bts
-This space for rent, but the price is high
Re: request for error checking feature [message #184078 is a reply to message #184068] Wed, 04 December 2013 09:41 Go to previous messageGo to next message
Ben Bacarisse is currently offline  Ben Bacarisse
Messages: 82
Registered: November 2013
Karma: 0
Member
add to buddy list
ignore all messages by this user
Jerry Stuckle <jstucklex(at)attglobal(dot)net> writes:

> On 12/3/2013 9:42 PM, Ben Bacarisse wrote:
>> Jerry Stuckle <jstucklex(at)attglobal(dot)net> writes:
>>
>>> On 12/3/2013 7:02 PM, Ben Bacarisse wrote:
>>>> Christoph Michael Becker <cmbecker69(at)arcor(dot)de> writes:
>>>>
>>>> > richard wrote:
>>>> >
>>>> >> Correcting errors one at a time, uploading, and doing that a few hundred
>>>> > ^^^^^^^^^
>>>> >> times is tedious, time consuming, and damn boring.
>>>> >
>>>> > Set up a development environment on your local machine -- that'll save
>>>> > you a lot of time. No need to upload any files in this case -- just
>>>> > edit them in place and refresh the browser window.
>>>>
>>>> For people doing a lot of development a full server + PHP + bells +
>>>> whistles is invaluable, but for simple stuff it is worth knowing that
>>>> recent PHP versions come with a built-in server mode.
>>>>
>>>
>>> Which may or may not operate the same as the production server. It
>>> depends on a lot of factors, including the exact server being used,
>>> the modules loaded and the server configuration, amongst other things.
>>
>> Yes, it's main value is probably for learning PHP or early prototyping
>> where you should be able to avoid anything server specific. PHP modules
>> are not a problem -- you can add those in the usual way.
>
> No, it's main value is for you to develop in an environment as close
> to identical on the server as possible. Everything I do server-wise
> is tested on my development systems first.

Me too. I think we've used different associations for "it". My "it"
was PHP's internal server. I'm guessing at its usefulness based on only
two reports from friends. Since I happen to have a full development
system, I don't use it myself.

>>> It isn't all that hard to set up a development server pretty much
>>> identical to the production server. And a lot more accurate in
>>> duplicating the environment. Even for simple stuff it is invaluable.
>>
>> Actually I've found it to be frustratingly difficult. I help out with
>> several sites with different PHP versions, each with a sightly different
>> sets of PHP modules and configurations. The server types and loaded
>> modules also vary a lot, and at least one site uses a module that I'd
>> have to buy if I wanted accurate duplication. Rather than have multiple
>> installs or virtual machines all over the place I've opted for a single
>> "typical" set-up that is probably not the same as any of the live ones.
>
> I have a standard setup that I use on all my servers.

Sadly, I can't do that. The "helping out" almost always happens after
the site is up and the organisation is usually reluctant to change
anything at all.

> If I need a
> different setup for a client, I'll either create a separate
> configuration file for my test systems or I create a new virtual
> machine. It doesn't take me more than about 30 minutes to go from
> nothing to a working virtual machine.
>
> As far as paid modules go - if it's necessary for proper operation of
> the website, I get it. It's a cost of doing business.

I don't usually ask for money so paying for stuff has be justified to
the individual or charity involved. In the specific case of the paid
for module it was simpler just to work out what it was doing rather than
trying to match my development environment to the production one. I
agree wholeheartedly that it's a good idea, I just don't think it's
always possible or even always worth the time and or money.

--
Ben.
Re: request for error checking feature [message #184079 is a reply to message #184078] Wed, 04 December 2013 10:37 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On 12/4/2013 9:41 AM, Ben Bacarisse wrote:
> Jerry Stuckle <jstucklex(at)attglobal(dot)net> writes:
>
>> On 12/3/2013 9:42 PM, Ben Bacarisse wrote:
>>> Jerry Stuckle <jstucklex(at)attglobal(dot)net> writes:
>>>
>>>> On 12/3/2013 7:02 PM, Ben Bacarisse wrote:
>>>> > Christoph Michael Becker <cmbecker69(at)arcor(dot)de> writes:
>>>> >
>>>> >> richard wrote:
>>>> >>
>>>> >>> Correcting errors one at a time, uploading, and doing that a few hundred
>>>> >> ^^^^^^^^^
>>>> >>> times is tedious, time consuming, and damn boring.
>>>> >>
>>>> >> Set up a development environment on your local machine -- that'll save
>>>> >> you a lot of time. No need to upload any files in this case -- just
>>>> >> edit them in place and refresh the browser window.
>>>> >
>>>> > For people doing a lot of development a full server + PHP + bells +
>>>> > whistles is invaluable, but for simple stuff it is worth knowing that
>>>> > recent PHP versions come with a built-in server mode.
>>>> >
>>>>
>>>> Which may or may not operate the same as the production server. It
>>>> depends on a lot of factors, including the exact server being used,
>>>> the modules loaded and the server configuration, amongst other things.
>>>
>>> Yes, it's main value is probably for learning PHP or early prototyping
>>> where you should be able to avoid anything server specific. PHP modules
>>> are not a problem -- you can add those in the usual way.
>>
>> No, it's main value is for you to develop in an environment as close
>> to identical on the server as possible. Everything I do server-wise
>> is tested on my development systems first.
>
> Me too. I think we've used different associations for "it". My "it"
> was PHP's internal server. I'm guessing at its usefulness based on only
> two reports from friends. Since I happen to have a full development
> system, I don't use it myself.
>
>>>> It isn't all that hard to set up a development server pretty much
>>>> identical to the production server. And a lot more accurate in
>>>> duplicating the environment. Even for simple stuff it is invaluable.
>>>
>>> Actually I've found it to be frustratingly difficult. I help out with
>>> several sites with different PHP versions, each with a sightly different
>>> sets of PHP modules and configurations. The server types and loaded
>>> modules also vary a lot, and at least one site uses a module that I'd
>>> have to buy if I wanted accurate duplication. Rather than have multiple
>>> installs or virtual machines all over the place I've opted for a single
>>> "typical" set-up that is probably not the same as any of the live ones.
>>
>> I have a standard setup that I use on all my servers.
>
> Sadly, I can't do that. The "helping out" almost always happens after
> the site is up and the organisation is usually reluctant to change
> anything at all.
>
>> If I need a
>> different setup for a client, I'll either create a separate
>> configuration file for my test systems or I create a new virtual
>> machine. It doesn't take me more than about 30 minutes to go from
>> nothing to a working virtual machine.
>>
>> As far as paid modules go - if it's necessary for proper operation of
>> the website, I get it. It's a cost of doing business.
>
> I don't usually ask for money so paying for stuff has be justified to
> the individual or charity involved. In the specific case of the paid
> for module it was simpler just to work out what it was doing rather than
> trying to match my development environment to the production one. I
> agree wholeheartedly that it's a good idea, I just don't think it's
> always possible or even always worth the time and or money.
>

That's the difference. I get paid for what I do.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: request for error checking feature [message #184085 is a reply to message #184048] Wed, 04 December 2013 15:19 Go to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On Tue, 03 Dec 2013 16:52:05 -0500, richard wrote:

> How about making it so that when you check documents for errors, ALL of
> the errors get listed in one shot!
> I'm tired of having to correct errors one by one.
> Correcting errors one at a time, uploading, and doing that a few hundred
> times is tedious, time consuming, and damn boring.
>
> And knowing more precisely what caused the error.
> e.g. ""theme song"" generates Parse error: syntax error, unexpected
> T_CONSTANT_ENCAPSED_STRING, expecting ')
>
> WTF does that mean?
> Why can't it just say "Double quotes not allowed here".

Because the error is not "double quotes not allowed here".

Double quotes, or to be more accurate a zero length string literal, is a
perfectly valid string anywhere that a string is allowed.

The error is the word theme that appears after the empty string literal.

The php interpreter does not know that you intended theme song to be a
string literal, it knows that it has a string literal (which happens to
be a zero length string) followed by unexpected words that match the form
of constant names (not being variable names or reserved words).

The interpreter will not try and guess what you wanted to do when your
syntax is broken. In addition, it stops at the first error because it
makes no sense to try and carry on processing.

If you knew what you were doing, you might try:

php -<some command line arg here> filename.php

but I'm guessing that you don't even know what the word you need to
search for to try and find which command line argument to use is.

Hint: It's on this web page:

http://www.php.net/manual/en/features.commandline.options.php

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: illegal offset problem
Next Topic: odd iframe problem
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Dec 12 03:39:32 EST 2017

Total time taken to generate the page: 0.00874 seconds