mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-02 08:10:04 +00:00
Cron API: Add a new wp_doing_cron() helper function.
This replaces `DOING_CRON` checks via the constant. Props tfrommen. Fixes #39591. git-svn-id: https://develop.svn.wordpress.org/trunk@40575 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -663,7 +663,7 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) {
|
||||
* A disk that has zero free bytes has bigger problems.
|
||||
* Require we have enough space to unzip the file and copy its contents, with a 10% buffer.
|
||||
*/
|
||||
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
|
||||
if ( wp_doing_cron() ) {
|
||||
$available_space = @disk_free_space( WP_CONTENT_DIR );
|
||||
if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space )
|
||||
return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) );
|
||||
@@ -769,7 +769,7 @@ function _unzip_file_pclzip($file, $to, $needed_dirs = array()) {
|
||||
* A disk that has zero free bytes has bigger problems.
|
||||
* Require we have enough space to unzip the file and copy its contents, with a 10% buffer.
|
||||
*/
|
||||
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
|
||||
if ( wp_doing_cron() ) {
|
||||
$available_space = @disk_free_space( WP_CONTENT_DIR );
|
||||
if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space )
|
||||
return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) );
|
||||
|
||||
Reference in New Issue
Block a user