Re: [PHP] A Good OOP Tutorial/Read?

2013-05-21 Thread Dan Joseph
Hey guys, thanks again for the talk and education.  I've purchased the
book, and started reading thru the links given.  Take care!

-Dan


On Sun, May 19, 2013 at 12:28 PM, Tedd Sperling t...@sperling.com wrote:

 To all:

 Thanks to Stuart, I finally got it.

 The concept of Interface is a bit difficult to explain, but his excellent
 console made the concept clear.

 Many thanks to all for their efforts to educate me.

 Cheers,

 tedd


 _
 t...@sperling.com
 http://sperling.com


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




-- 
-Dan Joseph

http://www.danjoseph.me
http://www.dansrollingbbq.com
http://www.youtube.com/DansRollingBBQ


Re: [PHP] A Good OOP Tutorial/Read?

2013-05-19 Thread Tedd Sperling
On May 19, 2013, at 5:19 AM, mrfroasty mrfroa...@gmail.com wrote:

 On 05/16/2013 11:28 PM, Tedd Sperling wrote:
 So, if you find a good reference, please let me know.
 
 In my point of view, Interfaces and Abstracts are completely different stuffs 
 not related at all.Interface is a kind of a way of defining how all objects 
 should behave or written by developers (one has used a word contract or 
 agreement).
 
 For instance we are writting this huge application where hundreds of 
 developers are going to work together.We make an agreement all objects in 
 this application should provide a function for someone debug to see all the 
 contents or data in that object and call this method $this-debug();
 
 In order to guarantee that developers will have to obey this agreement, the 
 only way is to throw some bunch of exception when they do not.This can be 
 defined in an interface.Where everyone implimenting this interface (creating 
 objects) must have a function called debug().

I understand all of that -- but that's not the question I am asking.

Certainly, I can create an interface and if anyone wants to implement the 
interface, then they are forced to flesh-out the methods it contains. I 
understand that -- it's a contract.

But the other side of the argument is why would anyone want to do that other 
than to meet a design criteria?

It is very easy to understand double inheritance -- it is simply where a child 
can inherit methods from both parents. But in languages that do not support 
double inheritance, an Interface is offered as a solution -- and therein is my 
question.

So, in that regard how does an Interface provide methods to classes that 
implement the Interface?

Just show me a *simple* example (either php or Java will do).

Cheers,

tedd

PS: There have been people who have provided Interface examples, but none have 
demonstrated quasi-double inheritance.

_
tedd.sperl...@gmail.com
http://sperling.com

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



Re: [PHP] A Good OOP Tutorial/Read?

2013-05-19 Thread Tedd Sperling
To all:

Thanks to Stuart, I finally got it.

The concept of Interface is a bit difficult to explain, but his excellent 
console made the concept clear.

Many thanks to all for their efforts to educate me.

Cheers,

tedd


_
t...@sperling.com
http://sperling.com


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



Re: [PHP] A Good OOP Tutorial/Read?

2013-05-17 Thread Tedd Sperling
Nick:

I thank you for your addition, but what you provided did nothing to explain the 
difference between abstract and interface.

In your example:

An abstract Shape with Circle and Square inheriting.

OR

An interface Shape with Circle and Square implementing.

Does exactly the same thing -- so where's the difference?

Also, your:

Please make an effort to understand polymorphic concepts of OOP as
they are rudimentary. Without that one will never grasp OO Patterns
(Gang of Four).

Was more insulting than helpful.  Polymorphism was not the question asked.

Clearly the getArea() method is polymorphic and overridden in both Circle and 
Shape classes and also in BOTH abstract and interface examples.

Additionally, I'm not sure what:

 (int double side) 

means.

Cheers,

tedd


_
tedd.sperl...@gmail.com
http://sperling.com


-

On May 16, 2013, at 8:47 PM, Nick Khamis sym...@gmail.com wrote:

 interface Shape {
 public double getArea();
 }
 
 class Circle implements Shape {
  double radius;
  public Circle(int double radius) {
this.radius = radius;
  }
 
  public double getArea() {
return (radius * radius * 3.1415);
  }
 
 }
 
 class Square implements Shape {
  double side;
 
  public Square(int double side) {
this.side = side;
  }
 
  double getArea() {
return (side * side);
  }
 }
 
 
 Please make an effort to understand polymorphic concepts of OOP as
 they are rudimentary. Without that one will never grasp OO Patterns
 (Gang of Four).
 
 Ninus.
 
 On 5/16/13, Tedd Sperling tedd.sperl...@gmail.com wrote:
 Thanks to both Bastien and Sebastian:
 
 While I understand that an interface is like an abstract Class, in that you
 don't have to flesh-out your methods, but rather where you define exactly
 how Classes who implement that interface will be required to flesh-out those
 methods. But so what? What's the point?
 
 Without giving me complicated examples, just give me one simple example that
 illustrates the advantage of using an interface over writing a new Class
 where you flesh-out whatever methods you want. After all, an interface
 requires the same thing, does it not?
 
 As such, I just don't see the advantage interfaces bring.
 
 Cheers,
 
 tedd
 
 
 _
 tedd.sperl...@gmail.com
 http://sperling.com
 
 
 
 --
 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] A Good OOP Tutorial/Read?

2013-05-17 Thread Stuart Dallas
On 17 May 2013, at 14:04, Tedd Sperling tedd.sperl...@gmail.com wrote:

 I thank you for your addition, but what you provided did nothing to explain 
 the difference between abstract and interface.
 
 In your example:
 
An abstract Shape with Circle and Square inheriting.
 
 OR
 
An interface Shape with Circle and Square implementing.
 
 Does exactly the same thing -- so where's the difference?

An interface does what it says on the tin: it describes an interface that a 
class can then tell the world it implements.

An abstract class provides functionality as well as an interface description. 
An abstract class cannot be instantiated, it can only be extended.

The logging example given by someone earlier in this thread is the most common 
example given for interfaces. This is where the interface is defined as an API 
for others to implement and/or use which then enables users to pick and choose 
the combination of implementations they want to use based on their requirements 
without needing to change any of the code of either class.

Abstract classes are more likely to be used where there is a set of shared 
functionality that is required by several other classes, but which is not 
functionally useful by itself. An example of this from a current project of 
mine is in aggregating news sources (RSS, scraping, custom formats, etc).

I have an abstract base class which supplies common code to parse and process 
data, and some abstract methods that must be implemented by any class that 
extends it because the abstract class methods may call them. The abstract class 
also contains a static factory method for getting instances of the 
type-specific classes.

With this architecture the users of the abstract class never see the derived 
classes so there's no need to publish an interface for them to use.

Does that help at all?

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] A Good OOP Tutorial/Read?

2013-05-17 Thread Sebastian Krebs
2013/5/17 Tedd Sperling tedd.sperl...@gmail.com

 Nick:

 I thank you for your addition, but what you provided did nothing to
 explain the difference between abstract and interface.

 In your example:

 An abstract Shape with Circle and Square inheriting.

 OR

 An interface Shape with Circle and Square implementing.


 Does exactly the same thing -- so where's the difference?


- The first one allows to contain implemented methods. Interfaces enforce
contract only, which makes them more stable on the long run. Sooner or
later (or right from the beginning) someone _will_ implement a method in
that class, which will loosen the separation between the contract and the
implementation. And then it begins, that it is hard to distinguish, what
from this class is contract (and should _never_ change without a good
reason) and what is implementation, that can change.
- It is semantically different as first one states Circle _is a_ Shape,
whereas interfaces defines their relationship more like Circle _behaves
like_ a Shape.
- In many languages you can only extend from one class.

Of course: Technically they do the same, but thats not the point ;) Also
technically you don't _require_ interfaces at all. As mentioned: Most of
this happens in ones mind. For example if you change an interface, you
should _always_ expect to break something ;)

Most of OOP isn't about syntax or technical features anyway, but it is
about concepts (design and so on).

And as a sidenote: I don't say (and don't believe ;)) that my explanation
is completely academically correct ;)




 Also, your:

 Please make an effort to understand polymorphic concepts of OOP as
 they are rudimentary. Without that one will never grasp OO Patterns
 (Gang of Four).

 Was more insulting than helpful.  Polymorphism was not the question asked.

 Clearly the getArea() method is polymorphic and overridden in both Circle
 and Shape classes and also in BOTH abstract and interface examples.

 Additionally, I'm not sure what:

  (int double side)

 means.

 Cheers,

 tedd


 _
 tedd.sperl...@gmail.com
 http://sperling.com


 -

 On May 16, 2013, at 8:47 PM, Nick Khamis sym...@gmail.com wrote:

  interface Shape {
  public double getArea();
  }
 
  class Circle implements Shape {
   double radius;
   public Circle(int double radius) {
 this.radius = radius;
   }
 
   public double getArea() {
 return (radius * radius * 3.1415);
   }
 
  }
 
  class Square implements Shape {
   double side;
 
   public Square(int double side) {
 this.side = side;
   }
 
   double getArea() {
 return (side * side);
   }
  }
 
 
  Please make an effort to understand polymorphic concepts of OOP as
  they are rudimentary. Without that one will never grasp OO Patterns
  (Gang of Four).
 
  Ninus.
 
  On 5/16/13, Tedd Sperling tedd.sperl...@gmail.com wrote:
  Thanks to both Bastien and Sebastian:
 
  While I understand that an interface is like an abstract Class, in that
 you
  don't have to flesh-out your methods, but rather where you define
 exactly
  how Classes who implement that interface will be required to flesh-out
 those
  methods. But so what? What's the point?
 
  Without giving me complicated examples, just give me one simple example
 that
  illustrates the advantage of using an interface over writing a new Class
  where you flesh-out whatever methods you want. After all, an interface
  requires the same thing, does it not?
 
  As such, I just don't see the advantage interfaces bring.
 
  Cheers,
 
  tedd
 
 
  _
  tedd.sperl...@gmail.com
  http://sperling.com
 
 
 
  --
  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




-- 
github.com/KingCrunch


Re: [PHP] A Good OOP Tutorial/Read?

2013-05-17 Thread Tedd Sperling
Stuart:

You said:

 An interface does what it says on the tin: it describes an interface that a 
 class can then tell the world it implements.
 
 An abstract class provides functionality as well as an interface description. 
 An abstract class cannot be instantiated, it can only be extended.
 
 The logging example given by someone earlier in this thread is the most 
 common example given for interfaces. This is where the interface is defined 
 as an API for others to implement and/or use which then enables users to pick 
 and choose the combination of implementations they want to use based on their 
 requirements without needing to change any of the code of either class.

I understand the stated differences between abstract and interface. I can 
cite what the differences are, but I don't see the practical application 
differences. To me there is no difference between an abstract class (without 
method declarations) and an interface.

However, I view an interface as a statement (a contract) where IF you want 
someone to use your code you outline the methods you require them to flesh-out 
in their code  -- but I would like to see a simple example of that.

I vaguely get the logging example given by Larry, but I'm not good at abstract 
thinking -- I need a concrete simple example.

I tried to create a demo where I had a Toaster Class that contained 
breadNumber() and toastSetting() methods and then created an interface so my 
students could use the Toaster, but it didn't really hold up as well as I 
wanted.

So, can anyone give me a simple example where an interface is used so I can 
easily explain why they are important?

Thanks,

tedd


_
tedd.sperl...@gmail.com
http://sperling.com

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



Re: [PHP] A Good OOP Tutorial/Read?

2013-05-17 Thread Matijn Woudt
On Fri, May 17, 2013 at 4:04 PM, Tedd Sperling tedd.sperl...@gmail.comwrote:

 Stuart:

 You said:

  An interface does what it says on the tin: it describes an interface
 that a class can then tell the world it implements.
 
  An abstract class provides functionality as well as an interface
 description. An abstract class cannot be instantiated, it can only be
 extended.
 
  The logging example given by someone earlier in this thread is the most
 common example given for interfaces. This is where the interface is defined
 as an API for others to implement and/or use which then enables users to
 pick and choose the combination of implementations they want to use based
 on their requirements without needing to change any of the code of either
 class.

 I understand the stated differences between abstract and interface. I
 can cite what the differences are, but I don't see the practical
 application differences. To me there is no difference between an abstract
 class (without method declarations) and an interface.

 However, I view an interface as a statement (a contract) where IF you want
 someone to use your code you outline the methods you require them to
 flesh-out in their code  -- but I would like to see a simple example of
 that.

 I vaguely get the logging example given by Larry, but I'm not good at
 abstract thinking -- I need a concrete simple example.

 I tried to create a demo where I had a Toaster Class that contained
 breadNumber() and toastSetting() methods and then created an interface so
 my students could use the Toaster, but it didn't really hold up as well as
 I wanted.

 So, can anyone give me a simple example where an interface is used so I
 can easily explain why they are important?

 Thanks,

 tedd


There are plenty, but they are never required. I see interfaces more as
some kind of documentation in PHP code, they have much more advantages in
other languages (eg. Java).
A good example would be if you build a product that allows plugins to be
used. You would create an interface (which requires the functions init,
execute and finish for example), and state that any plugin should implement
that interface and hese functions.
It's the cleaner way of doing things, but it surely would work the same as
if you didn't use an interface, and just told in your documentation that a
class should have these 3 functions.

- Matijn


Re: [PHP] A Good OOP Tutorial/Read?

2013-05-17 Thread Stuart Dallas
On 17 May 2013, at 15:04, Tedd Sperling tedd.sperl...@gmail.com wrote:

 Stuart:
 
 You said:
 
 An interface does what it says on the tin: it describes an interface that a 
 class can then tell the world it implements.
 
 An abstract class provides functionality as well as an interface 
 description. An abstract class cannot be instantiated, it can only be 
 extended.
 
 The logging example given by someone earlier in this thread is the most 
 common example given for interfaces. This is where the interface is defined 
 as an API for others to implement and/or use which then enables users to 
 pick and choose the combination of implementations they want to use based on 
 their requirements without needing to change any of the code of either class.
 
 I understand the stated differences between abstract and interface. I can 
 cite what the differences are, but I don't see the practical application 
 differences. To me there is no difference between an abstract class (without 
 method declarations) and an interface.

