Skip to main content

Design Patterns PHP

DesignPatternsPHPThis is a collection of known design patterns and some sample code how to implement them in PHP. Every pattern has a small list of examples (most of them from Zend Framework, Symfony2 or Doctrine2 as I’m most familiar with this software).
I think the problem with patterns is that often people do know them but don’t know when to apply which.

Comments

Popular posts from this blog

Introduction to PHP PDO

Introduction to PHP PDO
(PHP Data Objects)


1. What is PDO
2. What Databases does PDO support
3. Where do I begin?
4. Connect to a Database
* Connect to PgSQL
* Connect to SQLite
* Connect to MySQL
* Connect to Firebird
* Connect to Informix
* Connect to Oracle
* Connect to ODBC
* Connect to DBLIB
* Connect to IBM
5. There is no five
6. Close a Database Connection
7. Query a Database
* INSERT
* SELECT
* UPDATE
8. Fetch Modes
* FETCH ASSOC
* FETCH NUM
* FETCH BOTH
* FETCH OBJECT
* FETCH LAZY
* FETCH CLASS
* FETCH INTO
9. Error Handling
10. Prepared Statements
11. Transactions
12. Get Last Insert ID
13. Global Instance
14. Conclusions

What is PDO.

PDO is a PHP extension to formalise PHP's database connections by creating a uniform interface. This allows developers to create code which is portable…

Securely Communicating with Remote Servers via PHP

PHP has an SSH2 library which provides access to resources (shell, remote exec, tunneling, file transfer) on a remote machine using a secure cryptographic transport. Objectively, it is a tedious and highly frustrating task for a developer to implement it due to its overwhelming configuration options and complex API with little documentation.
The phpseclib (PHPSecure Communications Library) package has a developer friendly API. It uses some optional PHP extensions if they’re available and falls back on an internal PHP implementation otherwise. To use this package, you don’t need any non-default PHP extensions installed. Installationcomposer require phpseclib/phpseclib This will in