Re: [PHP] Persistent flag in memory

2010-02-11 Thread Jochem Maas
Op 2/11/10 7:25 AM, Teus Benschop schreef:
 On Thu, 2010-02-11 at 06:46 +, Jochem Maas wrote:
 Op 2/11/10 6:34 AM, Teus Benschop schreef:
 On Thu, 2010-02-11 at 05:53 +, Jochem Maas wrote:
 whatever it is that your trying to do, it sounds like one of two things:

 1. you have hosting that is unsuitable for your needs
 2. you are tackling the problem incorrectly

 at any rate, as far I'm concerned, you should never have a long running
 php process via a web server. (obviously this is the point that someone
 posts a brilliant use case to prove me wrong ;-)

 could you detail what is is you're actuallt trying to do, chances are 
 people
 have:

 a. got a better alternative
 b. already invented the particular wheel you're trying to build
 c. you really do need shell (or even just control panel) access to run a 
 cron job


 What I am trying to achieve is to have a php script run once a minute
 and do a few tasks. There are some constraints:
 - Users usually install the php application on their local machines, be
 it Linux, Windows, or Macintosh.
 - The application is defined as needing zero-configuration, i.e. it runs
 out of the box.

 much too vague. no mention of a webserver ... zero-config and needing to 
 install
 are somewhat mutually exclusive.

 I still have the feeling you're using the wrong tool for the job somehow,
 I may be wrong or drunk or both ;)
 
 Well, on the web server, this usually would be Apache, though one user
 indicated he would use some light httpd instead. Then, of course, yes,
 installation is not zero-config, but what I mean is that after
 installation no further configuration steps would be needed, e.g. if the
 user unpacks a tarball in the web root, it should run straightaway, or
 if he does 'apt-get install pacakge', no further configuration would
 be needed. I thought therefore that using visitors page requests was a
 clever way of initiating starting a php script. At the moment I've got
 the following code:

if you're doing all this already in order to facilitate a multi-platform
install ... why not go the extra yard and have the install process setup
a cronjob (or scheduled task, launchd entry, etc, depending on platform)?

 $crontable = Database_Cron::getInstance ();
 if ($crontable-getFlag ()) die;
 $crontable-setFlag ();
 ignore_user_abort(true);
 set_time_limit(0);
 while(1)
 {
   $log = Database_Logs::getInstance();
   $log-log (Minutely maintenance routine started);
   .. do some maintenance ...
   $log-log (Minutely maintenance routine finished);
   sleep(60);
 }

of itself this seems like reasonable code, people argue about
the finer details but you seem to be writing clean and tidy stuff.

as such I still don't think this kind of thing belongs in a webserver
process.

I have recently been using daemontools (*nix/bsd compatible daemon management
tools ... also used to manage qmail processes) to actually keep a
long running / perpetual script running ... it's a very robust bit of
kit which takes care of running just one instance of whatever
and restarting it if it happens to die ... very nice, very simple, not
available on Windows (AFAIK) ... and helps to keep this kind
of management logic out of the actual php app.

 This uses the mechanism of a sql table in memory, which seems fine for
 the moment, since it is volatile and would disappear if the user
 restarts his laptop (or if the Amazon cloud reboots ;) - thus next time
 the user visits any page, this script would be restarted and do the
 maintenance till the user shuts down, and so on. I still have to look
 into the other mechanisms of creating a volatile flag.
 
 I think therefore, with my limited experience of PHP, that the above
 does well, though improvements are welcome.

I'd think your php is an issue - little bit I've seen suggests you
code diligently, it's merely the vehicle your using to have the script run
perpetually that irks me.

 About scripts running forever, I don't see a problem here since most of
 the time it sleeps anyway, and when I look in my Ubuntu 9.10 laptop,
 doing ps ax gives 194 live processes already, so what does the one
 single extra sleeping process matter?

in practice not much on a personal machine - nonetheless it's wasteful
and technically a webserver is unneeded and creates another layer of
complexity and overhead. it does seem rather brittle in terms of how you
have it set up though.

realise that your Ubuntu laptop is *probably* alot more stable, robust when
running a never-ending Apache child [worker] process with mod_php loaded and
executing ... I'd be quite confident that it would be stable and such on my
Mac as well ... but a Windows machine, I wouldn't trust that to do it ...
and keep running reliably (not from the script or the user POV)

it's possible that it's the best you can do given the pratical circumstances
of the users/maintainers of the installations ... but I hazard to say
you 'wrapper' for you perpetual/reaccuring script *might* be a sub-optimal
setup 

Re: [PHP] Owner or other; permissions for webpage users

2010-02-11 Thread Ashley Sheridan
On Thu, 2010-02-11 at 17:01 +1100, clanc...@cybec.com.au wrote:

 On Wed, 10 Feb 2010 16:08:42 +1030, james.mcl...@gmail.com (James McLean) 
 wrote:
 
 On Wed, Feb 10, 2010 at 2:51 PM,  clanc...@cybec.com.au wrote:
  I'm basically familiar with the UNIX permissions - 'owner', 'group', or 
  'other', but I
  have no real idea how these apply to webpage users under PHP. I know that 
  if I FTP to the
  server I am the owner, and I think that if I, or anyone else, opens one of 
  my webpages I
  am 'other'.
 
 Almost right. It's UGO, User Group and Other.
 
 When you view a PHP page, it's (usually) served by Apache, the process
 will be owned by a user, usually 'apache'; who is also a member of a
 group, usually 'apache'. On some systems these users/groups can be
 'httpd', 'www-data' etc. When you or I look at a PHP file served from
 Apache, there is no concept of users/groups/others outside those that
 apply to the Apache process that served the data.
 
  However what I would like to do is assign certain users, who have logged 
  in through a
  security portal, to 'group', so that they (but not 'others') have 
  permission to write to
  data files on the site.
 
 It's a seperate thing, because once again inside PHP there is no
 concept of users/groups outside the Apache process itself. It would be
 up to your PHP code to manage who has access to what, the files will
 all be read from and written to disk by the Apache process.
 
 Thanks. So it is as I feared, and if I want any file to be editable under any
 circumstances, I have to give write access to 'others'.
 
 It is a little surprising that PHP has not made any provision for 
 manipulating users write
 permissions, as this could provide a little extra protection from malicious 
 users.
 
 


You can manipulate users write permissions if you're the owner of a
file, but what you're asking is to manipulate the user under which PHP
is running dynamically. As users and permissions is so integral to the
safe working of the system, this would be no easy feat for something
that you should be easily able to tackle with some PHP ingenuity.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] HTML5 aside description

2010-02-11 Thread Ashley Sheridan
On Thu, 2010-02-11 at 01:44 -0500, Robert Cummings wrote:

 *haha* I've removed w3.org from the recipients list... so onwards to the 
 content below...
 
 
 Jochem Maas wrote:
  Op 2/10/10 9:08 PM, Robert Cummings schreef:
  From the editor's draft:
 
  
  The aside element represents a section of a page that consists of
  content that is tangentially related to the content around the aside
  element, and which could be considered separate from that content. Such
  sections are often represented as sidebars in printed typography.
 
  The element can be used for typographical effects like pull quotes or
  sidebars, for advertising, for groups of nav elements, and for other
  content that is considered separate from the main content of the page.
  
 
  Dear God, please don't suggest it be used for noise like sidebars,
  advertising, or non related groups of nav elements. Asides are NOT often
  represented AS sidebars in printed typography, they are often
  represented IN sidebars of printed typography. This distinction is
  fundamentally different.
 
  I've never read a serious article where suddenly an aside is made where
  it says:
 
  BUY! BUY! BUY! BUY OUR JUNK TODAY!!
 
  An aside is tangential to the content (as in the working draft of the
  spec), this means it is related in some way, usually enriching the
  information/experience rather than watering it down with nonsense.
 
  I beg you to reconsider your wording for this element's description.
  
  as an aside, I think I'll wait until there is some general consensus on the
  actual constructive usage of this sort of tag until I use it - personally I
  really think this is too vague.
  
  the concepts of what is structural, what is semantic and what is style are 
  too
  mixed up and vague for me to worry, just yet, about the details of these 
  new-fangled
  HTML5 tags (not mention browser support).
  
  @Rob - your browswer compability 'hack' example in another recent thread is 
  a
  perfect example or the problems we face with trying to delineate between 
  styling and
  semantics and as such I think I lot of what HTML5 adds is arbitrary and 
  rather
  vague (the CANVAS and video stuff not withstanding)
  
  personally I don't give a hoot - browsers (and more importantly the users, 
  and the
  various versions they run - and will be running for quite some time) mean 
  that,
  as fas as I'm concerned, HTML5 and everything it may entail is still a pipe 
  dream.
  
  As long as people run IE6 or IE7 (actually any POS browser that doesn't 
  properly
  attempt to implement current standards) such things as semantically marked 
  up ASIDES
  (as vague as the concept might) are rather irrelevant to the day to day 
  business of
  building web sites/applications that accessible/relevant/usable/etc to the 
  general
  public.
 
 I can only somewhat agree with your assessment above. It is true that 
 while many people still use broken browsers like IE6 and IE7; however, 
 this should not completely dissuade us from improving the experience for 
 those users that *do* choose standards compliant browsers. If we ignore 
 those users because we don't see the point in wasting time on the IE* 
 crowd, then we essentially weaken the argument in favour of embracing 
 standards. While IE* Joe, doesn't give a damn about whether his browser 
 supports aside or not, studious Jane really enjoys the enriched 
 experience her browser provides because not only does it understand 
 asides, but it provides a convenient extra facility that extracts them 
 into a browsable list with excerpts taken from the surrounding text for 
 context (inverting the relationship :). Then there's Jenny who's blind, 
 she's listening to the content on the page and hears a little ding go 
 off that indicates there's further information available that she can 
 review-- she can choose to pull it up and listen to it, after which the 
 reader returns to where she left off the original content. Alternatively 
 she may choose not to interrupt the main flow of information, but again, 
 similar to Jane's experience she can listen to each one afterwards in a 
 summarized fashion.
 
 This is how serious organizations, and almost certainly Government, will 
 markup their information. Regardless of whether everyone has a browser 
 that supports the information. If the semantic markup improves usability 
 and enriches the information, then it will be used to meet that purpose.
 
  PS. from a semantics POV, Robert Cummings is, IMHO, spot on in his 
  assessment - I do enjoy
  his posts, he's a sharp cookie with plenty to offer and I always enjoy 
  reading his
  argumentation and opinion!
 
 Thanks... You've got me blushing :D
 
 Cheers,
 Rob.
 -- 
 http://www.interjinn.com
 Application and Templating Framework for PHP
 


