» Latest Articles » page 4

 
Sort articles by: Date | Most Rates | Most Views | Comments | Alphabet

PHP PSR-3 Log Interface Specification

Author: bamboo06 on 2-02-2019, 17:34, views: 2559

0 The main purpose of this specification is to allow the log class library to log information in a simple and generic way by receiving a PsrLogLoggerInterface object. The framework and the CMS content management system can extend this interface if necessary, but this specification is required to ensure that the log interface can still be properly connected when using third-party class library files. This article develops a generic interface specification for the log class library.
PHP PSR-3 Log Interface Specification

The implementers in this article refer to the class libraries or frameworks that implement the LoggerInterface interface. Conversely, they are the users of LoggerInterface.

Category: PHP Scripts

 

PHP PSR-2 code style specification

Author: bamboo06 on 2-02-2019, 17:26, views: 1450

0 This specification is an inheritance and extension of the PSR-1 basic code specification. This specification hopes to reduce the inconvenience caused by the different styles of the code when browsing the code of different authors by formulating a series of rules for normalizing PHP code.
PHP PSR-2 code style specification

When multiple programmers work together on multiple projects, a common coding specification is needed. The style specification in this article is derived from the common characteristics of multiple different project code styles. Therefore, the value of this specification is that we all follow This coding style is not about itself.

Category: PHP Scripts

 

PHP PSR-1 basic code specification

Author: bamboo06 on 2-02-2019, 17:06, views: 1554

0 Encoding specifications and standards are extremely important when working with groups to develop PHP projects. Next, let's revisit the PHP code related specifications developed by the FIG organization. The current general specifications are: PSR-1 basic code specification, PSR-2 code style specification, PSR-3 log interface specification, PSR-4 Autoloader automatic loading specification.
PHP PSR-1 basic code specification

The PSR-1 Basic Code Specification establishes standards for the basic elements of the code to ensure a high degree of interoperability between shared PHP code.

Category: PHP Scripts

 

Implementation of file breakpoint resume by HTML5

Author: bamboo06 on 31-01-2019, 22:10, views: 1718

1 HTML5's FILE api has a slice method that splits the BLOB object. The front end obtains the corresponding file through the FileList object, segments the large file according to the specified splitting manner, and then passes it to the back end one by one, and then the back end then splicing the files in a sequence.
Implementation of file breakpoint resume by HTML5

At present, there are two commonly used methods for resuming breakpoints. One is to upload files through the websocket interface, and the other is through ajax. Both methods have their own advantages. Although websocket sounds more high-end, it uses different ones. The other algorithms outside the protocol are basically similar, and the server needs to open the ws interface. Here, the relatively convenient ajax is used to illustrate the idea of uploading the breakpoint.

Category: Javascript / HTML5

 

Core.css - lightweight CSS reset and grid system

Author: bamboo06 on 31-01-2019, 22:03, views: 1341

0 Core.css is a very small CSS reset and grid system. If your project is very small, you don't need to use a large css framework such as Bootstrap. You only need less than 4kb core.css, you can have css reset. And grid systems and responsive layouts.
Core.css - lightweight CSS reset and grid system

Core.css uses a .row to represent the rows in the container. If you append a class with the largest width to it, it represents a fixed-width row, otherwise it is a full-screen row. .col represents the column in the container, which divides the width of the container into 12 columns, which is what we often call a 12-grid system. .xs-12 represents a column width of 100%. Similarly, .xs-3 represents a column width of 25% because it requires 4 .xs-3 to reach 100% of the 12 grid. Others are analogously from .xs-1 to xs-12.

Category: CSS

 

Monolog-PHP log class library introduction

Author: bamboo06 on 2-12-2018, 17:47, views: 2107

0 Monolog is a full and easy to expand log log library under php. There are many well-known php frameworks including Symfony, Laravel, CakePHP and so on that have Monolog built in. Monolog can send your logs to files, sockets, inboxes, databases and various web services.
Monolog-PHP log class library introduction

Monolog follows the PSR3 interface specification and can be easily replaced with other log classes that follow the same specification. Monolog has good extensibility. Through the interfaces Handler, Formatter and Processor, you can expand and customize the Monolog library.

Category: PHP Scripts / Plugins

 

https is the trend of the development of the world's websites

Author: bamboo06 on 27-11-2018, 14:27, views: 1883

0 HTTPS This is a lot of websites that are used to protect user data. It is enabled when the user logs in. More often, due to trade-offs in performance overhead, basically all data is transmitted unencrypted. Multimedia files, especially streaming media, seem to have no security problems in plain text transmission. However, they actually have very serious consequences, such as being maliciously hijacked traffic, and inserting a small advertisement on the page. The visitor also thought that this was the advertisement provided by the interviewed station. If it is a normal advertisement, it can be tolerated, but pornographic gambling false medical advertisements abound. This is certainly not a good user experience.
https is the trend of the development of the world's websites

So, in our particular environment, it's okay to focus on HTTPS, not to mention deploying HTTPS for the purpose of protecting user privacy.

Category: Internet

 

Website status code

Author: bamboo06 on 14-11-2018, 18:19, views: 2488

2 404, 503, 301, the website status code is the most common, but as a webmaster, you should have more website status codes in order to respond to various errors in the website and fix errors faster. Here are some website status codes that Yang Xiaojie blogs for everyone.
Website status code

100 Continue
The initial request has been accepted and the customer should continue to send the rest of the request. (HTTP 1.1 new)
101 Switching Protocols
The server will switch to another protocol in accordance with the client's request (HTTP 1.1 new)
200 OK
Everything is ok, and the answer to the GET and POST requests is followed.

Category: Internet

 

Drag and Drop Drag and Drop for HTML5

Author: bamboo06 on 11-11-2018, 21:41, views: 2330

1 Drag & Drop is a common feature that grabs an object and drags it to another location. In HTML5, drag and drop is part of the standard, and any element can be dragged and dropped. In the past, we used the Mousedown, Mouseove, Mouseup and other events of the mouse to constantly acquire the coordinates of the mouse to modify the position of the element. Now the html5 native Drag & Drop event (DnD) is convenient and the performance is improved.

Internet Explorer 9+, Firefox, Opera 12, Chrome, and Safari 5 support drag and drop.

Category: HTML5

 

Use javascript to realize related operations of adding to cart

Author: bamboo06 on 10-10-2018, 16:53, views: 2226

1 There are many ways to add items to the shopping cart. The usual way is to click the “Add to Cart” button and you will be redirected to the shopping cart. In the shopping cart, you can click the “Billing” button to settle. Today I will introduce you to a more friendly solution.
Use javascript to realize related operations of  adding to cart

By default, the shopping cart is hidden and invisible. When the user clicks the Add to Cart button, the item information will be added to the shopping cart. The shopping cart will appear as a button in the lower right corner of the page. Clicking the button will expand the shopping cart. , display the product information in the shopping cart, and also delete or settle the items in the shopping cart. Users can also temporarily close the shopping cart to continue shopping.

Category: Javascript / Plugins