پیاچپی فراتر از وب: اسکریپتهای شل، نرمافزارهای دسکتاپ، دیمونهای سیستم و بیشتر بدون یادگیری زبان جدید
PHP beyond the web : shell scripts, desktop software, system daemons, and more without learning a new language
معرفی کتاب «پیاچپی فراتر از وب: اسکریپتهای شل، نرمافزارهای دسکتاپ، دیمونهای سیستم و بیشتر بدون یادگیری زبان جدید» (با عنوان لاتین PHP beyond the web : shell scripts, desktop software, system daemons, and more without learning a new language) نوشتهٔ Robert Aley، منتشرشده توسط نشر Apress : Imprint : Apress در سال 2017. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.
Use your existing web-based PHP skills to write all types of software: CLI scripts, desktop software, network servers, and more. This book gives you the tools, techniques, and background necessary to write just about any type of software you can think of, using the PHP you know. PHP Beyond the Web shows you how to take your knowledge of PHP development for the web and utilise it with a much wider range of software systems. Enjoy the benefits of PHP after reading this book: save money by redeploying existing skills, not learning new ones; save time and increase productivity by using a high-level language; and make money by providing your clients a full-stack service (not just websites). PHP is no longer just a great scripting language for websites, it's now a powerful general-purpose programming language. Expand your use of PHP into your back-end systems, server software, data processing services, desktop interfaces, and more. What You'll Learn Write interactive shell scripts Work with system daemons Write desktop software Build network servers Interface with electronics using PHP and the Raspberry Pi Manage performance, deployment, licensing, and system interaction Discover the software tools for development and get other great sources of technical information and help Who This Book Is For Experienced PHP programmers or experienced programmers interested in leveraging PHP outside the web development context. Contents at a Glance 4 Contents 5 About the Author 15 About the Technical Reviewer 16 Acknowledgments 17 Chapter 1: Introduction 18 “Use PHP? We’re Not Building a Web Site, You Know!” 18 Further Reading 19 Are You New to PHP? 19 Further Reading 19 Reader Prerequisites 20 An Important Note About Operating Systems 20 PHP on WSL: Windows Subsystem for Linux 20 Further Reading 21 About the Sample Code 21 External Resources 21 Further Reading 21 PHP 7 22 Chapter 2: Getting Away from the Web—the Basics 23 PHP Without a Web Server 23 PHP Versions: What’s Yours? 24 A Few Good Reasons Not to Do It in PHP 25 High-Performance Requirements 25 Don’t (Necessarily) Reinvent the Wheel 25 Keeping the Source Closed 25 Thinking About Security 26 Further Reading 27 CLI-Specific Code Frameworks 27 Further Reading 27 Chapter 3: Understanding the CLI SAPI, and Why You Need To 29 What’s Different About the CLI SAPI? 29 Further Reading 30 CLI SAPI Installation 30 PHP Command-Line Options 30 Further Reading 34 Command-Line Arguments for Your Script 34 The Many Ways to Call PHP Scripts 36 From a File 36 From a String 36 From STDIN 37 As a Self-Executing Script: Unix/Linux 37 Further Reading 38 As a Self-Executing Script: Windows 39 Windows php-win.exe 39 “Click to Run” Your PHP 39 Clickable Icons: Linux 40 Further Reading 40 Clickable Icons: Windows 40 Clickable Icons: Ubuntu Unity 41 Further Reading 42 Quitting Your Script 42 Further Reading 43 Chapter 4: Development Tools 44 PHP REPLs 44 Build Systems 48 Continuous Integration 49 Further Reading 49 Debuggers 51 Testing and Unit Testing 52 Further Reading 53 Static Code Analysis 54 Further Reading 55 Virtual Development and Testing Environments 57 Further Reading 59 Source/Version-Control Systems and Code Repositories 59 Further Reading 60 IDEs and Editors 60 Documentation Generators 60 Profilers 61 Other Tools 61 Chapter 5: User-Facing Software 64 Command-Line Interfaces 65 Command-Line Interface Basics 65 Advanced Command-Line Input 68 Further Reading 71 Working with STDIN, STOUT, and STDERR 71 CLI Helper Libraries 73 Partial GUI Elements—Dialog Boxes 74 Dialogs Invoked from the Shell 74 notify-send 74 zenity 75 kdialog 75 Further Reading 75 Windows Dialog Boxes 76 Static HTML Output 76 Further Reading 78 Complete Graphical Interfaces 78 Further Reading 78 Understanding GUI and Event-Based Programming 78 Further Reading 79 wxPHP 79 Further Reading 80 PHP-GTK 83 Local Web Server and Browser 85 Further Reading 85 PHP’s Built-in (Testing) Web Server 85 WebSocket and Browser 86 SiteFusion 87 WinBinder 88 Adobe AIR 88 NW.js 88 Electron 89 PHP-Qt 89 PHP/TK 89 Chapter 6: System Software 90 Daemons in PHP 90 Creating a Daemon 91 Further Reading 95 Network Daemons Using libevent 95 Further Reading 100 File Monitoring Daemons Using inotify 100 Using the inotify PECL Extension 101 Further Reading 103 Further Reading 103 Using the inotifywait Command 104 Inotify Limits 105 Task Dispatch and Management Systems 105 Gearman and PHP 105 Further Reading 107 Other Task Dispatch Systems 107 Further Reading 107 Chapter 7: Interacting with Other Software 108 Starting External Processes from PHP, or Shelling Out 108 Further Reading 109 Further Reading 109 Talking to Other Processes 109 Semaphores 109 Further Reading 111 Further Reading 111 Shared Memory 111 Further Reading 115 PHP Message Queues 115 Further Reading 119 Third-Party Message Queues 119 Further Reading 121 APC Cached Variables 121 Further Reading 121 Virtual Files—tmpfs 121 Virtual Files—Windows RAM Disks 122 Further Reading 122 Standard Streams 122 Linux Signals 123 Task Dispatch and Management Systems 123 Chapter 8: Talking to the System 124 File-System Interactions 124 Data Files and Formats 124 Dealing with Large Files 125 Further Reading 126 Understanding File System Functions 127 Further Reading 127 The PHP File Status and realpath Caches 127 Working with Cross-Platform and Remote File Systems 128 Accessing the Windows Registry 129 Further Reading 130 Linux Signals 131 Further Reading 132 Sending Signals 134 Linux Timed-Event Signals 134 Printing (to Paper) 136 Further Reading 136 Audio 138 Further Reading 139 Databases—No Change Here 139 Other Hardware and System Interactions 139 PHP and the Raspberry Pi 140 Raspberry Pi: The Basics of Tri-State Logic 140 Raspberry Pi: Accessing the GPIO Ports from PHP 143 Raspberry Pi: Using the Rest of the Hardware 146 Raspberry Pi: Further Resources 146 Further Reading 146 Chapter 9: Performance and Stability—Profiling and Improving 148 The Background on Performance 148 Further Reading 149 Specific Issues for General-Purpose Programming 149 Profile, Profile, Profile! 150 Manual Profiling 150 Profiling Tools 152 Further Reading 152 Low-Level Profiling 154 Further Reading 154 Profiling—The Likely Results 154 Further Reading 155 Silver Bullets 155 Silver Bullet 1—Better Hardware 155 Silver Bullet 2—Newer PHP Versions 155 Silver Bullet 3—Opcode Caching 156 Further Reading 156 Silver Bullet 4—Compiling 156 Further Reading 158 Silver Bullet 5—JIT Compilers and Alternative Virtual Machines 158 Further Reading 159 Further Reading 160 Further Reading 161 The Standard PHP Library 161 Further Reading 161 Garbage Collection 162 Further Reading 162 Multithreading and Concurrent Programming in PHP 163 Further Reading 163 Big Data and PHP—MapReduce 164 Further Reading 164 Data Caching 165 Further Reading 165 Know Thy Functions 166 Further Reading 166 Outsourcing Code to Other Languages 166 Further Reading 167 Other Performance Tips and Tricks 167 Further Reading 167 Stability and Performance of Long-Running Processes 168 Avoid Micro and Premature Optimizations 169 Chapter 10: Distribution and Deployment Issues 171 Error Handling and Logging 171 Further Reading 173 Installers and Bundling Files 173 Embedded Data Files at the End of a PHP Script 173 Phar Executable Bundles 174 Further Reading 175 Generic Installers 175 Controlling the (PHP) Environment 176 Extending Your Application with Plug-ins 177 Further Reading 177 Documentation 177 Further Reading 177 Licensing and Legal Issues 178 Further Reading 179 Deploying Frameworks 179 Appendix A: Compiling and Installing PHP, Extensions, and Libs 180 Compiling and Installing PHP 180 Windows 181 macOS 181 Linux/Unix 181 Compiling and Installing (Extra) Core Extensions 183 Installing Multiple Versions of PHP 184 Further Reading 185 Using PEAR and PECL 185 Using Composer 185 Using Symfony2 Bundles 186 Appendix B: File and Data Format Libraries for PHP 187 Office Documents 187 Compression, Archiving, and Encryption 190 Graphics 191 Audio 192 Multimedia and Video 193 Programming, Technical, and Data Interchange 193 Miscellaneous 194 Appendix C: Sources of Help 195 The PHP Manual 195 Official Mailing Lists 195 Stack Overflow 195 Other Books 196 Newsgroups 196 PHP Subreddit 196 PHP on GitHub 196 PHP News Sites 197 Appendix D: Interesting Libraries, Tools, Articles, and Projects 198 Alternative Programming Styles 198 Machine Learning, Artificial Intelligence, and Data Analysis 199 Databases 201 Natural Language 201 Graphics and Imaging 202 Unicode 203 Audio 203 Event-Driven PHP 203 PHP Internals 204 Web Site/Service APIs 204 Security Related 205 JavaScript 205 Servers 205 Programming 206 Financial 206 Hardware 206 Appendix E: Integrated Development Environments for PHP 207 Open Source Options 207 Commercial Options 208 Afterword: Where Now? 210 Giving Feedback and Getting Help and Support 210 Index 211 Use your existing web-based PHP skills to write all types of software: CLI scripts, desktop software, network servers, and more. This book gives you the tools, techniques, and background necessary to write just about any type of software you can think of, using the PHP you know. PHP Beyond the Web shows you how to take your knowledge of PHP development for the web and utilise it with a much wider range of software systems. Enjoy the benefits of PHP after reading this book: save money by redeploying existing skills, not learning new ones; save time and increase productivity by using a high-level language; and make money by providing your clients a full-stack service (not just websites). PHP is no longer just a great scripting language for websites, it's now a powerful general-purpose programming language. Expand your use of PHP into your back-end systems, server software, data processing services, desktop interfaces, and more. You will: Write interactive shell scripts Work with system daemons Write desktop software Build network servers Interface with electronics using PHP and the Raspberry Pi Manage performance, deployment, licensing, and system interaction Discover the software tools for development and get other great sources of technical information and help
دانلود کتاب پیاچپی فراتر از وب: اسکریپتهای شل، نرمافزارهای دسکتاپ، دیمونهای سیستم و بیشتر بدون یادگیری زبان جدید