That's true, there is no difference if the abstract class has no method 
declarations. But by the same token, that's the difference. It's a syntactical 
difference rather than a conceptual difference.

 However, I view an interface as a statement (a contract) where IF you want 
 someone to use your code you outline the methods you require them to 
 flesh-out in their code  -- but I would like to see a simple example of that.

That's not what an interface is for. I can see how the word is confusing as 
you can call the API of both an interface and a class (abstract and not) an 
interface, but in this context the word interface means the thing itself, not 
an aspect of the thing. An interface is an interface and does nothing more than 
define the API. An abstract class may also have methods and member variables.

 I vaguely get the logging example given by Larry, but I'm not good at 
 abstract thinking -- I need a concrete simple example.
 
 I tried to create a demo where I had a Toaster Class that contained 
 breadNumber() and toastSetting() methods and then created an interface so my 
 students could use the Toaster, but it didn't really hold up as well as I 
 wanted.
 
 So, can anyone give me a simple example where an interface is used so I can 
 easily explain why they are important?

I've knocked up a quick example of the logger use case: 
https://gist.github.com/3ft9/5599326

Note that if I publish that iLogger interface to others and let them provide 
implementations against it people can use their logging classes with my user 
class without any changes. Yes, this could be accomplished by using abstract 
class instead of interface but then it's more than just an interface that 
I'm publishing.

If you're looking for a reason why interfaces exist when abstract classes can 
accomplish the same task you need to talk to someone more academically minded 
than me. For me, interfaces have their place because they specifically limit 
what you're getting from a third party to an API definition, rather than it 
also containing additional code that should be audited before being used in 
your software.

Your toaster example would work, but I think you need to switch from the large 
object to a smaller aspect for it to make sense. Rather than being able to 
replace the whole toaster from their code, imagine if they wanted to replace a 
module within the toaster that determines the pattern to be burnt on to the 
bread. The Toaster class could optionally take an object that implements 
iToasterPattern which the students could supply to change the pattern burnt. To 
enable them to use that you would provide them with the API to the Toaster 
object so they can talk to it, and the iToasterPattern interface so they can 
provide their own implementation of iToasterPattern.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

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



Re: [PHP] A Good OOP Tutorial/Read?

2013-05-17 Thread Přemysl Fiala
Interfaces...I will add my 2 cents to what was already said.You don't need them, but they improve quality of your code. Your application is easily maintained, improved, understandable, accessible,  more cleaner, modules can be added easily...They implements some behavior (example):interface toastAble{  function toast($bread);}interface talkAble{ function sayHello();}abstract class AToaster implements toastAble{ function toast($bread) {	 $bread-state = STATE_DELICIOUS; }}class TalkingToaster extends AToaster implements talkAble{  function sayHello()  {	  echo "Hello, would you like to toast your bread?";  }}$toaster = new TalkingToaster();$toaster-sayHello();Premek.On Fri, 17 May 2013 16:04:40 +0200, Tedd Sperling tedd.sperl...@gmail.com wrote: Stuart: You said: An interface does what it says on the tin: it describes an interface   that a class can then tell the world it implements. An abstract class provides functionality as well as an interface   description. An abstract class cannot be instantiated, it can only be   extended. The logging example given by someone earlier in this thread is the most   common example given for interfaces. This is where the interface is   defined as an API for others to implement and/or use which then enables   users to pick and choose the combination of implementations they want   to use based on their requirements without needing to change any of the   code of either class. I understand the "stated" differences between abstract and interface. I   can cite what the differences are, but I don't see the practical   application differences. To me there is no difference between an   abstract class (without method declarations) and an interface. However, I view an interface as a statement (a contract) where IF you   want someone to use your code you outline the methods you require them   to flesh-out in their code  -- but I would like to see a simple example   of that. I vaguely get the logging example given by Larry, but I'm not good at   abstract thinking -- I need a concrete simple example. I tried to create a demo where I had a Toaster Class that contained   breadNumber() and toastSetting() methods and then created an interface   so my students could use the Toaster, but it didn't really hold up as   well as I wanted. So, can anyone give me a simple example where an interface is used so I   can easily explain why they are important? Thanks, tedd _ tedd.sperl...@gmail.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] A Good OOP Tutorial/Read?

2013-05-17 Thread David Harkness
On Fri, May 17, 2013 at 7:04 AM, Tedd Sperling tedd.sperl...@gmail.comwrote:

 To me there is no difference between an abstract class (without method
 declarations) and an interface.


The key difference in OO languages that do not allow multiple inheritance
is that you can always add an interface to an existing class but you can
only mix in an abstract class if your class doesn't extend another.

Let's say you want to define the contract for a UserDataAccessObject with
query and CRUD methods. If you make it an abstract class, I cannot
implement that contract using my AbstractMysqlDao base class. With an
interface, I can do

class MysqlUserDao
extends AbstractMysqlDao
implements UserDataAccessObject

Being a dynamic language, PHP allows you to fulfill a contract without
using interfaces at all. You can call findUserByLogin() on any object--even
those that don't declare that interface via __call(). However, you won't be
able to pass your objects to methods that use parameter type hinting. This
is where interfaces really shine, and they become more important as your
project grows in complexity. They are certainly *not* required to make good
use of OOP, especially in PHP/Python/Ruby.

However, I view an interface as a statement (a contract) where IF you want
 someone to use your code you outline the methods you require them to
 flesh-out in their code  -- but I would like to see a simple example of
 that.


Interfaces come in handy when implementing the visitor and observer
patterns. Simple example are always contrived, but here's mine:

interface Engine {
function orderFuel(Store $store);
function setSpeed($mph);
}

class SteamEngine implements Engine {
function orderFuel(Store $store) {
$store-order('coal', 1000, WeightUnit::POUND);
}
function setSpeed($mph) {
if ($mph = 80) {
throw new InvalidArgumentException('Cannot exceed 80mph');
}
$this-loadFuel(...);
}
}

class MrFusion implements Engine {
function orderFuel(Store $store) {
$store-order('aluminum can');
$store-order('banana peel');
}
function setSpeed($mph) {
if ($mph = 88  empty($this-destinationTime)) {
throw new IllegalStateException('Must set desired time
travel destination');
}
$this-adjustThrottle($mph - $this-speed);
}
}

You could make Engine an abstract class, but that would reduce your users'
choice.

David


Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread Francisco C Soares

On 05/16/2013 11:55 AM, Dan Joseph wrote:

Hey Folks,

I'm looking to refine my PHP 5 OOP skills.  I know the basics, understand
patterns, but have clearly missed a few things along the way.

Do any of you have some real good PHP 5 OOP tutorials/reads bookmarked you
could share?  Something other than php.net/oop5.

Try,
Tente,

http://www.killerphp.com/tutorials/object-oriented-php/

Success!
Sucesso!

___
Francisco C Soares ( *Junior* )
403790c89847cdbe5a262146de8fb93139c4

BLOG dotjunior.blogspot.com http://dotjunior.blogspot.com/


Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread Dan Joseph
Thanks!  This looks like a good start.  Covers some things I have questions
on.  I like his approach.

Now I just need something advanced to continue on after this.  I'd like to
learn more about extending, interfaces, abstracts, and why/when they should
be used.

Appreciate it!

-Dan


On Thu, May 16, 2013 at 11:01 AM, Francisco C Soares dotjun...@gmail.comwrote:

  On 05/16/2013 11:55 AM, Dan Joseph wrote:

 Hey Folks,

 I'm looking to refine my PHP 5 OOP skills.  I know the basics, understand
 patterns, but have clearly missed a few things along the way.

 Do any of you have some real good PHP 5 OOP tutorials/reads bookmarked you
 could share?  Something other than php.net/oop5.

  Try,
 Tente,

 http://www.killerphp.com/tutorials/object-oriented-php/

 Success!
 Sucesso!

 ___
 Francisco C Soares ( *Junior* )
 403790c89847cdbe5a262146de8fb93139c4

 BLOG dotjunior.blogspot.com




-- 
-Dan Joseph

http://www.danjoseph.me
http://www.dansrollingbbq.com
http://www.youtube.com/DansRollingBBQ


Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread Tedd Sperling
-Dan:

I teach this stuff and still don't fully understand the why/when for interfaces.

Even the guru's I talk with can't give me a good explanation as to what the 
advantages are in using them. I've done a lot of experimenting and can't see 
any advantage for them other than grouping different classes together and 
creating a new data-tytpe.

Other than that, from my perspective interfaces are mythicode.
 
So, if you find a good reference, please let me know.

Cheers,

tedd


_
tedd.sperl...@gmail.com
http://sperling.com





On May 16, 2013, at 11:11 AM, Dan Joseph dmjos...@gmail.com wrote:

 Thanks!  This looks like a good start.  Covers some things I have questions
 on.  I like his approach.
 
 Now I just need something advanced to continue on after this.  I'd like to
 learn more about extending, interfaces, abstracts, and why/when they should
 be used.
 
 Appreciate it!
 
 -Dan
 
 
 On Thu, May 16, 2013 at 11:01 AM, Francisco C Soares 
 dotjun...@gmail.comwrote:
 
 On 05/16/2013 11:55 AM, Dan Joseph wrote:
 
 Hey Folks,
 
 I'm looking to refine my PHP 5 OOP skills.  I know the basics, understand
 patterns, but have clearly missed a few things along the way.
 
 Do any of you have some real good PHP 5 OOP tutorials/reads bookmarked you
 could share?  Something other than php.net/oop5.
 
 Try,
 Tente,
 
 http://www.killerphp.com/tutorials/object-oriented-php/
 
 Success!
 Sucesso!
 
 ___
 Francisco C Soares ( *Junior* )
 403790c89847cdbe5a262146de8fb93139c4
 
 BLOG dotjunior.blogspot.com
 
 
 
 
 -- 
 -Dan Joseph
 
 http://www.danjoseph.me
 http://www.dansrollingbbq.com
 http://www.youtube.com/DansRollingBBQ


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



Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread Nick Khamis
OO comes from the heart. You know you have it when everything you look at
turn into objects, attributes, accessors, mutators, and constructors.

When IBM transitioned from functional to OO level programming, they had their
top level engineers walk into a room and tell their employees that 80% of their
employes will not be able to make the transition. Which percent are you?


Ninus Khamis (PhD)

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



Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread Sebastian Krebs
2013/5/16 Tedd Sperling tedd.sperl...@gmail.com

 -Dan:

 I teach this stuff and still don't fully understand the why/when for
 interfaces.

 Even the guru's I talk with can't give me a good explanation as to what
 the advantages are in using them. I've done a lot of experimenting and
 can't see any advantage for them other than grouping different classes
 together and creating a new data-tytpe.


An interface is like an contract: It doesn't do anything itself, but every
class, that implements it must follow. This isn't only about the signature
of the methods, but also about the semantics, which is ideally described
directly in the methods comment (DocBlocks). On the other hand the class is
completely free on how it fulfill the contract.

For example: A QueueInterface. It probably defines the signatures for (at
least) enqueue() and dequeue() and their semantics: enqueue()
enqueues an element at the end of the queue and may fail with an
XY-Exception, when the queue is full, deuqeue() dequeues an element from
the front of the queue and throws an Z-Exception, when the queue is empty.
An implementing class is free to implement this on top of a database, or an
array, as well as the class is free to extend it with other methods as it
like.

Of course you could implement it as abstract class, but this leads
(instantly, or later) to a mix between contract and implementation details,
that (by the way) should be up to the implementing class anyway.

Now that you have one, or more classes implementing that interface you can
type hint against this contract and only against this one, because it is
better to always hint against the most-simple type the methods requires. In
this example this means: I, the method x(), expect a queue and I am
completely uninterested in how it is implemented, or what other features it
provides, because I don't use them anyway. Now you can give me a
database-cursor, or a wrapped array as long as they _behave_ like a queue
(-- implementing that interface).

As a side effect: Sometimes it is more fail-safe, because if you change
signatures, or add methods, you'll face the errors from wrongly implemented
classes instantly ;)

Oh: And you are not forced to extend a class :) Lets say I have a
Comparable-interface and a User-Class. Would Comparable be a class, I
have to extend it, which makes it impossible to extend any other class and
also the semantic is wrong: A User _behaves_ like a Comparable, but it
_is not_ a Comparable. (For me implementing an interface is usually more
a behaves like, looks like, or provides, whereas extending a class is
directly a is a-relationship).

This said, the difference between an interface and an abstract class is
mostly in the head: An abstract class is in my opinion never such a strict
contract, like an interface, especially because you can always leave the
contract-only-restriction by implementing something into the class, what
is then directly inherited by the subclasses.


My 2 cent :) But for me this idea works quite fine :D

Regards,
Sebastian




 Other than that, from my perspective interfaces are mythicode.

 So, if you find a good reference, please let me know.

 Cheers,

 tedd


 _
 tedd.sperl...@gmail.com
 http://sperling.com





 On May 16, 2013, at 11:11 AM, Dan Joseph dmjos...@gmail.com wrote:

  Thanks!  This looks like a good start.  Covers some things I have
 questions
  on.  I like his approach.
 
  Now I just need something advanced to continue on after this.  I'd like
 to
  learn more about extending, interfaces, abstracts, and why/when they
 should
  be used.
 
  Appreciate it!
 
  -Dan
 
 
  On Thu, May 16, 2013 at 11:01 AM, Francisco C Soares 
 dotjun...@gmail.comwrote:
 
  On 05/16/2013 11:55 AM, Dan Joseph wrote:
 
  Hey Folks,
 
  I'm looking to refine my PHP 5 OOP skills.  I know the basics,
 understand
  patterns, but have clearly missed a few things along the way.
 
  Do any of you have some real good PHP 5 OOP tutorials/reads bookmarked
 you
  could share?  Something other than php.net/oop5.
 
  Try,
  Tente,
 
  http://www.killerphp.com/tutorials/object-oriented-php/
 
  Success!
  Sucesso!
 
  ___
  Francisco C Soares ( *Junior* )
  403790c89847cdbe5a262146de8fb93139c4
 
  BLOG dotjunior.blogspot.com
 
 
 
 
  --
  -Dan Joseph
 
  http://www.danjoseph.me
  http://www.dansrollingbbq.com
  http://www.youtube.com/DansRollingBBQ


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




-- 
github.com/KingCrunch


Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread Bastien


Bastien Koert

On 2013-05-16, at 5:28 PM, Tedd Sperling tedd.sperl...@gmail.com wrote:

 -Dan:
 
 I teach this stuff and still don't fully understand the why/when for 
 interfaces.
 
 Even the guru's I talk with can't give me a good explanation as to what the 
 advantages are in using them. I've done a lot of experimenting and can't see 
 any advantage for them other than grouping different classes together and 
 creating a new data-tytpe.
 
 Other than that, from my perspective interfaces are mythicode.
 
 So, if you find a good reference, please let me know.
 
 Cheers,
 
 tedd
 
 
 _
 

Tedd,

The best argument I've seen for interfaces is to abstract calling classes to 
avoid binding to a particular framework. Phpmaster was where I saw that.

The idea was that by implementing an interface, the swapping out a framework 
was much simpler since the only code that needed to be written was more the 
interface adapter to the new framework

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



Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread Tedd Sperling
Thanks to both Bastien and Sebastian:

While I understand that an interface is like an abstract Class, in that you 
don't have to flesh-out your methods, but rather where you define exactly how 
Classes who implement that interface will be required to flesh-out those 
methods. But so what? What's the point?

Without giving me complicated examples, just give me one simple example that 
illustrates the advantage of using an interface over writing a new Class where 
you flesh-out whatever methods you want. After all, an interface requires the 
same thing, does it not? 

As such, I just don't see the advantage interfaces bring.

Cheers,

tedd


_
tedd.sperl...@gmail.com
http://sperling.com



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



Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread Nick Khamis
interface Shape {
 public double getArea();
}

class Circle implements Shape {
  double radius;
  public Circle(int double radius) {
this.radius = radius;
  }

  public double getArea() {
return (radius * radius * 3.1415);
  }

}

class Square implements Shape {
  double side;

  public Square(int double side) {
this.side = side;
  }

  double getArea() {
return (side * side);
  }
}


Please make an effort to understand polymorphic concepts of OOP as
they are rudimentary. Without that one will never grasp OO Patterns
(Gang of Four).

Ninus.

On 5/16/13, Tedd Sperling tedd.sperl...@gmail.com wrote:
 Thanks to both Bastien and Sebastian:

 While I understand that an interface is like an abstract Class, in that you
 don't have to flesh-out your methods, but rather where you define exactly
 how Classes who implement that interface will be required to flesh-out those
 methods. But so what? What's the point?

 Without giving me complicated examples, just give me one simple example that
 illustrates the advantage of using an interface over writing a new Class
 where you flesh-out whatever methods you want. After all, an interface
 requires the same thing, does it not?

 As such, I just don't see the advantage interfaces bring.

 Cheers,

 tedd


 _
 tedd.sperl...@gmail.com
 http://sperling.com



 --
 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] A Good OOP Tutorial/Read?

2013-05-16 Thread Larry Garfield

On 05/16/2013 06:45 PM, Tedd Sperling wrote:

Thanks to both Bastien and Sebastian:

While I understand that an interface is like an abstract Class, in that you 
don't have to flesh-out your methods, but rather where you define exactly how 
Classes who implement that interface will be required to flesh-out those 
methods. But so what? What's the point?

Without giving me complicated examples, just give me one simple example that 
illustrates the advantage of using an interface over writing a new Class where 
you flesh-out whatever methods you want. After all, an interface requires the 
same thing, does it not?

As such, I just don't see the advantage interfaces bring.

Cheers,

tedd


Practical example, PSR-3:

https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md

Say you're writing a stand-alone library, maybe a Twitter-connecting 
library.  You want to be able to log stuff, but don't want to have to 
deal with opening log files yourself.  You also want to allow your 
library to be used by people running Symfony, Code Igniter, Drupal, Zend 
Framework, or PHPBB, all of which have their own logging systems in 
place that may talk to syslog, a database, files on disk, or whatever.  
People using those frameworks don't want your library spewing log files 
all over their file system.


Instead, you simply support the PSR-3 logging interface.  You accept an 
object that implements that interface in your constructor, and then 
write to it.  What happens on the other side?  Who gives a damn!


For your own testing, you can write a simple class that implements that 
interface and dumps log messages to disk.


When someone uses your library with Symfony, they just pass in a Monolog 
object (the logging system used by Symfony), and your code is now 
logging errors to whatever they have Monolog configured to do.


When someone uses your library with Drupal, they just pass in the Drupal 
Watchog logger object (which is being rewritten to use PSR-3 as we 
speak), and now your library is logging errors to Drupal's logging 
system (which could be syslog or a DB table, depending on how the user 
has their site configured).


And you don't give a damn about any of that.  All you care about is that 
you support any object that matches this interface.  What that object 
does with the messages you send it, and where that object came from, you 
don't have to give a crap about.


Now take that same concept and apply it at a smaller scale, within your 
own project.  Swap out your database-based cache system for a 
memcache-based one.  Your code doesn't change, because it's writing to 
an interface, not to the database.  Swap out your data store with one 
that is used just for testing.  Etc.


That's what interfaces give you.  Loose coupling, and the ability to 
divide-and-conquer... and even let someone else solve problems for you. :-)


--Larry Garfield

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



Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread Dan Joseph
Hey Guys,

Thanks for all this good information so far.  I'll keep you posted on my
edumacation!

-Dan


On Thu, May 16, 2013 at 11:16 PM, Larry Garfield la...@garfieldtech.comwrote:

 On 05/16/2013 06:45 PM, Tedd Sperling wrote:

 Thanks to both Bastien and Sebastian:

 While I understand that an interface is like an abstract Class, in that
 you don't have to flesh-out your methods, but rather where you define
 exactly how Classes who implement that interface will be required to
 flesh-out those methods. But so what? What's the point?

 Without giving me complicated examples, just give me one simple example
 that illustrates the advantage of using an interface over writing a new
 Class where you flesh-out whatever methods you want. After all, an
 interface requires the same thing, does it not?

 As such, I just don't see the advantage interfaces bring.

 Cheers,

 tedd


 Practical example, PSR-3:

 https://github.com/php-fig/**fig-standards/blob/master/**
 accepted/PSR-3-logger-**interface.mdhttps://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md

 Say you're writing a stand-alone library, maybe a Twitter-connecting
 library.  You want to be able to log stuff, but don't want to have to deal
 with opening log files yourself.  You also want to allow your library to be
 used by people running Symfony, Code Igniter, Drupal, Zend Framework, or
 PHPBB, all of which have their own logging systems in place that may talk
 to syslog, a database, files on disk, or whatever.  People using those
 frameworks don't want your library spewing log files all over their file
 system.

 Instead, you simply support the PSR-3 logging interface.  You accept an
 object that implements that interface in your constructor, and then write
 to it.  What happens on the other side?  Who gives a damn!

 For your own testing, you can write a simple class that implements that
 interface and dumps log messages to disk.

 When someone uses your library with Symfony, they just pass in a Monolog
 object (the logging system used by Symfony), and your code is now logging
 errors to whatever they have Monolog configured to do.

 When someone uses your library with Drupal, they just pass in the Drupal
 Watchog logger object (which is being rewritten to use PSR-3 as we speak),
 and now your library is logging errors to Drupal's logging system (which
 could be syslog or a DB table, depending on how the user has their site
 configured).

 And you don't give a damn about any of that.  All you care about is that
 you support any object that matches this interface.  What that object
 does with the messages you send it, and where that object came from, you
 don't have to give a crap about.

 Now take that same concept and apply it at a smaller scale, within your
 own project.  Swap out your database-based cache system for a
 memcache-based one.  Your code doesn't change, because it's writing to an
 interface, not to the database.  Swap out your data store with one that is
 used just for testing.  Etc.

 That's what interfaces give you.  Loose coupling, and the ability to
 divide-and-conquer... and even let someone else solve problems for you. :-)

 --Larry Garfield


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




-- 
-Dan Joseph

http://www.danjoseph.me
http://www.dansrollingbbq.com
http://www.youtube.com/DansRollingBBQ


Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread tamouse mailing lists
Back to the OP's request, Ken Pugh's Interface Oriented Design goes quite
a long way in describing OO* and directly to the heart of why interfaces
make so much sense as a way of designing your code. It does not show PHP
examples, it tries to remain agnostic to language.


Re: [PHP] some good deals on good books

2012-03-31 Thread Tommy Pham
On Sat, Mar 31, 2012 at 12:02 AM, tamouse mailing lists
tamouse.li...@gmail.com wrote:

 ( I apologize if this offends anyone's sensibilities. I am not in the
 employ of O'Reilly, nor is this going to make me any scratch. I just
 think this is a good chance to pick up some pretty useful books. )


Makes a lot of sense to me for someone kind enough to share a great
offer to fellow coders/hackers :)

Thanks.  I'll pass this along to the folks newly interested in PHP.

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



Re: [PHP] some good deals on good books

2012-03-31 Thread Daniel Brown
On Sat, Mar 31, 2012 at 03:02, tamouse mailing lists
tamouse.li...@gmail.com wrote:
 I know there are quite a few people here who are just beginning to
 learn how to write programs as they also learn about PHP. O'Reilly has
 a deal on some pretty important books available electronically, save
 50%. If this appeals to you, head to 
 http://shop.oreilly.com/category/deals/essential-code.do  and check
 them out.

 ( I apologize if this offends anyone's sensibilities. I am not in the
 employ of O'Reilly, nor is this going to make me any scratch. I just
 think this is a good chance to pick up some pretty useful books. )

There was no affiliate code, so it doesn't appear as though there
was any ulterior motive.  As such, if anyone is offended, perhaps they
don't quite possess sensibilities.  ;-P

The link you provided will also benefit a lot who read the list
via numerous external sources, such as forums that auto-populate with
content from these lists, and the archives, which are slurped by
Google so quickly that, on occasion, I've seen posts show up in Google
before I even get the chance to read the original email.

Great job on a thoughtful post.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] PDO: good, popular?

2010-12-15 Thread Nicholas Kell

On Dec 14, 2010, at 5:45 PM, Govinda wrote:

 In previous experience with questions such as these, you will get
 several types of individual responses to usages of the software. Some
 good, some bad, depending on the experience level of the commenter
 with both the language and the code in question.
 
 It's a combination of your current understanding of php and the
 associated usages of other languages, and what you want to know.
 
 Don't trust what people say, trust what feels right at the current
 time of your usage of the php library available/your experience level,
 and what you currently know how to use.
 
 From my experience with several languages, once you know the basics,
 even if you do re-invent the 'wheel', so did firestone,michelin, and
 goodyear, and they're not complaining. And you'll feel better for
 reinventing, than using someone elses.
 
 
 I think this ^^^ advice is brilliant, understated; nothing replaces 
 integration of one's own thorough understanding.
 
 
 Govinda
 govinda(DOT)webdnatalk(AT)gmail(DOT)com

@the OP

I absolutely agree.

One-thousand people will miraculously come up with two-thousand opinions on PDO 
and similar tools. PDO is only one of many, many tools in your toolbox.

At the end of the day - get ahold of PDO, mess around with it a bit, read some 
docs, etc.. See what you can do with it, then see if it was worth the learning 
curve and how you can leverage your newly found knowledge on your next project. 
Then, drop it like it's hot when you don't need it. No need to jam a square peg 
in a round hole. Whip out your pocket knife and make a round peg for a nice 
snug fit. After all, that's why you carry a pocket knife - right?


If it feels good - do it.

Re: [PHP] PDO: good, popular?

2010-12-14 Thread David Hutto
On Tue, Dec 14, 2010 at 6:10 AM, Sam Smith a...@itab.com wrote:
 Searching for PHP CRUD in hopes of learning the best way to access
 databases and to use PEAR or what I came across PDO.

 I want to know the communities opinion of PDO: everyone uses it or no one
 uses it or it's great or what?

In previous experience with questions such as these, you will get
several types of individual responses to usages of the software. Some
good, some bad, depending on the experience level of the commenter
with both the language and the code in question.

It's a combination of your current understanding of php and the
associated usages of other languages, and what you want to know.

Don't trust what people say, trust what feels right at the current
time of your usage of the php library available/your experience level,
and what you currently know how to use.

From my experience with several languages, once you know the basics,
even if you do re-invent the 'wheel', so did firestone,michelin, and
goodyear, and they're not complaining. And you'll feel better for
reinventing, than using someone elses.



 Thanks


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



Re: [PHP] PDO: good, popular?

2010-12-14 Thread Richard Quadling
On 14 December 2010 11:10, Sam Smith a...@itab.com wrote:
 Searching for PHP CRUD in hopes of learning the best way to access
 databases and to use PEAR or what I came across PDO.

 I want to know the communities opinion of PDO: everyone uses it or no one
 uses it or it's great or what?

 Thanks


If you are developing code for a single database and you are really,
really sure you're not going to ever use another DB, then maybe PDO is
an unnecessary layer.

If you are developing code which has to remain compatible across
multiple DBs, then PDO would, on the surface, seem like a good idea.
The downside though is that PDO still requires DB specific drivers.

I only work on 1 DB (MS SQL). So, I don't use PDO.

From http://docs.php.net/manual/en/intro.pdo.php :

PDO provides a data-access abstraction layer, which means that,
regardless of which database you're using, you use the same functions
to issue queries and fetch data. PDO does not provide a database
abstraction; it doesn't rewrite SQL or emulate missing features. You
should use a full-blown abstraction layer if you need that facility.

Richard.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] PDO: good, popular?

2010-12-14 Thread David Hutto
In other words, in ten years from now, even the advisors you get today
will rethink their answers with 20/20/hindsight, and not think about
your ignorance of technology, but their own.

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



Re: [PHP] PDO: good, popular?

2010-12-14 Thread Richard Quadling
On 14 December 2010 15:45, David Hutto smokefl...@gmail.com wrote:
 From my experience with several languages, once you know the basics,
 even if you do re-invent the 'wheel', so did firestone,michelin, and
 goodyear, and they're not complaining. And you'll feel better for
 reinventing, than using someone elses.

Strange that you should mention those tyre manufacturers. I work for a
tyre remoulder. We take their dead tyres and remake them into high
quality remoulds. The majority of all food delivered in the UK run on
our tyres!

Essentially, we are recycling. Looking to the future and all that.

