php-general Digest 9 Aug 2009 22:31:48 -0000 Issue 6276
Topics (messages 296505 through 296524):
Re: Displaying user data and picture
296505 by: tedd
Question: what are frameworks?
296506 by: Parham Doustdar
296509 by: Ralph Deffke
296510 by: Michael A. Peters
296511 by: Tony Marston
296512 by: Sudheer Satyanarayana
296513 by: Bastien Koert
Re: PHP programming strategy
296507 by: tedd
296508 by: Ashley Sheridan
Re: Can php be cause a strain on a web server
296514 by: Daniel Brown
296517 by: Jerry Wilborn
296522 by: Daniel Brown
MySQL auto_increment fields Server version: 5.1.32-community-log
296515 by: Ralph Deffke
296516 by: Jerry Wilborn
296519 by: Ralph Deffke
296521 by: Ralph Deffke
296523 by: Nisse Engström
296524 by: tedd
Re: APC optimization in CLI
296518 by: Mattias Thorslund
296520 by: Robert Cummings
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
At 9:00 AM -0400 8/7/09, Bob McConnell wrote:
From: Ralph Deffke
however there are some reasonable reasons to store a
image in the database.
1. if u have no access to write files to the disk this
is the case in most free hosting services they give u
php and mysql and thats it
2. if u want some access control to the image, e.g. login
controlled. server admins dont like u playing arround
with the htaccess file
3. its easy in those and other cases
4. image directores are public, and apear in search engines
5. There is a natural relationship between the images and other data
already in the database, such as ID photos linked to employee numbers.
6. When you move to another server, you simply move the database and
not the database AND image directories.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
Hi there,
I've heard of frameworks, but I don't quite know what they are used for. I've
done a little search on the internet, but even though I've been able to find
different PHP frameworks, I'm not quite sure what they offer, or in what they
differ, or why I shouldn't just use PHP as it is.
Can someone give a little bit of explaination?
Thanks!
--
---
Contact info:
Skype: parham-d
MSN: fire_lizard16 at hotmail dot com
email: parham90 at GMail dot com
--- End Message ---
--- Begin Message ---
good question !! I think the word "framework" is modern fashion term in the
first case. in former days we used to say "library" C comes with a standard
library, in modern words C comes with a standard framework. I use my own
framework, means I reuse my code written for similar things before, so I use
my "framework". its like a painter, he uses a ready made frame to paint what
ever he wants,
u can use the yahoo UI framework to "paint" ur page. A operating system is a
"framework" unifieing the underlaying hardware.
as in former days u said "library" u say more modern "framework" in both
cases its a bunch of functions doing some stuff the user of the framework
hasn't to take care about by using the framework.
hope that helps
ralph
ralph_def...@yahoo.de
""Parham Doustdar"" <parha...@gmail.com> wrote in message
news:5c.b0.05105.f18be...@pb1.pair.com...
Hi there,
I've heard of frameworks, but I don't quite know what they are used for.
I've done a little search on the internet, but even though I've been able to
find different PHP frameworks, I'm not quite sure what they offer, or in
what they differ, or why I shouldn't just use PHP as it is.
Can someone give a little bit of explaination?
Thanks!
--
---
Contact info:
Skype: parham-d
MSN: fire_lizard16 at hotmail dot com
email: parham90 at GMail dot com
--- End Message ---
--- Begin Message ---
Ralph Deffke wrote:
good question !! I think the word "framework" is modern fashion term in the
first case. in former days we used to say "library" C comes with a standard
library, in modern words C comes with a standard framework. I use my own
framework, means I reuse my code written for similar things before, so I use
my "framework". its like a painter, he uses a ready made frame to paint what
ever he wants,
u can use the yahoo UI framework to "paint" ur page. A operating system is a
"framework" unifieing the underlaying hardware.
as in former days u said "library" u say more modern "framework" in both
cases its a bunch of functions doing some stuff the user of the framework
hasn't to take care about by using the framework.
hope that helps
I think framework is different than library.
Pear is a collection of libraries.
PECL (and binary modules that ship with php) are a collection of libraries.
I don't use pre-packaged frameworks so it probably is best for me not to
define them, but I think they are a basically a collection of classes
and libraries intended to make rapid development of web applications faster.
--- End Message ---
--- Begin Message ---
""Parham Doustdar"" <parha...@gmail.com> wrote in message
news:5c.b0.05105.f18be...@pb1.pair.com...
> Hi there,
I> I've heard of frameworks, but I don't quite know what they are used for.
> I've done a little search on the internet, but even though I've been able
> to find different PHP frameworks, I'm not quite sure what they offer, or
> in what they differ, or why I shouldn't just use PHP as it is.
> Can someone give a little bit of explaination?
> Thanks!
A framework is more than just a simple collection of libraries, it is a
support structure in which another software project (application) can be
organised and developed. The simplest framework is nothing more than a menu
system which informs the user what application components are available, and
provides the means for the user to choose an option from that list and cause
it to executed or activated. This means that each application component can
be developed without the need for any code to handle the menu functionality.
The component is simply plugged into the framework and it is instantly
available.
This simple framework can be extended to provide other features, such as
security. Instead of allowing just anybody to access the application it may
need to be restricted to registered users only, and this can be accomplished
by inserting a login mechanism into the framework. It may then be decided
that not every user is allowed to access every component, so additional
access control mechanisms can be built in. It should be possible to extend
the framework without having to touch every single component that runs
within it.
The framework may provide other facilities, such as providing the ability to
navigate between components, to pass messages between components, audit
logging, workflow, et cetera. This allows the application programmers to
concentrate on the needs of the application without being bogged down with
other details.
Some people seem to think that each application needs its own separate
framework in order to satisfy the unique needs of that application, but they
have simply not learned to abstract out that functionality which is common
to every application. It is therefore possible to build a framework that can
be used by any number of different applications. RADICORE is such a
framework.
An advantage of a reusable framework is that once a programmer has become
familiar with it he can carry that knowledge forward into the next
application without having to learn a different framework.
A framework is a support structure in which another software project
(application) can be organised and developed. The simplest framework is
nothing more than a menu system which informs the user what application
components are available, and provides the means for the user to choose an
option from that list and cause it to executed or activated. This means that
each application component can be developed without the need for any code to
handle the menu functionality. The component is simply plugged into the
framework and it is instantly available.
This simple framework can be extended to provide other features, such as
security. Instead of allowing just anybody to access the application it may
need to be restricted to registered users only, and this can be accomplished
by inserting a login mechanism into the framework. It may then be decided
that not every user is allowed to access every component, so additional
access control mechanisms can be built in. It should be possible to extend
the framework without having to touch every single component that runs
within it.
The framework may provide other facilities, such as providing the ability to
navigate between components, to pass messages between components, audit
logging, workflow, et cetera. This allows the application programmers to
concentrate on the needs of the application without being bogged down with
other details.
Some people seem to think that each application needs its own separate
framework in order to satisfy the unique needs of that application, but they
have simply not learned to abstract out that functionality which is common
to every application. It is therefore possible to build a framework that can
be used by any number of different applications. RADICORE is such a
framework.
An advantage of a reusable framework is that once a programmer has become
familiar with it he can carry that knowledge forward into the next
application without having to learn a different framework.
There are lots of different PHP frameworks available for the simple reason
that there are lots of different PHP programmers who each have their own
methodologies and techniques. Some frameworks are written to aid the
development of particular kinds of software, such as building web sites or
CMS systems, whereas others (like Radicore) are for building web
applications.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
--- End Message ---
--- Begin Message ---
Michael A. Peters wrote:
Ralph Deffke wrote:
good question !! I think the word "framework" is modern fashion term
in the
first case. in former days we used to say "library" C comes with a
standard
library, in modern words C comes with a standard framework. I use my own
framework, means I reuse my code written for similar things before,
so I use
my "framework". its like a painter, he uses a ready made frame to
paint what
ever he wants,
u can use the yahoo UI framework to "paint" ur page. A operating
system is a
"framework" unifieing the underlaying hardware.
as in former days u said "library" u say more modern "framework" in both
cases its a bunch of functions doing some stuff the user of the
framework
hasn't to take care about by using the framework.
hope that helps
I think framework is different than library.
Pear is a collection of libraries.
PECL (and binary modules that ship with php) are a collection of
libraries.
I don't use pre-packaged frameworks so it probably is best for me not
to define them, but I think they are a basically a collection of
classes and libraries intended to make rapid development of web
applications faster.
You might consider reading this:
http://en.wikipedia.org/wiki/Software_framework
--
With warm regards,
Sudheer. S
Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net,
Personal: http://sudheer.net
--- End Message ---
--- Begin Message ---
On Sun, Aug 9, 2009 at 9:29 AM, Sudheer
Satyanarayana<sudhee...@binaryvibes.co.in> wrote:
> Michael A. Peters wrote:
>>
>> Ralph Deffke wrote:
>>>
>>> good question !! I think the word "framework" is modern fashion term in
>>> the
>>> first case. in former days we used to say "library" C comes with a
>>> standard
>>> library, in modern words C comes with a standard framework. I use my own
>>> framework, means I reuse my code written for similar things before, so I
>>> use
>>> my "framework". its like a painter, he uses a ready made frame to paint
>>> what
>>> ever he wants,
>>>
>>> u can use the yahoo UI framework to "paint" ur page. A operating system
>>> is a
>>> "framework" unifieing the underlaying hardware.
>>>
>>> as in former days u said "library" u say more modern "framework" in both
>>> cases its a bunch of functions doing some stuff the user of the framework
>>> hasn't to take care about by using the framework.
>>>
>>> hope that helps
>>
>> I think framework is different than library.
>> Pear is a collection of libraries.
>> PECL (and binary modules that ship with php) are a collection of
>> libraries.
>>
>> I don't use pre-packaged frameworks so it probably is best for me not to
>> define them, but I think they are a basically a collection of classes and
>> libraries intended to make rapid development of web applications faster.
>>
> You might consider reading this:
>
> http://en.wikipedia.org/wiki/Software_framework
>
>
>
>
> --
>
> With warm regards,
> Sudheer. S
> Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net,
> Personal: http://sudheer.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
It's also worth noting that the frameworks goals may differ. The
CodeIgniter framework has support for both PHP 4 and PHP5, which makes
it more flexible where hosts have not upgraded to php5 for whatever
reason. Many of the others (like cake, symfony and zend) tend to only
support php5 and are also more object oriented from a coding
perspective.
Then there implementation features; CodeIgniter has a smaller
learning curve, footprint and is faster than many of the others. Zend
allows developers to pick and choose the framework components to use
as well having a very rich feature set. symfony has a full ORM layers
that handles mapping object to the database layer. Cake, symfony and
zend offer features to generate the basic classes for each database
table.
In all cases the idea of the framework is to abstract the heavy
lifting (the common features of developing uploaders, database
handlers, forms handling, validation etc) and allowing developers to
simply use the framework functionality to handle that, freeing up time
to focus on getting the business logic of the application in place.
--
Bastien
Cat, the other other white meat
--- End Message ---
--- Begin Message ---
At 10:54 AM +1000 8/9/09, Clancy wrote:
On Sat, 8 Aug 2009 07:53:42 -0400, tedd.sperl...@gmail.com (tedd) wrote:
>Also, if you use first-child, it could be taken down to:
<div class="pfm">
<img src="Images/Nxxxxx.jpg">
<p>Yanni Nxxxxx </p>
<p>Sally Riordan Scholarship, 2007- </p>
</div>
Except that line 2 is smaller than line 1. In my scheme of things
<p> has normal
paragraph spacing, 'nrmltxtn' has zero spacing, and 'notetxtn' is a
size smaller, also
with zero line spacing.
Yes, but using first-child you can make the first child <p> of class
"pfm" whatever you want while making all other children <p>'s in the
class something else.
But, as it was said, IE's have problems with first-child rules.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On Sun, 2009-08-09 at 07:55 -0400, tedd wrote:
> At 10:54 AM +1000 8/9/09, Clancy wrote:
> >On Sat, 8 Aug 2009 07:53:42 -0400, tedd.sperl...@gmail.com (tedd) wrote:
> > >Also, if you use first-child, it could be taken down to:
> >>
> >><div class="pfm">
> >> <img src="Images/Nxxxxx.jpg">
> >> <p>Yanni Nxxxxx </p>
> >> <p>Sally Riordan Scholarship, 2007- </p>
> >></div>
> >
> >Except that line 2 is smaller than line 1. In my scheme of things
> ><p> has normal
> >paragraph spacing, 'nrmltxtn' has zero spacing, and 'notetxtn' is a
> >size smaller, also
> >with zero line spacing.
> >
>
> Yes, but using first-child you can make the first child <p> of class
> "pfm" whatever you want while making all other children <p>'s in the
> class something else.
>
> But, as it was said, IE's have problems with first-child rules.
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
How does IE8 fare with selectors in CSS?
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On Sat, Aug 8, 2009 at 11:08, Jerry Wilborn<jerrywilb...@gmail.com> wrote:
> You're going to have to be more
> specific. There are very few problems where this is absolutely no solution.
And you're going to have to read what he said again and understand
the context of the question and answer. It requires no more specifics
unless it's being explained to a pre-schooler.
--
</Daniel P. Brown>
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig
--- End Message ---
--- Begin Message ---
You seem nice.
Jerry Wilborn
jerrywilb...@gmail.com
On Sun, Aug 9, 2009 at 12:54 PM, Daniel Brown <danbr...@php.net> wrote:
> On Sat, Aug 8, 2009 at 11:08, Jerry Wilborn<jerrywilb...@gmail.com> wrote:
> > You're going to have to be more
> > specific. There are very few problems where this is absolutely no
> solution.
>
> And you're going to have to read what he said again and understand
> the context of the question and answer. It requires no more specifics
> unless it's being explained to a pre-schooler.
>
> --
> </Daniel P. Brown>
> daniel.br...@parasane.net || danbr...@php.net
> http://www.parasane.net/ || http://www.pilotpig.net/
> Check out our great hosting and dedicated server deals at
> http://twitter.com/pilotpig
>
--- End Message ---
--- Begin Message ---
On Sun, Aug 9, 2009 at 15:03, Jerry Wilborn<jerrywilb...@gmail.com> wrote:
> You seem nice.
I have my moments.
--
</Daniel P. Brown>
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig
--- End Message ---
--- Begin Message ---
Hi all,
I'm facing the fact that it seems that auto_increment fields in a table not
start at 1 like it was in earlier versions even if I install mySQL brand new
creating all tables new. it seems to me that auto_increments handling has
changed to older version. is somebody out there who can give me a quick
background about auto_increment and how and if I can control the behavior of
mySQL about them.
ralph_def...@yahoo.de
--- End Message ---
--- Begin Message ---
ALTER TABLE T1 AUTO_INCREMENT=1;
It's likely that you dropped every record and expected the auto_increment to
reset.
Jerry Wilborn
jerrywilb...@gmail.com
On Sun, Aug 9, 2009 at 1:17 PM, Ralph Deffke <ralph_def...@yahoo.de> wrote:
> Hi all,
>
> I'm facing the fact that it seems that auto_increment fields in a table not
> start at 1 like it was in earlier versions even if I install mySQL brand
> new
> creating all tables new. it seems to me that auto_increments handling has
> changed to older version. is somebody out there who can give me a quick
> background about auto_increment and how and if I can control the behavior
> of
> mySQL about them.
>
> ralph_def...@yahoo.de
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
no this is not the point ! if I do this, the next auto_increment is still
10720
i can do what I want however the is defined long unsigned unique
auto_increment, what happens is in t1 the value is set to 10720 in t2 the
next value ist set to 10721 while the next record in t1 gets 10721.
it seems like the values in this field are unique OVER the whole database.
very strange to me...
ralph_def...@yahoo.de
"Jerry Wilborn" <jerrywilb...@gmail.com> wrote in message
news:3f4628f60908091202s67205256o222f22a0bfb61...@mail.gmail.com...
> ALTER TABLE T1 AUTO_INCREMENT=1;
> It's likely that you dropped every record and expected the auto_increment
to
> reset.
>
> Jerry Wilborn
> jerrywilb...@gmail.com
>
>
> On Sun, Aug 9, 2009 at 1:17 PM, Ralph Deffke <ralph_def...@yahoo.de>
wrote:
>
> > Hi all,
> >
> > I'm facing the fact that it seems that auto_increment fields in a table
not
> > start at 1 like it was in earlier versions even if I install mySQL brand
> > new
> > creating all tables new. it seems to me that auto_increments handling
has
> > changed to older version. is somebody out there who can give me a quick
> > background about auto_increment and how and if I can control the
behavior
> > of
> > mySQL about them.
> >
> > ralph_def...@yahoo.de
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
--- End Message ---
--- Begin Message ---
no this is not the point ! if I do this, the next auto_increment is still
10720
i can do what I want however the field is defined "long unsigned unique
auto_increment", what happens is in t1 the value is set to 10720 in t2 the
next value ist set to 10721 while the next record in t1 gets 10722.
it seems like the values in this field are unique OVER the whole database.
very strange to me...
ralph_def...@yahoo.de
> "Jerry Wilborn" <jerrywilb...@gmail.com> wrote in message
> news:3f4628f60908091202s67205256o222f22a0bfb61...@mail.gmail.com...
> > ALTER TABLE T1 AUTO_INCREMENT=1;
> > It's likely that you dropped every record and expected the
auto_increment
> to
> > reset.
> >
> > Jerry Wilborn
> > jerrywilb...@gmail.com
> >
> >
> > On Sun, Aug 9, 2009 at 1:17 PM, Ralph Deffke <ralph_def...@yahoo.de>
> wrote:
> >
> > > Hi all,
> > >
> > > I'm facing the fact that it seems that auto_increment fields in a
table
> not
> > > start at 1 like it was in earlier versions even if I install mySQL
brand
> > > new
> > > creating all tables new. it seems to me that auto_increments handling
> has
> > > changed to older version. is somebody out there who can give me a
quick
> > > background about auto_increment and how and if I can control the
> behavior
> > > of
> > > mySQL about them.
> > >
> > > ralph_def...@yahoo.de
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
>
>
--- End Message ---
--- Begin Message ---
On Sun, 9 Aug 2009 20:17:15 +0200, "Ralph Deffke" wrote:
> I'm facing the fact that it seems that auto_increment fields in a table not
> start at 1 like it was in earlier versions even if I install mySQL brand new
> creating all tables new. it seems to me that auto_increments handling has
> changed to older version. is somebody out there who can give me a quick
> background about auto_increment and how and if I can control the behavior of
> mySQL about them.
Did you Google for it? I found the following page that
might be relevant:
<http://dev.mysql.com/doc/refman/5.1/en/innodb-auto-increment-handling.html>
"Beginning with MySQL 5.1.22, InnoDB provides a locking
strategy that significantly improves scalability and
performance of SQL statements that add rows to tables
with AUTO_INCREMENT columns.
...
InnoDB uses the following algorithm to initialize the
auto-increment counter for a table t that contains an
AUTO_INCREMENT column named ai_col: After a server
startup, for the first insert into a table t, InnoDB
executes the equivalent of this statement:
SELECT MAX(ai_col) FROM t FOR UPDATE;
InnoDB increments by one the value retrieved by the
statement and assigns it to the column and to the
auto-increment counter for the table."
/Nisse
--- End Message ---
--- Begin Message ---
At 8:17 PM +0200 8/9/09, Ralph Deffke wrote:
Hi all,
I'm facing the fact that it seems that auto_increment fields in a table not
start at 1 like it was in earlier versions even if I install mySQL brand new
creating all tables new. it seems to me that auto_increments handling has
changed to older version. is somebody out there who can give me a quick
background about auto_increment and how and if I can control the behavior of
mySQL about them.
ralph_def...@yahoo.de
Why be concerned about it? What difference does it make?
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
Matic Meznar wrote:
Hi,
When running a PHP script from CLI, does APC optimize it before
execution, or does APC only provide the apc_*() functions when runing
in CLI mode?
If I recall correctly, none of the accelerators work in CLI mode.
There is a php.ini setting named apc.enable_cli, which would suggest
otherwise.
I tried enabling it, and it seems my CLI script is a little faster
actually. Highly unscientific but looks like about 10%.
Cheers,
Mattias
--- End Message ---
--- Begin Message ---
Mattias Thorslund wrote:
Robert Cummings wrote:
Matic Meznar wrote:
Hi,
When running a PHP script from CLI, does APC optimize it before
execution, or does APC only provide the apc_*() functions when runing
in CLI mode?
If I recall correctly, none of the accelerators work in CLI mode.
There is a php.ini setting named apc.enable_cli, which would suggest
otherwise.
I tried enabling it, and it seems my CLI script is a little faster
actually. Highly unscientific but looks like about 10%.
I stand corrected. However, accelerators don't make scripts faster per
se. They merely cut out the script reading and parsing time. So, while
you may experience 10% gain within the first second of your script
running, the use of an accelerator should have no bearing down the road
except for the initial dynamic load of other scripts at runtime. Long
running scripts will see almost no benefit from an accelerator. This is
the general reason why CLI acceleration isn't very useful. That said
though, one could certainly glean an advantage if they had a cron job or
other daemon that was loading a script often.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---