LotusPhp framework directory_PHP tutorial
The order is a bit messy. In fact, the introduction should be followed by the introduction of the program directory. I was busy in those days, so I wrote some simple ones. Today I am back on track and will finish writing all Lotusphp in order. Documentation
│ Config.php ConfigExpression / Configuration expression class
│ Lotus.php Glue code
│ shortcut.php � 到 到到 到 到 suit: Store.php LtStoreFile / File storage class
│ StoreMemory.php LtStoreMemory / Memory storage class, used in general test mode Automatic Loading
│ CacheAdapterFactory.php CacheAdapterFactory / Cache Adapter Factory Class
│ │ CacheConfigBuilder.php CacheConfigBuilder / Cache Configuration Class
│ │ CacheConnectionManager.php ConnectionManager / Cache connection manager class
│ │ CacheHandle.php │ CacheAdapter / Cache Adapter Interface
│ │ CacheAdapterApc.php CacheAdapterApc / Apc Cache Adapter Class
│ │ CacheAdapterEAccelerator.php CacheAdapterEAccelerator / EAccelerator cache adapter class
│ │ CacheAdapterFile.php CacheAdapterFile / File Cache Adapter Class
│ │ CacheAdapterMemcache.php AdapterMemcache / Memcache Cache Adapter Class
│ │ CacheAdapterMemcached.php CacheAdapterMemcached / Memcached Cache Adapter Class
│ │ CacheAdapterXcache.php CacheAdapterXcache /│ b─TableDataGateway TableDataGateway / Table data gateway
│ CacheTableDataGateway.php CacheTabledataGateway / cache table data gate A> │ │ Captcha.php Captcha / Verification Code
│ │ CaptChaimagengine.php Captchaimagengine / Verification Code Picture Generation Class
│ │
│ ─fonts FONTS / font folder
│ Ding-DongDaddyO.ttf
│ Duality.ttf
│ Jura.ttf
│ StayPuft.ttf
│ TimesNewRomanBold.ttf
│ VeraSansBold.ttf
│
├─ Cookie Cookie / Cookie operation class
│
├─DB PHP DBADAPTERFACTORY / Database Adapter Factory Class
│ │ Dbconfigbuilder.php Dbconfigbuilder / Database Configuration Class
│ │ DBConnectionManager.php DbConnectionManager / Database Connection Manager
│ │ │ dbhandle.php dbhandle / database operating handle
│ │ DBSQLESSION.PHP DBSQLEXPRESSION / Database SQL expression class
│ │
│ ├ ─ ADapter Adapter / Adapter
│ │ │ dbconnectionadapter. PHP qli.php DbConnectionAdapterMysqli / Mysqli connection adapter class
│ │ │ DbConnectionAdapterPdo.php DbConnectionAdapterPdo / Pdo connection adapter Class
│ │ │ DbConnectionAdapterPgsql.php DbConnectionAdapterPgsql /
PostgreSQL connection adapter class
│ │ │ DbConnectionAdapterSqlite.php DbConnectionAdapterSqlite / Sqlite connection adapter class
│ │ │ │ └─SqlAdapter SqlAdapter / Sql adapter
│ │ DbSqlAdapter.php DbSqlAdapter / Sql adapter class
│ │ DbSqlAdapterMys ql. PHP DBSQLADAPTERMYSQL /MySQL SQL adapter class
│ │ dbsqladapterpgsql.php dbsqladapterpgsql /PostgreSql SQL adapter class
│ │ DBSQLADAPTERTERTERITE.PHP DB DB SQLADAPTERSQLITE / SQLITE SQL adapter class
│ │
│ └ - Queryngine Queryngine / Database Query Engine
│ ├─SqlMap │ │ │ │ │ │ Object.php AbstractDbSqlMapFilterObject / SqlMap Processing Factory Abstract Class
│ │ DbSqlMapClient.php │ │ │ DbSqlMapResultFactory.php DbSqlMapResultFactory / SqlMap record factory class
│ │ │TableDataGateway DbTableDataGateway / Table data gateway class
│ DbTableRelation.php DbTableRelation / Empty
│ DbWhereCondition. php Inflector.php
│
├─Logger
├ - MVC MVC / MVC
│ Action.php Action / Action abstract class, under the MVC mode, all running programs must inherit it or its subclasses
│ Component.php Component / and Action Similarly, there is verification under Action, such as identity, form verification, and Component without verification
│ Context.php Context.php Context/Context processing class handles some common operations of clients and servers, such as form variable judgment, etc.
│ Dispatcher.php Dispatcher / Dispatching class. From it to call the relevant class │ TemplateView.php Template / Template
│ View.php Template / Class
│
├ - ObjectIl ObjectItil.php ObjectUtil / Declare the singleton mode of various classes
│
├─Pagination Pagination Rbac.php RBAC / RBAC Authentication Class
│
├─Router Router / Routing class. Parse url's
│
├─Session . SessionStoreFiles.php SessionStoreFiles / Session file Storage class
│ SessionStoreMemcache.php SessionStoreMemcache/Session MemcacheStorage class
│ SessionStoreMysql.php SessionStoreMy sql / Session Mysql storage class, temporarily empty
│ SessionStoreSqlite.php SessionStoreSqlite / Session Sqlite storage class
│ u─ Url url
│ url.php url / url generated class
│
├ - Validator value / form verification
│ validator.php value / form verification class
│ ValidatorDtd.php
This is a file directory printed with dos. Each file and folder has annotations listed. You can see the directory structure and mutual functions. Even without looking at the code, you can understand the general architecture and the functions of each class. , helpful for understanding Lotusphp
Each folder represents a component. There may be multiple classes or subclasses under each component.
The several files in the root directory of the folder are the basic classes of Lotusphp and are indispensable. Even if you transplant the components to other frameworks in the future, these basic classes must be transplanted together. If you want to transform other classes to suit Lotusphp's framework calls, you must fully understand these basic classes.
Lotus.php is the glue code, used to glue all components and set related parameters. It is also the only page that needs to be referenced in the framework. The others are automatically loaded by Autoloader
Config.php and ConfigExpression.php are configuration classes that are specially designed to read configuration files. Many function definitions in Lotusphp need to be implemented through configuration files. Programs can be quickly changed through configuration file classes. Settings, such as some properties of database connection, some settings of paging, etc.
Store.php, StoreFile.php, and StoreMemory.php are the basic classes used for file storage operations. Configuration, templates, Autoloader, etc. are all implemented through file caching
In future chapters we will have a detailed usage introduction for all components
www.bkjia.com