If you can recycle others code into new and interesting ways, then go for it.

Richard.


-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP] PDO: good, popular?

2010-12-14 Thread la...@garfieldtech.com
I'm the DB maintainer for Drupal 7, and we rebuilt our entire DB layer 
on top of PDO.  It's a rather nice API, although as others have noted it 
does not abstract away SQL entirely; it abstracts the API calls you need 
to use to get to SQL.


We then built a layer on top of that which does abstract away most 
database weirdness using fluent query builders.  It's much 
lighter-weight than an ORM.  I'm in the process of spinning it off as a 
stand-alone library because we think it's that cool, but it's not 
completely divorced from Drupal yet.  Stay tuned. :-)


But yes, PDO is nice.

--Larry Garfield

On 12/14/10 5:10 AM, Sam Smith wrote:

Searching for PHP CRUD in hopes of learning the best way to access
databases and to use PEAR or what I came across PDO.

I want to know the communities opinion of PDO: everyone uses it or no one
uses it or it's great or what?

Thanks



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



Re: [PHP] PDO: good, popular?

2010-12-14 Thread Adam Richardson
On Tue, Dec 14, 2010 at 6:10 AM, Sam Smith a...@itab.com wrote:

 Searching for PHP CRUD in hopes of learning the best way to access
 databases and to use PEAR or what I came across PDO.

 I want to know the communities opinion of PDO: everyone uses it or no one
 uses it or it's great or what?

 Thanks


I like working with PDO.  I use a very thin set of wrapper functions to
automatically grab the connection information from a config file, cause
errors to be thrown as exceptions, and make sure the results are formatted
as arrays.  It works very well and relatively fast.

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com


Re: [PHP] PDO: good, popular?

2010-12-14 Thread Lester Caine

la...@garfieldtech.com wrote:

I'm the DB maintainer for Drupal 7, and we rebuilt our entire DB layer
on top of PDO.  It's a rather nice API, although as others have noted it
does not abstract away SQL entirely; it abstracts the API calls you need
to use to get to SQL.

We then built a layer on top of that which does abstract away most
database weirdness using fluent query builders.  It's much
lighter-weight than an ORM.  I'm in the process of spinning it off as a
stand-alone library because we think it's that cool, but it's not
completely divorced from Drupal yet.  Stay tuned. :-)


Larry - how many databases does it actually work with? Having rebuilt the DB 
layer using PDO did you actually gain anything?


Sam - The situation on database abstraction is not clear cut and a lot of 
tangents have been generated while the traditional approaches are still the best 
in many cases.


As has been said ... if you only intend to use on database, then use the 
matching driver and work the SQL in a manor that works for you with that database.


If you need a full range of databases supported, then ADOdb is STILL the best 
option, and will quite happily use a PDO or generic driver internally depending 
on your choice, but which ever you use ( and the generic ones still tend to be 
faster especially with the accelerator package ) the abstraction of the SQL is 
much more important then simply managing a few data conversions. ADOdb will 
build tables across the whole range of databases it supports from a single 
'profile', while PDO needs a lot of help to do the same, preferring instead to 
have separate 'profiles' for each database each hand coded.


PDO still needs a number of areas finishing before it can become a total 
replacement for the legacy stuff that is available such as the PEAR libraries 
and the likes of Drupal writing their own abstraction layer on top of it ... 
along with a number of other projects who are now doing the same thing ... shows 
that PDO is not creating the common platform it was supposed to :(


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] PDO: good, popular?

2010-12-14 Thread Govinda

In previous experience with questions such as these, you will get
several types of individual responses to usages of the software. Some
good, some bad, depending on the experience level of the commenter
with both the language and the code in question.

It's a combination of your current understanding of php and the
associated usages of other languages, and what you want to know.

Don't trust what people say, trust what feels right at the current
time of your usage of the php library available/your experience level,
and what you currently know how to use.

From my experience with several languages, once you know the basics,
even if you do re-invent the 'wheel', so did firestone,michelin, and
goodyear, and they're not complaining. And you'll feel better for
reinventing, than using someone elses.



I think this ^^^ advice is brilliant, understated; nothing replaces  
integration of one's own thorough understanding.



Govinda
govinda(DOT)webdnatalk(AT)gmail(DOT)com


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



Re: [PHP] PDO: good, popular?

2010-12-14 Thread Paul M Foster
On Tue, Dec 14, 2010 at 03:10:56AM -0800, Sam Smith wrote:

 Searching for PHP CRUD in hopes of learning the best way to access
 databases and to use PEAR or what I came across PDO.
 
 I want to know the communities opinion of PDO: everyone uses it or no one
 uses it or it's great or what?

I use PDO within a class which handles various housekeeping (error
handling etc.) for everything. PDO handles all the popular RDBMSes (as
far as I know). It can also sanitize queries to avoid SQL injection.
Simple interface. It's also part of PHP, meaning it's well tested and
solid.

Paul

-- 
Paul M. Foster

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



Re: [PHP] PDO: good, popular?

2010-12-14 Thread Larry Garfield
On Tuesday, December 14, 2010 1:02:33 pm Lester Caine wrote:
 la...@garfieldtech.com wrote:
  I'm the DB maintainer for Drupal 7, and we rebuilt our entire DB layer
  on top of PDO.  It's a rather nice API, although as others have noted it
  does not abstract away SQL entirely; it abstracts the API calls you need
  to use to get to SQL.
  
  We then built a layer on top of that which does abstract away most
  database weirdness using fluent query builders.  It's much
  lighter-weight than an ORM.  I'm in the process of spinning it off as a
  stand-alone library because we think it's that cool, but it's not
  completely divorced from Drupal yet.  Stay tuned. :-)
 
 Larry - how many databases does it actually work with? Having rebuilt the
 DB layer using PDO did you actually gain anything?

Drupal 6 and earlier supported MySQL and, kinda sorta, Postgres, maybe.

Drupal 7 ships with support for MySQL, Postgres, and SQLite out of the box and 
add-on modules provide support for Oracle and MS SQL, within reason.  So we 
increased our DB support from 1.5 to 5, essentially.

We also gained, as part of the rewrite, untyped prepared statements, 
transactions, and master/slave support (although that's nothing to do with PDO 
per se, just our layer on top of it).  And that allowed us, in turn, to build 
type-safe query builders, support for MERGE queries, and all kinds of other 
fun stuff on top of that.

 PDO still needs a number of areas finishing before it can become a total
 replacement for the legacy stuff that is available such as the PEAR
 libraries and the likes of Drupal writing their own abstraction layer on
 top of it ... along with a number of other projects who are now doing the
 same thing ... shows that PDO is not creating the common platform it was
 supposed to :(

That is, sadly, true.  PDO is not a complete and perfect DB library, in part 
because there are few people who work on it, and fewer still who understand 
all of the vendor-specific issues at hand and the vendors have been very slow 
to lend a hand, preferring to work on proprietary APIs.  It's quite 
unfortunate, but I still consider PDO an overall win.

If anyone knows C and wants to make a name for themselves in the PHP world, 
PDO is looking for some heroes. :-)

--Larry Garfield

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



Re: [PHP] How good is IIS for hosting PHP? Can I get stuff like mod_rewrite rules, op-code caching, etc.?

2010-11-19 Thread Aman Singh
Check out
http://learn.iis.net/page.aspx/773/how-to-install-the-microsoft-web-platform-for-php
?WT.mc_id=soc-c-in-loc--cfp/
Also mod_rewrite is possible:
http://learn.iis.net/page.aspx/470/importing-apache-modrewrite-rules?WT.mc_id=soc-c-in-loc--cfp.

Ditto for caching: http://www.iis.net/download/wincacheforphp

On Sat, Nov 20, 2010 at 11:45 AM, lavanya pandita
lavanyapand...@gmail.comwrote:

 How good is IIS for hosting PHP? Can I get stuff like mod_rewrite rules,
 op-code caching, etc.?



RE: [PHP] is ?= good?

2010-06-14 Thread Daevid Vincent
 -Original Message-
 From: Paul M Foster [mailto:pa...@quillandmouse.com] 
 Sent: Saturday, June 12, 2010 10:40 PM
 
 this in PHP. I can convert from '.' to '+' (as in most 
 languages) in my
 mind, but embedding variables in strings was a harder habit 
 to break. My
 opinion is that the dot operator used this way was a mistake for
 PHP. Not using the dot operator to mean concatenate would mean we
 could use it to replace the accursed '-' for class/method selection.
 And the plus operator is obviously a more natural fit for string
 concatenation.
 
 And yes, if you're going to use the dot operator, surround it with
 spaces for readability.

Ironically, I believe that in the old days of PHP/FI the + was used
instead of . -- to their defense, OOP wasn't even around then and so no
precedent had been set for the . and I think they wanted to avoid
confusion with actual addition. I just remember having to go through and
re-work a bunch of code that broke b/c of this change.

But yes, I agree with you there. + should have stayed as the concat AND
addition, just like in JavaScript and other languages, and . should have
been used instead of -

All of this I think could have been done AND maintain backwards
compatability with the use of some php.ini directives. Alternatively, I bet
some fancy regex scripts could also have been written that would migrate
old code to new code styles (I think the python guys did this for
print)

*sigh*. It is what it is now. Ain't no going back from here. Like it or
lump it as they say.


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



RE: [PHP] is ?= good?

2010-06-12 Thread tedd

At 5:28 PM -0700 6/11/10, Daevid Vincent wrote:

  -Original Message-
  From: Ahmed Mohsen [mailto:mre...@gmail.com]
 

 Hey Daevid, does this form ?php echo 'The answer is '.$answer; ?
 improve anything in processing time or it's just for the sake of
 readability?


Technically it does have a microscopic speed increase, but unless you're
pumping out hundreds or thousands of lines (like in a loop) you most likely
won't notice it. In my code, I always try to use the proper quote marks
because I *am* dealing with huge tables of data. I've said this a hundred
times before, if you can shave off 0.001 from each row, then after 1,000
rows, you've shaved 1 second off the page time. That seems small, but that
shit adds up. Caching will help, as the page is already parsed once, so PHP
doesn't have to do the work again in many cases. To me, it's a good habbit
and costs you nothing to do.

The difference is that with  the PHP engine has to pre-process the string
and look to see if there's anything interesting it needs to do -- such as
replace any $var with their equivalents or \n or whatever else. A ' means
to use it as is, so PHP just spits it back out.


In my test comparing:

   $a = 'The answer is ' .$answer;

vs:

   $a = The answer is $answer;

I ran numerous test using 10,000,000 (10 million) operations each and 
the results never exceed 1/2 of a second difference, usually around 
1/3 of a second.


I realize that servers and conditions can change the results, but 
these results are what my server produced. I also realize there can 
be special conditions where one should consider speed, but seldom is 
the case where one needs to be concerned about pre-processing a 
string. The likelihood that it will present a problem is extremely 
remote. And these results are with today's speeds -- the difference 
will be less tomorrow and an order of magnitude less in a couple of 
years, or less.


I guess that what I am trying to say is pick considerations that are 
significant enough to have real merit. If you can show that your 
solution can be significantly improved by doing something a certain 
way, then more power to you. However, simply saying one way is better 
because it is faster, or uses less memory, doesn't carry the weight 
it once did. For example, it would have been nice if the net had been 
based on 8-bit instead of 7-bit, but the people who developed ASCII 
were concerned about memory. They were right for what they considered 
important at their time, but those concerns created a larger problem 
for the industry that followed. The significants of concerns change 
over time and not realizing that can create problems later.


Cheers,

tedd

--
---
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] is ?= good?

2010-06-12 Thread Paul M Foster
On Fri, Jun 11, 2010 at 05:29:50PM -0400, tedd wrote:

snip

 As for the Python print problem, I don't do Python -- so, it can
 win the lottery, or die, I don't care.

The issue, as I recall, is that for Python 3, they are changing print
(without parentheses) to require parentheses. This change alone (and
there are others like this in Python 3) will necessitate a *lot* of code
rewrites. Sometimes I wonder about Guido van Rossum.


 As for don't embed a variable into a literal string and use
 preprocessing, as I said above, I often do this:

 ?php echo(The answer is $answer);?

 and find no problems whatsoever in doing so.

 However, I wouldn't do this:

 ?php echo 'The answer is '.$answer; ?

 OR, I would place a space before/after the . (i.e., 'The answer is '
 . $answer). However, I don't like doing that because I also program
 in other languages, which use the dot operator differently.

I tend to do it the way Tedd does, but I'm rethinking this. I recently
had occasion to do a lot of programming in C and Python, and one thing
stood out at me: I can't recall another language which allows
interpolation of variables within strings (without significant diddling,
if at all). It caused me great difficulty because I'm so used to doing
this in PHP. I can convert from '.' to '+' (as in most languages) in my
mind, but embedding variables in strings was a harder habit to break. My
opinion is that the dot operator used this way was a mistake for
PHP. Not using the dot operator to mean concatenate would mean we
could use it to replace the accursed '-' for class/method selection.
And the plus operator is obviously a more natural fit for string
concatenation.

And yes, if you're going to use the dot operator, surround it with
spaces for readability.

Paul

-- 
Paul M. Foster

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



RE: [PHP] is ?= good?

2010-06-11 Thread Daevid Vincent
 -Original Message-
 From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
 
 ...as those tags only work when short_tags are turned on, which
 itself causes problems with outputting XML from PHP. 

Can you elaborate on this Ashley?

I use short tags and I output XML all the time. In fact I'm knee deep in
building an API right now for Panasonic Avionics that is all XML based. We
have hundreds of airplanes hitting the API, sending XML and getting XML
back -- all via LAMP. I'm also simultaneously doing some cURL JSON-RPC
bi-directional communication.

This is the second XML API I've written for enterprise level service. I
have no problems at all.

I call poppycock. This sounds like FUD to me. ;-)

D.


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



Re: [PHP] is ?= good?

2010-06-11 Thread Robert Cummings



Daevid Vincent wrote:

-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 


...as those tags only work when short_tags are turned on, which
itself causes problems with outputting XML from PHP. 


Can you elaborate on this Ashley?

I use short tags and I output XML all the time. In fact I'm knee deep in
building an API right now for Panasonic Avionics that is all XML based. We
have hundreds of airplanes hitting the API, sending XML and getting XML
back -- all via LAMP. I'm also simultaneously doing some cURL JSON-RPC
bi-directional communication.

