PHP is a server-side scripting language designed for web development and also used as a general-purpose programming language.

Rasmus Lerdorf created PHP in 1994, it’s reference implementation is now handled by the PHP group. It used to mean Personal Home Page, but now it stands for the recursive acronym PHP: hypertext preprocessor. From my personal experience, it is easy to learn, free to use and has a large community and support group.

Let’s take a look at the “Amazing Projects List


Design Pattern

Image result for the 23 gang of four (gof) patterns

This repository is created by Domnikl. It has sample code of different design patterns and explains how developers could implement these patterns in PHP projects. For someone who really wants to be a good programmer must refer to the repository.

Every pattern has a small list of examples (most from Zend Framework, Symfony 2 and Doctrine 2).

Examples:
Here are some examples of Singleton, Factory and Strategy pattern.

<?php
class Singleton
{
    public static function getInstance()
    {
        static $instance = null;
        if (null === $instance) {
            $instance = new static();
        }
        return $instance;
    }
    protected function __construct()
    {
    }
    private function __clone()
    {
    }
    private function __wakeup()
    {
    }
}
class SingletonChild extends Singleton
{
}
$obj = Singleton::getInstance();
var_dump($obj === Singleton::getInstance());
$anotherObj = SingletonChild::getInstance();
var_dump($anotherObj === Singleton::getInstance());
var_dump($anotherObj === SingletonChild::getInstance());
?>
<?php
class Automobile
{
    private $bikeMake;
    private $bikeModel;
    public function __construct($make, $model)
    {
        $this->bikeMake  = $make;
        $this->bikeModel = $model;
    }
    public function getMakeAndModel()
    {
        return $this->bikeMake . ' ' . $this->bikeModel;
    }
}
class AutomobileFactory
{
    public static function create($make, $model)
    {
        return new Automobile($make, $model);
    }
}
$pulsar = AutomobileFactory::create('ktm', 'Pulsar');
print_r($pulsar->getMakeAndModel());
class Automobile
{
    private $bikeMake;
    private $bikeModel;
    public function __construct($make, $model)
    {
        $this->bikeMake  = $make;
        $this->bikeModel = $model;
    }
    public function getMakeAndModel()
    {
        return $this->bikeMake . ' ' . $this->bikeModel;
    }
}
class AutomobileFactory
{
    public static function create($make, $model)
    {
        return new Automobile($make, $model);
    }
}
$pulsar = AutomobileFactory::create('ktm', 'pulsar');
print_r($pulsar->getMakeAndModel());
?>
<?php
$elements   = array(
    array(
        'id' => 2,
        'date' => '2011-01-01'
    ),
    array(
        'id' => 1,
        'date' => '2011-02-01'
    )
);
$collection = new ObjectCollection($elements);
$collection->setComparator(new IdComparator());
$collection->sort();
echo "Sorted by ID:\n";
print_r($collection->elements);
$collection->setComparator(new DateComparator());
$collection->sort();
echo "Sorted by date:\n";
print_r($collection->elements);
?>

Composer

Image result for composer

 A Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage them for you with PSR-4 standards.

Installation :

There are two ways to install Composer. Locally as part of your project, or globally as a system-wide executable.

Locally :

To install composer locally, run the installer in your project. see Download Instruction.

The installer will check a few PHP settings and then download composer.phar  to your working directory.

Now run the following command to run Composer.
php composer.phar

Globally :

You can place the Composer PHAR anywhere you wish.

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Authors – Nils Adermann & Jordi Boggiano


PHPUnit

Image result for phpunit

PHPUnit is a testing framework. It’s an instance of the xUnit architecture and used for easy maintenance of a lot of projects. PHPUnit is currently the most popular PHP unit testing framework. Besides providing features such as mocking objects, it provides code coverage analysis, logging and tons of other powerful features.

Installation :


Via Download :
You can download PHPUnit 7 from here and make it executable:

Via Composer :

composer require --dev phpunit/phpunit ^7 ./vendor/bin/phpunit --version

Faker

Faker is a PHP library that generates fake data for your projects.

I would use faker for various purpose as below.

  1. Bootstrap a database
  2. Create good-looking XML
  3. Stress Testing
  4. Anonymize data from production servers.

You can install faker with the following command.

composer require fzaninotto/faker

Example : 

<?php
// require the Faker autoloader 
require_once '/path/to/Faker/src/autoload.php';
// alternatively, use another PSR-0 compliant autoloader (like the Symfony2 ClassLoader for instance)
// use the factory to create a Faker\Generator instance 
$faker = Faker\ Factory::create();
// generate data by accessing properties 
echo $faker - > name;
// 'Lucy Cechtelar'; 
echo $faker - > address;
// "426 Jordy Lodge  
// Cartwrightshire, SC 88120-6700" 
echo $faker - > text;
// Dolores sit sint laboriosam dolorem culpa et autem. Beatae nam sunt fugit  
// et sit et mollitia sed.  
// Fuga deserunt tempora facere magni omnis. Omnis quia temporibus 

Author – Fzaninotto


xDebug

xdebug-atyantik-technologies

One of my favorite tool to analyze code step by step to find bugs or solve coding mysteries. It provides debugging and profiling capabilities. It uses the DBGp debugging protocol.

You can clone the XDebug source directory with:

git clone https://github.com/xdebug/xdebug.git cd xdebug

It is always recommended to run the latest version of the master branch.

Author – Derick Rethans 


PHPMailer

phpmailer-atyantik-technologies

This is a full-featured emailing class for all projects. Great replacement for the mail() function.  And supports File/String/Inline attachments with HTML email content.

You can install PHPMailer using Composer.

composer require phpmailer/phpmailer

OR, You can download from here.

Using SMTP in PHPMailer

<?php
require_once "vendor/autoload.php";
$mail            = new PHPMailer; //Enable SMTP debugging.  
$mail->SMTPDebug = 3; //Set PHPMailer to use SMTP. 
$mail->isSMTP(); //Set SMTP host name                           
$mail->Host       = "smtp.gmail.com"; //Set this to true if SMTP host requires authentication to send email 
$mail->SMTPAuth   = true; //Provide username and password     
$mail->Username   = "[email protected]";
$mail->Password   = "super_secret_password"; //If SMTP requires TLS encryption then set it 
$mail->SMTPSecure = "tls"; //Set TCP port to connect to  
$mail->Port       = 587;
$mail->From       = "[email protected]";
$mail->FromName   = "Full Name";
$mail->addAddress("[email protected]", "Recepient Name");
$mail->isHTML(true);
$mail->Subject = "Subject Text";
$mail->Body    = "<i>Mail body in HTML</i>";
$mail->AltBody = "This is the plain text version of the email content";
if (!$mail->send()) {
    echo "Mailer Error: " . $mail->ErrorInfo;
} else {
    echo "Message has been sent successfully";
}

Author – PHPMailer Team
Documentation – WIKI


Slim Framework

Image result for slim php

Slim (Slim FrameWork) is a micro framework that helps you quickly write simple yet powerful web applications and APIs.

You can install slim framework by using composer.

$ composer require slim/slim "^3.0"

Usage –

Create index.php file.

<?php
require 'vendor/autoload.php';
$app = new Slim\App();
$app->get('/hello/{name}', function($request, $response, $args)
{
    return $response->getBody()->write("Hello, " . $args['name']);
});
$app->run();

You may quickly test this using the built-in server:

$ php -S localhost:8000

Author – slim framework team
Website-https://www.slimframework.com/


Bootstrap CMS

bootstrap-atyantik-technologies

This library offers a PHP based CMS and that uses LARAVEL 5.1 and Sentry.
You can install Bootstrap CMS by using below command :

git clone [email protected]:BootstrapCMS/CMS.git

Author: Graham Campbell


Voten

This library offers a code for creating a real-time social bookmarking platform. It is simple to use and offer great flexibility to the developers.

Author – Voten team
website
: voten


PsySH

psysh-atyantik-technologies

PsySh offers a dev console and interactive debugger for your projects. This repo creates a REPL platform for developers.

Installation: PHP manual
commands for psysh.

The above is my personal list of projects. I would like to hear more from you. Drop your project link in comments and I will definitely give it a try.