Muutke küpsiste eelistusi

E-raamat: Typed PHP: Stronger Types For Cleaner Code

  • Formaat: PDF+DRM
  • Ilmumisaeg: 04-Aug-2016
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781484221143
Teised raamatud teemal:
  • Formaat - PDF+DRM
  • Hind: 24,69 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: PDF+DRM
  • Ilmumisaeg: 04-Aug-2016
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781484221143
Teised raamatud teemal:

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

Discover how stronger types mean cleaner code and better running and optimized PHP applications. This unique book looks at typed PHP: PHP types, strings, regular expressions, and more from PHP 7 as found in standard PHP libraries, user libraries, extensions, and cross-compilers. You'll see how to create a set of reusable tools that unify and ease the scalar types of PHP. This is an important topic for creating in your web development and other projects.

PHP has a rich history and a dominant place on the web. It has achieved much despite language inconsistencies and difficulties. Bjarne Stroustrup once said: "There are only two kinds of languages: the ones people complain about and the ones nobody uses".

PHP is one of those languages that everybody uses, yet that's often seen as a good reason to ignore the bad parts and just get stuff done. We're all for getting stuff done, and to that end, the author has used Plain Ol' PHP for many years. It's always bugged him how procedural PHP is, in an ecosystem of OOP libraries and frameworks. So he decided to take a deeper look at building a stronger type system on top of PHP. That's the goal of this book.



What you'll learn

  • Discover the fundamentals of PHP strings, regex, underscores, native function inconsistencies, and more
  • Examine the structure of PHP types including boxing, regex, namespace functions, composer autoload, null problem, optional values, and more
  • Work with extensions like vagrant + phansible, provisioning, vagrant commands, SPL types, scalar objects, zephir, and more
  • Design using scalar, SPL, zephir, structure types, resolving types, chaining, combining number types, PHPUnit, packaging, and more
  • Plan for the future using a case study example


Who is this book for 
This book is for experienced web developers and PHP programmers.  


About the Author xi
About the Technical Reviewer xiii
Acknowledgments xv
Introduction xvii
Chapter 1 The State of PHP
1(6)
Procedural versus Object Oriented
1(2)
Procedural Programming
1(1)
Object Oriented Programming
2(1)
Which Is the Best?
3(1)
Which Is PHP?
3(1)
Native Function Inconsistencies
3(3)
Sporadic Underscores
4(1)
Sporadic Abbreviation
4(1)
Inconsistent Argument Order
5(1)
Regular Expression/Strings
5(1)
Nouns/Verbs
6(1)
Strange Return Values
6(1)
Conclusion
6(1)
Chapter 2 Structure
7(12)
Decorating
7(2)
Resolving Types
9(4)
Functions
10(1)
Regular Expressions
11(2)
All Together!
13(1)
Namespace Functions
13(2)
Composer Autoload
14(1)
Importing Namespaced Functions
14(1)
Optional Types
15(3)
The Null Problem
15(1)
Optional Values
16(1)
In The Wild
17(1)
Conclusion
18(1)
Chapter 3 Extensions
19(14)
Vagrant + Phansible
19(6)
Installing
19(3)
Provisioning
22(2)
Vagrant Commands
24(1)
SPL Types
25(2)
Installing SPL Types
25(1)
Using SPL Types
26(1)
Scalar Objects
27(3)
Installing Scalar Objects
28(1)
Using Scalar Objects
29(1)
Zephir
30(2)
Installing Zephir
30(1)
Using Zephir
30(2)
Conclusion
32(1)
Chapter 4 Design
33(18)
Which Method to Use
33(1)
Namespace Methods
33(1)
Scalar Objects/SPL Types
34(1)
Zephir
34(1)
Which Functions to Keep
34(9)
String Functions
35(2)
Number Functions
37(2)
Array Functions
39(4)
Which Functions to Add
43(2)
String Functions
43(1)
Array Functions
44(1)
How to Structure Functions
45(2)
Resolving Types
45(1)
Chaining
46(1)
Combining Number Types
47(1)
How to Test
47(1)
PHPUnit
47(1)
What Should We Test?
48(1)
When Should We Write Tests?
48(1)
Recommendations
48(1)
How to Package
48(1)
Make a Readme File
48(1)
Installation Instructions
49(1)
License
49(1)
Contribution Guidelines
49(1)
Conclusion
49(2)
Chapter 5 Implementation
51(24)
Extending Composer
51(14)
Example: Path Plugin
51(7)
Example: Hook Plugin
58(7)
PHP Implementation
65(9)
Functions
65(9)
Conclusion
74(1)
Index 75
Christopher Pitt is an expert web developer, PHP programmer/coder and writer, working at SilverStripe. He usually works on application architecture, though sometimes you'll find him building compilers or robots.