PluginProbe
Meow Gallery / trunk
Meow Gallery vtrunk
5.5.4 5.5.3 5.5.2 5.5.1 5.5.0 5.4.9 5.4.8 5.4.7 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 All 156 releases
meow-gallery / classes / init.php

init.php in Meow Gallery trunk, at classes/init.php

45 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( class_exists( 'MeowPro_MGL_Core' ) && class_exists( 'Meow_MGL_Core' ) ) {
4 function mgl_admin_notices() {
5 echo '<div class="error"><p>Thanks for installing the Pro version of Meow Gallery :) However, the free version is still enabled. Please disable or uninstall it.</p></div>';
6 }
7 add_action( 'admin_notices', 'mgl_admin_notices' );
8 return;
9 }
10
11 spl_autoload_register(function ( $class ) {
12 $necessary = true;
13 $file = null;
14 if ( strpos( $class, 'Meow_MGL_Builders_' ) !== false ) {
15 $necessary = false;
16 $file = MGL_PATH . '/classes/builders/' . str_replace( 'meow_mgl_builders_', '', strtolower( $class ) ) . '.php';
17 if ( !file_exists( $file ) ) {
18 $file = MGL_PATH . '/premium/builders/' . str_replace( 'meow_mgl_builders_', '', strtolower( $class ) ) . '.php';
19 }
20 }
21 else if ( strpos( $class, 'Meow_MGL' ) !== false ) {
22 $file = MGL_PATH . '/classes/' . str_replace( 'meow_mgl_', '', strtolower( $class ) ) . '.php';
23 }
24 else if ( strpos( $class, 'MeowKit_MGL_' ) !== false ) {
25 $file = MGL_PATH . '/common/' . str_replace( 'meowkit_mgl_', '', strtolower( $class ) ) . '.php';
26 }
27 else if ( strpos( $class, 'MeowKitPro_MGL_' ) !== false ) {
28 $necessary = false;
29 $file = MGL_PATH . '/common/premium/' . str_replace( 'meowkitpro_mgl_', '', strtolower( $class ) ) . '.php';
30 }
31 else if ( strpos( $class, 'MeowPro_MGL' ) !== false ) {
32 $necessary = false;
33 $file = MGL_PATH . '/premium/' . str_replace( 'meowpro_mgl_', '', strtolower( $class ) ) . '.php';
34 }
35 if ( $file ) {
36 if ( !$necessary && !file_exists( $file ) ) {
37 return;
38 }
39 require( $file );
40 }
41 });
42
43 $core = new Meow_MGL_Core();
44
45 ?>