MindMap Gallery PHP the Right way
This is a mind map talking about how to know and use php in the right way. You can create a mind map like this effortlessly.
Edited at 2020-09-27 14:00:44Halloween has many faces. The theme you envision should influence how you decorate the party space. Jack-o'-lanterns and friendly ghosts are more lighthearted Halloween characters. Zombies, witches, and vampires are much darker. If you want to celebrate all the fun sides of Halloween, then it’s okay to mesh the cute with the frightening. Here is a mind map which lists down the 39 Cutest Couples Halloween Costumes of 2021.
Halloween simply wouldn't be Halloween without the movies that go along with it. There's nothing like a movie night filled with all the greatest chainsaw-wielding, spell-binding, hair-raising flicks to get you in the spooky season spirit. So, break out the stash of extra candy, turn off all the lights, lock every last door, and settle in for the best of the best Halloween movies. Here are the 35 Halloween movies listed on the mind map based on the year of release.
This mind map contains lots of interesting Halloween trivia, great tips for costumes and parties (including food, music, and drinks) and much more. It talks about the perfect Halloween night. Each step has been broken down into smaller steps to understand and plan better. Anybody can understand this Halloween mind map just by looking at it. It gives us full story of what is planned and how it is executed.
Halloween has many faces. The theme you envision should influence how you decorate the party space. Jack-o'-lanterns and friendly ghosts are more lighthearted Halloween characters. Zombies, witches, and vampires are much darker. If you want to celebrate all the fun sides of Halloween, then it’s okay to mesh the cute with the frightening. Here is a mind map which lists down the 39 Cutest Couples Halloween Costumes of 2021.
Halloween simply wouldn't be Halloween without the movies that go along with it. There's nothing like a movie night filled with all the greatest chainsaw-wielding, spell-binding, hair-raising flicks to get you in the spooky season spirit. So, break out the stash of extra candy, turn off all the lights, lock every last door, and settle in for the best of the best Halloween movies. Here are the 35 Halloween movies listed on the mind map based on the year of release.
This mind map contains lots of interesting Halloween trivia, great tips for costumes and parties (including food, music, and drinks) and much more. It talks about the perfect Halloween night. Each step has been broken down into smaller steps to understand and plan better. Anybody can understand this Halloween mind map just by looking at it. It gives us full story of what is planned and how it is executed.
PHP the Right way
Code Style Guide
PSR-1
PSR_2
PSR_4
PEAR Coding Standards
Symfony Coding Standards
Language Highlights
Programming Paradigms
General
Solid object-oriented model in PHP 5.0 (2004)
Anonymous functions and namespaces in PHP 5.3 (2009)
Traits in PHP 5.4 (2012)
Object-oriented Programming
Including support for classes, abstract classes, interfaces, inheritance, constructors, cloning, exceptions, and more.
Read about Object-oriented PHP
Read about Traits
Functional Programming
A function can be assigned to a variable
Functions can be passed as arguments to other functions
Functions can return other functions
Anonymous functions
Support for closure
Present since PHP 5.3 (2009).
PHP 5.4 added the ability to bind closures to an object’s scope and also improved support for callables
Meta Programming
PHP supports various forms of meta-programming through mechanisms like the Reflection API and Magic Methods.
PHP: ReflectionClass
Magic Methods
are special functions, which automatically excecute some action on an object of class: __get, __constructor, __call,...
Similar to didSet in Swift
Customize behavior: constructor, destructor, getAttribute,...
Didadvantage: slower than nomal function
Example: Use Meta Programing to generate method
Namespaces
are a way of encapsulating items
When both libraries are used in the same namespace, they collide and cause trouble => Namespaces solve this problem
Code style: PSR-4 (or PSR-0)
The latter requires PHP 5.3, so many PHP 5.2-only projects implement PSR-0.
In October 2014 the PHP-FIG deprecated the previous autoloading standard: PSR-0
For an autoloader standard for a new application or package -> PSR-4
Namespaces + autoloader
namespaces aid autoloader know what $PATH of class and auto require it.
Autoloader
relevant: Regular Expression 1
relevant: Regular Expression 2
Autoload with composer
Standard PHP Library
Command Line Interface
Xdebug
Dependency Management
Composer
Composer installs packages in separate project that mean only in project scope, NOT global packages.
PEAR
PEAR installs packages globally, which means after installing them once they are available to all projects on that server.
Handling PEAR dependencies with Composer
Coding Practices
The Basics
Date and Time
Design Patterns
Working with UTF-8
UTF-8 at the PHP level
UTF-8 at the Database level
UTF-8 at the browser level
Internationalization (i18n) and Localization (l10n)
Common ways to implement
Gettext
Installation
Structure
Types of files
Domains
Locale code
Directory structure
Plural forms
Sample implementation
Discussion on l10n keys
Everyday usage
.......
Dependency Injection
Basic Concept
Dependency injection is a software design pattern that allows the removal of hard-coded dependencies and makes it possible to change them, whether at run-time or compile-time
Complex Problem
Inversion of Control
Dependency Injection is a way to implement Inversion of Control
S.O.L.I.D
Single Responsibility Principle
Every class should only have responsibility over a single part of the functionality provided by the software.
Open/Closed Principle
We can very easily extend our code with support for something new without having to modify existing code (inheritance, traits, implements, extends,..)
Liskov Substitution Principle
“Child classes should never break the parent class’ type definitions.”
Interface Segregation Principle
Instead of having a single monolithic interface that all conforming classes need to implement, we should instead provide a set of smaller, concept-specific interfaces that a conforming class implements one or more of.
Dependency Inversion Principle
“Depend on Abstractions. Do not depend on concretions.”. Put simply, this means our dependencies should be interfaces/contracts or abstract classes rather than concrete implementations.
Classes communicate together through interfaces/abstract instead of implementation
Containers
aid init lower module
Further Reading
Database
MySQL Extension
{ mysql } has superseded by { mysqli, PDO }
{ mysql } officially removed in PHP 7.0.
PDO Extension
A database connection abstraction library
Built into PHP since 5.1.0
Provides a common interface to talk with many different databases.
Interacting with Databases
Use OOP to create a model - similar to MVC
Abstraction Layers
Some abstraction layers have been built using the PSR-0 or PSR-4 namespace standards
Open source
Aura SQL
Doctrine2 DBAL
Propel
Zend-db
Templating
Benefits
is clear separation they create between the presentation logic and the rest of your application.
Templates have the sole responsibility of displaying formatted content
Templates are not responsible for data lookup, persistence or other more complex tasks.
Improve the organization of presentation code
Plain PHP Templates
are simply templates that use native PHP code
can combine PHP code within other code, like HTML
Compiled Templates
Libraries
Error and Exception
Errors
Error Severity
E_ERROR
Errors are fatal run-time errors and are usually caused by faults in your code and need to be fixed as they’ll cause PHP to stop executing.
E_NOTICE
Notices are advisory messages caused by code that may or may not cause problems during the execution of the script, execution is not halted.
E_WARNING
Warnings are non-fatal errors, execution of the script will not be halted.
Changing PHP’s Error Reporting Behaviour
if you only want to see Errors and Warnings
Inline Error Suppression
You can also tell PHP to suppress specific errors with the Error Control Operator @
PHP handles expressions using an @ in a less performant way than expressions without an @
If there’s a way to avoid the error suppression operator, you should consider it
Earlier we mentioned there’s no way in a stock PHP system to turn off the error control operator. However, Xdebug has an xdebug.scream ini setting which will disable the error control operator. You can set this via your php.ini file with the following.
Exceptions
More information on this and details on how to use ErrorException with error handling can be found at ErrorException Class.
Security
Web Application Security
Password Hashing
Data Filtering
Configuration Files
Register Globals
Error Reporting
Testing
Test Driven Development
Behavior Driven Development
Complementary Testing Tools
Sever and Deployment
Platform as a Service (PaaS)
Virtual or Dedicated Servers
Shared Servers
Building and Deploying your Application
Virtualization
Vagrant
Docker
Catching
Opcode Cache
Object Caching
Documenting your Code
PHPDoc
Definition
Doc for class
Inside the class
Resource
From the Source
People to Follow
Mentoring
PHP PaaS Providers
Frameworks
Micro Frameworks
Full-Stack Frameworks
Component Frameworks
Components
Other Useful Resources
Video Tutorials
Books
Community
PHP User Groups
PHP Conferences
ElePHPants