I'd say that from what I've heard, Governments aren't that good at
getting accessible sites up, so the chances of them using HTML5
semantically, well, the immediate future 

Re: [PHP] PHP Manual problems

2010-02-11 Thread Ashley Sheridan
On Thu, 2010-02-11 at 10:16 +1100, Ross McKay wrote:

 On Wed, 10 Feb 2010 10:12:01 -0500, Robert Cummings wrote:
 
 I'm doing quite a bit more work in public sector these days. Recently ne 
 department finally did away with IE6 and moved to IE7. Here's what I had 
 to do to accomodate this gotcha:
 
  Nothing
 
 See, that was tough. Why was it so hard? Because I developed for 
 Firefox/Opera and touched up for IE6, 7, 8 since these are inevitable 
 paths of evolution in the public sector. [...]
 
 We work the same way and generally just encounter a bit of swearing and
 minor CSS rework when we get around to IE6. Otherwise, it's all fine.
 Working to the standards and then patching for IE6 is easier than
 working to IE6 and patching for *everything else*. :)
 
 Regarding platforms, IMHO the main reason IE6 is so persistent is that
 it comes with Windows XP. Vista was such a flop that Windows XP is still
 the base of most SOE/COE distributions both in government and business.
 Now that Windows 7 is out and shown to be somewhat more worthy, IE6 will
 be replaced by IE8 in due course as Windows 7 becomes the SOE/COE base.
 
 I too am hoping for a switch to more Linux desktops, but I can't see it
 happening soon at most government / business organisations that deal in
 Microsoft Office documents until OpenOffice.org can better support the
 huge range of spottily formatted Office documents out there. That, or
 everyone moves to Google Docs, or regulations enforce exchange of
 government documents in OpenDocument formats :)
 -- 
 Ross McKay, Toronto, NSW Australia
 The documentation and sample application having failed me,
  I resort to thinking. This desperate tactic works, and I
  resolve that problem and go on to the next
  - Michael Swaine,  Programming Paradigms,  Dr Dobb's Journal
 


There's a good reason for OpenOffice having some difficulties with MS
Office documents. Back when MS rushed through getting their document
standard ratified by ISO (which itself is a whole other story) they
didn't explain all the details quite as well as they might have. Later
on, MS found they were having some difficulty following their own
'standard' and so altered it in various ways in Office2007. Needless to
say, ISO weren't too happy when MS asked if they could just 'change the
specs' for their file format, and quite rightly refused to do so.

In short, this means that there is a MS ISO standard that MS is the only
one not trying to follow, and software like OpenOffice is left to
reverse engineering the format again.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] problems with permissions or getting access to a file

