php-general Digest 15 Apr 2008 19:01:31 -0000 Issue 5406

Topics (messages 272999 through 273008):

Re: What is the practical use of "abstract" and "interface"?
        272999 by: Jay Blanchard
        273000 by: Rodrigo Reis da Rocha

Most viewed?
        273001 by: Steve Marquez
        273002 by: Nathan Nobbe
        273005 by: Shawn McKenzie

security for hersh site
        273003 by: Dale Hersowitz

protecting php from the hersh corporation
        273004 by: Dale Hersowitz
        273006 by: Daniel Brown

Re: Quarters
        273007 by: Zoltán Németh

Re: where to put a function
        273008 by: Zoltán Németh

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
[snip]
...stuff...
[/snip]

The practical use of an abstract class is in its ability to define
criteria for classes that inherit from it. How practical would it be to
define a 'truck' class with 4 wheels and then define a 'car' class with
4 wheels when we could define an abstract class that defines vehicles
with 4 wheels? Both of our classes can now inherit from that abstract
class and we can define features only relevant to them. If you refactor
diligently you will no doubt find places where you need to create
abstract classes.

The methods that are exposed by an object define the interface for that
object. It is how everything outside of the object interacts with the
object. You don't have to know how the method works all you need is the
interface....like the gas pedal on the car. 

--- End Message ---
--- Begin Message ---
Just adding one line to the topic...
Interfaces are like C or C++ headers files. Them are used to another
class(program in C) to call methods without care the implementation. In
other hand abstract classes are (as the name says) an abstract way to use
multiple specializations of the same group of classes. Like vehicle is an
abstraction to car, motorbike, bike... with that you can use the method ride
to all these vehicles using an vehicle variable pointing to an instance of
car, motorbike or bike.

Cheers.

Rodrigo Reis.

2008/4/15, Jay Blanchard <[EMAIL PROTECTED]>:
>
> [snip]
> ...stuff...
> [/snip]
>
> The practical use of an abstract class is in its ability to define
> criteria for classes that inherit from it. How practical would it be to
> define a 'truck' class with 4 wheels and then define a 'car' class with
> 4 wheels when we could define an abstract class that defines vehicles
> with 4 wheels? Both of our classes can now inherit from that abstract
> class and we can define features only relevant to them. If you refactor
> diligently you will no doubt find places where you need to create
> abstract classes.
>
> The methods that are exposed by an object define the interface for that
> object. It is how everything outside of the object interacts with the
> object. You don't have to know how the method works all you need is the
> interface....like the gas pedal on the car.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Atenciosamente,
Rodrigo.

--- End Message ---
--- Begin Message ---
Greetings,

Can any of you point me in the right direction on how to use PHP to create a
most viewed or most clicked articles list? Can it be done with PHP?

Thank you so much,

Steve Marquez
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
On Tue, Apr 15, 2008 at 9:41 AM, Steve Marquez <[EMAIL PROTECTED]>
wrote:

> Greetings,
>
> Can any of you point me in the right direction on how to use PHP to create
> a
> most viewed or most clicked articles list? Can it be done with PHP?


are these articles on a site youre creating?  it should be pretty simple
then.  basically, when somebody clicks on a link to an article on the site,
drive that request through some php code that increments a counter in the
database.  then on the page where you show the 'most clicked' its
essentially just an ORDER BY most_clicked DESC LIMIT x query.  where
most_clicked is the field name of the counter, and x is the number of
results you want to show; so like for top 3, x=3.

-nathan

--- End Message ---
--- Begin Message ---
Steve Marquez wrote:
Greetings,

Can any of you point me in the right direction on how to use PHP to create a
most viewed or most clicked articles list? Can it be done with PHP?

Thank you so much,

Steve Marquez
[EMAIL PROTECTED]

Short answer, yes.

The right direction would be something like this:

In the article table of your db add a 'reads' field or similar. Modify your article display code so that when it loads it increments the reads field for that article.

Now to display the article with the most reads you just query the article table for the max reads or for all articles and sort on reads, etc...

-Shawn

--- End Message ---
--- Begin Message ---
Hi,
I would like to ensure that our php.ini is fully locked down to prevents
individuals from any exploiting vulnerabilities in our site.
(hershonline.com) What sites do you recommend to gather this information?

Do you recommend running tools like securitymetrics.com? I ran this on our
site (hersh) and found no real errors. However, I want to make sure that
hersh site is fully secure.

Thanks for the advice.

Thanks,
Dale Hersowitz
Hersh Corporaton
hershonline.com 



--- End Message ---
--- Begin Message ---
Hi,
I would like to ensure that our php.ini is fully locked down to prevents 
individuals from any exploiting vulnerabilities in our site. 
(hershonline.com) What sites do you recommend to gather this information?

Do you recommend running tools like securitymetrics.com? I ran this on our 
site (hersh) and found no real errors. However, I want to make sure that 
hersh site is fully secure.

Thanks for the advice.

Thanks,
Dale Hersowitz
Hersh Corporaton
hershonline.com



--- End Message ---
--- Begin Message ---
    Yes, by all means, you will want to protect PHP from your
corporation.  In fact, we all want you to do the same.

    No posts in four years, and then - bam! - six posts in one day on
three different lists saying the same thing.  A little antsy, are we?
;-P

-- 
</Daniel P. Brown>
Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!

--- End Message ---
--- Begin Message ---
tedd írta:
Hi gang:

Check out my new game:

http://webbytedd.com/quarters/

What do you think?

that's cool, the only problem is that I lost ten times out of ten ;)

maybe on the weekend I give it a deeper analysis and so I can figure out the winning strategy - because there must be one, which is used by the program

greets,
Zoltán Németh


Cheers,

tedd

PS: I originally wrote the game for the Mac over eight years ago.


--- End Message ---
--- Begin Message ---
Rick Pasotto írta:
Probably been answered a thousand times; if so, just tell me where to
look.

I have a function that includes a specific sql query that is used on
only one page on the site. Should that function be coded (1) in the page
itself, (2) in a separate file that only that page includes, or (3) in a
master file that contains all the functions used on the site and is
included on every page?

I've been doing #1 (not actually a function in this case) but #3 is
appealing, especially since I would implement it as OOP and the page
itself would be really just a template. What is the cost of parsing a
bunch of functions that are not used on a given page load?



Q: where to put a function?
A: into the class where it belongs.

sorry I could not stand it ;)

to be more serious, one giant 'functions.php' include file is not a very good solution, because you might end up including dozens of unused functions in every page.

on the other hand, putting it into the page doesn't let you use it anywhere else.

so the solution should be somewhat like the oop class organization: put together those that are logically belonging together. this way you'll have libraries for each type of functions, and only include what you need

greets,
Zoltán Németh


--- End Message ---

Reply via email to