Title, I'm a little confused, who can say it carefully:
1, the difference between psr-0 and psr-4 in composer;
2, the difference between the psr-0 norm and the psr-4 norm;
3, composer and Php-fig, who indulge who.
Reply content:
Title, I'm a little confused, who can say it carefully:1, the difference between psr-0
abbreviations when using abbreviations to not allow color names, RGB () to ensure that the 16-binary notation is uniform in capitalization. (Recommended capitalization)2D Position (background-position)You must give the value of the background-position in two directions. Because the default is 0% 0%, but gives only one direction value, the other side defaults to the Center property value.textThe font-family
Front-end encoding specification (2) HTML specification, front-end EncodingDocument Type
HTML5 document type statement is recommended:
(Html in text/HTML format is recommended. Avoid using XHTML. XHTML and its attributes, suchapplication/xhtml+xmlLimited space for application support and Optimization in browsers ).
In HTML, it is better not to close tags with no
1. PSR-0 specification[1] namespace must be consistent with absolute path[2] class name first letter must be capitalized[3] Except for the entry file, the other ". PHP" must have only one class[4]php class files must be loaded automatically, not include, etc.[5] Single inlet2. Case[1] directory structure[2] Source code
Generally speaking, our PSR-0 specification can generally be divided into the following five parts:(1) Class name space must be consistent with absolute path(2) The first letter of the class name must be capitalized(3) Except for the entry file, the other PHP files must have only one class(4) PHP files must be able to be loaded automatically, cannot have include
PSR Specification
PSR Specification
Introduction: PSR is a shorthand for PHP standard recommendations, PHP specifications developed by the PHP FIG organization, is the practice of PHP development standards. The purpose of these specifications is to: through the framework of the author or the representative of the framework of the discussion, with the minimum limit, the development of a collaborative standar
namespace is actually a directory separator. That's not what class name is. Now, after PSR-4 out, I do feel that such a rule is a little bad. It's weird.6th article
6th don't say much. Since you use PHP, the filename is, of course, the end of the. php suffix. The reason for this rule, I guess roughly, is someone using the. php3 suffix. All right. This is a myth. Because it is allowed in the Apache configuration file:
So, be honest with. php as the suffix name.7th article
File capitaliz
the interesting point is: The specification itself may also exist conflict of ... Well, no matter what, the taste, we slowly realize it, now, go ...II: Naming conventions1: Consider using complex numbers in namespacesIf you have a group of similar types that are grouped under the same namespace, you might consider using complex numbers for namespaces.The most typical example is that in the FCL, we need to centralize all non-generic collection classes
1.javascript:void (0) meaningWe often use code such as Javascript:void (0), so what does javascript:void (0) mean in JavaScript?The key in Javascript:void (0) is the Void keyword, which is a very important keyword in JavaScript, which specifies that an expression is evaluated but does not return a value.The following c
Generally speaking, our PSR-0 specification can generally be divided into the following five parts:
(1) Class name space must be consistent with absolute path
(2) The first letter of the class name must be capitalized
(3) Except for the entry file, the other PHP files must have only one class
(4) PHP files must be able to be loaded automatically, cannot hav
This article introduces the PHP design pattern one of the namespace, the automatic loading class, PSR-0 encoding specification, now share to everyone, the need for friends can refer to
First, the namespace: solve the problem of the class name or function name conflict in the production environment when there are many cooperative development;test1.php
test2.php
test.php
Second, automatic loading class: T
PSR-0 Specification 1. Namespaces must be consistent with absolute paths 2. The first letter of the class name must be capitalized 3. Other than the entry file, PHP must have only one class.
Develop a framework that complies with PSR-0 specifications
1. Use all namespaces2. All PHP files must be loaded automatically, c
PHPPSR-2 code style specification
Code style specificationThis specification is the inheritance and extension of [PSR-1] [] basic code specification.This specification aims to develop a series of standardized php code rules to reduce the inconvenience caused by different code styles when browsing code of diffe
Guide:
5.3
Level 2 instruction details
5.3.1
Force Multi-point coils (FC)
Request
Byte 0:FC = 0F (16 binary)
Byte 1-2: Reference value
Byte 3-4: Number of bits (1-800)
BYTE 5: Number of bytes (B = (bits + 7)/8)
Byte 6-(b+5): Data written (minimum point = First coil)
Response
Byte
in. NET coding specification is not recommended. All variables are prefixed with camel, rather than data types and m_.
Replace Nam,addr,sal with Name,address,salary and so on.
Don't use a single letter variable like i,n,x. Use Index,temp and so on. Variable exception for loop iteration:
If the variable is used only for the iteration count, not elsewhere in the loop, it is allowed to be named with a single letter variable, rather than a separate li
() sum in subqueries to perform an existence check Do not use such a statement: Select column_list from tablename where 0 You should use such a statement instead: Select column_list from tablename where EXISTS (SELECT * from Table2 where ...) When you use COUNT (), SQL Server does not know that you are doing an existence check, it calculates all matching values, either performs a full table scan, or scans the smallest nonclustered index. When you us
instance method:
string s = "1234";
int i = S.toint32 (); Same as Extensions.toint32 (s)
int[] digits = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
int[] A = digits. Slice (4, 3); Same as Extensions.slice (digits, 4, 3)
2.3 Call to extension method
The detailed rules for extending method calls are described below. In the following form of method invocation:
Expr. Identifier ()
Expr. Identifier (args)
Expr. Identifier
Huawei software programming specification Learning (2) -- Comment
2-1: Generally, the valid comments of the source program must be20%Above
Note:The principle is to help read and understand the program, Added to the place where the comment is added. The comment language must be accurate, easy to understand, and concise.
2
structure is shown below. Note the brackets, spaces, and the position of the curly braces. The case statement must be indented relative to switch, and the break keyword (or other terminating keyword) must be indented with the case body. If there is a non-empty case straight-through statement, you must have a comment like//no break.for ($i = 0; $i For body}### 5.5 foreach一个foreach语句看起来像下面这样。注意其括号、空格以及花括号的位置。foreach ($iterable as $key = = $value) {fore
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.