2010-02-11 Thread Richard Quadling
On 11 February 2010 09:31, Pat patrick.j.r...@gmail.com wrote:
 Richard Quadling wrote:

 On 10 February 2010 16:31, Pat patrick.j.r...@gmail.com wrote:


 hi all
 having trouble here with a site that I am hosting on go-daddy

 I want to keep my php and my images apart

 so to do this I have the base directory which contains the php scripts.
 On
 the directory above that I have
 my photos stored in /photos

 when I run my scripts I get the following:

 time -4 hours1265815323 
 *Warning*: filemtime() [function.filemtime
 http://www.patrickrice.net/tomdcam/function.filemtime]: stat failed for
 testPanasonicCamMotion20100201022429140.jpg in
 */home/content/j/a/c/jackcards/html/tomdcam/MotionCamLast1Hours.php* on
 line
 *16*

 1265815323

 *Warning*: filemtime() [function.filemtime
 http://www.patrickrice.net/tomdcam/function.filemtime]: stat failed for
 testPanasonicCamMotion20100201022429140.jpg in
 */home/content/j/a/c/jackcards/html/tomdcam/MotionCamLast1Hours.php* on
 line
 *28*
 0
 time -4 hours1265815323 
 *Warning*: filemtime() [function.filemtime
 http://www.patrickrice.net/tomdcam/function.filemtime]: stat failed for
 testPanasonicCamMotion20100201022619570.jpg in
 */home/content/j/a/c/jackcards/html/tomdcam/MotionCamLast1Hours.php* on
 line
 *16

 *_The script is the following below _from running this script, I keep
 getting this error, now when I copy this script in to the directory photo
 where the photos are stored, the script displays the images with no
 problems
 leaving me think that the issue is with the permissions, I have modified
 the
 pre-emptions to give all access as a test and still problems. Anyone got
 any
 Ideas??

 Thanks in advance.
 Pat


 read() only returns the filename, not the full path.

 So, when the script is in the same directory, the current directory
 contains the required file.

 Try using ...

 filemtime(realpath($f))

 instead.



 Thanks Richard, It was really wrecking my head.
 Pat


No problem.

-- 
-
Richard Quadling
Standing on the shoulders of some very clever giants!
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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



Re: [PHP] HTML5 aside description

2010-02-11 Thread Michael A. Peters

If aside is not proper to use for this purpose, what would be?

sidebar suggests a particular type of layout.
section suggests content.
nav is appropriate for some items in a side bar, but not all, and is 
often a child of how aside is being used.

div give no semantics.

I would like to see a toc tag for nav that serves as a table of 
contents of sorts (what I often have at the top of a side bar) but I 
suspect nav is considered sufficient.


Maybe sidebar would be best, and the reference to column type layout 
can just be understood that isn't necessarily on the side?


Reading up on it, I saw some suggest figure for what some of you want 
aside used for, but a figure is often important content and has its 
own meaning so that's not exactly appropriate.


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



Re: [PHP] Persistent flag in memory

2010-02-11 Thread Teus Benschop
On Thu, 2010-02-11 at 08:26 +, Jochem Maas wrote:
 if you're doing all this already in order to facilitate a multi-platform
 install ... why not go the extra yard and have the install process setup
 a cronjob (or scheduled task, launchd entry, etc, depending on platform)?

The reason is that the php application will not only be installed
locally, but also properly on a server. And some users could have
servers that do not offer access to the cron daemon. Which means it
might be covered by the installer on windows, and other platforms, but
there would still be no crontab equivalent on the server that runs on
the internet. Hence an platform-independent solution is still needed.
Once that platform-independent solution is there, it could as well be
deployed everywhere. But this seems to be going off-topic.

 I have recently been using daemontools (*nix/bsd compatible daemon management
 tools ... also used to manage qmail processes) to actually keep a
 long running / perpetual script running ... it's a very robust bit of

If little or no configuration would be required that would help, and if
it were available on commodity servers like Bravehost that would be a
plus too.


 it's merely the vehicle your using to have the script run
 perpetually that irks me.

Well, on the type of vehicle used to get a job done, my feeling is that
PHP is very flexible and should / can adapt to the user's need, so why
not use the tools provided?

 
 in practice not much on a personal machine - nonetheless it's wasteful
 and technically a webserver is unneeded and creates another layer of
 complexity and overhead. it does seem rather brittle in terms of how you
 have it set up though.

Basically it is written as a web application, which installs locally as
well. Therefore to reduce programming efforts, and to make it easier to
be cross-platform, the LAMP server was chosen. Programmer's efforts are
expensive, therefore choosing these robust tools as Apache, MySQL and
PHP / Perl / Python was done for that reason.

 
 it's possible that it's the best you can do given the pratical circumstances
 of the users/maintainers of the installations ... but I hazard to say
 you 'wrapper' for you perpetual/reaccuring script *might* be a sub-optimal
 setup ... then again it's rather hard to say without known exactly what you
 want done every minute, why it needs to be done on the user's machine and
 what the connection with a cloud.

The cloud comes in when somebody installs  the app in such an
environment (if that is at all possible, I haven't looked into that).
The tasks to be done every minute is to check incoming email and process
is since users can operate the system through email as well must like a
message board where users can post by email. Then there's the processing
of the outgoing email queue since all email sent to a user is first
going to be put online, then transferred to email if the connection is
on. Then there would be regular tasks as sending out diffs to the users
since this is an online collaboration environment for translators, so
other members can see who changed what in the translation. (This all is
still to be made, but these are the plans). PHP is very flexible so
should be able to do all of this. But I am afraid to go off-topic again.

Teus.



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



Re: [PHP] HTML5 aside description

2010-02-11 Thread Michael A. Peters

Michael A. Peters wrote:

If aside is not proper to use for this purpose, what would be?


How about margin ??

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



Re: [PHP] HTML5 aside description

2010-02-11 Thread Ashley Sheridan
On Thu, 2010-02-11 at 05:59 -0800, Michael A. Peters wrote:

 Michael A. Peters wrote:
  If aside is not proper to use for this purpose, what would be?
 
 How about margin ??
 


To me margin says an area of space around the content. That's not to say
that content can't be put in a margin, but I just don't think it
accurately describes the content. For me, the margin is the entire area
around the content, so these areas of content we're describing could
exist repeatedly as child elements of the margin.

How about boxout instead? It describes to me what I think is the gist
of the this topic.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Persistent flag in memory

2010-02-11 Thread Bastien Koert
On Thu, Feb 11, 2010 at 8:47 AM, Teus Benschop teusjanne...@gmail.com wrote:
 On Thu, 2010-02-11 at 08:26 +, Jochem Maas wrote:
 if you're doing all this already in order to facilitate a multi-platform
 install ... why not go the extra yard and have the install process setup
 a cronjob (or scheduled task, launchd entry, etc, depending on platform)?

 The reason is that the php application will not only be installed
 locally, but also properly on a server. And some users could have
 servers that do not offer access to the cron daemon. Which means it
 might be covered by the installer on windows, and other platforms, but
 there would still be no crontab equivalent on the server that runs on
 the internet. Hence an platform-independent solution is still needed.
 Once that platform-independent solution is there, it could as well be
 deployed everywhere. But this seems to be going off-topic.

 I have recently been using daemontools (*nix/bsd compatible daemon management
 tools ... also used to manage qmail processes) to actually keep a
 long running / perpetual script running ... it's a very robust bit of

 If little or no configuration would be required that would help, and if
 it were available on commodity servers like Bravehost that would be a
 plus too.


 it's merely the vehicle your using to have the script run
 perpetually that irks me.

 Well, on the type of vehicle used to get a job done, my feeling is that
 PHP is very flexible and should / can adapt to the user's need, so why
 not use the tools provided?


 in practice not much on a personal machine - nonetheless it's wasteful
 and technically a webserver is unneeded and creates another layer of
 complexity and overhead. it does seem rather brittle in terms of how you
 have it set up though.

 Basically it is written as a web application, which installs locally as
 well. Therefore to reduce programming efforts, and to make it easier to
 be cross-platform, the LAMP server was chosen. Programmer's efforts are
 expensive, therefore choosing these robust tools as Apache, MySQL and
 PHP / Perl / Python was done for that reason.


 it's possible that it's the best you can do given the pratical circumstances
 of the users/maintainers of the installations ... but I hazard to say
 you 'wrapper' for you perpetual/reaccuring script *might* be a sub-optimal
 setup ... then again it's rather hard to say without known exactly what you
 want done every minute, why it needs to be done on the user's machine and
 what the connection with a cloud.

 The cloud comes in when somebody installs  the app in such an
 environment (if that is at all possible, I haven't looked into that).
 The tasks to be done every minute is to check incoming email and process
 is since users can operate the system through email as well must like a
 message board where users can post by email. Then there's the processing
 of the outgoing email queue since all email sent to a user is first
 going to be put online, then transferred to email if the connection is
 on. Then there would be regular tasks as sending out diffs to the users
 since this is an online collaboration environment for translators, so
 other members can see who changed what in the translation. (This all is
 still to be made, but these are the plans). PHP is very flexible so
 should be able to do all of this. But I am afraid to go off-topic again.

 Teus.



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



Could the app be converted to an Adobe AIR app or use PHPdock (
http://www.nusphere.com/products/phpdock.htm ) to run local? There are
a number of security issues that surround installing a webserver and a
database locally on a users machine that may become issues.

-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] HTML5 aside description

2010-02-11 Thread Robert Cummings

Ashley Sheridan wrote:

On Thu, 2010-02-11 at 01:44 -0500, Robert Cummings wrote:
*haha* I've removed w3.org from the recipients list... so onwards to the 
content below...



Jochem Maas wrote:
 Op 2/10/10 9:08 PM, Robert Cummings schreef:
 From the editor's draft:

 
 The aside element represents a section of a page that consists of
 content that is tangentially related to the content around the aside
 element, and which could be considered separate from that content. Such
 sections are often represented as sidebars in printed typography.

 The element can be used for typographical effects like pull quotes or
 sidebars, for advertising, for groups of nav elements, and for other
 content that is considered separate from the main content of the page.
 

 Dear God, please don't suggest it be used for noise like sidebars,
 advertising, or non related groups of nav elements. Asides are NOT often
 represented AS sidebars in printed typography, they are often
 represented IN sidebars of printed typography. This distinction is
 fundamentally different.

 I've never read a serious article where suddenly an aside is made where
 it says:

 BUY! BUY! BUY! BUY OUR JUNK TODAY!!

 An aside is tangential to the content (as in the working draft of the
 spec), this means it is related in some way, usually enriching the
 information/experience rather than watering it down with nonsense.

 I beg you to reconsider your wording for this element's description.
 
 as an aside, I think I'll wait until there is some general consensus on the

 actual constructive usage of this sort of tag until I use it - personally I
 really think this is too vague.
 
 the concepts of what is structural, what is semantic and what is style are too

 mixed up and vague for me to worry, just yet, about the details of these 
new-fangled
 HTML5 tags (not mention browser support).
 
 @Rob - your browswer compability 'hack' example in another recent thread is a

 perfect example or the problems we face with trying to delineate between 
styling and
 semantics and as such I think I lot of what HTML5 adds is arbitrary and rather
 vague (the CANVAS and video stuff not withstanding)
 
 personally I don't give a hoot - browsers (and more importantly the users, and the

 various versions they run - and will be running for quite some time) mean 
that,
 as fas as I'm concerned, HTML5 and everything it may entail is still a pipe 
dream.
 
 As long as people run IE6 or IE7 (actually any POS browser that doesn't properly

 attempt to implement current standards) such things as semantically marked up 
ASIDES
 (as vague as the concept might) are rather irrelevant to the day to day 
business of
 building web sites/applications that accessible/relevant/usable/etc to the 
general
 public.

I can only somewhat agree with your assessment above. It is true that 
while many people still use broken browsers like IE6 and IE7; however, 
this should not completely dissuade us from improving the experience for 
those users that *do* choose standards compliant browsers. If we ignore 
those users because we don't see the point in wasting time on the IE* 
crowd, then we essentially weaken the argument in favour of embracing 
standards. While IE* Joe, doesn't give a damn about whether his browser 
supports aside or not, studious Jane really enjoys the enriched 
experience her browser provides because not only does it understand 
asides, but it provides a convenient extra facility that extracts them 
into a browsable list with excerpts taken from the surrounding text for 
context (inverting the relationship :). Then there's Jenny who's blind, 
she's listening to the content on the page and hears a little ding go 
off that indicates there's further information available that she can 
review-- she can choose to pull it up and listen to it, after which the 
reader returns to where she left off the original content. Alternatively 
she may choose not to interrupt the main flow of information, but again, 
similar to Jane's experience she can listen to each one afterwards in a 
summarized fashion.


This is how serious organizations, and almost certainly Government, will 
markup their information. Regardless of whether everyone has a browser 
that supports the information. If the semantic markup improves usability 
and enriches the information, then it will be used to meet that purpose.


 PS. from a semantics POV, Robert Cummings is, IMHO, spot on in his assessment 
- I do enjoy
 his posts, he's a sharp cookie with plenty to offer and I always enjoy 
reading his
 argumentation and opinion!

Thanks... You've got me blushing :D

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP



I'd say that from what I've heard, Governments aren't that good at 
getting accessible sites up, so the chances of them using HTML5 
semantically, well, the immediate future doesn't look too rosy!


Also, I thought I'd throw in my tuppence as to the use of aside. I'd 
tend 

Re: [PHP] HTML5 aside description

2010-02-11 Thread Robert Cummings

Michael A. Peters wrote:

If aside is not proper to use for this purpose, what would be?

sidebar suggests a particular type of layout.
section suggests content.
nav is appropriate for some items in a side bar, but not all, and is 
often a child of how aside is being used.

div give no semantics.

I would like to see a toc tag for nav that serves as a table of 
contents of sorts (what I often have at the top of a side bar) but I 
suspect nav is considered sufficient.


Maybe sidebar would be best, and the reference to column type layout 
can just be understood that isn't necessarily on the side?


Reading up on it, I saw some suggest figure for what some of you want 
aside used for, but a figure is often important content and has its 
own meaning so that's not exactly appropriate.


I would lean towards div if there is no appropriate semantic tag to 
markup the information. But in the case of ads, there really should be a 
n ad tag :)


The problem though with semantic tags like ad is that it wouldn't be 
used in practice by most commercial sites, because then the browser 
would know exactly what to rip out (or at least plugins like adblock) *lol*.


Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] HTML5 aside description

2010-02-11 Thread Robert Cummings

Robert Cummings wrote:
I don't know about where you are, but Canadian government has very 
specific guidelines on how content should be marked up... and semantic 
use of tags is a clear part of that:


 The institution respects the universal accessibility
  guidelines developed by the World Wide Web Consortium's Web
  Accessibility Initiative by ensuring compliance of its Web
  sites with the Priority 1 and Priority 2 checkpoints of the
  Web Content Accessibility Guidelines 1.0 (WCAG), with the
  following exception:

  WCAG  checkpoint 3.4 is superseded by requirement 2 of the
  Common Look and Feel Standards for the Internet, Part 3:
  Standard on Common Web Page Formats.

  http://


Oops, that was supposed to remind me to come back and paste the CLF2 URL:

http://www.tbs-sct.gc.ca/clf2-nsi2/index-eng.asp

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] HTML5 aside description

2010-02-11 Thread Ashley Sheridan
On Thu, 2010-02-11 at 09:39 -0500, Robert Cummings wrote:

 Ashley Sheridan wrote:
  On Thu, 2010-02-11 at 01:44 -0500, Robert Cummings wrote:
  *haha* I've removed w3.org from the recipients list... so onwards to the 
  content below...
 
 
  Jochem Maas wrote:
   Op 2/10/10 9:08 PM, Robert Cummings schreef:
   From the editor's draft:
  
   
   The aside element represents a section of a page that consists of
   content that is tangentially related to the content around the aside
   element, and which could be considered separate from that content. Such
   sections are often represented as sidebars in printed typography.
  
   The element can be used for typographical effects like pull quotes or
   sidebars, for advertising, for groups of nav elements, and for other
   content that is considered separate from the main content of the page.
   
  
   Dear God, please don't suggest it be used for noise like sidebars,
   advertising, or non related groups of nav elements. Asides are NOT often
   represented AS sidebars in printed typography, they are often
   represented IN sidebars of printed typography. This distinction is
   fundamentally different.
  
   I've never read a serious article where suddenly an aside is made where
   it says:
  
   BUY! BUY! BUY! BUY OUR JUNK TODAY!!
  
   An aside is tangential to the content (as in the working draft of the
   spec), this means it is related in some way, usually enriching the
   information/experience rather than watering it down with nonsense.
  
   I beg you to reconsider your wording for this element's description.
   
   as an aside, I think I'll wait until there is some general consensus on 
   the
   actual constructive usage of this sort of tag until I use it - 
   personally I
   really think this is too vague.
   
   the concepts of what is structural, what is semantic and what is style 
   are too
   mixed up and vague for me to worry, just yet, about the details of these 
   new-fangled
   HTML5 tags (not mention browser support).
   
   @Rob - your browswer compability 'hack' example in another recent thread 
   is a
   perfect example or the problems we face with trying to delineate between 
   styling and
   semantics and as such I think I lot of what HTML5 adds is arbitrary and 
   rather
   vague (the CANVAS and video stuff not withstanding)
   
   personally I don't give a hoot - browsers (and more importantly the 
   users, and the
   various versions they run - and will be running for quite some time) 
   mean that,
   as fas as I'm concerned, HTML5 and everything it may entail is still a 
   pipe dream.
   
   As long as people run IE6 or IE7 (actually any POS browser that doesn't 
   properly
   attempt to implement current standards) such things as semantically 
   marked up ASIDES
   (as vague as the concept might) are rather irrelevant to the day to day 
   business of
   building web sites/applications that accessible/relevant/usable/etc to 
   the general
   public.
 
  I can only somewhat agree with your assessment above. It is true that 
  while many people still use broken browsers like IE6 and IE7; however, 
  this should not completely dissuade us from improving the experience for 
  those users that *do* choose standards compliant browsers. If we ignore 
  those users because we don't see the point in wasting time on the IE* 
  crowd, then we essentially weaken the argument in favour of embracing 
  standards. While IE* Joe, doesn't give a damn about whether his browser 
  supports aside or not, studious Jane really enjoys the enriched 
  experience her browser provides because not only does it understand 
  asides, but it provides a convenient extra facility that extracts them 
  into a browsable list with excerpts taken from the surrounding text for 
  context (inverting the relationship :). Then there's Jenny who's blind, 
  she's listening to the content on the page and hears a little ding go 
  off that indicates there's further information available that she can 
  review-- she can choose to pull it up and listen to it, after which the 
  reader returns to where she left off the original content. Alternatively 
  she may choose not to interrupt the main flow of information, but again, 
  similar to Jane's experience she can listen to each one afterwards in a 
  summarized fashion.
 
  This is how serious organizations, and almost certainly Government, will 
  markup their information. Regardless of whether everyone has a browser 
  that supports the information. If the semantic markup improves usability 
  and enriches the information, then it will be used to meet that purpose.
 
   PS. from a semantics POV, Robert Cummings is, IMHO, spot on in his 
   assessment - I do enjoy
   his posts, he's a sharp cookie with plenty to offer and I always enjoy 
   reading his
   argumentation and opinion!
 
  Thanks... You've got me blushing :D
 
  Cheers,
  Rob.
  -- 
  http://www.interjinn.com
  Application and Templating 

