SpeedPHP 3 has changed from solely supporting MySQL/Smarty to supporting several database types as well as multiple template engines and data caching engines.
SpeedPHP 3 strengthens and improves most of the original functions and architecture, achieving a balance between fast, light and easy to expand.
SpeedPHP 3 has fixed all bugs and errors since SpeedPHP2, and its stability has reached a new level.
Upgrading from SpeedPHP version 2 to SpeedPHP version 3 is very simple and only requires the following steps:
Download SpeedPHP 3 files.
Remove the original SpeedPHP 2 files and replace them with SpeedPHP 3 files.
For the original SpeedPHP 2 application, you need to add the spRun(); function at the bottom of the entry file in order to start the application.
The static HTML files generated by the original spHtml must be deleted and the temporary folder (usually the tmp directory) must be deleted and regenerated.
The encrypted password input box in the original spAcl has become an independent extension in SpeedPHP 3. Please go to the SpeedPHP forum extension section to download the new md5password extension (the original encrypted password input box) to install and use.
How to use SpeedPHP 3:
The use of SpeedPHP 3 is basically the same as SpeedPHP second edition, so the SpeedPHP second edition manual can also be used on SpeedPHP 3.
Various database configuration instructions Template engine settings instructions Cache configuration instructions Speedy template engine simple use Introducing new features:
1. Supports multiple database types: MySQLi, Sqlite, Oracle, MsSQL, PDO, etc.
2. Add SAE cloud computing SAE branch version and GBK branch version (exclusively for Sina cloud computing platform).
3. Supports multiple template engines: Smarty, Template Lite, speedy, etc.
4. Supports multiple caching mechanisms: Memcache, Xcache, APC, eAccelerator, etc.
5. Improve the database and template engine driver structure, improve the logical structure of the controller and view class, make it more reasonable and further save resources.
6. Many original functions have been strengthened, spHTML generation static function has been improved, and static URL mode has been enhanced.
7. Add spRun, spDB, replace, affectedRows, runSql, escape,
8. Many bugs since the release of the second version of SpeedPHP have been corrected, and the stability has been greatly improved.
9. To maintain consistent application configuration, SP2 members only need to add spRun to the entry file.
10. Keep it simple, easy to learn, and lightweight.
ChangeLog
The UrlRewrite extension has been updated, controller/action mapping has been added, main/index hiding has been removed, and parameter hiding can be set.
Added the escape member function to replace __val_escape for string filtering and corrected the template value mode. If the value is false, it will not be sent to the template. This can adapt to the shortcoming that smarty's loop cannot determine whether a value exists.
Modified the processing logic of spModel's replace member function to avoid adding new records by mistake when there are no data changes.
Optimize automatic page output mode, automatic output is now operated by spController.
Corrected a prompt issue in the import function. Corrected the way null values are handled in the driver. Removed redundant SQL running record statements from some databases. Corrected the Oracle and MsSQL drivers. Corrected an error in the sqlite driver. Corrected an error in the mysqli driver. Corrected the error that the pdo driver could not obtain data.
The __val_escape function of spModel is modified to judge null, numbers, etc. spCache is defined as a single-use spModel affiliated class. Similar to spVerifier, it cannot be called multiple times. Remove the invalid parameters of spLinker. Fix the problem in the getTable function of the mssql driver. Restore the constructor of spController. Replace the code of the instantiated view object in the spController constructor. Moved out into spRun.
Fixed the logical processing of 'url_path_base' configuration and fixed the problem of table name processing in limit in mssql driver.
The SpeedPHP framework joins the fork of the SAE cloud computing environment version
The SpeedPHP framework has added a branch of the GBK version and revised the copyright information in the SpeedPHP framework code files.
spModel adds a replace method to update records that meet the conditions. If the record does not exist, a new record will be added.
Corrected the logic of clearing pager data of spPager. Corrected the logic of has function of spArgs. has will determine whether the variable exists and whether the variable value length is greater than 0.
spError will record the error information using error_log in the Release environment.
Shielded the error prompt of session_start initialization. Optimized spHtml generation logic. Adjusted spHtml prompting method and logic. Corrected the way of registering view functions. It can support object, class name and function name as registered handles. Adjusted the prompt method and logic of spHtml to remove the useless settings url_getter and url_setter in html, and directly use the member functions of spHtml.
Fixed __val_escape return value being null.
spModel adds a runSql method. runSql will replace query to execute SQL statements. The query method is retained for forward compatibility, but it is recommended to use the runSql method with a clearer meaning.
spModel adds the affectedRows() method to obtain the number of records affected by update, create and other operations.
The spRun function is added to separate the speedphp core process and the two steps of executing user code, so that some operation codes that require class libraries but before the user code is executed can be added. At the same time, when upgrading to this version of the framework, you need to make a modification to the entry file: in the entry file (usually index.php): require(SP_PATH."/SpeedPHP.php"); below this line, add spRun( ); function call.
The database-driven variable conn is modified to public
Improve spHtml's fielding method for parameters, use json_encode to replace the less efficient and strictly typed serialize, so that the parameters of the generated page can be more free and efficient. However, at the same time, in the existing code upgraded to this modification, it will be necessary Regenerate static HTML files.
When the default url_path_base configuration is empty, the entry file is /index.php
Corrected typographical errors in the spAccessCache class. Added sp_notice_php configuration. Developers can customize the error prompt program. Modified the prompt message that the spContrller method cannot be found. Shielded the NOTICE message generated when the spConfigReady configuration array was overwritten. Corrected the class name and object name issues registered by the template function and removed them. Experimental feature "Encrypted password input box"
The spAccessCache class supports the expansion of the spAccess function with more caching methods in an extended form. Currently, the cache driver types supported by spAccessCache are as follows: This allows developers to have a fast and simple template engine solution in addition to template engines such as Smarty.
Added db_pdo, db_pdo_mysql, db_pdo_sqlite database driver classes to support the PDO database interface. Currently, PDO links mysql and sqlite are supported and added to the db_sae database driver class. SAE MySQL database is supported to be added to the db_oracle database driver class. Oracle database types are supported to be added to the db_sqlite database driver class. , support the Sqlite database type to join the db_mssql database driver class, support the MSSQL database type to join the db_mysqli class, support the MySQLi database driver type, change the mysql database driver name to db_mysql, add the limit formatting method, modify the instantiation method in the db_mysql constructor, and add support for mysql The database long link mode is added to the TemplateLite class library file. The two variables $tbl_name and $_db are changed to public. The constructor of spModel is rewritten to support the driver of multiple database types. After the paging data is obtained, it will be deleted, here It will not cause confusion in the next paging data. Modified the way SQL statements implement limit logic to cope with the problem that some database types cannot support limit syntax.
In conjunction with spController, the template engine instance is changed. Improved the way of assigning values to the template engine driver to perform fault-tolerant processing of template-affiliated functions to support template engines that cannot register template functions. Improve the network reading method of spHtml to avoid the problem of being unable to read files but generating blank HTML pages. Add the CURL series of network reading methods to use when file_get_contents cannot read network data. Improve the prompt of file_get_contents and detect whether the PHP environment prohibits network reading when network reading fails. Restricts spHtml to only generate HTML files within the scope of APP_PATH. Fixed logic problems in spHtml's url reading and generating functions.
spController's template engine variables have been redefined to support multiple template engines. Fixed a reading problem of __get function. Fixed the problem that when spArgs gets the value, the default cannot be 0.
Changed the default value of the db_driver_path configuration and added the spDB function. spDB can achieve a shortcut of simply using the spModel subclass, and directly operate on the table (owned by spModel) without the definition of the spModel subclass. Remove the ampersand of spConfigReady, fix the path problem of automatic template output, change the mysql driver location, transfer the Smarty directory and transfer the mysql driver, delete the spDB file, and the spDB function will be placed in spFunctions as the core function in the future.
Add the Drivers directory and place the core program driver class. When the view is closed, you can still use $this->variables and $this->display for template assignment. However, its template syntax must be ordinary PHP syntax.
Expand