Skip to content

Commit 055e083

Browse files
committed
Fix bug
1 parent 6c927d6 commit 055e083

File tree

14 files changed

+46
-31
lines changed

14 files changed

+46
-31
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.editorconfig
22
.vscode/
3+
*.txt

model/startup/startup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class ModelStartupStartup extends Model
44
{
55
public function getResolvers() {
6-
$rawMapping = file_get_contents(DIR_PLUGIN.'mapping.json');
6+
$rawMapping = file_get_contents(VF_DIR_PLUGIN.'mapping.json');
77
$mapping = json_decode( $rawMapping, true );
88
$result = array();
99
foreach ($mapping as $key => $value) {

plugin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ function add_plugin_page()
2222

2323
function my_plugin_admin_scripts() {
2424
wp_enqueue_style( 'vuefront-style', plugins_url('d_vuefront/view/stylesheet/admin.css') );
25-
wp_enqueue_style( 'bootstrap-style', 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' );
26-
wp_enqueue_script( 'bootstrap-script', 'https://code.jquery.com/jquery-3.4.1.min.js' );
27-
wp_enqueue_script( 'clipboard-script', 'https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js' );
28-
wp_enqueue_script( 'bootstrap-script', 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js' );
25+
wp_enqueue_style( 'bootstrap-style', plugins_url('d_vuefront/view/stylesheet/bootstrap.min.css') );
26+
wp_enqueue_script( 'jquery' );
27+
wp_enqueue_script( 'clipboard' );
28+
wp_enqueue_script( 'bootstrap-script', plugins_url('d_vuefront/view/javascript/bootstrap.min.js') );
2929
}
3030

3131
function vuefront_options_page_output()

resolver/startup/startup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function index()
2222

2323
try {
2424
$resolvers = $this->model_startup_startup->getResolvers();
25-
$schema = BuildSchema::build(file_get_contents(DIR_PLUGIN.'schema.graphql'));
25+
$schema = BuildSchema::build(file_get_contents(VF_DIR_PLUGIN.'schema.graphql'));
2626
$rawInput = file_get_contents('php://input');
2727
$input = json_decode($rawInput, true);
2828
$query = $input['query'];

resolver/startup/wordpress.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
class ResolverStartupWordpress extends Resolver {
44
public function index() {
5-
include_once realpath( DIR_PLUGIN . '../../../wp-admin/includes/plugin.php' );
6-
require_once realpath( DIR_PLUGIN . '../../../wp-load.php' );
7-
// require_once realpath(DIR_PLUGIN.'system/helpers/load.php');
5+
include_once realpath( VF_DIR_PLUGIN . '../../../wp-admin/includes/plugin.php' );
6+
require_once realpath( VF_DIR_PLUGIN . '../../../wp-load.php' );
7+
// require_once realpath(VF_DIR_PLUGIN.'system/helpers/load.php');
88
}
99
}

system/engine/action.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function __construct($route) {
1212

1313
// Break apart the route
1414
while ($parts) {
15-
$file = DIR_PLUGIN . 'resolver/' . implode('/', $parts) . '.php';
15+
$file = VF_DIR_PLUGIN . 'resolver/' . implode('/', $parts) . '.php';
1616

1717
if (is_file($file)) {
1818
$this->route = implode('/', $parts);
@@ -33,7 +33,7 @@ public function execute($registry, array $args = array()) {
3333
return new \Exception('Error: Calls to magic methods are not allowed!');
3434
}
3535

36-
$file = DIR_PLUGIN . 'resolver/' . $this->route . '.php';
36+
$file = VF_DIR_PLUGIN . 'resolver/' . $this->route . '.php';
3737
$class = 'Resolver' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);
3838

3939
if (is_file($file)) {

system/engine/actionType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function __construct($route) {
1212

1313
// Break apart the route
1414
while ($parts) {
15-
$file = DIR_PLUGIN . 'type/' . implode('/', $parts) . '.php';
15+
$file = VF_DIR_PLUGIN . 'type/' . implode('/', $parts) . '.php';
1616

1717
if (is_file($file)) {
1818
$this->route = implode('/', $parts);
@@ -33,7 +33,7 @@ public function execute($registry, array $args = array()) {
3333
return new \Exception('Error: Calls to magic methods are not allowed!');
3434
}
3535

36-
$file = DIR_PLUGIN . 'type/' . $this->route . '.php';
36+
$file = VF_DIR_PLUGIN . 'type/' . $this->route . '.php';
3737
$class = 'Type' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);
3838

3939
if (is_file($file)) {

system/engine/loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function model($route)
3737
$route = preg_replace('/[^a-zA-Z0-9_\/]/', '', (string)$route);
3838

3939
if (!$this->registry->has('model_' . str_replace('/', '_', $route))) {
40-
$file = DIR_PLUGIN . 'model/' . $route . '.php';
40+
$file = VF_DIR_PLUGIN . 'model/' . $route . '.php';
4141
$class = 'Model' . preg_replace('/[^a-zA-Z0-9]/', '', $route);
4242

4343
if (is_file($file)) {

system/helpers/mutations.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
function getMutations($registry) {
33
$result = array();
44

5-
$files = glob(DIR_PLUGIN.'type/**/*.php', GLOB_BRACE);
5+
$files = glob(VF_DIR_PLUGIN.'type/**/*.php', GLOB_BRACE);
66

77
foreach ($files as $filepath) {
8-
$route = str_replace(DIR_PLUGIN.'type/', '', $filepath);
8+
$route = str_replace(VF_DIR_PLUGIN.'type/', '', $filepath);
99
$route = str_replace('.php', '', $route);
1010
$output = $registry->get('load')->type($route.'/getMutations');
1111

system/helpers/queries.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
function getQueries($registry) {
33
$result = array();
44

5-
$files = glob(DIR_PLUGIN.'type/**/*.php', GLOB_BRACE);
5+
$files = glob(VF_DIR_PLUGIN.'type/**/*.php', GLOB_BRACE);
66

77
foreach ($files as $filepath) {
8-
$route = str_replace(DIR_PLUGIN.'type/', '', $filepath);
8+
$route = str_replace(VF_DIR_PLUGIN.'type/', '', $filepath);
99
$route = str_replace('.php', '', $route);
1010
$output = $registry->get('load')->type($route.'/getQuery');
1111

0 commit comments

Comments
 (0)