This is the second XML API I've written for enterprise level service. I
have no problems at all.

I call poppycock. This sounds like FUD to me. ;-)


It's called a standard:

http://www.w3.org/TR/REC-xml/#sec-pi

A processing instruction without a target is incorrect. What should 
process the data if there is no target? The assumption of PHP when no 
target is declared is not part of the standard. Just because you've done 
two anecdotal enterprise projects and haven't had a problem, doesn't 
make it right.


Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

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



Re: [PHP] is ?= good?

2010-06-11 Thread Robert Cummings

Robert Cummings wrote:


Daevid Vincent wrote:

-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 


...as those tags only work when short_tags are turned on, which
itself causes problems with outputting XML from PHP. 

Can you elaborate on this Ashley?

I use short tags and I output XML all the time. In fact I'm knee deep in
building an API right now for Panasonic Avionics that is all XML based. We
have hundreds of airplanes hitting the API, sending XML and getting XML
back -- all via LAMP. I'm also simultaneously doing some cURL JSON-RPC
bi-directional communication.

This is the second XML API I've written for enterprise level service. I
have no problems at all.

I call poppycock. This sounds like FUD to me. ;-)


It's called a standard:

 http://www.w3.org/TR/REC-xml/#sec-pi

A processing instruction without a target is incorrect. What should 
process the data if there is no target? The assumption of PHP when no 
target is declared is not part of the standard. Just because you've done 
two anecdotal enterprise projects and haven't had a problem, doesn't 
make it right.


I spoke too fast, I thought we were talking about ? and not ?=
The latter is questionable since technically the = could be considered a 
processing character (at least from what I read in the spec. Perhaps it 
is ambiguous though with other languages.


Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

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



Re: [PHP] is ?= good?

2010-06-11 Thread Robert Cummings

Robert Cummings wrote:

Robert Cummings wrote:

Daevid Vincent wrote:

-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 


...as those tags only work when short_tags are turned on, which
itself causes problems with outputting XML from PHP. 

Can you elaborate on this Ashley?

I use short tags and I output XML all the time. In fact I'm knee deep in
building an API right now for Panasonic Avionics that is all XML based. We
have hundreds of airplanes hitting the API, sending XML and getting XML
back -- all via LAMP. I'm also simultaneously doing some cURL JSON-RPC
bi-directional communication.

This is the second XML API I've written for enterprise level service. I
have no problems at all.

I call poppycock. This sounds like FUD to me. ;-)

It's called a standard:

 http://www.w3.org/TR/REC-xml/#sec-pi

A processing instruction without a target is incorrect. What should 
process the data if there is no target? The assumption of PHP when no 
target is declared is not part of the standard. Just because you've done 
two anecdotal enterprise projects and haven't had a problem, doesn't 
make it right.


I spoke too fast, I thought we were talking about ? and not ?=
The latter is questionable since technically the = could be considered a 
processing character (at least from what I read in the spec. Perhaps it 
is ambiguous though with other languages.


And on further reading I'm pretty sure the = character does not fall 
into the allowed caracters for a PITarget:


http://www.w3.org/TR/REC-xml/#NT-PITarget

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

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



RE: [PHP] is ?= good?

2010-06-11 Thread Ashley Sheridan
On Fri, 2010-06-11 at 10:40 -0700, Daevid Vincent wrote:

  -Original Message-
  From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
  
  ...as those tags only work when short_tags are turned on, which
  itself causes problems with outputting XML from PHP. 
 
 Can you elaborate on this Ashley?
 
 I use short tags and I output XML all the time. In fact I'm knee deep in
 building an API right now for Panasonic Avionics that is all XML based. We
 have hundreds of airplanes hitting the API, sending XML and getting XML
 back -- all via LAMP. I'm also simultaneously doing some cURL JSON-RPC
 bi-directional communication.
 
 This is the second XML API I've written for enterprise level service. I
 have no problems at all.
 
 I call poppycock. This sounds like FUD to me. ;-)
 
 D.
 
 


For ?= to work, the short_tags setting needs to be turned on I believe,
which can cause issues when outputting the XML declaration line unless
it's broken into two parts, which is messier than '?php echo' IMHO.

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




Re: [PHP] is ?= good?

2010-06-11 Thread tedd

At 1:34 AM +0300 6/11/10, Ahmed Mohsen wrote:
I know that i should use the full open tag in php ?php ? but i 
want to know if its good to use this tag ?=$name? instead of ?php 
echo $name ?


Ahmed:

In many cases it boils down to an individual preference. I am sure 
you will find programmers on both sides and in the middle of this 
argument. Some saying they never use it, others saying that they 
always use it, and still others saying It depends -- meaning they 
use it in certain cases.


I believe, just because it can be done doesn't mean that it should be done.

My practice is *never* to use ?=

In fact, my practice is to not only use ?php echo, but to enclose 
the echo argument with a (), like:


?php echo(The answer is $answer);?

I am sure there will be some that think that my practice is an 
overkill, or not good practice, but it's a good thing that we all 
have a choice. Make your choice to best serve how you want your code 
to look.


Cheers,

tedd

--
---
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] is ?= good?

2010-06-11 Thread tedd

At 5:53 PM -0700 6/10/10, Daevid Vincent wrote:

I use them ALL the time. MUCH cleaner IMHO than the alternatives.

And *IF* someday it is ever depricated, it's trival to:

 s/?=/? echo/g

Don't let 'em scare ya!



 s/?=/?php echo/g

Cheers,

tedd
--
---
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] is ?= good?

2010-06-11 Thread David Harkness
On Fri, Jun 11, 2010 at 11:16 AM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:

 For ?= to work, the short_tags setting needs to be turned on I believe,
 which can cause issues when outputting the XML declaration line unless
 it's broken into two parts, which is messier than '?php echo' IMHO.


Can you give an example of how this breaks? I don't see any problems with

?= '?xml blah blah ?' ?

unless you are trying to validate your PHP script as XML. Given that PHP is
*not* XML I don't know why you'd want to do that. But I've seen this
argument a few times while looking into this issue so maybe I'm just not
seeing the big picture.

David


RE: [PHP] is ?= good?

2010-06-11 Thread Daevid Vincent
 -Original Message-
 From: tedd [mailto:tedd.sperl...@gmail.com] 

 I believe, just because it can be done doesn't mean that it 
 should be done.
 
 My practice is *never* to use ?=
 
 In fact, my practice is to not only use ?php echo, but to enclose 
 the echo argument with a (), like:
 
 ?php echo(The answer is $answer);?
 
 I am sure there will be some that think that my practice is an 
 overkill, or not good practice, but it's a good thing that we all 
 have a choice. Make your choice to best serve how you want your code 
 to look.

As per http://us3.php.net/echo

echo() is not actually a function (it is a language construct), so you are
not required to use parentheses with it. echo() (unlike some other language
constructs) does not behave like a function, so it cannot always be used in
the context of a function. Additionally, if you want to pass more than one
parameter to echo(), the parameters must not be enclosed within
parentheses. 

So you might want to reconsider your coding practice/style here and use the
construct as designed or you might end up with a far worse scenario than
short-tags could ever provide. Something more along the Python print
debacle.

Also, for the love of God, please don't embed a variable into a literal
string and use preprocessing.

Do it like so:

?php echo 'The answer is '.$answer; ?


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



RE: [PHP] is ?= good?

2010-06-11 Thread Daevid Vincent
 

 -Original Message-
 From: David Harkness [mailto:davi...@highgearmedia.com] 
 Sent: Friday, June 11, 2010 1:13 PM
 To: PHP General
 Subject: Re: [PHP] is ?= good?
 
 On Fri, Jun 11, 2010 at 11:16 AM, Ashley Sheridan
 a...@ashleysheridan.co.ukwrote:
 
  For ?= to work, the short_tags setting needs to be turned 
 on I believe,
  which can cause issues when outputting the XML declaration 
 line unless
  it's broken into two parts, which is messier than '?php echo' IMHO.
 
 
 Can you give an example of how this breaks? I don't see any 
 problems with
 
 ?= '?xml blah blah ?' ?
 
 unless you are trying to validate your PHP script as XML. 
 Given that PHP is
 *not* XML I don't know why you'd want to do that. But I've seen this
 argument a few times while looking into this issue so maybe 
 I'm just not
 seeing the big picture.

...and even *IF* it did break for that ONE instance, then simply do as I do
in my xml_header.inc.php file:

header( Content-type: text/xml );
print ?xml version=\1.0\ encoding=\utf-8\ ?\n;

Problem solved.

EVERY other tag in an XML document is just straight up html like:

foobar/foo

There are no other ?xml tags or anything to worry about.

Again the whole XML argument seems to be exaggerated.


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



RE: [PHP] is ?= good?

2010-06-11 Thread tedd

At 1:43 PM -0700 6/11/10, Daevid Vincent wrote:

  -Original Message-
  From: tedd [mailto:tedd.sperl...@gmail.com]
  In fact, my practice is to not only use ?php echo, but to enclose

 the echo argument with a (), like:


  ?php echo(The answer is $answer);?


 I am sure there will be some that think that my practice is an
 overkill, or not good practice, but it's a good thing that we all
 have a choice. Make your choice to best serve how you want your code
 to look.


As per http://us3.php.net/echo

echo() is not actually a function (it is a language construct), so you are
not required to use parentheses with it. echo() (unlike some other language
constructs) does not behave like a function, so it cannot always be used in
the context of a function. Additionally, if you want to pass more than one
parameter to echo(), the parameters must not be enclosed within
parentheses.

So you might want to reconsider your coding practice/style here and use the
construct as designed or you might end up with a far worse scenario than
short-tags could ever provide. Something more along the Python print
debacle.

Also, for the love of God, please don't embed a variable into a literal
string and use preprocessing.

Do it like so:

?php echo 'The answer is '.$answer; ?


Daevid:

I'm aware that echo is a language construct and does not require the 
(). However, please note the reference you provided, namely:


http://us3.php.net/echo

They use echo() to describe the construct -- so, if they can use 
it, then I figure I'm in good company.


I also practice using () because it is easier for *me* to read, 
understand, and document my work. You are free to do as you want.


As for the Python print problem, I don't do Python -- so, it can 
win the lottery, or die, I don't care.


As for don't embed a variable into a literal string and use 
preprocessing, as I said above, I often do this:


?php echo(The answer is $answer);?

and find no problems whatsoever in doing so.

However, I wouldn't do this:

?php echo 'The answer is '.$answer; ?

OR, I would place a space before/after the . (i.e., 'The answer is ' 
. $answer). However, I don't like doing that because I also program 
in other languages, which use the dot operator differently.


My experience has shown me that most, if not all, languages are 
merging -- as such, I think the dot operator is more established as 
something other than just an operation to combine strings.


Cheers,

tedd
--
---
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] is ?= good?

2010-06-11 Thread tedd

At 2:19 PM -0700 6/11/10, Daevid Vincent wrote:

EVERY other tag in an XML document is just straight up html :


Just curious -- like html tags:

hr
br

Or do you have to change them to:

hr /
br /

How does XML handle those tags?

Cheers,

tedd

--
---
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] is ?= good?

2010-06-11 Thread Ashley M. Kirchner

On 6/11/2010 11:40 AM, Daevid Vincent wrote:


I use short tags and I output XML all the time.
   


I think there's a difference to note here.  You're outputting XML 
from PHP, versus files having XML tags in the files ... I ran into a 
problem with short tags not too long ago when a client transferred their 
website to us.  They had every single file starting with:


?xml version=1.0 encoding=UTF-8?

When you have short_tags enabled, this causes problems.  And 
because we have other clients who have applications written using 
short_tags, I had to redo all of those XML tags and make them:


???xml version=1.0 encoding=UTF-8?

This is why personally I refuse to use short tags - I'd rather type 
the whole thing out  and not run into trouble later if for some reason I 
have to move hosts.  None of my new servers have short_tags turned on.  
And anyone who asks is being told the same thing: type it out.


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



Re: [PHP] is ?= good?

2010-06-11 Thread David Harkness
On Fri, Jun 11, 2010 at 2:51 PM, Ashley M. Kirchner ash...@pcraft.comwrote:

 They had every single file starting with:

 ?xml version=1.0 encoding=UTF-8?


*PHP* files? I would have flagged that as the problem rather than disabling
short tags.

David


Re: [PHP] is ?= good?

2010-06-11 Thread Ashley M. Kirchner

On 6/11/2010 4:07 PM, David Harkness wrote:
*PHP* files? I would have flagged that as the problem rather than 
disabling

short tags.
   


Yeah, whoever created their site originally mixed XML/HTML/PHP all 
in the same file (all the files were .html but contained xml and php 
snippets) so I had to change their specific virtual host and then each 
individual file ...



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



Re: [PHP] is ?= good?

2010-06-11 Thread Ahmed Mohsen

On 6/12/2010 12:34 AM, tedd wrote:

At 2:19 PM -0700 6/11/10, Daevid Vincent wrote:

EVERY other tag in an XML document is just straight up html :


Just curious -- like html tags:

hr
br

Or do you have to change them to:

hr /
br /

How does XML handle those tags?

Cheers,

tedd



If they have no content, you should use hr / tags, otherwise use the 
full open and close tags around the content. titleCONTENT/title


--
Kind regards,
Ahmed Mohsen.

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



Re: [PHP] is ?= good?

2010-06-11 Thread Ahmed Mohsen

On 6/11/2010 11:43 PM, Daevid Vincent wrote:

-Original Message-
From: tedd [mailto:tedd.sperl...@gmail.com]

I believe, just because it can be done doesn't mean that it
should be done.

My practice is *never* to use?=

In fact, my practice is to not only use?php echo, but to enclose
the echo argument with a (), like:

?php echo(The answer is $answer);?

I am sure there will be some that think that my practice is an
overkill, or not good practice, but it's a good thing that we all
have a choice. Make your choice to best serve how you want your code
to look.


As per http://us3.php.net/echo

echo() is not actually a function (it is a language construct), so you are
not required to use parentheses with it. echo() (unlike some other language
constructs) does not behave like a function, so it cannot always be used in
the context of a function. Additionally, if you want to pass more than one
parameter to echo(), the parameters must not be enclosed within
parentheses.

