Skip to main content
main-content

Über dieses Buch

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 LearnWrite interactive shell scriptsWork with system daemonsWrite desktop softwareBuild network serversInterface with electronics using PHP and the Raspberry PiManage performance, deployment, licensing, and system interactionDiscover 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.

Inhaltsverzeichnis

Frontmatter

Chapter 1. Introduction

Abstract
Both its current recursive moniker (PHP: PHP Hypertext Preprocessor) and the name originally bestowed upon it by its creator Rasmus Lerdorf (PHP: Personal Home Page) reinforce the widely held view that PHP is a scripting language for the Web. And that was true back in 1995 when PHP was first created and for a number of years afterward. In the web arena, PHP excels. It’s easy to use, quick to develop in, widely deployed, and tightly integrated into web stacks (it’s usually the P in LAMP, WAMP, MAMP, and so on), and of course it is free and open source.
Rob Aley

Chapter 2. Getting Away from the Web—the Basics

Abstract
This chapter presents a look at the basic steps involved in breaking PHP free from the Web. You’ll learn the technical steps as well as the differences in programming practices and focus.
Rob Aley

Chapter 3. Understanding the CLI SAPI, and Why You Need To

Abstract
As I mentioned in Chapter 2, most off-web programming you do will involve using the PHP CLI SAPI. It’s therefore important to have a good grasp of how to use it, know the options for configuring and running it, and understand how it differs from the web-based SAPIs you are used to using. Luckily, the differences are minimal, and many are intuitive, although it’s still worth having a thorough read of this chapter as the CLI SAPI forms the basis upon which most of your code will run.
Rob Aley

Chapter 4. Development Tools

Abstract
So far we’ve outlined some of the basics of using PHP without a web server, but before we really get into the nitty-gritty details of developing useful nonweb software, we’re going to take a slight detour into the world of PHP development tools.
Rob Aley

Chapter 5. User-Facing Software

Abstract
After slugging through the preliminary information necessary to understand developing PHP in a nonweb context, you’re now getting to the nitty-gritty of how to start communicating with your users without the rendering engine of a web browser.
Rob Aley

Chapter 6. System Software

Abstract
In the previous chapter, you looked at user-facing software—software that the human user interacts with directly. In this chapter, you are going to look at what I call system software—software that does things (generally) without a human driving it.
Rob Aley

Chapter 7. Interacting with Other Software

Abstract
Few pieces of software run in total isolation. Most talk to various other processes and programs on your system. This is particularly true on open source systems (where licensing is less of an issue), because there is often little point in reinventing the wheel when, with minimal effort, you can simply call upon other existing software and libraries to perform tasks that are already a “solved problem.”
Rob Aley

Chapter 8. Talking to the System

Abstract
So far you’ve looked at software that communicates with your users, via text-based or graphical interfaces, and system software that doesn’t need to talk to users at all. One thing that both types of software have in common is the need to deal with the underlying system that it sits on top of. That system is a structure containing the file system, operating system, hardware interfaces, and various system-level services. When programming for the Web, you typically don’t interact with hardware, lower-level aspects of the system, and so on. Indeed, in many cases, you specifically take steps to prohibit your users from doing so!
Rob Aley

Chapter 9. Performance and Stability—Profiling and Improving

Abstract
PHP script performance (a term we use to encompass indicators such as speed of execution and usage of resources) is an issue for both PHP-based web sites as well as other applications written in PHP. This chapter looks at the issues affecting PHP performance in general, specific performance considerations for nonweb applications, and the tools and resources available for solving performance-related problems. We also look at stability of long-running scripts, which is often tied closely to performance issues..
Rob Aley

Chapter 10. Distribution and Deployment Issues

Abstract
Now that you’ve written your perfect piece of software, your audience eagerly awaits its delivery and installation onto their precious machines. Distributing and deploying software comes with its own set of headaches above and beyond those you encountered just writing the damn thing. This chapter covers some of the issues that you may come across when thinking about deployment and distribution of your software. These issues may vary from those that arise from the common situation of pushing code to your own web server for a PHP-driven web site. In particular, this chapter focuses on scenarios of distributing your software in a way that it is no longer under your direct control and not on your own systems.
Rob Aley

Backmatter

Weitere Informationen

Premium Partner

    Bildnachweise