In PHP, trait is suitable for situations where method reuse is required but not suitable for inheritance. 1) Trait allows multiplexing methods in classes to avoid multiple inheritance complexity. 2) When using trait, you need to pay attention to method conflicts, which can be resolved through the alternative and as keywords. 3) Overuse of trait should be avoided and its single responsibility should be maintained to optimize performance and improve code maintainability.

Dependency Injection Container (DIC) is a tool that manages and provides object dependencies for use in PHP projects. The main benefits of DIC include: 1. Decoupling, making components independent, and the code is easy to maintain and test; 2. Flexibility, easy to replace or modify dependencies; 3. Testability, convenient for injecting mock objects for unit testing.

SplFixedArray is a fixed-size array in PHP, suitable for scenarios where high performance and low memory usage are required. 1) It needs to specify the size when creating to avoid the overhead caused by dynamic adjustment. 2) Based on C language array, directly operates memory and fast access speed. 3) Suitable for large-scale data processing and memory-sensitive environments, but it needs to be used with caution because its size is fixed.

PHP handles file uploads through the $\_FILES variable. The methods to ensure security include: 1. Check upload errors, 2. Verify file type and size, 3. Prevent file overwriting, 4. Move files to a permanent storage location.

In JavaScript, you can use NullCoalescingOperator(??) and NullCoalescingAssignmentOperator(??=). 1.??Returns the first non-null or non-undefined operand. 2.??= Assign the variable to the value of the right operand, but only if the variable is null or undefined. These operators simplify code logic, improve readability and performance.

CSP is important because it can prevent XSS attacks and limit resource loading, improving website security. 1.CSP is part of HTTP response headers, limiting malicious behavior through strict policies. 2. The basic usage is to only allow loading resources from the same origin. 3. Advanced usage can set more fine-grained strategies, such as allowing specific domain names to load scripts and styles. 4. Use Content-Security-Policy-Report-Only header to debug and optimize CSP policies.

HTTP request methods include GET, POST, PUT and DELETE, which are used to obtain, submit, update and delete resources respectively. 1. The GET method is used to obtain resources and is suitable for read operations. 2. The POST method is used to submit data and is often used to create new resources. 3. The PUT method is used to update resources and is suitable for complete updates. 4. The DELETE method is used to delete resources and is suitable for deletion operations.

HTTPS is a protocol that adds a security layer on the basis of HTTP, which mainly protects user privacy and data security through encrypted data. Its working principles include TLS handshake, certificate verification and encrypted communication. When implementing HTTPS, you need to pay attention to certificate management, performance impact and mixed content issues.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1
Powerful PHP integrated development environment