Re: [PHP] HTML5 aside description

2010-02-11 Thread Michael A. Peters

Robert Cummings wrote:

Michael A. Peters wrote:

If aside is not proper to use for this purpose, what would be?

sidebar suggests a particular type of layout.
section suggests content.
nav is appropriate for some items in a side bar, but not all, and is 
often a child of how aside is being used.

div give no semantics.

I would like to see a toc tag for nav that serves as a table of 
contents of sorts (what I often have at the top of a side bar) but I 
suspect nav is considered sufficient.


Maybe sidebar would be best, and the reference to column type layout 
can just be understood that isn't necessarily on the side?


Reading up on it, I saw some suggest figure for what some of you 
want aside used for, but a figure is often important content and 
has its own meaning so that's not exactly appropriate.


I would lean towards div if there is no appropriate semantic tag to 
markup the information. But in the case of ads, there really should be a 
n ad tag :)


I don't know.
I understand making it cake for ad blockers is attractive, but I run a 
web site that benefits the local community and is paid for out of my 
pocket and while some donations have come in, nowhere near what it 
costs. There are a few select ads (no flash or animated) and even they 
don't make up the difference, but I wouldn't use something like ad 
because I personally have taken a huge financial cut this year (20% 
income reduction) yet I'm kind enough to out of pocket provide this 
service, including things like a SSL certificate so that users who want 
to log on can do so without fear of password sniffing etc. and I will 
never charge for use of my site, so while I don't specifically look for 
people running ad blockers, when they do, it kind of feels like they are 
giving me the finger.


I do not mind script/flash blockers (and will never use flash ads 
because of how many behave poorly and do things like expand to cover 
content or flash at high rates giving headaches and possibly even 
causing seizures) but I know people use ad blockers, so I host the ad 
images myself which seems to neuter them, but I would never use 
something like ad until someone paid me to, and it would have to cover 
costs (which are not covered even right now even with ads).


I've been accused (once) of trying to profit from the site.
I'd post how I replied to the jerk, but I assume some children read this 
list.


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



Re: [PHP] HTML5 aside description

2010-02-11 Thread Ashley Sheridan
On Thu, 2010-02-11 at 07:02 -0800, Michael A. Peters wrote:

 Robert Cummings wrote:
  Michael A. Peters wrote:
  If aside is not proper to use for this purpose, what would be?
 
  sidebar suggests a particular type of layout.
  section suggests content.
  nav is appropriate for some items in a side bar, but not all, and is 
  often a child of how aside is being used.
  div give no semantics.
 
  I would like to see a toc tag for nav that serves as a table of 
  contents of sorts (what I often have at the top of a side bar) but I 
  suspect nav is considered sufficient.
 
  Maybe sidebar would be best, and the reference to column type layout 
  can just be understood that isn't necessarily on the side?
 
  Reading up on it, I saw some suggest figure for what some of you 
  want aside used for, but a figure is often important content and 
  has its own meaning so that's not exactly appropriate.
  
  I would lean towards div if there is no appropriate semantic tag to 
  markup the information. But in the case of ads, there really should be a 
  n ad tag :)
 
 I don't know.
 I understand making it cake for ad blockers is attractive, but I run a 
 web site that benefits the local community and is paid for out of my 
 pocket and while some donations have come in, nowhere near what it 
 costs. There are a few select ads (no flash or animated) and even they 
 don't make up the difference, but I wouldn't use something like ad 
 because I personally have taken a huge financial cut this year (20% 
 income reduction) yet I'm kind enough to out of pocket provide this 
 service, including things like a SSL certificate so that users who want 
 to log on can do so without fear of password sniffing etc. and I will 
 never charge for use of my site, so while I don't specifically look for 
 people running ad blockers, when they do, it kind of feels like they are 
 giving me the finger.
 
 I do not mind script/flash blockers (and will never use flash ads 
 because of how many behave poorly and do things like expand to cover 
 content or flash at high rates giving headaches and possibly even 
 causing seizures) but I know people use ad blockers, so I host the ad 
 images myself which seems to neuter them, but I would never use 
 something like ad until someone paid me to, and it would have to cover 
 costs (which are not covered even right now even with ads).
 
 I've been accused (once) of trying to profit from the site.
 I'd post how I replied to the jerk, but I assume some children read this 
 list.
 


I think ad's have and always will be part of the web. What gets up most
peoples noses, and is something you said you don't do, is flashy ads
that try to take over the screen, or ads that pretend to be some sort of
warning on your computer. I'm wise enough not to be taken by the latter
ones, but the ones that try to take over my screen (always in Flash too)
are annoying for 2 reasons: 1) older versions of the Flash player on
Linux couldn't handle transparent windowed mode in Flash, so I was left
with a big white block over the content, and 2) I just don't like ad's
that change size and move over the whole page forcing you to click on
them to get at the content that you wanted underneath.

Unobtrusive ads are fine. I can look at them or ignore them if I wish,
which is likely to get a better response than shoving them in my face.
It's for this very reason that I don't read most of the free London
newspapers, because I can't stand the people who try to shove them at me
every time I try to get a train home from work.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] HTML5 aside description

2010-02-11 Thread Robert Cummings

Michael A. Peters wrote:

Robert Cummings wrote:

Michael A. Peters wrote:

If aside is not proper to use for this purpose, what would be?

sidebar suggests a particular type of layout.
section suggests content.
nav is appropriate for some items in a side bar, but not all, and is 
often a child of how aside is being used.

div give no semantics.

I would like to see a toc tag for nav that serves as a table of 
contents of sorts (what I often have at the top of a side bar) but I 
suspect nav is considered sufficient.


Maybe sidebar would be best, and the reference to column type layout 
can just be understood that isn't necessarily on the side?


Reading up on it, I saw some suggest figure for what some of you 
want aside used for, but a figure is often important content and 
has its own meaning so that's not exactly appropriate.
I would lean towards div if there is no appropriate semantic tag to 
markup the information. But in the case of ads, there really should be a 
n ad tag :)


I don't know.
I understand making it cake for ad blockers is attractive, but I run a 
web site that benefits the local community and is paid for out of my 
pocket and while some donations have come in, nowhere near what it 
costs. There are a few select ads (no flash or animated) and even they 
don't make up the difference, but I wouldn't use something like ad 
because I personally have taken a huge financial cut this year (20% 
income reduction) yet I'm kind enough to out of pocket provide this 
service, including things like a SSL certificate so that users who want 
to log on can do so without fear of password sniffing etc. and I will 
never charge for use of my site, so while I don't specifically look for 
people running ad blockers, when they do, it kind of feels like they are 
giving me the finger.


I do not mind script/flash blockers (and will never use flash ads 
because of how many behave poorly and do things like expand to cover 
content or flash at high rates giving headaches and possibly even 
causing seizures) but I know people use ad blockers, so I host the ad 
images myself which seems to neuter them, but I would never use 
something like ad until someone paid me to, and it would have to cover 
costs (which are not covered even right now even with ads).


