SYMFOY2 directory structure description, SYMFOY2 directory structure _php tutorial

Source: Internet
Author: User
Tags event listener

SYMFOY2 directory structure description, SYMFOY2 directory structure


Understanding the framework's directory structure is a way for the framework to get started quickly, with a mature framework where each functional module is partitioned into different directories.

Symfony2 Level directory structure:

├──app                // This directory contains, the configuration file (the application configuration file will be import into the configuration file in this area to take effect), the cached class, the cached template ├──bin├── Composer.json├──composer. Lock ├──license├──readme.md├──src                 // The applications we write are stored in this directory (including controller, Model, View, routing profile, application configuration file, etc.)├──upgrade-2.2. Md├──upgrade -2.3md├──upgrade-2.4.            md├──upgrade.md├──vendor//  Symfony2 's core modules (Httpkernel components, dependencyinjection components, etc.) and third-party plug-ins (most commonly used third-party plug-ins sonataadmin) are stored in this directory └──web               // entrance script files are stored in this directory

The following are the main instructions for SYMFONY2 level two directories and subdirectories

Web Directory main File Description:

├──app_dev.php                          // Debug Mode entry file (in debug mode, additional output of the application's running information, including load time, routing performed, execution of SQL statements, etc.)├──apple-touch- icon.png├──app.php                               // import file in production environment (equivalent to index.php effect of TP frame) ├──bundles├──config.php├──favicon.ico├──robots.txt

App directory main directory and file description:

├──appcache.php├──appkernel.php//a Appkernel class is initialized inside the portal file, and the Appkernel class is in this file, and the main function of the Appkernel class is to initialize the bundle for the entire Web application. //including the core bundle of the SYMFONY2 framework, the bundle of third-party plug-ins, and the bundle,bundle of our own applications, in Symfony2, are equivalent to a complete //a complete package of a function, and the bundles we want to use must be registered within the Appkernel class. ├──autoload.php//the file is responsible for automatically loading the classes that are registered inside, and usually we don't need to manually modify it├──bootstrap.php.cache//Symfony2 the core class cache file, the core class that the SYMFONY2 framework must use will be compiled into this file. The purpose of this is to reduce the running time when opening//The number of files, improve the speed of operation. Because different classes are stored in different files, if the necessary classes are not cached in a file, then each time we run//to open multiple files. If we organize the necessary classes into a file, we run them in the same file each time. For example: Request class, Response class,//container classes, kernel classes, and so on will be cached in this file. So, if we want to echo ' debug in Request ' inside the request class; Such a statement, we will put//This statement writes the request class under the Bootstrap.php.cache file instead of the symfony/vendor/symfony/symfony/src/symfony/component/ httpfoundation/request.php//the request class inside. Actually symfony/vendor/symfony/symfony/src/symfony/component/httpfoundation/ The request class inside the request.php is cached to Bootstrap.php.cache//in the├──cache//cache directory, cached in different modes (build mode, debug mode). The main cache is the template file, container class, route map related data, etc.│├──dev│└──prod├──check.php├──config//The directory where the configuration files are stored, config_dev.yml and config_prod.yml are the configuration files that are loaded by the SYMFONY2 framework. However, to facilitate management, we will be the configuration of different modules//To make these profiles work in different configuration files, we also need to import them into config_dev.yml and config_prod.yml. │├──config_dev.yml//configuration file for debug mode│├──config_prod.yml//configuration file for Build mode│├──config_test.yml│├──config.yml//generic configuration file, as long as the import into the corresponding debug mode of the configuration file, you can take effect│├──parameters.yml//the variables used to store the configuration file, for example: Data name, database password, database host, and so on│├──parameters.yml.dist│├──routing_dev.yml//in debug mode, the routing configuration file that we write in SRC requires import to this file to be valid│├──routing.yml//Generic Routing configuration file│└──security.yml//firewall configuration file, where the firewall is the Web application firewall, not the server's firewall, which is configured with role permissions, ACLs, etc., this file needs config_*.php import in order to take effect├──console├──logs//Symfony2 running logs, similarly, different modes have different logs│├──dev.log│└──prod.log├──phpunit.xml.dist├──resources│└──views└──symfonyrequirements.php

A demo directory under SRC shows:

├──demobundle//src Directory is the code of our application layer, a function can be organized into a bundle, such as a simple shopping cart function, a bit more complex//a blog system can be organized into a bundle. │├──acmedemobundle.php//Do you remember app/appkernel.php? Each bundle to be loaded and acted on by the SYMFONY2 framework requires that the bundle be registered to the Appkernel class, which is actually//To register the bundle class in this file with the Appkernel class, we can manually add it to the Appkernel class, or you can generate a bundle from the command line //added to Appkernel inside. │├──command│├──controller//Controller directory, as the name implies, this directory is the controller class, if you do not understand what is controller, please learn MVC first│├──dependencyinjection//This directory holds an extension to the Acmedemobundle│├──eventlistener//This directory holds the event listener class, the SYMFONY2 framework is an event-driven framework, and different stages trigger different times, and the listener listens to the corresponding event,//The listeners are then executed when the corresponding event is triggered. If the contact is not very understanding, can not be too tangled, and further into contact. │├──form//This directory holds the form class. │├──resources//The directory contains the bundle's configuration files, template files, etc.├──config├──routing.yml//This file holds the routing configuration of the bundle└──services.xml//This file holds the bundle's services Configuration├── Public└──views//This folder holds all the template files for the bundle│├──tests│└──twig


The Android directory structure is what, detailed instructions,

SRC: source Location
Gen: System auto-generated ID index
android4.2.2 and Android PR ... And Libs: Here is a jar or library that you may need to import
Asset: Storage of foreign resources
Bin: The jar or apt generated by the final program
Res: is the different resolution picture store (drawable beginning); Layout file; menu layout file; custom values such as color, string, etc. (values start with)
Androidmanifest:android program configuration files, such as rights management, activity registration, etc.;
----, let's go buy a book.

Ubuntu directory Structure

/boot: Here is the place where the Linux core and boot-related files are located, and the vmliuz-xxx in the directory is the kernel. If booting is using grub, there is also a/boot/grub subdirectory in this directory.

/dev: This directory is the external device for all Linux, and it functions like. SYS and WIN under DOS. vxd. In Linux, devices and files are accessed in the same way, for example:/dev/hda represents the first physical IDE hard disk.

/etc: The files that the system needs to read during the boot process are in this directory. such as Lilo parameters, user accounts, and passwords.

/home: The user's main directory, such as a user named Buyu, whose home directory is/home/buyu.

/lib: This directory contains the most basic dynamic link shared library of the system, similar to the System32 directory under Windows, and almost all applications need to use these shared libraries.

/lost+found: Stores files that have been lost due to an illegal shutdown, similar to the. chk file under Windows.

http://www.bkjia.com/PHPjc/890822.html www.bkjia.com true http://www.bkjia.com/PHPjc/890822.html techarticle SYMFOY2 directory structure description, SYMFOY2 directory structure Understanding the framework's directory structure is a way for the framework to get started quickly, a mature framework, each functional module is divided into different storage ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.