Expert PHP 5 Tools phần 1 ppt

47 339 0
Expert PHP 5 Tools phần 1 ppt

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... Contents 14 3 14 3 14 8 15 9 16 8 17 2 17 4 18 2 14 4 14 4 14 4 1 45 1 45 14 6 14 6 14 6 14 6 14 7 14 7 14 8 14 8 14 8 15 7 15 8 15 8 15 8 15 8 17 2 17 3 1 75 1 75 17 6 17 7 18 0 18 2 1 85 1 85 18 9 19 0 1 95 [ iv ] Download from Wow! eBook www.WoweBook.com 19 0 19 4 Table of Contents 19 7 19 7 19 9 200 202 208 209 209 210 212 212 212 212 213 213 213 213 214 214 2 15 232 233 2 35 237 240 237 238 238 240 2 41 242... 2 51 2 51 252 252 253 254 254 255 255 Table of Contents 256 256 257 257 257 258 259 259 260 260 2 61 262 262 2 65 2 65 269 269 2 71 274 276 278 282 288 289 2 91 2 91 292 292 293 294 294 2 95 296 296 297 298 298 299 300 3 01 304 3 05 3 05 [ vi ] Download from Wow! eBook www.WoweBook.com Table of Contents 306 307 309 317 3 21 3 21 326 328 328 329 329 3 31 332 333 333 334 334 3 35. .. 333 334 334 3 35 3 35 3 35 336 337 3 41 344 338 339 340 342 342 343 3 45 3 45 349 350 352 353 354 356 358 358 362 362 [ vii ] Download from Wow! eBook www.WoweBook.com Table of Contents 363 364 3 65 366 367 369 370 370 372 372 380 382 383 383 384 390 390 3 91 3 91 [ viii ] Download from Wow! eBook www.WoweBook.com 384 384 394 3 95 397 397 398 398 399 4 01 4 01 402 402 403 403... working version of PHP 5 installed on your system Some of the chapters rely on command line tools such as pear and pecl, which are included in the standard distribution of PHP Version 5. 2.x of PHP or higher is recommended for maximum compatibility with the sample code If you do not already have PHP installed on your system, you can download it from php. net here: http://www .php. net/downloads .php Although... 398 398 399 4 01 4 01 402 402 403 403 403 404 404 404 4 05 4 05 406 407 409 Table of Contents 4 35 [ ix ] www.WoweBook.com 409 412 413 417 420 420 428 433 Index Download from Wow! eBook 409 Download from Wow! eBook www.WoweBook.com Preface This book will enable you to take your PHP development skills to an enterprise level by teaching the skills and tools necessary to write maintainable and efficient... distinguish them from function calls < ?php // all conditionals on the same line if ($myValue 10 0) { doSomethingImportant(); } // too many conditional for one line // break up conditionals like this if ($myValue > 5 || $myValue < 5 || $myValue == 0 || $myValue == -3) { doSomethingElseImportant(); } ?> [ 12 ] Download from Wow! eBook www.WoweBook.com Chapter 1 If-elseif-else statements The... 18 ] Download from Wow! eBook www.WoweBook.com Chapter 1 Methodology In this section, we will look at some conventions that take advantage of object-oriented features found in PHP5 and later Some of the recommendations listed as follows are generally considered best practices Type hinting Whenever possible, functions should type-hint by specifying the class of the parameter Furthermore, as of PHP 5. 1, ... interactive debugging using tools created for PHP developers—all the information in one place Your code will be more maintainable, efficient, and self-documenting What this book covers Chapter 1, Coding Style and Standards, explains how to define a coding standard that suits your development process and how to enforce it using PHP_ CodeSniffer Chapter 2, Documentation with phpDocumentor, explains how... actually does PHP tags All PHP code is to be enclosed by full PHP tags: < ?php and ?> Short tags () or ASP-style tags () are not allowed Indenting Tabs are to be replaced by four space characters Most IDEs and text editors can be set to do this automatically Line length The suggested maximum number of characters per line is 80 characters, although just about all GUI-based editing tools can... ucfirst(strtolower($value)); } [ 15 ] Download from Wow! eBook www.WoweBook.com Coding Style and Standards // join with underscores $absolutePath = implode('_', $parts); // remove trailing file extension $absolutePath = str_replace(' .php' , '', $absolutePath); return $absolutePath; } } $classNameExamples = array('/var/www/sites/my_app/includes/classes/logging/db/Mysql .php' , '/var/www/sites/my_app/includes/classes/logging/db/MysqlPatched .php' , . 1 15 Debugging 1 15 PDT preferences 11 9 Appearance 11 9 Code style 11 9 Debug 12 0 Editor 12 1 New project layout 12 3 PHP executables 12 4 PHP interpreter 12 4 PHP manual 12 4 PHP servers 1 25 Tem pl at es 1 25 Other. assist 11 0 Code folding 11 0 Mark occurrences 11 1 Override indicators 11 2 Type, method, and resource navigation 11 2 Inspection 11 4 Projects and les 11 4 PHP explorer 11 4 Type hierarchy 1 15 Debugging. 14 8 svn 14 8 svnadmin 15 7 svnlook 15 8 svnserve 15 8 svndumplter 15 8 svnversion 15 8 Creating a Subversion project 15 9 Basic version control workow 16 8 A closer look at the repository 17 2 Data store 17 2 Layout

Ngày đăng: 12/08/2014, 16:21

Từ khóa liên quan

Mục lục

  • Cover

  • Copyright

  • Credits

  • About the Author

  • About the Reviewers

  • Table of Contents

  • Preface

  • Chapter 1: Coding Style and Standards

    • Coding standard considerations

      • Pros

      • Cons

      • A PHP coding standard

        • Formatting

          • PHP tags

          • Indenting

          • Line length

          • Line endings

          • Spacing

          • Statements

          • Strings

          • Arrays

          • Control structures

          • Class and method definitions

          • Naming conventions

            • Class names

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan