Yii Fast, secure, professional PHP Framework _php Foundation

Source: Internet
Author: User
Tags benchmark error handling i18n php framework sql injection yii zend framework ruby on rails

Yii is a high-performance PHP framework for developing WEB2.0 applications.
Yii brings rich features including mvc,dao/activerecord,i18n/l10n, caching, authentication and role-based access control, scaffolding, testing, etc., which can significantly shorten development time

Official website: http://www.yiiframework.com/

Yii Fast

Yii only loads the functionality you need. It has powerful caching support. It is clearly designed to work efficiently with AJAX.

Yii Security

The standard of YII is safe. It includes input validation, output filtering, SQL injection, and Cross-site scripting prevention.

Professional

YII can help you develop clean and reusable code. It follows the MVC pattern, ensuring a clear separation of the logical and presentation layers.

The YII framework is a high-performance PHP framework for developing large Web applications based on components. Yii provides almost everything the Web 2.0 application development needs today. Yii is one of the most efficient PHP frameworks. Yii is the founder of the painstaking crystallization of Manggold J, began to develop on January 1, 2008.

Yii is a component-based, high-performance PHP framework for developing large Web applications. Yii is written in strict OOP and has perfect library references and comprehensive tutorials. From mvc,dao/activerecord,widgets,caching, hierarchical rbac,web services, to thematic, i18n, and l10n,yii provide nearly everything you need for today's Web 2.0 application development. In fact, Yii is one of the most efficient PHP frameworks.
Yii is a high-performance PHP5 Web application Development framework. With a simple command-line tool, YIIC can quickly create a code framework for a Web application that allows developers to add business logic based on the generated code framework to quickly complete application development.

Yii Benefits

Yii is easy to learn and use. All you need to know about PHP and object-oriented programming is to get started quickly without having to learn a new architecture or template language in advance.
With the development of Yii very fast, in addition to the framework itself, need to write for the application of very little coding. In fact, this is one of the most efficient development frameworks.
YII is highly reusable and scalable, and is purely object-oriented. Everything in Yii is a self-contained, reusable, extensible component. More importantly, YII has an increasing number of extension libraries. Components that are mainly contributed by the user, which may help significantly reduce your development time.
Yii has a wealth of features. From MVC, Dao/activerecord, to thematic, internationalization, and localization, YII delivers the functionality required for nearly all today's Web 2.0 application development.
The Yii reference manual is a complete, YII document with whatever information you need to learn and master it.
Yii was first designed to accommodate the development of complex web applications. He is not a by-product of some projects or a third party integration. Instead, it incorporates the author's rich experience in Web application development and other popular web frameworks and applications for the crystallization of good ideas.
Finally, but not unimportant, Yii is free and Yii follows the latest BSD license. It ensures that its third party development is also sequential and BSD compatible with the license. This means that you are free to use yii, both legally and financially, to develop any open source or proprietary application.

Characteristics

Yii has almost all the features of today's Web 2.0 application development. The following is a short list of these features.
Model-View-controller (MVC) design pattern: Yii uses this mature technology in web programming to better separate the logical layer from the presentation layer.
Database Access Objects (DAO) and active Record:yii allow data objects in the developer model database to reduce their effort to write long and repetitive SQL statements.
Integration with jquery: As one of the most popular JavaScript frameworks, jquery can write efficient and flexible JavaScript interfaces.
Form input and validation: Yii makes it easy and safe to collect form input. Yii has a validator that ensures the validity of the data, as well as auxiliary methods and components that show errors when validation fails.
Web 2: Supported by jquery, Yii comes with a set of Web 2.0 parts, such as AutoComplete input fields, TreeView, and so on.
Authentication and Authorization: YII has built-in authentication support. It also supports the authorization of Role-based access Control (RBAC) through tiering.
Theme: It can instantly change the view of a yii application.
Web services: Yii supports the automatic generation of complex WSDL service specifications and the management of Web service request processing.
Internationalization (i18n) and Localization (L10N): YII supports message conversion, date and time formats, digital formats, and interface localization.
Tiered caching scenario: Yii supports data caching, page caching, fragment caching, and dynamic content. Cached storage media, which can be easily changed without touching the application code.
Error handling and Logging: error handling is well presented, log information can be sorted, filtered, and assigned to different locations.
Security: Yii is equipped with a number of security measures to help secure Web applications to prevent network attacks. These include Cross-site scripting (XSS) prevention, cross site request forgery (CSRF) prevention, cookie tampering prevention, and so on.
Components that conform to xhtml:yii and command line tools generate code that conforms to XHTML standards.
Automatic code Generation: Yii provides tools for automatically generated code, depending on your needs, such as generating a skeleton, crud application, and so on.
Fully object-oriented: The YII framework adheres to the strict object-oriented programming paradigm. It does not define any global functions or variables. Moreover, it defines a class hierarchy that allows maximum reusability and customization.
Friendly use of Third-party code: YII carefully designed to make it a third party code very good work. For example, you can use the code of the pear or Zend framework in your YII application.
Detailed documentation: Each single method or attribute is well documented. A comprehensive tutorial and some novice tutorials are also available.
Extensions Library: Yii provides an extension library that makes up a user-supplied component, making this list of features never-ending.

