After 20 days of improvement and testing, the second Beta test version of ThinkPHP5.2 has been released. This time, the processing mechanism of the fetchSql method is mainly improved, and many query usages are unified and simplified.
Major Update
##Improved the parsing mechanism of fetchSql
Introduced a separateFetch The class handles the fetchSql method separately to ensure that the return type of the Query class query method is not affected by fetchSql.
Unify and simplify query usage
This test version unifies and streamlines many query usages, so that you will not have another query It solves the problem of multiple usages of functions and facilitates the formulation of team norms.get/all The query method is unified into the find/select method;
fetchPdo method and return the PDO object uniformly using the pdo query method;
resultset_typeConfiguration uniformly uses the fetchCollection method;
readMaster method and uniformly uses the master method;
save method does not support incoming conditions, unified query and update method calls;
db/modelAssistant function, unified use of class calls;
AddedfetchArrayMethod
If model query is used, you can now call thefetchArray method, and the query result will be Array data is always returned. Facilitates the data transfer of some statistical charts.
Use the DateTime class for time field writing instead
Use theDateTime class for automatic operation of time fields, supporting micro Second-level time records provide higher-precision system time records.
You only need to set the decimal precision of the time field in the data table to automatically record. If you need to output microsecond precision data, set thedateTimeFormat format.
The model adds schema attribute
The model addsschema attribute support, which is used to define the fields and types of the corresponding data table information, and supports the use of PHP variable type definitions. After defining this attribute, you can improve query performance and automatically identify the parameter binding type of the field without using optimize:schema.
The type attribute of the model is only used to set data table fields for automatic type conversion.Support application of public function files
In multi-application mode, support loading of application public function files.Automatic recognition of multiple entry files
#If the application name is not specified in the application entry file, the current entry file can be automatically identified when the entry file is accessed Application Name. By default, the file name of the current application entry will be used as the application name.Some methods are no longer supported
The following usages are no longer supported due to practicality or simplification considerations:## The#Query class (can be replaced by the pdo method); the
class get/all/getOrFail/allOrFail method;
where parameter; the readMaster method of the
Query class and model class , this method cannot be used normally under swoole (manually call the master method if necessary); setInc# of the
methods; database’s
resultset_type(call if necessary
fetchCollectiondb
class static method instead);
##Improve
joinAbandonedsave
methodCancel the setInc
andof the model class
Improve the acquisition of model field information
Cancel the model and the readMaster method of the Db class
Improve parameter binding type retrieval
Query class addedfetchArray method supports model query return array type
Automatic writing of time fields is changed to use the DateTime class, which supports microsecond data
Improved validation class extended validation Do not check whether require
Improve queryCURDmethod
Correction model output
ImprovementupdateMethod
CorrectioninsertGetIdMethod
CorrectiongetFieldTypeMethod
Improvementthink schema Directive
Improve cache and log path acquisition
DeletedbAssistant function Correct several assistant functions
BuilderClassselectMethod adds a second parameter
Cancelresultset_typeSet
Correction of dynamic query methodfetchsqlProcessing
Improve automatic identification of multi-application entry files
serverReturn type of method
getBindMethod
Configuration parameters
##Correction of resource routingCorrection
Improvement Controller
Correction
##Correction
requestCorrection
consoleCancel the
getclass ##allMethods are uniformly used find/selectMethodCancelfetchPdo
MethodFix the limit
parameter of##Improve errors in strict mode
Method added
Fetch