Leanpub Header

Skip to main content

PHP: The "Right" Way

Your guide to PHP best practices, coding standards, and authoritative tutorials.

Bu kitap % 100 tamamlandıBu kitabın son güncelleme zamanı 2025-04-23.

New to PHP? Coming back to PHP after a hiatus? Been writing PHP for a decade? Whatever your level, you'll learn something here. 

En düşük fiyat

Ücretsiz!

$7.99

Ödeyeceğiniz Miktar

Elde edilen kampanyalar

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
44,989
Okuyucular
89
Sayfa
22,664Kelimeler
Hakkında

Hakkında

Kitap Hakkında

There’s a lot of outdated information on the Web that leads new PHP users astray, propagating bad practices and insecure code. PHP: The Right Way is an easy-to-read, quick reference for PHP popular coding standards, links to authoritative tutorials around the Web and what the contributors consider to be best practices at the present time.

There is no canonical way to use PHP. This book aims to introduce new PHP developers to some topics which they may not discover until it is too late, and aims to give seasoned pros some fresh ideas on those topics they’ve been doing for years without ever reconsidering. This ebook will also not tell you which tools to use, but instead offer suggestions for multiple options, when possible explaining the differences in approach and use-case.

This is a living document and will continue to be updated with more helpful information and examples as they become available.

Bu kitabı Paylaş

Kategoriler

Lisans

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License

Yazar

Yazarlar Hakkında

Phil Sturgeon

Since 2010 I've worked as a freelancer, consultant, API lead, and CTO for several API-centric technology startups. Working as an internal API consultant for WeWork gave me a lot to write about, where I used my experience of things going horribly horribly wrong to help educate developers, define standards for API design and architecture, and implementing full API design lifecycles so we weren't all just building nonsense and hoping it was useful.

Trying to get loads of different questionably built APIs tidied up, playing nicely, and working quickly was a constant source of learning for me and everyone involved. I took a lot of that learning to Stoplight, and helped plan, build, and manage most of your favourite OpenAPI tools.

When I'm not banging on about APIs I'm riding, racing, or crashing various bikes, or saving the plant through Protect Earth, an environmental charity I co-founded in 2020. We create brand new woodlands, restore and extend ancient woodlands, and run around with machetes getting rid of invasive species.

The Leanpub Podcast
Josh Lockhart

Creator of the Slim Framework and PHP The Right Way. Senior developer at New Media Campaigns.

Podcast

Podcast Episode

İçerik

İçindekiler

1.Language Highlights

  1. 1.1Xdebug
  2. 1.2Command Line Interface
  3. 1.3Standard PHP Library
  4. 1.4Programming Paradigms
  5. 1.5Namespaces
  6. 1.6Windows Setup
  7. 1.7macOS Setup
  8. 1.8Linux Setup

2.Getting Started

  1. 2.1Common Directory structure
  2. 2.2Use the Current Stable Version (8.4)
  3. 2.3Built-in web server
  4. 2.4Complementary Testing Tools
  5. 2.5Test Driven Development

3.Testing

  1. 3.1Behavior Driven Development
  2. 3.2Complex Problem

4.Dependency Injection

  1. 4.1Containers
  2. 4.2Basic Concept
  3. 4.3Further Reading
  4. 4.4Data Filtering
  5. 4.5Web Application Security
  6. 4.6Error Reporting
  7. 4.7Configuration Files
  8. 4.8Register Globals

5.Security

  1. 5.1Password Hashing
  2. 5.2Further Reading
  3. 5.3Benefits
  4. 5.4Compiled Templates
  5. 5.5Plain PHP Templates

6.Templating

  1. 6.1Working with UTF-8

7.Coding Practices

  1. 7.1The Basics
  2. 7.2Design Patterns
  3. 7.3Internationalization (i18n) and Localization (l10n)
  4. 7.4Common ways to implement
  5. 7.5Gettext
  6. 7.6Date and Time
  7. 7.7PEAR
  8. 7.8Composer and Packagist

