PluginProbe
Performance Lab / 2.1.0
Performance Lab v2.1.0
trunk 1.0.0 1.0.0-beta.1 1.0.0-beta.2 1.0.0-beta.3 1.0.0-rc.1 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 1.8.0 1.9.0 2.0.0 2.1.0 2.2.0 2.3.0 2.4.0 2.5.0 2.6.0 2.6.1 2.7.0 2.8.0 All 44 releases
performance-lab / modules / database / sqlite / can-load.php

can-load.php in Performance Lab 2.1.0, at modules/database/sqlite/can-load.php

37 lines 897 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Can load function to determine if SQLite can be activated.
4 *
5 * @since 1.8.0
6 * @package performance-lab
7 */
8
9 /**
10 * Checks whether the given module can be activated.
11 *
12 * @since 1.8.0
13 */
14 return function() {
15
16 // If the PERFLAB_SQLITE_DB_DROPIN_VERSION constant is defined, then the module is already active.
17 if ( defined( 'PERFLAB_SQLITE_DB_DROPIN_VERSION' ) ) {
18 return true;
19 }
20
21 // If a db.php file already exists in the wp-content directory, then the module cannot be activated.
22 if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
23 return false;
24 }
25
26 // If the SQLite3 class does not exist, then the module cannot be activated.
27 if ( ! class_exists( 'SQLite3' ) ) {
28 return false;
29 }
30
31 // If the db.php file can't be written to the wp-content directory, then the module cannot be activated.
32 if ( ! wp_is_writable( WP_CONTENT_DIR ) ) {
33 return false;
34 }
35 return true;
36 };
37