So you might want to reconsider your coding practice/style here and use the
construct as designed or you might end up with a far worse scenario than
short-tags could ever provide. Something more along the Python print
debacle.

Also, for the love of God, please don't embed a variable into a literal
string and use preprocessing.

Do it like so:

?php echo 'The answer is '.$answer; ?



Hey Daevid, does this form ?php echo 'The answer is '.$answer; ? 
improve anything in processing time or it's just for the sake of 
readability?


--
Kind regards,
Ahmed Mohsen.

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



RE: [PHP] is ?= good?

2010-06-11 Thread Daevid Vincent
 

 -Original Message-
 From: Ahmed Mohsen [mailto:mre...@gmail.com] 
 Sent: Friday, June 11, 2010 4:25 PM
 To: php-general@lists.php.net
 Subject: Re: [PHP] is ?= good?
 
 On 6/11/2010 11:43 PM, Daevid Vincent wrote:
  -Original Message-
  From: tedd [mailto:tedd.sperl...@gmail.com]
 
  I believe, just because it can be done doesn't mean that it
  should be done.
 
  My practice is *never* to use?=
 
  In fact, my practice is to not only use?php echo, but to enclose
  the echo argument with a (), like:
 
  ?php echo(The answer is $answer);?
 
  I am sure there will be some that think that my practice is an
  overkill, or not good practice, but it's a good thing that we all
  have a choice. Make your choice to best serve how you want 
 your code
  to look.
 
  As per http://us3.php.net/echo
 
  echo() is not actually a function (it is a language 
 construct), so you are
  not required to use parentheses with it. echo() (unlike 
 some other language
  constructs) does not behave like a function, so it cannot 
 always be used in
  the context of a function. Additionally, if you want to 
 pass more than one
  parameter to echo(), the parameters must not be enclosed within
  parentheses.
 
  So you might want to reconsider your coding practice/style 
 here and use the
  construct as designed or you might end up with a far worse 
 scenario than
  short-tags could ever provide. Something more along the 
 Python print
  debacle.
 
  Also, for the love of God, please don't embed a variable 
 into a literal
  string and use preprocessing.
 
  Do it like so:
 
  ?php echo 'The answer is '.$answer; ?
 
 
 Hey Daevid, does this form ?php echo 'The answer is '.$answer; ? 
 improve anything in processing time or it's just for the sake of 
 readability?

Technically it does have a microscopic speed increase, but unless you're
pumping out hundreds or thousands of lines (like in a loop) you most likely
won't notice it. In my code, I always try to use the proper quote marks
because I *am* dealing with huge tables of data. I've said this a hundred
times before, if you can shave off 0.001 from each row, then after 1,000
rows, you've shaved 1 second off the page time. That seems small, but that
shit adds up. Caching will help, as the page is already parsed once, so PHP
doesn't have to do the work again in many cases. To me, it's a good habbit
and costs you nothing to do.

The difference is that with  the PHP engine has to pre-process the string
and look to see if there's anything interesting it needs to do -- such as
replace any $var with their equivalents or \n or whatever else. A ' means
to use it as is, so PHP just spits it back out.

http://php.net/manual/en/language.types.string.php

http://stackoverflow.com/questions/482202/is-there-a-performance-benefit-si
ngle-quote-vs-double-quote-in-php

http://stackoverflow.com/questions/13620/





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



Re: [PHP] is ?= good?

2010-06-11 Thread Simon J Welsh

On 12/06/2010, at 8:43 AM, Daevid Vincent wrote:

 -Original Message-
 From: tedd [mailto:tedd.sperl...@gmail.com] 
 
 I believe, just because it can be done doesn't mean that it 
 should be done.
 
 My practice is *never* to use ?=
 
 In fact, my practice is to not only use ?php echo, but to enclose 
 the echo argument with a (), like:
 
 ?php echo(The answer is $answer);?
 
 I am sure there will be some that think that my practice is an 
 overkill, or not good practice, but it's a good thing that we all 
 have a choice. Make your choice to best serve how you want your code 
 to look.
 
 As per http://us3.php.net/echo
 
 echo() is not actually a function (it is a language construct), so you are
 not required to use parentheses with it. echo() (unlike some other language
 constructs) does not behave like a function, so it cannot always be used in
 the context of a function. Additionally, if you want to pass more than one
 parameter to echo(), the parameters must not be enclosed within
 parentheses. 
 
 So you might want to reconsider your coding practice/style here and use the
 construct as designed or you might end up with a far worse scenario than
 short-tags could ever provide. Something more along the Python print
 debacle.
 
 Also, for the love of God, please don't embed a variable into a literal
 string and use preprocessing.
 
 Do it like so:
 
 ?php echo 'The answer is '.$answer; ?

If you're doing it like that, you may as well use:

?php echo 'The answer is', $answer; ?

and leverage sending echo multiple parameters rather than using string 
concatenation.

---
Simon Welsh
Admin of http://simon.geek.nz/

Who said Microsoft never created a bug-free program? The blue screen never, 
ever crashes!

http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e





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



Re: [PHP] is ?= good?

2010-06-11 Thread Robert Cummings

Simon J Welsh wrote:

On 12/06/2010, at 8:43 AM, Daevid Vincent wrote:

Also, for the love of God, please don't embed a variable into a literal
string and use preprocessing.

Do it like so:

?php echo 'The answer is '.$answer; ?


If you're doing it like that, you may as well use:

?php echo 'The answer is', $answer; ?


?php echo 'The answer is ', $answer; ?

Fixed that for you :)

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

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



Re: [PHP] is ?= good?

2010-06-10 Thread Ashley Sheridan
On Fri, 2010-06-11 at 01:34 +0300, Ahmed Mohsen wrote:

 I know that i should use the full open tag in php ?php ? but i want to 
 know if its good to use this tag ?=$name? instead of ?php echo $name ?
 


Depends who you ask, there was a discussion of this on the list a while
back, and the result was pretty split 50/50. Personally I think it's a
bad idea, as those tags only work when short_tags are turned on, which
itself causes problems with outputting XML from PHP. Yes it saves a
little bit of typing, but with a decent IDE you can set up a shortcut
for that sort of thing anyway, negating the extra seconds spent on a
large project by typing the echo statement.

There is also a potential issue when you move your code to a different
server, as short tags are not enabled by default as of PHP 5.

But, like I said, if you ask someone else, you'll likely get a different
opinion on this issue.

If you're the only one using this code, and the server is in your
control, then it's down to what you prefer to use. If the codebase is
shared, or the hosting is not in your control (shared hosting, etc) then
it's probably best to stick to the regular ?php echo $name ? format.

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




Re: [PHP] is ?= good?

2010-06-10 Thread David Harkness
On Thu, Jun 10, 2010 at 3:34 PM, Ahmed Mohsen mre...@gmail.com wrote:

 I know that i should use the full open tag in php ?php ? but i want to
 know if its good to use this tag ?=$name? instead of ?php echo $name ?


According to some PHP 6 will remove support for short tags. They won't be
disabled by default--the feature simply won't exist.

http://www.slideshare.net/thinkphp/php-53-and-php-6-a-look-ahead

David


Re: [PHP] is ?= good?

2010-06-10 Thread Daniel Brown
On Thu, Jun 10, 2010 at 19:35, David Harkness davi...@highgearmedia.com wrote:

 According to some PHP 6 will remove support for short tags. They won't be
 disabled by default--the feature simply won't exist.

    http://www.slideshare.net/thinkphp/php-53-and-php-6-a-look-ahead

I don't know why Stefan said that, but in fairness, that slideshow
is two years old.  You'll still see short_open_tags, but you'll no
longer have ASP-style tags or the little-known script language=PHP
options available.

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
We now offer SAME-DAY SETUP on a new line of servers!

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



Re: [PHP] is ?= good?

2010-06-10 Thread Ahmed Mohsen

On 6/11/2010 2:49 AM, Daniel Brown wrote:

On Thu, Jun 10, 2010 at 19:35, David Harknessdavi...@highgearmedia.com  wrote:


According to some PHP 6 will remove support for short tags. They won't be
disabled by default--the feature simply won't exist.

http://www.slideshare.net/thinkphp/php-53-and-php-6-a-look-ahead


 I don't know why Stefan said that, but in fairness, that slideshow
is two years old.  You'll still see short_open_tags, but you'll no
longer have ASP-style tags or the little-knownscript language=PHP
options available.


It still much safer to use the full tag to avoid any errors in the future

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



Re: [PHP] is ?= good?

2010-06-10 Thread David Harkness
On Thu, Jun 10, 2010 at 4:49 PM, Daniel Brown danbr...@php.net wrote:

 You'll still see short_open_tags,


That's good to hear. Not that we're in any rush to jump into PHP6 given that
we're only just now *close* to deploying 5.3.


 but you'll no
 longer have ASP-style tags or the little-known script language=PHP
 options available.


Heh, that's funny since that old slideshow said that script language=PHP
would always be an option. I've never seen it myself so I'm not too worried.
;)

David


RE: [PHP] is ?= good?

2010-06-10 Thread Daevid Vincent
I use them ALL the time. MUCH cleaner IMHO than the alternatives.

And *IF* someday it is ever depricated, it's trival to:

 s/?=/? echo/g

Don't let 'em scare ya!

 -Original Message-
 From: Ahmed Mohsen [mailto:mre...@gmail.com] 
 Sent: Thursday, June 10, 2010 3:35 PM
 To: php-general@lists.php.net
 Subject: [PHP] is ?= good?
 
 I know that i should use the full open tag in php ?php ? 
 but i want to 
 know if its good to use this tag ?=$name? instead of ?php 
 echo $name ?
 
 -- 
 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] is ?= good?

2010-06-10 Thread Daniel P. Brown
On Thu, Jun 10, 2010 at 20:53, Daevid Vincent dae...@daevid.com wrote:
 I use them ALL the time. MUCH cleaner IMHO than the alternatives.

 And *IF* someday it is ever depricated, it's trival to:

         s/?=/? echo/g

Right.  Because if we do away with short_open_tags, the fix is to
replace them all with short_open_tags.  ;-P





P.S. - You may want to sed your vim.  ;-P


-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
We now offer SAME-DAY SETUP on a new line of servers!

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



Re: [PHP] is ?= good?

2010-06-10 Thread Floyd Resler


On Jun 10, 2010, at 8:53 PM, Daevid Vincent wrote:


I use them ALL the time. MUCH cleaner IMHO than the alternatives.

And *IF* someday it is ever depricated, it's trival to:

 s/?=/? echo/g

Don't let 'em scare ya!


-Original Message-
From: Ahmed Mohsen [mailto:mre...@gmail.com]
Sent: Thursday, June 10, 2010 3:35 PM
To: php-general@lists.php.net
Subject: [PHP] is ?= good?

I know that i should use the full open tag in php ?php ?
but i want to
know if its good to use this tag ?=$name? instead of ?php
echo $name ?

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


I have to agree that ?= is much cleaner and I use them all the time  
as well.


Take care,
Floyd


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



Re: [PHP] Anyone good with multiple SSL on Apache?

2010-03-10 Thread Per Jessen
Daniel Egeberg wrote:

 On Mon, Mar 8, 2010 at 23:21, Skip Evans s...@bigskypenguin.com
 wrote:
 D'oh!

 ...and I suppose there is just no way around that, eh?

 Skip
 
 You can use SNI, but it's not supported by all web servers and
 browsers.
 
 http://en.wikipedia.org/wiki/Server_Name_Indication
 

I don't know about the browser support, but the Apache and SNI
implementation is well described in this article:

http://www.heise.de/kiosk/archiv/ct/2009/23/174_kiosk  (download for a
fee)

/Per

-- 
Per Jessen, Zürich (-4.0°C)


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



Re: [PHP] Anyone good with multiple SSL on Apache?

2010-03-10 Thread Per Jessen
Per Jessen wrote:

 Daniel Egeberg wrote:
 
 On Mon, Mar 8, 2010 at 23:21, Skip Evans s...@bigskypenguin.com
 wrote:
 D'oh!

 ...and I suppose there is just no way around that, eh?

 Skip
 
 You can use SNI, but it's not supported by all web servers and
 browsers.
 
 http://en.wikipedia.org/wiki/Server_Name_Indication
 
 
 I don't know about the browser support, but the Apache and SNI
 implementation is well described in this article:
 
 http://www.heise.de/kiosk/archiv/ct/2009/23/174_kiosk  (download for a
 fee)
 

This looks like a pretty decent article too:

http://en.gentoo-wiki.com/wiki/Apache2/SSL_and_Name_Based_Virtual_Hosts

According to that, the following browsers support SNI:

* Opera 8.0+
* Firefox 2+
* Internet Explorer 7+ (but not on Windows XP)
* Safari 3.2.1+ 


-- 
Per Jessen, Zürich (-3.9°C)


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



Re: [PHP] Anyone good with multiple SSL on Apache?

2010-03-08 Thread Frank M. Kromann
You can only have one SSL per IP address. The SSL connection between the 
client and server is done before the host header name is made available 
to Apache.


- Frank

On 3/8/10 2:13 PM, Skip Evans wrote:

Hey all,

I have an Apache virtual config running a bunch of sites, one with 
SSL. I finally have a need to add SSL to one more, but when I do the 
first one (which is further down the file) comes up untrusted.


Since this is pretty far off topic I'd be obliged if someone who has 
configured this before can email me off list for some assistance.


Much thanks!
Skip



--

Frank M. Kromann, M.Sc.E.E.

Web by Pixel, Inc.


Phone: +1 949 742 7533

Cell: +1 949 702 1794

Denmark: +45 88 33 64 80



Re: [PHP] Anyone good with multiple SSL on Apache?

2010-03-08 Thread Skip Evans

D'oh!

...and I suppose there is just no way around that, eh?

Skip

Frank M. Kromann wrote:
You can only have one SSL per IP address. The SSL connection between the 
client and server is done before the host header name is made available 
to Apache.


- Frank

On 3/8/10 2:13 PM, Skip Evans wrote:

Hey all,

I have an Apache virtual config running a bunch of sites, one with 
SSL. I finally have a need to add SSL to one more, but when I do the 
first one (which is further down the file) comes up untrusted.