My intent wasn't to make it easy for ad blockers, but to indicate that 
for correctness that would be the appropriate semantic tag. As I later 
mentioned, commercial sites wouldn't use just because it would make it 
easy for ad blockers to strip :|


Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] HTML5 aside description

2010-02-11 Thread tedd

At 5:08 AM + 2/11/10, Jochem Maas wrote:

rgds,
Jochem

 PS. from a semantics POV, Robert Cummings is, IMHO, spot on in his 
assessment - I do enjoy
his posts, he's a sharp cookie with plenty to offer and I always 
enjoy reading his

argumentation and opinion!


With the danger of Rob becoming insufferable, I enjoy and also learn 
from Rob's opinion, advice, and practice. He is undoubtedly sharp and 
probably too intelligent for this list. But until he realizes that, 
we'll continue to gain from his contribution.


Cheers,

tedd

PS: I agree with most of what he practices except for bracket spacing. :-)

--
---
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] HTML5 aside description

2010-02-11 Thread Robert Cummings



tedd wrote:

At 5:08 AM + 2/11/10, Jochem Maas wrote:

rgds,
Jochem

 PS. from a semantics POV, Robert Cummings is, IMHO, spot on in his 
assessment - I do enjoy
his posts, he's a sharp cookie with plenty to offer and I always 
enjoy reading his

argumentation and opinion!


With the danger of Rob becoming insufferable, I enjoy and also learn 
from Rob's opinion, advice, and practice. He is undoubtedly sharp and 
probably too intelligent for this list. But until he realizes that, 
we'll continue to gain from his contribution.


Bleh, I dunno about all that... even if I were too smart for the list, I 
love the list for the feeling of community... it takes more than just me 
for that feeling. I thank all the people on the list who make it a 
pleasure to read and learn, and who don't take discussion/argumentation 
personally. I learn many things from the members on this list too and 
I'm never afraid to admit when I'm wrong. Mere discussion that exposes 
the many facets of an issue is a great way to advance one's thinking 
regardless of whether it confirms your original viewpoint or not. Thanks 
again to all on this list.



PS: I agree with most of what he practices except for bracket spacing. :-)


Everyone's a critic :D

Cheers,
Rob.

*lol* Almost got caught posting to W3.org again ;)

--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] Persistent flag in memory

