Skip to content

Commit 4877285

Browse files
committed
Only include install_functions.php when needed
Move the require_once() call from schema() to init() method, and check whether the plugin needs an upgrade before including the file. Fixes #54
1 parent 91bd6c5 commit 4877285

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Snippets.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public function hooks() {
5454

5555
public function init() {
5656
require_once("Snippets.API.php");
57+
58+
if( plugin_needs_upgrade( $this ) ) {
59+
require_once( dirname( __FILE__ ) . '/install_functions.php' );
60+
}
5761
}
5862

5963
/**
@@ -156,8 +160,6 @@ function() use ( $t_app, $t_plugin ) {
156160
}
157161

158162
public function schema() {
159-
require_once('install.php');
160-
161163
return array(
162164
# 2010-03-18
163165
0 => array("CreateTableSQL", array(plugin_table("snippet"), "

0 commit comments

Comments
 (0)