Since this is pretty far off topic I'd be obliged if someone who has 
configured this before can email me off list for some assistance.


Much thanks!
Skip



--

Frank M. Kromann, M.Sc.E.E.

Web by Pixel, Inc.


Phone: +1 949 742 7533

Cell: +1 949 702 1794

Denmark: +45 88 33 64 80



--

Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com

Those of you who believe in
telekinesis, raise my hand.
 -- Kurt Vonnegut

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



Re: [PHP] Anyone good with multiple SSL on Apache?

2010-03-08 Thread Frank M. Kromann

Not that I know of.

- Frank

On 3/8/10 2:21 PM, Skip Evans wrote:

D'oh!

...and I suppose there is just no way around that, eh?

Skip

Frank M. Kromann wrote:
You can only have one SSL per IP address. The SSL connection between 
the client and server is done before the host header name is made 
available to Apache.


- Frank

On 3/8/10 2:13 PM, Skip Evans wrote:

Hey all,

I have an Apache virtual config running a bunch of sites, one with 
SSL. I finally have a need to add SSL to one more, but when I do the 
first one (which is further down the file) comes up untrusted.


Since this is pretty far off topic I'd be obliged if someone who has 
configured this before can email me off list for some assistance.


Much thanks!
Skip



--

Frank M. Kromann, M.Sc.E.E.

Web by Pixel, Inc.


Phone: +1 949 742 7533

Cell: +1 949 702 1794

Denmark: +45 88 33 64 80





--

Frank M. Kromann, M.Sc.E.E.

Web by Pixel, Inc.


Phone: +1 949 742 7533

Cell: +1 949 702 1794

Denmark: +45 88 33 64 80



Re: [PHP] Anyone good with multiple SSL on Apache?

2010-03-08 Thread Kim Madsen

Skip Evans wrote on 08/03/2010 23:21:

D'oh!

...and I suppose there is just no way around that, eh?


two public IPs pointing to the same server? ;o)

--
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] Anyone good with multiple SSL on Apache?

2010-03-08 Thread Daniel Egeberg
On Mon, Mar 8, 2010 at 23:21, Skip Evans s...@bigskypenguin.com wrote:
 D'oh!

 ...and I suppose there is just no way around that, eh?

 Skip

You can use SNI, but it's not supported by all web servers and browsers.

http://en.wikipedia.org/wiki/Server_Name_Indication

-- 
Daniel Egeberg

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



Re: [PHP] Re: Good source for sample data?

2010-01-29 Thread Michael Kubler

Agree'd.
I've done this a couple of times. Usually best is to grab a couple of 
free online dictionary lists. One for peoples names, another for 
business names, then just randomly pull the data from the dictionaries. 
Addresses, websites, phone numbers, and zip codes can all be randomly 
generated, or you can use the GEONames database 
http://www.geonames.org/ to generate actual locations.


Also, wasn't there some test data available by MySQL? I think it was the 
Sakila http://dev.mysql.com/doc/sakila/en/sakila.htmldatabase 
http://forums.mysql.com/list.php?121.


--
Michael Kubler
I believe in a better world. I support the Zeitgeist Movement


Shawn McKenzie wrote:

Brian Dunning wrote:
  

Hey all -

I need a few million sample contact records - name, company, address, email, 
web, phone, fax. ZIP codes and area codes and street addresses should be 
correct and properly formatted, but preferably not real people or companies or 
email addresses. But they'd work if you did address validation or mapping. 
Anyone have a suggestion?

- Brian



It should be easy to code a routine to generate random data.  Maybe 20 -
30 lines of code.  Obviously you may have a name like Dgidfgq Xcvbop and
company Wsdkn, but it shouldn't matter if testing is your purpose.

  


Re: [PHP] A good book for a perspective programer.

2008-01-13 Thread Sean-Michael
Very nice link kingzones, I did not come across this one yet!

As I mentioned I was looking for some text books that I could keep on
hand... I can print some from the link you provided.  I was looking for a
bit more feed back :( maybe this is all I need :)  I do have the chm manual,
I use it a lot!

Thanks again!
Sean-Michael.

[EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I have learned PHP using PHP manual available at the www.php.net in chm
 format...
 You can also try.. my php free books collection here
 http://www.kingzones.org/bookszone/php.php

 But still I go with PHP manual...


 On Jan 11, 2008 11:42 PM, Sean-Michael [EMAIL PROTECTED] wrote:

 I've been searching the web for all the tutorials I can on the subject of
 php programming, I don't think there is a limit on what is really
 available
 to learn.

 What I want to ask is if anyone can recommend a good/best text book to
 learn
 from, I like to have a good book on hand!  I was going to purchase the 
 Zen
 Study Guide but after some research I cam to the conclusion that this is
 not
 a good book to buy, or perhaps it is a good companion to my online
 studies?

 It's my understanding that this book would be best for me?

 PHP Objects, Patterns, and Practice, Second Edition

 http://www.amazon.com/PHP-Objects-Patterns-Practice-Second/dp/1590599098/ref=sr_1_2?ie=UTF8s=booksqid=1200074884sr=1-2

 Thanks in advance for advice with this!

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




 -- 
 Visit: http://www.kingzones.org/
 

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



Re: [PHP] A good book for a perspective programer.

2008-01-11 Thread kingzones
I have learned PHP using PHP manual available at the www.php.net in chm
format...
You can also try.. my php free books collection here
http://www.kingzones.org/bookszone/php.php

But still I go with PHP manual...


On Jan 11, 2008 11:42 PM, Sean-Michael [EMAIL PROTECTED] wrote:

 I've been searching the web for all the tutorials I can on the subject of
 php programming, I don't think there is a limit on what is really
 available
 to learn.

 What I want to ask is if anyone can recommend a good/best text book to
 learn
 from, I like to have a good book on hand!  I was going to purchase the Zen
 Study Guide but after some research I cam to the conclusion that this is
 not
 a good book to buy, or perhaps it is a good companion to my online
 studies?

 It's my understanding that this book would be best for me?

 PHP Objects, Patterns, and Practice, Second Edition

 http://www.amazon.com/PHP-Objects-Patterns-Practice-Second/dp/1590599098/ref=sr_1_2?ie=UTF8s=booksqid=1200074884sr=1-2

 Thanks in advance for advice with this!

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




-- 
Visit: http://www.kingzones.org/


Re: [PHP] What good are constants if you can't use them in an array?

2006-08-03 Thread John Nichel

Daevid Vincent wrote:

*sigh*

Why is PHP so lame...



Because some users are too lazy to RTFM.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] What good are constants if you can't use them in an array?

2006-08-02 Thread Robert Cummings
On Wed, 2006-08-02 at 15:24 -0700, Daevid Vincent wrote:
 *sigh*
 
 Why is PHP so lame...


Why are you trolling on the PHP list?

 
 ?php 
 class PHPISLAME
 {
 const STOP = 0;
 const START = 1;
 const PAUSE = 2;
   
 public static $STATES = array(
   STOP = 'Stopped',
   START = 'Started',
   PAUSE = 'Paused'
);
 
 public static $STATESHACK = array(
   0 = 'Stopped',
   1 = 'Started',
   2 = 'Paused'
);
 }
 
 print_r(PHPISLAME::$STATES);
 
 print_r(PHPISLAME::$STATESHACK);
 ?
 
 What is this crap!!?:
 Array ( [STOP] = Stopped [START] = Started [PAUSE] = Paused ) 
 
 Array ( [0] = Stopped [1] = Started [2] = Paused )

PHP assumes type string for for undefined constants. If you weren't so
lame and had error reporting at a high enough level you would have been
well notified. My guess is that you are referencing a constant before
the class has been declared. You are expecting that the class
information exists at the same time of declaration. While I'm sure there
are ways to make it happen, it's up to you to ask the PHP internals to
solve your chicken egg problem... and I doubt it will happen with your
lame attitude.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] What good are constants if you can't use them in an array?

2006-08-02 Thread Jochem Maas
Daevid Vincent wrote:
 *sigh*
 
 Why is PHP so lame...

you know the story about the bad workman and his tools?
please go and read the manual entry regarding how to reference
class constants.

 
 ?php 
 class PHPISLAME
 {
 const STOP = 0;
 const START = 1;
 const PAUSE = 2;
   
 public static $STATES = array(
   STOP = 'Stopped',
   START = 'Started',
   PAUSE = 'Paused'
);
 
 public static $STATESHACK = array(
   0 = 'Stopped',
   1 = 'Started',
   2 = 'Paused'
);
 }
 
 print_r(PHPISLAME::$STATES);
 
 print_r(PHPISLAME::$STATESHACK);
 ?
 
 What is this crap!!?:

what that crap is would be self evident if you bothered to
turn on E_NOTICEs in your error_reporting. (hint: what does
php do with undefined constants?)

 Array ( [STOP] = Stopped [START] = Started [PAUSE] = Paused ) 
 
 Array ( [0] = Stopped [1] = Started [2] = Paused )
 

oh would you look at this 

$ php -v
PHP 5.1.4-pl0-gentoo (cli) (built: Jul  5 2006 18:26:03)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
? php -r 'class Test {const MYTEST = 3;public static $S = array( Test::MYTEST 
= TEST );}var_dump(Test::$S);'

array(1) {
  [3]=
  string(4) TEST
}


... now take a deep breath and relax :-)

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



Re: [PHP] What good are constants if you can't use them in an array?

2006-08-02 Thread Robert Cummings
On Wed, 2006-08-02 at 18:56 -0400, Robert Cummings wrote:
 On Wed, 2006-08-02 at 15:24 -0700, Daevid Vincent wrote:
  *sigh*
  
  Why is PHP so lame...
 
 
 Why are you trolling on the PHP list?
 
  
  ?php 
  class PHPISLAME
  {
  const STOP = 0;
  const START = 1;
  const PAUSE = 2;
  
  public static $STATES = array(
  STOP = 'Stopped',
  START = 'Started',
  PAUSE = 'Paused'
   );
  
  public static $STATESHACK = array(
  0 = 'Stopped',
  1 = 'Started',
  2 = 'Paused'
   );
  }
  
  print_r(PHPISLAME::$STATES);
  
  print_r(PHPISLAME::$STATESHACK);
  ?
  
  What is this crap!!?:
  Array ( [STOP] = Stopped [START] = Started [PAUSE] = Paused ) 
  
  Array ( [0] = Stopped [1] = Started [2] = Paused )
 
 PHP assumes type string for for undefined constants. If you weren't so
 lame and had error reporting at a high enough level you would have been
 well notified. My guess is that you are referencing a constant before
 the class has been declared. You are expecting that the class
 information exists at the same time of declaration. While I'm sure there
 are ways to make it happen, it's up to you to ask the PHP internals to
 solve your chicken egg problem... and I doubt it will happen with your
 lame attitude.

Furthermore, you aren't even using them properly. The documentation
clearly shows the following usage:

ClassName::constant
self::constant
parent::constant

Sheeesh!

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] What good are constants if you can't use them in anarray? [solved] I'm a jerk.

2006-08-02 Thread Daevid Vincent
   Why is PHP so lame...
  Why are you trolling on the PHP list?

Not trolling. Just frustrated. Apologies.

 Furthermore, you aren't even using them properly. The documentation
 clearly shows the following usage:
 
 ClassName::constant

This is how you have to use it.

 self::constant
 parent::constant

These don't work.

Okay. I deserve the new a$$hole I was ripped by the list.

Sorry.

I'll crawl back into my hole now... ;-)

d

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



Re: [PHP] What good are constants if you can't use them in anarray? [solved] I'm a jerk.

2006-08-02 Thread Jochem Maas
Daevid Vincent wrote:
 Why is PHP so lame...
 Why are you trolling on the PHP list?
 
 Not trolling. Just frustrated. Apologies.
 
 Furthermore, you aren't even using them properly. The documentation
 clearly shows the following usage:

 ClassName::constant
 
 This is how you have to use it.
 
 self::constant
 parent::constant
 
 These don't work.

they should work, but only when used in running code - if you use class
constant in static property definitions (ala your array) you need
to explicitly name the class.

 
 Okay. I deserve the new a$$hole I was ripped by the list.
 
 Sorry.
 
 I'll crawl back into my hole now... ;-)

make sure it's not that new hole ... the paint is still drying :-P

 
 d
 

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



Re: [PHP] Any good free easy converting tool?

2005-10-13 Thread Leif Gregory
Hello Gustav,

Wednesday, October 12, 2005, 12:55:11 PM, you wrote:
 Someone know of any good free tool for converting from Access to
 Mysql. I just need to import certain tables into an already
 existance database.

DBTools (freeware)
http://www.dbtools.com.br/

I use it quite a bit.

-- 
  TBUDL/BETA/DEV/TECH Lists Moderator / PGP 0x6C0AB16B
 __       Geocaching:http://gps.PCWize.com
(  )  ( ___)(_  _)( ___)  TBUDP Wiki Site:  http://www.PCWize.com/thebat/tbudp
 )(__  )__)  _)(_  )__)   Roguemoticons  Smileys:http://PCWize.com/thebat
()()()(__)PHP Tutorials and snippets:http://www.DevTek.org

MCSE == Minesweeper Consultant / Solitaire Expert

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



Re: [PHP] Any good free easy converting tool?

2005-10-12 Thread Joe Harman
On 10/12/05, Gustav Wiberg [EMAIL PROTECTED] wrote:
 Hi there!

 Someone know of any good free tool for converting from Access to Mysql. I
 just need to import certain tables into an already existance database.

 /G
 http://www.varupiraten.se/

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



Hey Gustav!!!

I use Navicat... i think they have a free trail package for their
software... it's the best that I can find out there!!

Good luck!
Joe
--
Joe Harman
-
Do not go where the path may lead, go instead where there is no path
and leave a trail. - Ralph Waldo Emerson

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



Re: [PHP] Any good free easy converting tool?

2005-10-12 Thread Gustav Wiberg

Hi there!

I need to do a one time convert from an Access-databasetable to an 
MySQL-database-table.


Is the MyODBC the only way?

/G

- Original Message - 
From: Jay Blanchard [EMAIL PROTECTED]