8.Dependency Management

  1. 8.1Books
  2. 8.2People to Follow
  3. 8.3Other Useful Resources
  4. 8.4Video Tutorials
  5. 8.5Components
  6. 8.6PHP PaaS Providers

9.Resources

  1. 9.1Frameworks
  2. 9.2From the Source

10.Errors and Exceptions

  1. 10.1Errors
  2. 10.2Exceptions

11.Caching

  1. 11.1Object Caching
  2. 11.2Opcode Cache
  3. 11.3Virtual or Dedicated Servers
  4. 11.4Shared Servers

12.Servers and Deployment

  1. 12.1Platform as a Service (PaaS)
  2. 12.2Building and Deploying your Application
  3. 12.3Docker
  4. 12.4Vagrant

13.Virtualization

14.Code Style Guide

15.Community

  1. 15.1PHP Conferences
  2. 15.2PHP User Groups
  3. 15.3ElePHPants
  4. 15.4Interacting with Databases
  5. 15.5MySQL Extension
  6. 15.6PDO Extension
  7. 15.7Abstraction Layers

16.Databases

  1. 16.1PHPDoc

17.Documenting your Code

Amaçlar

Desteklenen Kampanyalar

Protect Earth

Protect Earth

https://protect.earth
We plant trees, wildflowers, and remove invasives to tackle the climate/biodiversity crises, and literally everyone can get involved! Registered charity 1192453
Protect Earth create, restores, and protects woodlands all over the UK. We plant tens of thousands of trees every year on low quality farmland, schools, wedding venues, council land, road verges, golf courses, or anywhere else that makes sense. Increasingly Protect Earth is securing its own land, restoring an ancient temporate rainforest in Cornwall, and creating a brand new temperate rainforest in Wales.
Electronic Frontier Foundation

Electronic Frontier Foundation

Defending your civil liberties in a digital world.

https://www.eff.org/
Based in San Francisco, EFF is a donor-supported membership organization working to protect fundamental rights regardless of technology.
From the Internet to the iPod, technologies are transforming our society and empowering us as speakers, citizens, creators, and consumers. When our freedoms in the networked world come under attack, the Electronic Frontier Foundation (EFF) is the first line of defense. EFF broke new ground when it was founded in 1990—well before the Internet was on most people's radar—and continues to confront cutting-edge issues defending free speech, privacy, innovation, and consumer rights today. From the beginning, EFF has championed the public interest in every critical battle affecting digital rights.

Leanpub Önkoşulsuz, Risksiz, %100 Mutluluk Garantilidir

Leanpub'tan yaptığınız alışverişlerde, 60 günlük sürede %100 iade garantisi mevcut, bunun için sadece iki tıklama yeterli. Detaylar için (ingilizce) kullanım sözleşmesini okuyunuz.

10$ değerinde bir satıştan 8$, 20$ değerinde bir satıştan 16$ kazanın

7,99$ veya üzeri satışlarda %80 telif, 0,99$ ile 7,98$ arasındaki satışlarda 50 sent sabit ücret düşülerek %80 telif ödüyoruz. 10$'lık bir satıştan 8$, 20$'lık bir satıştan 16$ kazanıyorsunuz. Yani, kitabınızın iade edilmemiş 5000 kopyasını 20$'dan satarsak, 80.000$ kazanacaksınız.

(Evet, bazı yazarlar Leanpub'da bundan çok daha fazlasını kazandılar.)

Gerçekte, yazarlar Leanpub'da yazarak, yayınlayarak ve satarak 14 milyon dolardan fazla kazandılar.

Leanpub'da yazmak hakkında daha fazla bilgi edinin

Ücretsiz Güncellemeler. DRM İçermez.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Leanpub'ın e-kitap formatları ve bunları nerede okuyabileceğiniz hakkında daha fazla bilgi edinin

Leanpub üzerinde Yazın ve Yayımlayın

Authors and publishers use Leanpub to publish amazing in-progress and completed ebooks, just like this one. You can use Leanpub to write, publish and sell your book as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Leanpub üzerinde nasıl yazabileceğinizi öğrenin