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



[PHP] Compile PHP with MySQL support

2011-10-13 Thread Nick Khamis
Hello Everyone,

I am trying to compile php from source using the following config:

./configure --prefix=/usr/local/php
--with-apxs2=/usr/local/apache/bin/apxs
--with-config-file-path=/usr/local/php
--with-mcrypt=/usr/local/bin/mcrypt --with-mysqli
--with-gettext=./ext/gettext --with-pear
--with-libxml-dir=/usr/include/libxml2 --with-zlib --with-gd
--enable-pcntl

Note the mysqli without pointing to /usr/local/mysql/bin/mysql_config.
The problem is MySQL is not installed on the machine, it is actually
installed on another server.

MySQLi Suport:

mysqli
MysqlI Support  enabled
Client API library version  5.1.49
Active Persistent Links 0
Inactive Persistent Links   0
Active Links0
Client API header version   5.1.49
MYSQLI_SOCKET   /var/run/mysqld/mysqld.sock

Directive   Local Value Master Value
mysqli.allow_local_infile   On  On
mysqli.allow_persistent On  On
mysqli.default_host no valueno value
mysqli.default_port 33063306
mysqli.default_pw   no valueno value
mysqli.default_socket   no valueno value
mysqli.default_user no valueno value
mysqli.max_linksUnlimited   Unlimited
mysqli.max_persistent   Unlimited   Unlimited
mysqli.reconnectOff Off

The machine I compiled PHP on does not have mysqli.so, and so I am
recieving the "fatal call to undefined function mysql_connect()"
error. Can someone tell me how to compile php from source with mysql
support, but actually mysql is installed on a different server?

Can I download a precompile mysqli anywhere? The PHP version is 5.1.49
as noted earlier.

Thanks in Advance,

Nick


[PHP] Compile PHP with MySQLi (With MySQL on a remote server)

2011-10-13 Thread Nick Khamis
Hello Everyone,

I am trying to compile php from source using the following config:

./configure --prefix=/usr/local/php
--with-apxs2=/usr/local/
apache/bin/apxs
--with-config-file-path=/usr/local/php
--with-mcrypt=/usr/local/bin/mcrypt --with-mysqli
--with-gettext=./ext/gettext --with-pear
--with-libxml-dir=/usr/include/libxml2 --with-zlib --with-gd
--enable-pcntl

Note the mysqli without pointing to /usr/local/mysql/bin/mysql_config.
The problem is MySQL is not installed on the machine, it is actually
installed on another server.

MySQLi Suport:

mysqli
MysqlI Support  enabled
Client API library version  5.1.49
Active Persistent Links 0
Inactive Persistent Links   0
Active Links0
Client API header version   5.1.49
MYSQLI_SOCKET   /var/run/mysqld/mysqld.sock

Directive   Local Value Master Value
mysqli.allow_local_infile   On  On
mysqli.allow_persistent On  On
mysqli.default_host no valueno value
mysqli.default_port 33063306
mysqli.default_pw   no valueno value
mysqli.default_socket   no valueno value
mysqli.default_user no valueno value
mysqli.max_linksUnlimited   Unlimited
mysqli.max_persistent   Unlimited   Unlimited
mysqli.reconnectOff Off

The machine I compiled PHP on does not have mysqli.so, and so I am
recieving the "fatal call to undefined function mysql_connect()"
error. Can someone tell me how to compile php from source with mysql
support, but actually mysql is installed on a different server?

Can I download a precompile mysqli anywhere? The PHP version is 5.1.49
as noted earlier.

Thanks in Advance,

Nick


[PHP] Stuck on undefined function mysql_connect()

2011-10-13 Thread Nick Khamis
I have been stuck on this, and have no idea what is causing it. I have
compiled PHP with mysqli support:

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs
--with-config-file-path=/usr/local/php --with-mcrypt=/usr/local/bin/mcrypt
--with-mysqli --with-gettext=./ext/gettext --with-pear
--with-libxml-dir=/usr/include/libxml2 --with-zlib --with-gd --enable-pcntl

mysqli MysqlI Supportenabled Client API library version 5.1.49 Active
Persistent Links 0 Inactive Persistent Links 0 Active Links 0 Client API
header version 5.1.49 MYSQLI_SOCKET /var/run/mysqld/mysqld.sock
DirectiveLocal ValueMaster Value mysqli.allow_local_infileOnOn
mysqli.allow_persistentOnOn mysqli.default_host*no value**no value*
mysqli.default_port33063306 mysqli.default_pw*no value**no value*
mysqli.default_socket*no value**no value* mysqli.default_user*no value**no
value* mysqli.max_linksUnlimitedUnlimited mysqli.max_persistentUnlimited
Unlimited mysqli.reconnectOffOff

However, there is no mysqli.so or mysql.so found anywhere? Please help, I
have fallen behind because of this.

Nick.


Re: [PHP] Stuck on undefined function mysql_connect()

2011-10-13 Thread Nick Khamis
I was just going to try recompilign with mysql instead of mysqli... I hope
this fixes it.
In terms of mysql being compiled into the core, does this mean I do not have
to add

extension=mysqli.so
extension_dir=/usr/local/php/
include/php/ext/

Thanks in Advance,


Re: [PHP] Stuck on undefined function mysql_connect()

2011-10-13 Thread Nick Khamis
Correct.  Extensions, such as those found in the PECL repository,
are added in that manner.  Things compiled into the core, such as what
you're doing with MySQLi, are automatically loaded regardless, because
they're statically-built into the PHP binary itself.