About Yii

Yii is a component-based, high-performance PHP Framework for developing large WEB applications. In web development Yii can maximize code reuse, greatly improve the speed of development. The name Yii (pronunciation is Yee or [JI:], should be "easy" pronunciation) is representative of the easy, efficient (efficient) and extensible (extensible)
Environmental requirements
To run a Yii-driven Web application, you need to have a Web server that supports PHP 5.1.0 or above.
Knowing object-oriented programming (OOP) can be very helpful for developers who intend to use YII. Because Yii is a pure OOP framework.
Applicable scope
Yii is a common web programming framework that can be used to develop almost all Web applications. Because it is lightweight and has a proven cache solution, it is especially useful for developing high flow applications such as portals, forums, Content management systems (CMS), e-business systems, and so on.
Compared with similar products
Like most PHP frameworks, Yii is a framework for MVC.
Yii wins other frameworks for its superior performance, rich functionality and clear documentation. Yii was carefully designed from the outset to be suitable for rigorous WEB application development. It is neither a derivative of a other project nor a combination of a third party work. It is the author's rich experience in Web application development and the research and thinking of most popular web programming frameworks and applications.

Performance

Yii Performance
Yii is a high-performance framework, and the following chart shows the efficiency of yii in comparison with other popular PHP frameworks. In this diagram, RPS represents "request per second", describing how many requests are executed per second by this framework. The larger the number, the higher the performance of the framework, and we can see that in this comparison Yii trumps other frameworks. The performance advantage of the YII is especially significant the widely used APC extension is enabled.
Performance alone is isn't the whole story (otherwise we should all use plain HTML or PHP). With such superior performance, Yii still provides a very rich feature setwhich can greatly improve your development effic Iency.
Why is yii so fast
Yii is so fast because it uses lazy loading technology extensively. For example, it will not be included until the first time the class is used, and the object will not be created until the object is first accessed. Frameworks suffer from the performance hit because they would enable a functionality (e.g. DB connection, user Sessi ON) No matter it are used or not during a request.
Standard settings
Here we explain how to design benchmark applications and get the RPS results above.
Base Request
Since Our goal are to compare the minimal overhead the all framework, the benchmark application for each framework should b E The simplest one. We choose to display a ' Hello world ' text string by placing an echo statement in the ' default action of each application. Any additional framework features (e.g. sessions) are disabled to ensure fairness of the comparison. To obtain a copy of the benchmark applications, please check out the Phpmark project.
Why use "Hello world"
Our test of "Hello World" is mainly to achieve our goals, such as: Find the minimum cost of each frame. Many people complain that the app "Hello World" is meaningless, as real-world applications often need to involve more complex tasks, such as database queries. This is wrong. In fact, especially in some large-scale web2.0 applications, what we often encounter is usually quite close to "Hello World". For example, the time that an application returns the current server in response to an AJAX request. Most of the content in the page is cached, and the application only needs to crawl the cached content and display it.
Another reason to use "Hello World" is that when you refer to a feature that is more complex (such as a database query), it is hard to guarantee a clear contrast. For example, a framework can perform very efficiently in a database query, but lacks a caching scheme. When another frame is slightly slower on the database query, there is an advanced caching feature to mitigate the system loss. In short, there are too many factors involved to make a clear comparison.
Standard tools and environments
Use the Apachebench tool's instruction "Ab–t 30-c URL" to get RPS number (for example: Run test 30 seconds in concurrent series 10). To get the number of each frame, we stopped and started the Apache Web server to avoid interference. Also run the test program several times to "preheat" the test environment. In Phpmark project, there is a name benchmark. The shell script of SH automates the benchmark program.

Credits

Yii's many ideas come from other well-known WEB programming frameworks and applications. The following is a short list.
Prado: This is the main source of thought for Yii. YII employs component-based and event-driven programming patterns, database abstraction layers, modular application architectures, internationalization and localization, and many of its other features and functions.
Ruby on Rails:yii inherits the idea of its configuration. Also refers to the ORM design pattern of its Active record.
JQuery: This is an integrated JavaScript framework based on YII.
Symfony:yii refers to its filtering design and plug-in architecture.
Joomla:yii cites its modular design and information translation program.

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.