TAILIEUCHUNG - PHP Objects, Patterns, and Practice- P3

PHP Objects, Patterns, and Practice- P3: This book takes you beyond the PHP basics to the enterprise development practices used by professional programmers. Updated for PHP with new sections on closures, namespaces, and continuous integration, this edition will teach you about object features such as abstract classes, reflection, interfaces, and error handling. You’ll also discover object tools to help you learn more about your classes, objects, and methods. | CHAPTER 5 OBJECT TOOLS Neither solution is ideal. By specifying paths in this much detail you freeze the library file in place. In using an absolute path you tie the library to a particular file system. Whenever you install the project on a new server all require statements will need changing to account for a new file path. By using a relative path you fix the relationship between the script s working directory and the library. This can make libraries hard to relocate on the filesystem without editing require statements and impractical to share among projects without making copies. In either case you lose the package idea in all the additional directories. Is it the business package or is it the projectlib business package In order to make included libraries work well in your code you need to decouple the invoking code from the library so that business can be referenced from anywhere on a system. You can do this by putting the package in one of the directories to which the include_path directive refers. include_path is usually set in PHP s central configuration file . It defines a list of directories separated by colons on Unix-like systems and semicolons on Windows systems. include_path . usr local lib php-libraries If you re using Apache you can also set include_path in the server application s configuration file usually called or a per-directory Apache configuration file usually called .htaccess with this syntax php_value include_path value . usr local lib php-libraries Note .htaccess files are particularly useful in web space provided by some hosting companies which provide very limited access to the server environment. When you use a filesystem function such as fopen or require with a nonabsolute path that does not exist relative to the current working directory the directories in the include path are searched automatically beginning with the first in the list in the case of fopen you must include a flag in its argument list to .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.