2010-02-11 Thread Teus Benschop
 On Thu, 2010-02-11 at 09:27 -0500, Bastien Koert wrote:
 Could the app be converted to an Adobe AIR app or use PHPdock (
 http://www.nusphere.com/products/phpdock.htm ) to run local? There are
 a number of security issues that surround installing a webserver and a
 database locally on a users machine that may become issues.

It probably could be converted into a local application using these
technologies, interesting technologies, by the way. The snag that will
be hit though is that the application is licensed under the GPL v 3.
Both tools you mention are closed source, I believe, and in addition I
am not sure whether these work for Windows only, leaving Mac and Unix
out. Will contributors to the applications be willing to buy the
technologies? The security issues that you mention should be taken
seriously. Teus.

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



RE: [PHP] RE: SOAP connect error

2010-02-11 Thread Eric Lommatsch

Are you using wsdl? If so, does the WSDL file contain the information that
the port to use for the requests is on port 8080?

--
-
Richard Quadling
Standing on the shoulders of some very clever giants!
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

First, I am sorry for not getting back to this yesterday. I had some other
things come up.

As far as I know this website is using WSDL. I know that one of the early
issues I ran into in trying to get this to work was not having the wsdl.php
file in the path.

That having been said are you talking about the wsdl file on the server that
is providing the service or are you talking about the wsdl file on the system
hosting the webpage. 

I can get everything to work correctly when I am working from our internal
development server. But when I attempt to put the file on the hosted site our
clients would ultimately be using I am getting the connect error. 

I have compared the wsdl.php files on these two servers and neither of them
have specific information about the port in them.

Here is the code that I am using to connect to the webservice:

$webservices_uri =
http://xx.xx.xx.xx:8080/jasperserver/services/repository;;

Here is the code where I am trying to connect:

function ws_checkUsername($username, $password)
{
$connection_params = array(user = $username, pass =
$password);
$info = new SOAP_client($GLOBALS[webservices_uri], false,
false, $connection_params);

$op_xml = request
operationName=\list\resourceDescriptor name=\\ wsType=\folder\
uriString=\\ isNew=\false\.
label/label/resourceDescriptor/request;

$params = array(request = $op_xml );
$response = $info-call(list,$params,array('namespace' =
$GLOBALS[namespace]));

return $response;
}

This is working when I use the IP address of the server behind the firewall,
but when I try to use the address that is open through the firewall it is not
connecting. I can connect to the external IP address by entering it into the
browser and it does ask for the username and password.

Thank you
 
Eric H. Lommatsch
Programmer
360 Business 
2087 South Grant Street
Denver, CO 80210
Tel 303-777-8939 Ext 23
Fax 888-282-9927
 
er...@360b.com

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



[PHP] PHP will NOT display this on my dev machine: Warning: session_start()...

2010-02-11 Thread John Black

I am running into a strange problem and I hope someone might have an
idea why this is happening.

My installation of PHP will *NOT* display the warning message below on 
my development machine where it should display it (sample code at the 
bottom).

Warning: session_start() [function.session-start]: Cannot send session
cache limiter 

After receiving a bug report from a customer I tested my code on a XAMPP
setup and, sure enough, it displayed the warning message.
But on my machine, I can't find a message in my php log, it is as if 
this problem does not even exist (on my dev machine).


My dev setup is:
OS: ARCH 64bit (about a month out of date)
PHP Dev stuff:
  Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8k DAV/2 SVN/1.6.6
  PHP/5.3.1 with Suhosin-Patch
  xdebug-2.0.5-2-x86_64

php.ini
  error_reporting = E_ALL | E_STRICT
  display_errors = On
  display_startup_errors = On
  log_errors = On
  html_errors = On
  

phpinfo() confirms that these settings are in effect
display_errors  On  On
error_reporting 32767   32767

So does anybody have any clue as to what could be causing this problem 
of not getting a warning message?


Here is sample code:
pThe warning should be below this line/p
?PHP session_start(); ?
pThe warning should be above this line/p

Which should produce the message below between the lines:
Warning: session_start() [function.session-start]: Cannot send session
cache limiter - headers already sent ( output started at file_name on
line 2 )

but on my machine all I get is this in html source of the output:
pThe warning should be below this line/p
pThe warning should be above this line/p

thx
--
John
Staat heißt das kälteste aller kalten Ungeheuer.  Kalt lügt es auch; und
diese Lüge kriecht aus seinem Munde: 'Ich, der Staat, bin das Volk.'
[Friedrich Nietzsche]


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



Re: [PHP] PHP will NOT display this on my dev machine: Warning: session_start()...

2010-02-11 Thread Adam Richardson
Do you have output buffering turned on?

On Thu, Feb 11, 2010 at 1:19 PM, John Black
s...@network-technologies.orgwrote:

 I am running into a strange problem and I hope someone might have an
 idea why this is happening.

 My installation of PHP will *NOT* display the warning message below on my
 development machine where it should display it (sample code at the bottom).
 Warning: session_start() [function.session-start]: Cannot send session
 cache limiter 

 After receiving a bug report from a customer I tested my code on a XAMPP
 setup and, sure enough, it displayed the warning message.
 But on my machine, I can't find a message in my php log, it is as if this
 problem does not even exist (on my dev machine).

 My dev setup is:
 OS: ARCH 64bit (about a month out of date)
 PHP Dev stuff:
  Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8k DAV/2 SVN/1.6.6
  PHP/5.3.1 with Suhosin-Patch
  xdebug-2.0.5-2-x86_64

 php.ini
  error_reporting = E_ALL | E_STRICT
  display_errors = On
  display_startup_errors = On
  log_errors = On
  html_errors = On
  

 phpinfo() confirms that these settings are in effect
display_errors  On  On
error_reporting 32767   32767

 So does anybody have any clue as to what could be causing this problem of
 not getting a warning message?

 Here is sample code:
 pThe warning should be below this line/p
 ?PHP session_start(); ?
 pThe warning should be above this line/p

 Which should produce the message below between the lines:
 Warning: session_start() [function.session-start]: Cannot send session
 cache limiter - headers already sent ( output started at file_name on
 line 2 )

 but on my machine all I get is this in html source of the output:
 pThe warning should be below this line/p
 pThe warning should be above this line/p

 thx
 --
 John
 Staat heißt das kälteste aller kalten Ungeheuer.  Kalt lügt es auch; und
 diese Lüge kriecht aus seinem Munde: 'Ich, der Staat, bin das Volk.'
 [Friedrich Nietzsche]


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




-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


Re: [PHP] PHP will NOT display this on my dev machine: Warning: session_start()...

2010-02-11 Thread Ashley Sheridan
On Thu, 2010-02-11 at 19:19 +0100, John Black wrote:

 I am running into a strange problem and I hope someone might have an
 idea why this is happening.
 
 My installation of PHP will *NOT* display the warning message below on 
 my development machine where it should display it (sample code at the 
 bottom).
 Warning: session_start() [function.session-start]: Cannot send session
 cache limiter 
 
 After receiving a bug report from a customer I tested my code on a XAMPP
 setup and, sure enough, it displayed the warning message.
 But on my machine, I can't find a message in my php log, it is as if 
 this problem does not even exist (on my dev machine).
 
 My dev setup is:
 OS: ARCH 64bit (about a month out of date)
 PHP Dev stuff:
Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8k DAV/2 SVN/1.6.6
PHP/5.3.1 with Suhosin-Patch
xdebug-2.0.5-2-x86_64
 
 php.ini
error_reporting = E_ALL | E_STRICT
display_errors = On
display_startup_errors = On
log_errors = On
html_errors = On

 
 phpinfo() confirms that these settings are in effect
   display_errors  On  On
   error_reporting 32767   32767
 
 So does anybody have any clue as to what could be causing this problem 
 of not getting a warning message?
 
 Here is sample code:
 pThe warning should be below this line/p
 ?PHP session_start(); ?
 pThe warning should be above this line/p
 
 Which should produce the message below between the lines:
 Warning: session_start() [function.session-start]: Cannot send session
 cache limiter - headers already sent ( output started at file_name on
 line 2 )
 
 but on my machine all I get is this in html source of the output:
 pThe warning should be below this line/p
 pThe warning should be above this line/p
 
 thx
 -- 
 John
 Staat heißt das kälteste aller kalten Ungeheuer.  Kalt lügt es auch; und
 diese Lüge kriecht aus seinem Munde: 'Ich, der Staat, bin das Volk.'
 [Friedrich Nietzsche]
 
 


Is your system setup with session autostart enabled? That would cause
PHP to ignore you manually starting them I believe, as they should have
already been started. I'm not 100% certain on this though.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Persistent flag in memory

2010-02-11 Thread Jochem Maas
Op 2/11/10 3:48 PM, Teus Benschop schreef:
 On Thu, 2010-02-11 at 09:27 -0500, Bastien Koert wrote:
 Could the app be converted to an Adobe AIR app or use PHPdock (
 http://www.nusphere.com/products/phpdock.htm ) to run local? There are
 a number of security issues that surround installing a webserver and a
 database locally on a users machine that may become issues.
 
 It probably could be converted into a local application using these
 technologies, interesting technologies, by the way. The snag that will
 be hit though is that the application is licensed under the GPL v 3.
 Both tools you mention are closed source, I believe, and in addition I
 am not sure whether these work for Windows only, leaving Mac and Unix
 out. Will contributors to the applications be willing to buy the
 technologies? The security issues that you mention should be taken
 seriously. Teus.

Adobe AIR is a free platform - incl. a free SDK, it runs on Win, Mac and Linux.
AFAICT there is no restriction for developing GPL code that runs on the Air
platform ... obviously you'll not be using PHP inside Air - javascript and/or
actionscript would be the language in which the app logic is written.

 


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



Re: [PHP] PHP will NOT display this on my dev machine: Warning: session_start()...

2010-02-11 Thread John Black

Adam Richardson wrote:

Do you have output buffering turned on?


THANK YOU!
That was it, for some reason ARCH has a tweaked php.ini in their main
repo, that sucks.

Thank you, I have been looking all over to fix this!

--
John


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



[PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread james stojan
I'm at my wits end trying to make this mysql statement insert work in
PHP. I'm not getting any errors from PHP or mysql but the insert fails
(nothing is inserted) error reporting is on and is reporting other
errors. When I echo out the query and manually paste it into PHP
myAdmin the query inserts without a problem. I know that I am
connecting to the database as well part of the data being inserted
comes from the same database and that the mysql user has permission to
do inserts (even tried as root no luck).

$query=INSERT INTO upload_history (v_id,hour,visits,date) VALUES
(.$v_id.,.$hour.,.$visits.,'$date1'.);;

$r2=mysql_query($query) or die(bA fatal MySQL error
occured/b.\nbr /Query:  . $query . br /\nError: ( .
mysql_errno() . )  . mysql_error());

This is an echo of $query and runs in phpmyadmin.

INSERT INTO history (v_id,hour,visits,date) VALUES (45,0,59,'2010 01 27');


Any idea what is going on here?

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



Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Joseph Thayne
Try putting tick marks (`) around the field and table names.  So your 
SQL query would then look like:


INSERT INTO `history` (`v_id`, `hour`, `visits`, `date`) VALUES (45, 0, 
59, '2010 01 27');


This is a good practice to get into.  The problem is that MySQL allows 
you to create tables and fields with the same name as functions.  If the 
tick marks are not there, then it assumes you mean to try using the 
function.  In your case, hour is a function in mysql.  I would assume 
that the reason it works in phpmyadmin is that it filters the query 
somehow to add the tick marks in.


Joseph

james stojan wrote:

I'm at my wits end trying to make this mysql statement insert work in
PHP. I'm not getting any errors from PHP or mysql but the insert fails
(nothing is inserted) error reporting is on and is reporting other
errors. When I echo out the query and manually paste it into PHP
myAdmin the query inserts without a problem. I know that I am
connecting to the database as well part of the data being inserted
comes from the same database and that the mysql user has permission to
do inserts (even tried as root no luck).

$query=INSERT INTO upload_history (v_id,hour,visits,date) VALUES
(.$v_id.,.$hour.,.$visits.,'$date1'.);;

$r2=mysql_query($query) or die(bA fatal MySQL error
occured/b.\nbr /Query:  . $query . br /\nError: ( .
mysql_errno() . )  . mysql_error());

This is an echo of $query and runs in phpmyadmin.

INSERT INTO history (v_id,hour,visits,date) VALUES (45,0,59,'2010 01 27');


Any idea what is going on here?

  


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



Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Kim Madsen

james stojan wrote on 11/02/2010 22:21:


$query=INSERT INTO upload_history (v_id,hour,visits,date) VALUES
(.$v_id.,.$hour.,.$visits.,'$date1'.);;


The ,'$date1'. is not correct syntax, change it to ,'.$date.'


--
Kind regards
Kim Emax - masterminds.dk

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



Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Mari Masuda
Also, in PHP you should NOT put the last semi-colon at the end of your SQL 
statement.  http://www.php.net/manual/en/function.mysql-query.php

On Feb 11, 2010, at 1:26 PM, Joseph Thayne wrote:

 Try putting tick marks (`) around the field and table names.  So your SQL 
 query would then look like:
 
 INSERT INTO `history` (`v_id`, `hour`, `visits`, `date`) VALUES (45, 0, 59, 
 '2010 01 27');
 
 This is a good practice to get into.  The problem is that MySQL allows you to 
 create tables and fields with the same name as functions.  If the tick marks 
 are not there, then it assumes you mean to try using the function.  In your 
 case, hour is a function in mysql.  I would assume that the reason it works 
 in phpmyadmin is that it filters the query somehow to add the tick marks in.
 
 Joseph
 
 james stojan wrote:
 I'm at my wits end trying to make this mysql statement insert work in
 PHP. I'm not getting any errors from PHP or mysql but the insert fails
 (nothing is inserted) error reporting is on and is reporting other
 errors. When I echo out the query and manually paste it into PHP
 myAdmin the query inserts without a problem. I know that I am
 connecting to the database as well part of the data being inserted
 comes from the same database and that the mysql user has permission to
 do inserts (even tried as root no luck).
 
 $query=INSERT INTO upload_history (v_id,hour,visits,date) VALUES
 (.$v_id.,.$hour.,.$visits.,'$date1'.);;
 
 $r2=mysql_query($query) or die(bA fatal MySQL error
 occured/b.\nbr /Query:  . $query . br /\nError: ( .
 mysql_errno() . )  . mysql_error());
 
 This is an echo of $query and runs in phpmyadmin.
 
 INSERT INTO history (v_id,hour,visits,date) VALUES (45,0,59,'2010 01 27');
 
 
 Any idea what is going on here?
 
  
 
 -- 
 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] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread james stojan
Thank you.
You were right on the money, hour was the problem and the tick marks
solved it. I spent 3 hours trying to figure out why I never got an error but
there was no insert and  php myadmin does add the tick marks automatically.
 Probably a good habit to always use the tick marks.

Learn something new everyday.

On Thu, Feb 11, 2010 at 4:26 PM, Joseph Thayne webad...@thaynefam.orgwrote:

 Try putting tick marks (`) around the field and table names.  So your SQL
 query would then look like:


 INSERT INTO `history` (`v_id`, `hour`, `visits`, `date`) VALUES (45, 0, 59,
 '2010 01 27');

 This is a good practice to get into.  The problem is that MySQL allows you
 to create tables and fields with the same name as functions.  If the tick
 marks are not there, then it assumes you mean to try using the function.  In
 your case, hour is a function in mysql.  I would assume that the reason it
 works in phpmyadmin is that it filters the query somehow to add the tick
 marks in.

 Joseph


 james stojan wrote:

 I'm at my wits end trying to make this mysql statement insert work in
 PHP. I'm not getting any errors from PHP or mysql but the insert fails
 (nothing is inserted) error reporting is on and is reporting other
 errors. When I echo out the query and manually paste it into PHP
 myAdmin the query inserts without a problem. I know that I am
 connecting to the database as well part of the data being inserted
 comes from the same database and that the mysql user has permission to
 do inserts (even tried as root no luck).

 $query=INSERT INTO upload_history (v_id,hour,visits,date) VALUES
 (.$v_id.,.$hour.,.$visits.,'$date1'.);;

 $r2=mysql_query($query) or die(bA fatal MySQL error
 occured/b.\nbr /Query:  . $query . br /\nError: ( .
 mysql_errno() . )  . mysql_error());

 This is an echo of $query and runs in phpmyadmin.

 INSERT INTO history (v_id,hour,visits,date) VALUES (45,0,59,'2010 01 27');


 Any idea what is going on here?






Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Joseph Thayne


Actually, the syntax is just fine.  I personally would prefer it the way 
you mention, but there actually is nothing wrong with the syntax.



The ,'$date1'. is not correct syntax, change it to ,'.$date.'


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



Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread James McLean
On Fri, Feb 12, 2010 at 8:27 AM, Joseph Thayne webad...@thaynefam.org wrote:

 Actually, the syntax is just fine.  I personally would prefer it the way you
 mention, but there actually is nothing wrong with the syntax.

 The ,'$date1'. is not correct syntax, change it to ,'.$date.'

My personal preference these days is to use Curly braces around
variables in strings such as this, I always find excessive string
concatenation such as is often used when building SQL queries hard to
read, and IIRC there was performance implications to it as well
(though I don't have access to concrete stats right now).

In your case, the variable would be something like this:

$query=INSERT INTO upload_history (v_id,hour,visits,date) VALUES
({$v_id}, {$hour}, {$visits}, '{$date}');

Much more readable and maintainable IMO.

No need for the trailing semicolon in SQL that uses an API like you
are using so save another char there too.
Backticks around column names are not required and IMO again they just
make the code hard to read. Just because phpMyAdmin uses them, doesn't
mean we all need to.

Cheers

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



Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Joseph Thayne
That is a good idea to use the curly braces.  I consistently forget 
about them, and fell like an idiot every time I am reminded of them.


As for the backticks, they are required because of MySQL, not because of 
phpMyAdmin.  The issue was not that phpMyAdmin uses backticks, it is 
that MySQL pretty much requires them when naming a field the same as an 
internal function to my knowledge.  If someone else knows of another way 
to designate to MySQL that a field named HOUR is the name of a field 
rather than the name of the internal function, I would love to know.


James McLean wrote:

On Fri, Feb 12, 2010 at 8:27 AM, Joseph Thayne webad...@thaynefam.org wrote:
  

Actually, the syntax is just fine.  I personally would prefer it the way you
mention, but there actually is nothing wrong with the syntax.



The ,'$date1'. is not correct syntax, change it to ,'.$date.'
  


My personal preference these days is to use Curly braces around
variables in strings such as this, I always find excessive string
concatenation such as is often used when building SQL queries hard to
read, and IIRC there was performance implications to it as well
(though I don't have access to concrete stats right now).

In your case, the variable would be something like this:

$query=INSERT INTO upload_history (v_id,hour,visits,date) VALUES
({$v_id}, {$hour}, {$visits}, '{$date}');

Much more readable and maintainable IMO.

No need for the trailing semicolon in SQL that uses an API like you
are using so save another char there too.
Backticks around column names are not required and IMO again they just
make the code hard to read. Just because phpMyAdmin uses them, doesn't
mean we all need to.

Cheers

  


Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Jochem Maas
Op 2/11/10 10:51 PM, James McLean schreef:
 On Fri, Feb 12, 2010 at 8:27 AM, Joseph Thayne webad...@thaynefam.org wrote:

 Actually, the syntax is just fine.  I personally would prefer it the way you
 mention, but there actually is nothing wrong with the syntax.

 The ,'$date1'. is not correct syntax, change it to ,'.$date.'
 
 My personal preference these days is to use Curly braces around
 variables in strings such as this, I always find excessive string
 concatenation such as is often used when building SQL queries hard to
 read, and IIRC there was performance implications to it as well
 (though I don't have access to concrete stats right now).
 
 In your case, the variable would be something like this:
 
 $query=INSERT INTO upload_history (v_id,hour,visits,date) VALUES
 ({$v_id}, {$hour}, {$visits}, '{$date}');

actually IIRC the engine compiles that to OpCodes that equate to:


$query = 'INSERT INTO upload_history (v_id,hour,visits,date) VALUES ('.$v_id.', 
'.$hour.', '.$visits.', '\''.{$date}.'\')';

 
 Much more readable and maintainable IMO.
 
 No need for the trailing semicolon in SQL that uses an API like you
 are using so save another char there too.
 Backticks around column names are not required and IMO again they just
 make the code hard to read. Just because phpMyAdmin uses them, doesn't
 mean we all need to.
 
 Cheers
 


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



Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread James McLean
On Fri, Feb 12, 2010 at 9:31 AM, Jochem Maas joc...@iamjochem.com wrote:
 Op 2/11/10 10:51 PM, James McLean schreef:
 My personal preference these days is to use Curly braces around
 variables in strings such as this, I always find excessive string
 concatenation such as is often used when building SQL queries hard to
 read, and IIRC there was performance implications to it as well
 (though I don't have access to concrete stats right now).

 In your case, the variable would be something like this:

 $query=INSERT INTO upload_history (v_id,hour,visits,date) VALUES
 ({$v_id}, {$hour}, {$visits}, '{$date}');

 actually IIRC the engine compiles that to OpCodes that equate to:

 $query = 'INSERT INTO upload_history (v_id,hour,visits,date) VALUES 
 ('.$v_id.', '.$hour.', '.$visits.', '\''.{$date}.'\')';

Interesting point, but the original code is still more readable, the
opcode's aren't our problem (at least in this case) :)

Cheers

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



Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread James McLean
On Fri, Feb 12, 2010 at 9:31 AM, Joseph Thayne webad...@thaynefam.org wrote:
 As for the backticks, they are required because of MySQL, not because of
 phpMyAdmin.  The issue was not that phpMyAdmin uses backticks, it is that
 MySQL pretty much requires them when naming a field the same as an internal
 function to my knowledge.  If someone else knows of another way to designate
 to MySQL that a field named HOUR is the name of a field rather than the name
 of the internal function, I would love to know.

Ahh I see :) Wasn't aware of that. Personally i've always been
over-descriptive when designing my tables which is possibly why I've
never run into that limitation :)

Thanks.

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



Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Joseph Thayne
Yeah, I am a lot more descriptive now.  I ran into it quite a bit when I 
was first starting out.


James McLean wrote:

On Fri, Feb 12, 2010 at 9:31 AM, Joseph Thayne webad...@thaynefam.org wrote:
  

As for the backticks, they are required because of MySQL, not because of
phpMyAdmin.  The issue was not that phpMyAdmin uses backticks, it is that
MySQL pretty much requires them when naming a field the same as an internal
function to my knowledge.  If someone else knows of another way to designate
to MySQL that a field named HOUR is the name of a field rather than the name
of the internal function, I would love to know.



Ahh I see :) Wasn't aware of that. Personally i've always been
over-descriptive when designing my tables which is possibly why I've
never run into that limitation :)

Thanks.

  


Re: [PHP] PHP Manual problems

2010-02-11 Thread clancy_1
On Thu, 11 Feb 2010 10:18:18 +, a...@ashleysheridan.co.uk (Ashley Sheridan) 
wrote:

On Thu, 2010-02-11 at 10:16 +1100, Ross McKay wrote:

...

There's a good reason for OpenOffice having some difficulties with MS
Office documents. Back when MS rushed through getting their document
standard ratified by ISO (which itself is a whole other story) they
didn't explain all the details quite as well as they might have. Later
on, MS found they were having some difficulty following their own
'standard' and so altered it in various ways in Office2007. Needless to
say, ISO weren't too happy when MS asked if they could just 'change the
specs' for their file format, and quite rightly refused to do so.

In short, this means that there is a MS ISO standard that MS is the only
one not trying to follow, and software like OpenOffice is left to
reverse engineering the format again.

When the first Word Macro virus appeared in the early 90s, the AV industry 
approached
Microsoft for the specifications of the internal structure of the Word 
documents. After
some discussion Microsoft agreed to make these available to firms who signed an 
NDA.
Several large firms did so, but when they got the specifications they 
immediately
discovered that they bore very little relation to the actual documents. When 
Microsoft was
approached about this their reply was Well, that's all we've got!  

The industry had to run a joint program to reverse engineer the specifications 
before they
could work out how to remove the virus.

The story that went around was that with each update Microsoft hired a new 
batch of young
graduates asidethey don't have preconceived notions (a.k.a. experience), and 
they don't
have extravagant ideas of their own worth/aside, told them vaguely what they 
wanted, and
left them to it. Then, as soon as they had something that sort of worked, they 
let them go
again. So there was no continuity, no documentation, no hope of bug fixes, and 
very little
likelihood that the next update would be improved in any meaningful sense.  I 
have seen
nothing to suggest that anything has changed.

And Bill actually likes it this way!  Someone who did a lot of support work for 
small and
medium enterprises told me that the biggest pressure for updating to the latest 
version
came from workers envious of the new employee, with his new computer and the 
new version
of the Microsoft rubbish --- sorry, wonder product.


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



[PHP] the limitation of upload_max_filesize, post_max_size

2010-02-11 Thread pinate

Hi,

I know that we can limit the size of upload file by specify
upload_max_filesize, post_max_size and even memory_limit parameters.
Though we can change these parameters, can someone please let me know what
the maximum value of these parameters can be? What is the factors we need to
take into account when specify these values.


Many thank,

Pinate
-- 
View this message in context: 
http://old.nabble.com/the-limitation-of-upload_max_filesize%2C-post_max_size-tp27556756p27556756.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Paul M Foster
On Fri, Feb 12, 2010 at 09:44:47AM +1030, James McLean wrote:

 On Fri, Feb 12, 2010 at 9:31 AM, Joseph Thayne webad...@thaynefam.org wrote:
  As for the backticks, they are required because of MySQL, not because of
  phpMyAdmin.  The issue was not that phpMyAdmin uses backticks, it is that
  MySQL pretty much requires them when naming a field the same as an internal
  function to my knowledge.  If someone else knows of another way to designate
  to MySQL that a field named HOUR is the name of a field rather than the name
  of the internal function, I would love to know.

Backticks are also required to preserve casing in MySQL, if you name
something in mixed or upper case; MySQL lowercases table and field names
otherwise. It's a silly misfeature of MySQL. 

I can't conceive of why a DBMS would assume something which should be
understood in the context of a field name should instead be interpreted
as a function call. Buy maybe that's just me.

Paul

-- 
Paul M. Foster

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



Re: [PHP] PHP Manual problems

2010-02-11 Thread Paul M Foster
On Fri, Feb 12, 2010 at 12:13:11PM +1100, clanc...@cybec.com.au wrote:

 On Thu, 11 Feb 2010 10:18:18 +, a...@ashleysheridan.co.uk (Ashley
 Sheridan) wrote:
 
 On Thu, 2010-02-11 at 10:16 +1100, Ross McKay wrote:
 
 ...
 
 There's a good reason for OpenOffice having some difficulties with MS
 Office documents. Back when MS rushed through getting their document
 standard ratified by ISO (which itself is a whole other story) they
 didn't explain all the details quite as well as they might have. Later
 on, MS found they were having some difficulty following their own
 'standard' and so altered it in various ways in Office2007. Needless to
 say, ISO weren't too happy when MS asked if they could just 'change the
 specs' for their file format, and quite rightly refused to do so.
 
 In short, this means that there is a MS ISO standard that MS is the only
 one not trying to follow, and software like OpenOffice is left to
 reverse engineering the format again.
 
 When the first Word Macro virus appeared in the early 90s, the AV industry
 approached
 Microsoft for the specifications of the internal structure of the Word
 documents. After
 some discussion Microsoft agreed to make these available to firms who
 signed an NDA.
 Several large firms did so, but when they got the specifications they
 immediately
 discovered that they bore very little relation to the actual documents. When
 Microsoft was
 approached about this their reply was Well, that's all we've got!
 
 The industry had to run a joint program to reverse engineer the
 specifications before they
 could work out how to remove the virus.
 
 The story that went around was that with each update Microsoft hired a
 new batch of young
 graduates asidethey don't have preconceived notions (a.k.a. experience),
 and they don't
 have extravagant ideas of their own worth/aside, told them vaguely what
 they wanted, and
 left them to it. Then, as soon as they had something that sort of worked,
 they let them go
 again. So there was no continuity, no documentation, no hope of bug fixes,
 and very little
 likelihood that the next update would be improved in any meaningful sense.
 I have seen
 nothing to suggest that anything has changed.

I suspect any lack of continuity was more due to the shifting of
personnel internally to differing projects, rather than the hiring of
all new coders each time.

But more importantly, I suspect MS coders just coded without writing any
docs. Coders usually suck at documentation and will avoid it unless
forced. And if forced to write docs, the docs were just a toss-off no
one ever actually looked at.

Microsoft's attitude, I'm sure was, Why should we care about other
players in the market? Just buy our crap and you won't have to worry
about our formats. (Except until the next upgrade.)

I think ISO's policy should be that if you're a company forwarding a
standard, your off-the-shelf software should verifiably duplicate that
standard. Otherwise, go pound sand. Same if you're a community proposing
a standard. Produce some software which adheres to that standard or shut
up.

Paul

-- 
Paul M. Foster

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



RE: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Joseph Thayne
I was going to write an example as to what should happen instead of what
actually does when id dawned on me why MySQL works the way it does.  One of
the biggest complaints people have with MySQL is in speed.  To demonstrate
what I just realized, take the following statement that will select the hour
from a given time as well as the value from the hour field:

SELECT HOUR('13:42:37') as thehour, hour FROM mytable;

Not a big deal and pretty straight forward.  What about the following?

SELECT HOUR(mydate) as thehour, hour FROM mytable;

Still pretty simple to determine which are the functions and which are the
field names.  However, take the following:

SELECT HOUR(NOW()) as thehour, hour FROM mytable;

As humans, glancing at it, it makes perfect sense to us as to which is
which.  However, try telling a computer how to interpret the above
statement.  You could look for parenthesis.  That would work fine on the
first two statements, but once you get to the third, you have to worry about
recursion and all possible permutations of the data that could come through.
This exponentially increases the complexity and processing time/power
required to run the query.  Granted, that query is a simple one, but plug it
into a query filled with multiple joins, and you have the potential of a
nightmare.  So why focus on adding in functionality that adds so much
complexity and will end up requiring that much extra support when a simple
character (the tick mark) will take care of the work for you and you can
then focus on other things such as data integrity and general processing
speed?

Joseph

-Original Message-
From: Paul M Foster [mailto:pa...@quillandmouse.com] 
Sent: Thursday, February 11, 2010 9:15 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Mysql statement works in phpmyadmin but not in php page

On Fri, Feb 12, 2010 at 09:44:47AM +1030, James McLean wrote:

 On Fri, Feb 12, 2010 at 9:31 AM, Joseph Thayne webad...@thaynefam.org
wrote:
  As for the backticks, they are required because of MySQL, not because of
  phpMyAdmin.  The issue was not that phpMyAdmin uses backticks, it is
that
  MySQL pretty much requires them when naming a field the same as an
internal
  function to my knowledge.  If someone else knows of another way to
designate
  to MySQL that a field named HOUR is the name of a field rather than the
name
  of the internal function, I would love to know.

Backticks are also required to preserve casing in MySQL, if you name
something in mixed or upper case; MySQL lowercases table and field names
otherwise. It's a silly misfeature of MySQL. 

I can't conceive of why a DBMS would assume something which should be
understood in the context of a field name should instead be interpreted
as a function call. Buy maybe that's just me.

Paul

-- 
Paul M. Foster

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



[PHP] Checking correct usage of fopen(), stream_set_timeout() and fread() [newbie]

2010-02-11 Thread Mark White
Hi,

I have some code to download large files as part of a larger class. I've
been in a discussion with the developer of a library that I'm using who has
told me clearly that my code will not work at all, even though it does. He
is suggesting my problems are due to my not understanding the nature of
fread() even the code is very similar to examples on php.net.

I do get very rare timeout problems where the stream_set_timeout() does not
seem to be firing, and PHP exits on a general timeout. However I'm using
this under Tomcat and the logs are not giving me as much information as
under Apache webserver, where I have been unable to reproduce this problem.
So it's proving difficult to track down and I'm not able to reproduce the
error consistently. I would appreciate any comments about the validity of
the code (at the bottom) so I have a better idea whether it is my problem,
or not. It might be that I need to catch and handle the error, but that is
an area where I have no experience as yet.

I'm aware the code could be rewritten in CURL, but for now I'm more after an
understanding of what problems there might be, if any, with this approach.
The server is returning content-length in the header, and chunk encoding is
not an approach I'm intending to use right now.

Also, I'd appreciate any ideas on what the developer might mean by the
following quote. He's asked that I do not use his mailing list anymore and
should take my questions to php-general, so it would be impolite to ignore
this so I can ask him to explain further:

3. The network buffer used by the PHP streams implementation reads data
eagerly. If you fread($socket, 1024) and the network buffer already
contains 24 bytes, PHP will try to read 1000 bytes nevertheless.

My understanding is the fread() will wait until is has 1024 bytes (in this
example) and then return that, unless EOF is encountered when the data up to
and including EOF is returned. I'm not sure what he's trying to say.

Many thanks for any advice on this.


Mark...

Code:
(The intentions are: used for downloading very large files while avoiding
memory problems, this is contained in a loop for a list of files, if the
socket is unavailable then the download is not attempted for that file, if
the socket is available but no data is received in a 30 second period, then
that download should be aborted and retried up to 5 times)

  $download_attempt = 1;
  do {
$fs = fopen('http://' . $host . $file, rb);

if (!$fs) {
  $this-writeDebugInfo(FAILED to open stream for , http://;
. $host . $file);
} else {

  $fm = fopen ($temp_file_name, w);
  stream_set_timeout($fs, 30);

  while(!feof($fs)) {
$contents = fread($fs, 4096); // Buffered download
fwrite($fm, $contents);
$info = stream_get_meta_data($fs);
if ($info['timed_out']) {
  break;
}
  }
  fclose($fm);
  fclose($fs);

  if ($info['timed_out']) {
// Delete temp file if fails
unlink($temp_file_name);
$this-writeDebugInfo(FAILED on attempt  .
$download_attempt .  - Connection timed out: , $temp_file_name);
$download_attempt++;
if ($download_attempt  5) {
  $this-writeDebugInfo(RETRYING: , $temp_file_name);
}
  } else {
// Move temp file if succeeds
$media_file_name = str_replace('temp/', 'media/',
$temp_file_name);
rename($temp_file_name, $media_file_name);
$this-newDownload = true;
$this-writeDebugInfo(SUCCESS: , $media_file_name);
  }
}
  } while ($download_attempt  5  $info['timed_out']);


Re: [PHP] Mysql statement works in phpmyadmin but not in php page

2010-02-11 Thread Paul M Foster
On Thu, Feb 11, 2010 at 09:49:02PM -0600, Joseph Thayne wrote:

 I was going to write an example as to what should happen instead of what
 actually does when id dawned on me why MySQL works the way it does.  One of
 the biggest complaints people have with MySQL is in speed.  

The much-vaunted speed of MySQL is the biggest complaint? Sheesh.

 To demonstrate
 what I just realized, take the following statement that will select the hour
 from a given time as well as the value from the hour field:
 
 SELECT HOUR('13:42:37') as thehour, hour FROM mytable;
 
 Not a big deal and pretty straight forward.  What about the following?
 
 SELECT HOUR(mydate) as thehour, hour FROM mytable;
 
 Still pretty simple to determine which are the functions and which are the
 field names.  However, take the following:
 
 SELECT HOUR(NOW()) as thehour, hour FROM mytable;
 
 As humans, glancing at it, it makes perfect sense to us as to which is
 which.  However, try telling a computer how to interpret the above
 statement.  You could look for parenthesis.  That would work fine on the
 first two statements, but once you get to the third, you have to worry about
 recursion and all possible permutations of the data that could come through.
 This exponentially increases the complexity and processing time/power
 required to run the query.  Granted, that query is a simple one, but plug it
 into a query filled with multiple joins, and you have the potential of a
 nightmare.  So why focus on adding in functionality that adds so much
 complexity and will end up requiring that much extra support when a simple
 character (the tick mark) will take care of the work for you and you can
 then focus on other things such as data integrity and general processing
 speed?

I understand what you're saying, and you may be right about why MySQL
was built this way. However, it's like telling the programmers not to
build a better parser; just make the user backtick stuff so we don't
have to write a proper parser. For a one-off script only I was going to
use, I'd do this. But not for a professional level product used by
millions, speed or no speed. Imagine if KR had tried to shortcut the C
parser this way; the C parser is almost endlessly re-entrant and must
accommodate some seriously obfuscated code. Which it does reliably.
Besides, if you've got a parser which understands joins, parsing things
like the distinction between hour (field name) and hour (function call)
is a piece of cake.

If a programmer working for me tried to pawn this off as a done, I'd
make him redo it. Again, maybe it's just me.

Anyway, we're way off topic

Paul

-- 
Paul M. Foster

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