To: 'Gustav Wiberg' [EMAIL PROTECTED]
Sent: Wednesday, October 12, 2005 8:56 PM
Subject: RE: [PHP] Any good free easy converting tool?



[snip]
Someone know of any good free tool for converting from Access to Mysql. I
just need to import certain tables into an already existance database.
[/snip]

Isn't the MyODBC thingie free?


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.14/129 - Release Date: 
2005-10-11





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



Re: [PHP] Any good free easy converting tool?

2005-10-12 Thread Gustav Wiberg


- Original Message - 
From: Joe Harman [EMAIL PROTECTED]

To: php-general@lists.php.net
Cc: Gustav Wiberg [EMAIL PROTECTED]
Sent: Wednesday, October 12, 2005 9:00 PM
Subject: Re: [PHP] Any good free easy converting tool?


On 10/12/05, Gustav Wiberg [EMAIL PROTECTED] wrote:

Hi there!

Someone know of any good free tool for converting from Access to Mysql. I
just need to import certain tables into an already existance database.

/G
http://www.varupiraten.se/

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




Hey Gustav!!!

I use Navicat... i think they have a free trail package for their
software... it's the best that I can find out there!!

Good luck!
Joe
--
Joe Harman
-
Do not go where the path may lead, go instead where there is no path
and leave a trail. - Ralph Waldo Emerson


--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.14/129 - Release Date: 2005-10-11

Hi there!

Thanx!

/G
http://www.varupiraten.se/

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



Re: [PHP] Any good free easy converting tool?

2005-10-12 Thread Guy Brom
Why don't you just import from Access to CSV and use LOAD DATA query on 
MySQL?

Gustav Wiberg [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

 - Original Message - 
 From: Joe Harman [EMAIL PROTECTED]
 To: php-general@lists.php.net
 Cc: Gustav Wiberg [EMAIL PROTECTED]
 Sent: Wednesday, October 12, 2005 9:00 PM
 Subject: Re: [PHP] Any good free easy converting tool?


 On 10/12/05, Gustav Wiberg [EMAIL PROTECTED] wrote:
 Hi there!

 Someone know of any good free tool for converting from Access to Mysql. I
 just need to import certain tables into an already existance database.

 /G
 http://www.varupiraten.se/

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



 Hey Gustav!!!

 I use Navicat... i think they have a free trail package for their
 software... it's the best that I can find out there!!

 Good luck!
 Joe
 --
 Joe Harman
 -
 Do not go where the path may lead, go instead where there is no path
 and leave a trail. - Ralph Waldo Emerson


 -- 
 No virus found in this incoming message.
 Checked by AVG Anti-Virus.
 Version: 7.0.344 / Virus Database: 267.11.14/129 - Release Date: 
 2005-10-11

 Hi there!

 Thanx!

 /G
 http://www.varupiraten.se/ 

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



Re: [PHP] Re: Good and free encoder for PHP5

2004-12-16 Thread Greg Donald
On Thu, 16 Dec 2004 01:57:42 -0200, Manuel Lemos [EMAIL PROTECTED] wrote:
 The point is that old software versions that work on old environment
 versions do not need you to upgrade the environment version even the
 vendor deprecates the old version.

Wrong.  Security issues force upgrades.  Operating systems being
depricated forces upgrades.

 While you think that newer versions
 will not have old bugs that probably were not affecting you, chances are
 that newer versions have newer bugs that may break your applications,
 especially if you upgrade right after those new versions are released.

I never said anything of the sort.  

 What I am trying to tell you is that you need to use your brain

Yeah, I probably never use my brain, thanks for that.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Re: Good and free encoder for PHP5

2004-12-16 Thread Manuel Lemos
Hello,
on 12/16/2004 02:10 AM Matthew Weier O'Phinney said the following:
You *do* make valid points about making needless upgrade -- if no
security vulnerabilities exist, the application works fine, and you
don't need features from the new version, there really is no reason to
upgrade. But when a security vulnerability *does* exist, and it *could*
affect your application, you've got another issue entirely on your
hands. The trick is learning to distinguish between the two.
You are still missing the point. A version may have vulnerabilities that 
 affect functions that you do not use. Upgrading in that case is 
pointless and risky because newer versions have new bugs.

Go and read back PHP version history and notice that were times when a 
vulnerability fixing upgrade introduced new vulnerabilities. If the old 
vulnerability was not affection your application you should not have 
upgrade.

Another point is that, if there is a patch available, apply the patch 
instead of upgrading to a new version. That is a common practice of high 
quality control Linux distributions like SuSE. Often when a 
vulnerability is reported, they provide a security fix that just applies 
the patch. This way you do not risk to break other things or be affected 
by new vulnerabilities.

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Good and free encoder for PHP5

2004-12-15 Thread Mário Gamito
Hi Manuel,
Yes, Turck works with PHP5.
My question is: if the last version was released a year ago, how much 
can i trust it ?

BTW, how good is Truck's algorithm and how hard it is to reverse 
engineer the code ?

portuguese mode
Abraço aí para o Brasil, meu.
A curtir o sol e as macacas no calçadão :)
/portuguese mode
Warm Regards,
Mário Gamito
Manuel Lemos wrote:
Hello,
Mário gamito said the following on 12/14/2004 08:51 AM:
Does anyone around here knows a *good* and *free* encoder for PHP5 ?
I used to run Turck, but it seems that somehow it has been discontinued.
(At least, the last release occured about a year ago).

Did it stop working? My Turck copy still works. ;-)

--
Mário Gamito
Administração de sistemas e desenvolvimento
Netual - Multimédia e Telecomunicações, Lda.
Rua João Afonso, Nº1
3800-198 Aveiro - Portugal
Tel. +351 234 371 431 / Fax. +351 234 371 438
E-mail: [EMAIL PROTECTED]
www.netual.pt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Good and free encoder for PHP5

2004-12-15 Thread Jason Barnett
Mário gamito wrote:
Hi Manuel,
Yes, Turck works with PHP5.
My question is: if the last version was released a year ago, how much 
can i trust it ?

IIRC the main developer for Turck was hired by Zend...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Good and free encoder for PHP5

2004-12-15 Thread Manuel Lemos
Hello,
on 12/15/2004 08:35 PM Greg Donald said the following:
Software it is not like people, it does not stop working with age.
I have all kinds of old software that doesn't work anymore.
That is because you changed the environment on which it was working.
The problem is always with people, not with software. Some people feel 
that they need to ride the latest wave and always upgrade to the latest 
versions as soon as they are released. The reality is that new versions 
have new bugs and there is no guaranteed that new bugs are not worse 
than the bugs in old versions.

The point is that if you do not need to use the latest version, just 
stick to the one you have and works for you. It will probably take 1 
year or so for PHP 5 to be as bug free as the current PHP 4, so my 
advice is to not upgrade unless you really need something fundamental 
only provided by PHP 5.

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Good and free encoder for PHP5

2004-12-15 Thread Greg Donald
On Wed, 15 Dec 2004 22:38:16 -0200, Manuel Lemos [EMAIL PROTECTED] wrote:
  I have all kinds of old software that doesn't work anymore.
 
 That is because you changed the environment on which it was working.

Exactly my point.  I don't control when M$ depricates their operating
systems.  I don't control when my favorite Linux distro upgrades their
glibc.  You have to upgrade at some point or be vulnerable to the
security issues that follow.

 The point is that if you do not need to use the latest version, just
 stick to the one you have and works for you.

Well, I'm not gonna run windows 95 just to play Afterlife.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Re: Good and free encoder for PHP5

2004-12-15 Thread Matthew Weier O'Phinney
* Manuel Lemos [EMAIL PROTECTED]:
 Hello,

 on 12/16/2004 01:27 AM Greg Donald said the following:
   I have all kinds of old software that doesn't work anymore.
  That is because you changed the environment on which it was working.
  
  Exactly my point.  I don't control when M$ depricates their operating
  systems.  I don't control when my favorite Linux distro upgrades their
  glibc.  You have to upgrade at some point or be vulnerable to the
  security issues that follow.

  The point is that if you do not need to use the latest version, just
  stick to the one you have and works for you.
 
  Well, I'm not gonna run windows 95 just to play Afterlife.

 The point is that old software versions that work on old environment 
 versions do not need you to upgrade the environment version even the 
 vendor deprecates the old version. While you think that newer versions 
 will not have old bugs that probably were not affecting you, chances are 
 that newer versions have newer bugs that may break your applications, 
 especially if you upgrade right after those new versions are released.

Greg's point is that sometimes you *must* upgrade because the old,
possibly unnoticed bugs create may security vulnerabilities that you
can't live with. If a library your application depends on (and that
library could be PHP) has a security flaw that could allow permission
escalation, for instance, and a patch exists for it, you'd be crazy or
stupid not to perform the upgrade.  If the upgrade breaks the
application that depends on it...  well, that's why we're coding in PHP,
right? So that we have the freedom to fix these things, instead of
relying on vendors. (Man, I love OSS!)

You *do* make valid points about making needless upgrade -- if no
security vulnerabilities exist, the application works fine, and you
don't need features from the new version, there really is no reason to
upgrade. But when a security vulnerability *does* exist, and it *could*
affect your application, you've got another issue entirely on your
hands. The trick is learning to distinguish between the two.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



Re: [PHP] Re: Good and free encoder for PHP5

2004-12-15 Thread Manuel Lemos
Hello,
on 12/16/2004 01:27 AM Greg Donald said the following:
I have all kinds of old software that doesn't work anymore.
That is because you changed the environment on which it was working.
Exactly my point.  I don't control when M$ depricates their operating
systems.  I don't control when my favorite Linux distro upgrades their
glibc.  You have to upgrade at some point or be vulnerable to the
security issues that follow.
The point is that if you do not need to use the latest version, just
stick to the one you have and works for you.

 Well, I'm not gonna run windows 95 just to play Afterlife.
The point is that old software versions that work on old environment 
versions do not need you to upgrade the environment version even the 
vendor deprecates the old version. While you think that newer versions 
will not have old bugs that probably were not affecting you, chances are 
that newer versions have newer bugs that may break your applications, 
especially if you upgrade right after those new versions are released.

What I am trying to tell you is that you need to use your brain before 
you make an upgrade, eventually leaving a reasonable amount of time 
since it was released because most bugs are only discovered when early 
adopters break their faces trying the just released versions. In the 
case of PHP 5, I do not recommend jumping to it before 1 year after 
5.0.0 release. Then your upgrade risk will be much smaller.

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Good and free encoder for PHP5

2004-12-15 Thread Manuel Lemos
Hello,
on 12/15/2004 07:32 PM Mário gamito said the following:
Yes, Turck works with PHP5.
My question is: if the last version was released a year ago, how much 
can i trust it ?
Software it is not like people, it does not stop working with age.

BTW, how good is Truck's algorithm and how hard it is to reverse 
engineer the code ?
It is not hard because you can always rebuild the original code for Zend 
opcodes. Turck just serialize Zend opcodes to files. I have not seen any 
 reverse engineer software but it should not be hard.

I just use Turck for caching. If you real want to use compile PHP 
applications, forget encoders (commercial included). Use a real PHP 
compiler like Roadsend. That is real PHP code protection.

http://www.roadsend.com/

portuguese mode
Abraço aí para o Brasil, meu.
A curtir o sol e as macacas no calçadão :)
:-) O Brasil é grande e o calçadão do Rio de Janeiro fica a muitas 
centenas de kilometros daqui. Hoje em dia nem com colete à prova de bala 
lá poria os pés. As autoridades do Rio de Janeiro são impotentes para 
deter a criminalidade na cidade e até mesmo nas praias. Engraçado é há 
quem se admire que o turismo para o Rio tem caído muito. Basta ver os 
jornais para ver a quantidade de turistas saqueados e baleados mesmo com 
cameras de vigilancia a filmar tudo. Resumindo, não conheço essas 
macacas do calçadão.

 /portuguese mode
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Good and free encoder for PHP5

2004-12-15 Thread Greg Donald
On Wed, 15 Dec 2004 20:12:54 -0200, Manuel Lemos [EMAIL PROTECTED] wrote:
 Software it is not like people, it does not stop working with age.

I have all kinds of old software that doesn't work anymore.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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


Re: [PHP] Re: Good and free encoder for PHP5

2004-12-15 Thread Raditha Dissanayake
Mário Gamito wrote:
Hi Manuel,
Yes, Turck works with PHP5.
My question is: if the last version was released a year ago, how much 
can i trust it ?

BTW, how good is Truck's algorithm and how hard it is to reverse 
engineer the code ?
Encoding generally does not protect you from reverse engineering. Laws do.
--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

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


Re: [PHP] Re: Good and free encoder for PHP5

2004-12-15 Thread tg-php
Well, you could try XP's Compatibility Mode, I think my girlfriend got 
Afterlife to run under XP doing that.  She got it to run somehow..haha.. 
because we just found a copy of Afterlife for like $1 somewhere and she picked 
it up.

Or, if you happen to be blessed with VMWare, there's always that.  I've used 
VMWare to succesfully set up DOS 6.22 and some games that didn't work under 
DOSBox and Windows 95 to run some games that Win98 and XP didn't like so much.

So there's always options..  if you have time and/or money :)You might be 
able to use Wine or something to run an older version of Windows to get 
Afterlife to work as well.

In general, yes.. software gets old and rusty on the new OS's... but if you're 
ingenuity is adequate, you can figure out a way to have your cake and eat it 
too.

Where there's a will (and a search engine and maybe $200 for VMWare)  
there's an emulation of some kind.

-TG
*** new email address [EMAIL PROTECTED]
*** old email address [EMAIL PROTECTED]  YAY CHAPTER 11!





= = = Original message = = =

On Wed, 15 Dec 2004 22:38:16 -0200, Manuel Lemos [EMAIL PROTECTED] wrote:
  I have all kinds of old software that doesn't work anymore.
 
 That is because you changed the environment on which it was working.

Exactly my point.  I don't control when M$ depricates their operating
systems.  I don't control when my favorite Linux distro upgrades their
glibc.  You have to upgrade at some point or be vulnerable to the
security issues that follow.

 The point is that if you do not need to use the latest version, just
 stick to the one you have and works for you.

Well, I'm not gonna run windows 95 just to play Afterlife.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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


  1   2   >