điện tử hoặc cơ khí, bao gồm cả photocopy, ghi âm, hoặc bằng bất kỳ lưu trữ thông tin hoặc hệ thống thu hồi, mà không có sự cho phép trước bằng văn bản của chủ sở hữu quyền tác giả và nhà xuất bảnVOiCE ® của chuyên gia trong phpLời nói đầu bởi dự án chì | CHAPTER 1 GETTING STARTED Figure 1-4. Zend Framework project welcome screen Exploring the Anatomy of Your Project If you open the folder that the Zend Tool Framework created for your project you will see that the project is organized into three subfolders public All the files that must be publicly accessible will reside in this folder which will be your document root. library This folder will contain the framework s library as well as a custom library that you will create for this project. application This folder is the heart of your project. It is where your models views and controllers will be. You should note that ZF is not nearly as strict as many other application frameworks. This structure represents the standard layout of a ZF application so many aspects of the framework will work without overriding the default behavior. At the same time you can customize almost every aspect of the framework to work the way you want it to work. I prefer the convention over configuration approach so I tend to stick with the defaults whenever possible. 8 Download at CHAPTER 1 GETTING STARTED The public Folder The public folder is your document root. Zend Framework follows current best security practices by not exposing any of the core executable files to the public. The only files that are kept in the public web root are files that the browser must be able to access. Redirecting the Request with .htaccess When a new request comes to your project the server loads the .htaccess file Listing 1-3 . The .htaccess file does two things. First it sets the APPLICATION_ENV environmental variable. This enables you to manage multiple environments in the application which can be configured independently. Once this is set it redirects every request that does not map to an existing file to the file. Listing 1-3. The .htaccess file in public .htaccess SetEnv APPLICATION_ENV development RewriteEngine On RewriteCond REQUEST_FILENAME -s OR RewriteCond rEQUEST_FILENAMe -l .