Created
May 5, 2018 19:02
-
-
Save w4/f502cd9e42fe588214c33bb0e123b711 to your computer and use it in GitHub Desktop.
koselig diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/.env.example b/.env.example | |
index ec44a125..dbc3c70a 100644 | |
--- a/.env.example | |
+++ b/.env.example | |
@@ -7,14 +7,16 @@ APP_URL=http://localhost | |
LOG_CHANNEL=stack | |
DB_CONNECTION=mysql | |
DB_HOST=127.0.0.1 | |
DB_PORT=3306 | |
DB_DATABASE=homestead | |
DB_USERNAME=homestead | |
+DB_CACHE=false # minutes to cache queries for by default (or false for no caching) | |
BROADCAST_DRIVER=log | |
CACHE_DRIVER=file | |
+CACHE_PREFIX=laravel # use this if you have multiple sites running on the same redis server for example | |
SESSION_DRIVER=file | |
SESSION_LIFETIME=120 | |
QUEUE_DRIVER=sync | |
@@ -30,6 +32,25 @@ MAIL_USERNAME=null | |
MAIL_PASSWORD=null | |
MAIL_ENCRYPTION=null | |
+WP_ALLOW_MULTISITE=false | |
+MULTISITE=false | |
+SUBDOMAIN_INSTALL= | |
+DOMAIN_CURRENT_SITE= | |
+PATH_CURRENT_SITE= | |
+SITE_ID_CURRENT_SITE= | |
+BLOG_ID_CURRENT_SITE= | |
+ | |
+ACF_PRO_KEY="your acf key here" | |
+ | |
+AUTH_KEY="put your unique phrase here" | |
+SECURE_AUTH_KEY="put your unique phrase here" | |
+LOGGED_IN_KEY="put your unique phrase here" | |
+NONCE_KEY="put your unique phrase here" | |
+AUTH_SALT="put your unique phrase here" | |
+SECURE_AUTH_SALT="put your unique phrase here" | |
+LOGGED_IN_SALT="put your unique phrase here" | |
+NONCE_SALT="put your unique phrase here" | |
+ | |
PUSHER_APP_ID= | |
PUSHER_APP_KEY= | |
PUSHER_APP_SECRET= | |
diff --git a/.gitignore b/.gitignore | |
index 67c0aeab..a0ce3196 100644 | |
--- a/.gitignore | |
+++ b/.gitignore | |
@@ -1,6 +1,8 @@ | |
+/vendor | |
/node_modules | |
/public/hot | |
/public/storage | |
+/public/cms | |
/storage/*.key | |
/vendor | |
/.idea | |
diff --git a/app/Providers/ACFServiceProvider.php b/app/Providers/ACFServiceProvider.php | |
new file mode 100644 | |
index 00000000..af17f6de | |
--- /dev/null | |
+++ b/app/Providers/ACFServiceProvider.php | |
@@ -0,0 +1,33 @@ | |
+<?php | |
+namespace App\Providers; | |
+ | |
+use Illuminate\Support\ServiceProvider; | |
+use Koselig\Support\Action; | |
+ | |
+/** | |
+ * Make ACF load and save from JSON files rather than from the database to allow | |
+ * fields to go into version control. | |
+ * | |
+ * @author Jordan Doyle <jordan@doyle.wf> | |
+ */ | |
+class ACFServiceProvider extends ServiceProvider | |
+{ | |
+ /** | |
+ * Register any application services. | |
+ * | |
+ * @return void | |
+ */ | |
+ public function boot() | |
+ { | |
+ $location = resource_path('fields'); | |
+ | |
+ Action::hook('acf/settings/save_json', function () use ($location) { | |
+ return $location; | |
+ }); | |
+ | |
+ Action::hook('acf/settings/load_json', function ($paths) use ($location) { | |
+ // this hook is ran twice for whatever reason so we have to conditionally add our location | |
+ return !in_array($location, $paths, true) ? array_merge($paths, [$location]) : $paths; | |
+ }); | |
+ } | |
+} | |
diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php | |
index 35471f6f..82e00892 100644 | |
--- a/app/Providers/AppServiceProvider.php | |
+++ b/app/Providers/AppServiceProvider.php | |
@@ -1,7 +1,7 @@ | |
<?php | |
- | |
namespace App\Providers; | |
+use Illuminate\Support\Facades\View; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
@@ -13,7 +13,15 @@ class AppServiceProvider extends ServiceProvider | |
*/ | |
public function boot() | |
{ | |
- // | |
+ register_nav_menu('primary_navigation', 'Primary Navigation'); | |
+ | |
+ View::share('menu', (function () { | |
+ try { | |
+ return menu('primary_navigation', 0); | |
+ } catch (Exception $e) { | |
+ return []; | |
+ } | |
+ })()); | |
} | |
/** | |
diff --git a/composer.json b/composer.json | |
index 65bf8b4f..38e6ef4d 100644 | |
--- a/composer.json | |
+++ b/composer.json | |
@@ -1,21 +1,57 @@ | |
{ | |
- "name": "laravel/laravel", | |
- "description": "The Laravel Framework.", | |
+ "name": "koselig/koselig", | |
+ "description": "Integrate Wordpress into Laravel seamlessly.", | |
"keywords": ["framework", "laravel"], | |
- "license": "MIT", | |
+ "license": "GPL-3.0+", | |
"type": "project", | |
+ "repositories": [ | |
+ { | |
+ "type": "vcs", | |
+ "url": "http://github.com/koselig/library" | |
+ }, | |
+ { | |
+ "type": "composer", | |
+ "url": "https://wpackagist.org" | |
+ }, | |
+ { | |
+ "type": "package", | |
+ "package": { | |
+ "name": "advanced-custom-fields/advanced-custom-fields-pro", | |
+ "version": "5.6.10", | |
+ "type": "wordpress-plugin", | |
+ "dist": { | |
+ "type": "zip", | |
+ "url": "https://connect.advancedcustomfields.com/index.php?p=pro&a=download" | |
+ }, | |
+ "require": { | |
+ "philippbaschke/acf-pro-installer": "^1.0", | |
+ "composer/installers": "^1.0" | |
+ } | |
+ } | |
+ } | |
+ ], | |
"require": { | |
"php": "^7.1.3", | |
"fideloper/proxy": "^4.0", | |
"laravel/framework": "5.6.*", | |
- "laravel/tinker": "^1.0" | |
+ "laravel/tinker": "^1.0", | |
+ "koselig/library": "dev-master", | |
+ "johnpbloch/wordpress": "^4.6", | |
+ "roots/wp-password-bcrypt": "^1.0", | |
+ "advanced-custom-fields/advanced-custom-fields-pro": "*", | |
+ "wpackagist-plugin/tinymce-advanced": "^4.6", | |
+ "barryvdh/laravel-ide-helper": "^2.4", | |
+ "barryvdh/laravel-debugbar": "^3.1", | |
+ "graham-campbell/exceptions": "^11.0" | |
}, | |
"require-dev": { | |
- "filp/whoops": "^2.0", | |
- "fzaninotto/faker": "^1.4", | |
+ "fzaninotto/faker": "~1.7", | |
"mockery/mockery": "^1.0", | |
- "nunomaduro/collision": "^2.0", | |
- "phpunit/phpunit": "^7.0" | |
+ "phpunit/phpunit": "^7.1", | |
+ "symfony/css-selector": "^4.0", | |
+ "symfony/dom-crawler": "^4.0", | |
+ "filp/whoops": "^2.1", | |
+ "nunomaduro/collision": "^2.0" | |
}, | |
"autoload": { | |
"classmap": [ | |
@@ -31,12 +67,6 @@ | |
"Tests\\": "tests/" | |
} | |
}, | |
- "extra": { | |
- "laravel": { | |
- "dont-discover": [ | |
- ] | |
- } | |
- }, | |
"scripts": { | |
"post-root-package-install": [ | |
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" | |
@@ -49,11 +79,23 @@ | |
"@php artisan package:discover" | |
] | |
}, | |
+ "minimum-stability": "dev", | |
+ "prefer-stable": true, | |
"config": { | |
"preferred-install": "dist", | |
"sort-packages": true, | |
"optimize-autoloader": true | |
}, | |
- "minimum-stability": "dev", | |
- "prefer-stable": true | |
+ "extra": { | |
+ "wordpress-install-dir": "public/cms", | |
+ "installer-paths": { | |
+ "public/content/mu-plugins/{$name}/": ["type:wordpress-muplugin"], | |
+ "public/content/plugins/{$name}/": ["type:wordpress-plugin"], | |
+ "public/content/themes/{$name}/": ["type:wordpress-theme"] | |
+ }, | |
+ "laravel": { | |
+ "dont-discover": [ | |
+ ] | |
+ } | |
+ } | |
} | |
diff --git a/config/app.php b/config/app.php | |
index b16e7f77..6ad9ec7e 100644 | |
--- a/config/app.php | |
+++ b/config/app.php | |
@@ -147,9 +146,18 @@ return [ | |
Illuminate\Validation\ValidationServiceProvider::class, | |
Illuminate\View\ViewServiceProvider::class, | |
+ /* | |
+ * Application Service Providers to be loaded before Koselig... | |
+ */ | |
+ App\Providers\ACFServiceProvider::class, | |
+ | |
/* | |
* Package Service Providers... | |
*/ | |
+ Koselig\Providers\KoseligServiceProvider::class, | |
/* | |
* Application Service Providers... | |
@@ -190,7 +198,6 @@ return [ | |
'Event' => Illuminate\Support\Facades\Event::class, | |
'File' => Illuminate\Support\Facades\File::class, | |
'Gate' => Illuminate\Support\Facades\Gate::class, | |
- 'Hash' => Illuminate\Support\Facades\Hash::class, | |
'Lang' => Illuminate\Support\Facades\Lang::class, | |
'Log' => Illuminate\Support\Facades\Log::class, | |
'Mail' => Illuminate\Support\Facades\Mail::class, | |
@@ -209,6 +216,15 @@ return [ | |
'Validator' => Illuminate\Support\Facades\Validator::class, | |
'View' => Illuminate\Support\Facades\View::class, | |
+ // Koselig Aliases | |
+ 'Wordpress' => Koselig\Support\Wordpress::class, | |
+ 'Meta' => Koselig\Models\Meta::class, | |
+ 'Hash' => Koselig\Facades\WPHash::class, | |
+ 'Query' => Koselig\Facades\Query::class, | |
+ 'Loop' => Koselig\Facades\Loop::class, | |
+ | |
+ // Application Aliases | |
+ | |
], | |
]; | |
diff --git a/config/auth.php b/config/auth.php | |
index 78175010..263987ac 100644 | |
--- a/config/auth.php | |
+++ b/config/auth.php | |
@@ -14,7 +14,7 @@ return [ | |
*/ | |
'defaults' => [ | |
- 'guard' => 'web', | |
+ 'guard' => 'wordpress', | |
'passwords' => 'users', | |
], | |
@@ -41,6 +41,11 @@ return [ | |
'provider' => 'users', | |
], | |
+ 'wordpress' => [ | |
+ 'driver' => 'wordpress', | |
+ 'provider' => 'wp_users', | |
+ ], | |
+ | |
'api' => [ | |
'driver' => 'token', | |
'provider' => 'users', | |
@@ -70,6 +75,13 @@ return [ | |
'model' => App\User::class, | |
], | |
+ 'wp_users' => [ | |
+ 'driver' => [ | |
+ 'driver' => 'eloquent', | |
+ 'model' => Koselig\Models\User::class, | |
+ ], | |
+ ], | |
+ | |
// 'users' => [ | |
// 'driver' => 'database', | |
// 'table' => 'users', | |
diff --git a/config/posttypes.php b/config/posttypes.php | |
new file mode 100644 | |
index 00000000..4bb949fb | |
--- /dev/null | |
+++ b/config/posttypes.php | |
@@ -0,0 +1,19 @@ | |
+<?php | |
+ | |
+return [ | |
+ 'supplier' => [ | |
+ 'public' => true, | |
+ 'capability_type' => 'page', | |
+ 'label' => 'Supplier', | |
+ 'map_meta_cap' => true, | |
+ 'menu_position' => 5, | |
+ 'hierarchical' => false, | |
+ 'rewrite' => false, | |
+ 'query_var' => false, | |
+ 'delete_with_user' => true, | |
+ 'supports' => [ | |
+ 'title', | |
+ 'revisions', | |
+ ], | |
+ ], | |
+]; | |
diff --git a/config/supports.php b/config/supports.php | |
new file mode 100644 | |
index 00000000..c0a343f8 | |
--- /dev/null | |
+++ b/config/supports.php | |
@@ -0,0 +1,9 @@ | |
+<?php | |
+ | |
+return [ | |
+ 'post-formats' => [], | |
+ 'post-thumbnails' => ['post'], | |
+ 'automatic-feed-links', | |
+ 'html5' => ['comment-list', 'comment-form', 'search-form', 'gallery', 'caption'], | |
+ 'title-tag', | |
+]; | |
diff --git a/config/templates.php b/config/templates.php | |
new file mode 100644 | |
index 00000000..e061e9a3 | |
--- /dev/null | |
+++ b/config/templates.php | |
@@ -0,0 +1,6 @@ | |
+<?php | |
+ | |
+return [ | |
+ // slug => name | |
+ 'home' => 'Homepage', | |
+]; | |
diff --git a/config/wordpress.php b/config/wordpress.php | |
new file mode 100644 | |
index 00000000..2b5835cd | |
--- /dev/null | |
+++ b/config/wordpress.php | |
@@ -0,0 +1,20 @@ | |
+<?php | |
+ | |
+return [ | |
+ 'auth_key' => env('AUTH_KEY'), | |
+ 'secure_auth_key' => env('SECURE_AUTH_KEY'), | |
+ 'logged_in_key' => env('LOGGED_IN_KEY'), | |
+ 'nonce_key' => env('NONCE_KEY'), | |
+ 'auth_salt' => env('AUTH_SALT'), | |
+ 'secure_auth_salt' => env('SECURE_AUTH_SALT'), | |
+ 'logged_in_salt' => env('LOGGED_IN_SALT'), | |
+ 'nonce_salt' => env('NONCE_SALT'), | |
+ 'wp_allow_multisite' => env('WP_ALLOW_MULTISITE'), | |
+ 'multisite' => env('MULTISITE'), | |
+ 'subdomain_install' => env('SUBDOMAIN_INSTALL'), | |
+ 'domain_current_site' => env('DOMAIN_CURRENT_SITE'), | |
+ 'path_current_site' => env('PATH_CURRENT_SITE'), | |
+ 'site_id_current_site' => env('SITE_ID_CURRENT_SITE'), | |
+ 'blog_id_current_site' => env('BLOG_ID_CURRENT_SITE'), | |
+ 'caching' => env('DB_CACHE'), | |
+]; | |
+ }, | |
diff --git a/public/content/db.php b/public/content/db.php | |
new file mode 100644 | |
index 00000000..8cd4e445 | |
--- /dev/null | |
+++ b/public/content/db.php | |
@@ -0,0 +1,5 @@ | |
+<?php | |
+ | |
+use Koselig\Proxy\WordpressDatabase; | |
+ | |
+$GLOBALS['wpdb'] = new WordpressDatabase; | |
diff --git a/public/content/mu-plugins/.gitignore b/public/content/mu-plugins/.gitignore | |
new file mode 100644 | |
index 00000000..120f485d | |
--- /dev/null | |
+++ b/public/content/mu-plugins/.gitignore | |
@@ -0,0 +1,2 @@ | |
+* | |
+!/.gitignore | |
diff --git a/public/content/object-cache.php b/public/content/object-cache.php | |
new file mode 100644 | |
index 00000000..b0ecdfd7 | |
--- /dev/null | |
+++ b/public/content/object-cache.php | |
@@ -0,0 +1,242 @@ | |
+<?php | |
+/** | |
+ * This file is just copied directly from Wordpress' cache.php with a few changes to how globals are used | |
+ * and method naming, etc. | |
+ */ | |
+use Koselig\Proxy\WordpressCache; | |
+ | |
+/** | |
+ * Adds data to the cache, if the cache key doesn't already exist. | |
+ * | |
+ * @since 2.0.0 | |
+ * @see WordpressCache::add() | |
+ * | |
+ * @global WordpressCache $wp_object_cache Object cache global instance. | |
+ * | |
+ * @param int|string $key The cache key to use for retrieval later. | |
+ * @param mixed $data The data to add to the cache. | |
+ * @param string $group Optional. The group to add the cache to. Enables the same key | |
+ * to be used across groups. Default empty. | |
+ * @param int $expire Optional. When the cache data should expire, in seconds. | |
+ * Default 0 (no expiration). | |
+ * | |
+ * @return bool False if cache key and group already exist, true on success. | |
+ */ | |
+function wp_cache_add($key, $data, $group = '', $expire = 0) | |
+{ | |
+ return $GLOBALS['wp_object_cache']->add($key, $data, $group, (int) $expire); | |
+} | |
+ | |
+/** | |
+ * Closes the cache. | |
+ * | |
+ * This function has ceased to do anything since WordPress 2.5. The | |
+ * functionality was removed along with the rest of the persistent cache. | |
+ * | |
+ * This does not mean that plugins can't implement this function when they need | |
+ * to make sure that the cache is cleaned up after WordPress no longer needs it. | |
+ * | |
+ * @since 2.0.0 | |
+ * | |
+ * @return true Always returns true. | |
+ */ | |
+function wp_cache_close() | |
+{ | |
+ return true; | |
+} | |
+ | |
+/** | |
+ * Decrements numeric cache item's value. | |
+ * | |
+ * @since 3.3.0 | |
+ * @see WordpressCache::decr() | |
+ * | |
+ * @global WordpressCache $wp_object_cache Object cache global instance. | |
+ * | |
+ * @param int|string $key The cache key to decrement. | |
+ * @param int $offset Optional. The amount by which to decrement the item's value. Default 1. | |
+ * @param string $group Optional. The group the key is in. Default empty. | |
+ * | |
+ * @return false|int False on failure, the item's new value on success. | |
+ */ | |
+function wp_cache_decr($key, $offset = 1, $group = '') | |
+{ | |
+ return $GLOBALS['wp_object_cache']->decr($key, $offset, $group); | |
+} | |
+ | |
+/** | |
+ * Removes the cache contents matching key and group. | |
+ * | |
+ * @since 2.0.0 | |
+ * @see WordpressCache::delete() | |
+ * | |
+ * @global WordpressCache $wp_object_cache Object cache global instance. | |
+ * | |
+ * @param int|string $key What the contents in the cache are called. | |
+ * @param string $group Optional. Where the cache contents are grouped. Default empty. | |
+ * | |
+ * @return bool True on successful removal, false on failure. | |
+ */ | |
+function wp_cache_delete($key, $group = '') | |
+{ | |
+ return $GLOBALS['wp_object_cache']->delete($key, $group); | |
+} | |
+ | |
+/** | |
+ * Removes all cache items. | |
+ * | |
+ * @since 2.0.0 | |
+ * @see WordpressCache::flush() | |
+ * | |
+ * @global WordpressCache $wp_object_cache Object cache global instance. | |
+ * | |
+ * @return bool False on failure, true on success | |
+ */ | |
+function wp_cache_flush() | |
+{ | |
+ return $GLOBALS['wp_object_cache']->flush(); | |
+} | |
+ | |
+/** | |
+ * Retrieves the cache contents from the cache by key and group. | |
+ * | |
+ * @since 2.0.0 | |
+ * @see WordpressCache::get() | |
+ * | |
+ * @global WordpressCache $wp_object_cache Object cache global instance. | |
+ * | |
+ * @param int|string $key The key under which the cache contents are stored. | |
+ * @param string $group Optional. Where the cache contents are grouped. Default empty. | |
+ * @param bool $force Optional. Whether to force an update of the local cache from the persistent | |
+ * cache. Default false. | |
+ * @param bool $found Optional. Whether the key was found in the cache. Disambiguates a return of false, | |
+ * a storable value. Passed by reference. Default null. | |
+ * | |
+ * @return bool|mixed False on failure to retrieve contents or the cache | |
+ * contents on success | |
+ */ | |
+function wp_cache_get($key, $group = '', $force = false, &$found = null) | |
+{ | |
+ return $GLOBALS['wp_object_cache']->get($key, $group, $force, $found); | |
+} | |
+ | |
+/** | |
+ * Increment numeric cache item's value. | |
+ * | |
+ * @since 3.3.0 | |
+ * @see WordpressCache::incr() | |
+ * | |
+ * @global WordpressCache $wp_object_cache Object cache global instance. | |
+ * | |
+ * @param int|string $key The key for the cache contents that should be incremented. | |
+ * @param int $offset Optional. The amount by which to increment the item's value. Default 1. | |
+ * @param string $group Optional. The group the key is in. Default empty. | |
+ * | |
+ * @return false|int False on failure, the item's new value on success. | |
+ */ | |
+function wp_cache_incr($key, $offset = 1, $group = '') | |
+{ | |
+ return $GLOBALS['wp_object_cache']->incr($key, $offset, $group); | |
+} | |
+ | |
+/** | |
+ * Sets up Object Cache Global and assigns it. | |
+ * | |
+ * @since 2.0.0 | |
+ * | |
+ * @global WordpressCache $wp_object_cache | |
+ */ | |
+function wp_cache_init() | |
+{ | |
+ $GLOBALS['wp_object_cache'] = new WordpressCache(); | |
+} | |
+ | |
+/** | |
+ * Replaces the contents of the cache with new data. | |
+ * | |
+ * @since 2.0.0 | |
+ * @see WordpressCache::replace() | |
+ * | |
+ * @global WordpressCache $wp_object_cache Object cache global instance. | |
+ * | |
+ * @param int|string $key The key for the cache data that should be replaced. | |
+ * @param mixed $data The new data to store in the cache. | |
+ * @param string $group Optional. The group for the cache data that should be replaced. | |
+ * Default empty. | |
+ * @param int $expire Optional. When to expire the cache contents, in seconds. | |
+ * Default 0 (no expiration). | |
+ * | |
+ * @return bool False if original value does not exist, true if contents were replaced | |
+ */ | |
+function wp_cache_replace($key, $data, $group = '', $expire = 0) | |
+{ | |
+ return $GLOBALS['wp_object_cache']->replace($key, $data, $group, (int) $expire); | |
+} | |
+ | |
+/** | |
+ * Saves the data to the cache. | |
+ * | |
+ * Differs from wp_cache_add() and wp_cache_replace() in that it will always write data. | |
+ * | |
+ * @since 2.0.0 | |
+ * @see WordpressCache::set() | |
+ * | |
+ * @global WordpressCache $wp_object_cache Object cache global instance. | |
+ * | |
+ * @param int|string $key The cache key to use for retrieval later. | |
+ * @param mixed $data The contents to store in the cache. | |
+ * @param string $group Optional. Where to group the cache contents. Enables the same key | |
+ * to be used across groups. Default empty. | |
+ * @param int $expire Optional. When to expire the cache contents, in seconds. | |
+ * Default 0 (no expiration). | |
+ * | |
+ * @return bool False on failure, true on success | |
+ */ | |
+function wp_cache_set($key, $data, $group = '', $expire = 0) | |
+{ | |
+ return $GLOBALS['wp_object_cache']->set($key, $data, $group, (int) $expire); | |
+} | |
+ | |
+/** | |
+ * Switches the internal blog ID. | |
+ * | |
+ * This changes the blog id used to create keys in blog specific groups. | |
+ * | |
+ * @since 3.5.0 | |
+ * @see WordpressCache::switch_to_blog() | |
+ * | |
+ * @global WordpressCache $wp_object_cache Object cache global instance. | |
+ * | |
+ * @param int $blog_id Site ID. | |
+ */ | |
+function wp_cache_switch_to_blog($blog_id) | |
+{ | |
+ $GLOBALS['wp_object_cache']->switchBlog($blog_id); | |
+} | |
+ | |
+/** | |
+ * Adds a group or set of groups to the list of global groups. | |
+ * | |
+ * @since 2.6.0 | |
+ * @see WordpressCache::add_global_groups() | |
+ * | |
+ * @global WordpressCache $wp_object_cache Object cache global instance. | |
+ * | |
+ * @param string|array $groups A group or an array of groups to add. | |
+ */ | |
+function wp_cache_add_global_groups($groups) | |
+{ | |
+ $GLOBALS['wp_object_cache']->addGlobalGroups($groups); | |
+} | |
+ | |
+/** | |
+ * Adds a group or set of groups to the list of non-persistent groups. | |
+ * | |
+ * @since 2.6.0 | |
+ * | |
+ * @param string|array $groups A group or an array of groups to add. | |
+ */ | |
+function wp_cache_add_non_persistent_groups($groups) | |
+{ | |
+ $GLOBALS['wp_object_cache']->addNonPersistentGroups($groups); | |
+} | |
diff --git a/public/content/plugins/.gitignore b/public/content/plugins/.gitignore | |
new file mode 100644 | |
index 00000000..a1c39d0d | |
--- /dev/null | |
+++ b/public/content/plugins/.gitignore | |
@@ -0,0 +1,4 @@ | |
+* | |
+!/.gitignore | |
+!/index.php | |
diff --git a/public/content/plugins/.gitkeep b/public/content/plugins/.gitkeep | |
new file mode 100644 | |
index 00000000..e69de29b | |
diff --git a/public/content/plugins/index.php b/public/content/plugins/index.php | |
new file mode 100644 | |
index 00000000..e0ee5083 | |
--- /dev/null | |
+++ b/public/content/plugins/index.php | |
@@ -0,0 +1,3 @@ | |
+<?php | |
+ | |
+// Silence is golden. | |
diff --git a/public/content/themes/koselig/index.php b/public/content/themes/koselig/index.php | |
new file mode 100644 | |
index 00000000..91791c8b | |
--- /dev/null | |
+++ b/public/content/themes/koselig/index.php | |
@@ -0,0 +1,10 @@ | |
+<?php | |
+/** | |
+ * Disable the frontend of the site. | |
+ * | |
+ * PLEASE DO NOT USE WORDPRESS TEMPLATES WHEN USING KOSELIG. | |
+ * | |
+ * @author Jordan Doyle <jordan@doyle.wf> | |
+ */ | |
+wp_redirect(site_url('wp-admin/')); | |
+exit; | |
diff --git a/public/content/themes/koselig/style.css b/public/content/themes/koselig/style.css | |
new file mode 100644 | |
index 00000000..2661a972 | |
--- /dev/null | |
+++ b/public/content/themes/koselig/style.css | |
@@ -0,0 +1,11 @@ | |
+/* | |
+Theme Name: Koselig | |
+Theme URI: | |
+Description: Theme to disable the default frontend of Wordpress. | |
+Author: Jordan Doyle <jordan@doyle.wf> | |
+Author URI: https://jordandoyle.uk/ | |
+Version: 1.0 | |
+License: GNU General Public License v3 or later | |
+License URI: https://www.gnu.org/licenses/gpl-3.0.en.html | |
+Tags: | |
+*/ | |
diff --git a/public/content/uploads/.gitignore b/public/content/uploads/.gitignore | |
new file mode 100644 | |
index 00000000..d6b7ef32 | |
--- /dev/null | |
+++ b/public/content/uploads/.gitignore | |
@@ -0,0 +1,2 @@ | |
+* | |
+!.gitignore | |
diff --git a/public/index.php b/public/index.php | |
index 4584cbcd..f83544f0 100644 | |
--- a/public/index.php | |
+++ b/public/index.php | |
@@ -21,7 +19,9 @@ define('LARAVEL_START', microtime(true)); | |
| | |
*/ | |
+require __DIR__.'/../vendor/koselig/library/src/helpers.php'; | |
+ | |
require __DIR__.'/../vendor/autoload.php'; | |
/* | |
|-------------------------------------------------------------------------- | |
@@ -52,9 +52,9 @@ $app = require_once __DIR__.'/../bootstrap/app.php'; | |
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); | |
$response = $kernel->handle( | |
- $request = Illuminate\Http\Request::capture() | |
+ $request = Koselig\Http\Request::capture() | |
); | |
$response->send(); | |
diff --git a/public/robots.txt b/public/robots.txt | |
index eb053628..bb289756 100644 | |
--- a/public/robots.txt | |
+++ b/public/robots.txt | |
@@ -1,2 +1,2 @@ | |
User-agent: * | |
-Disallow: | |
+Disallow: /cms/ | |
diff --git a/public/wp-config.php b/public/wp-config.php | |
new file mode 100644 | |
index 00000000..dd2d660c | |
--- /dev/null | |
+++ b/public/wp-config.php | |
@@ -0,0 +1,69 @@ | |
+<?php | |
+ | |
+// wp-config file to make the wordpress backend aware of our presence | |
+ | |
+/* | |
+|-------------------------------------------------------------------------- | |
+| Register The Auto Loader | |
+|-------------------------------------------------------------------------- | |
+| | |
+| Composer provides a convenient, automatically generated class loader for | |
+| our application. We just need to utilize it! We'll simply require it | |
+| into the script here so that we don't have to worry about manual | |
+| loading any of our classes later on. It feels nice to relax. | |
+| | |
+*/ | |
+ | |
+use Illuminate\Http\Request; | |
+use Illuminate\Support\Facades\Facade; | |
+ | |
+require __DIR__ . '/../vendor/koselig/library/src/helpers.php'; | |
+ | |
+require __DIR__ . '/../vendor/autoload.php'; | |
+ | |
+/* | |
+|-------------------------------------------------------------------------- | |
+| Turn On The Lights | |
+|-------------------------------------------------------------------------- | |
+| | |
+| We need to illuminate PHP development, so let us turn on the lights. | |
+| This bootstraps the framework and gets it ready for use, then it | |
+| will load up this application so that we can run it and send | |
+| the responses back to the browser and delight our users. | |
+| | |
+*/ | |
+ | |
+$app = require_once __DIR__ . '/../bootstrap/app.php'; | |
+ | |
+/* | |
+|-------------------------------------------------------------------------- | |
+| Run The Application | |
+|-------------------------------------------------------------------------- | |
+| | |
+| Once we have the application, we can handle the incoming request | |
+| through the kernel, and send the associated response back to | |
+| the client's browser allowing them to enjoy the creative | |
+| and wonderful application we have prepared for them. | |
+| | |
+*/ | |
+ | |
+$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); | |
+ | |
+$app->bootstrapWith([ | |
+ \Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables::class, | |
+ \Illuminate\Foundation\Bootstrap\LoadConfiguration::class, | |
+ \Illuminate\Foundation\Bootstrap\HandleExceptions::class, | |
+ \Illuminate\Foundation\Bootstrap\RegisterFacades::class, | |
+]); | |
+ | |
+$app->instance('request', Request::capture()); | |
+Facade::clearResolvedInstance('request'); | |
+ | |
+// force the root url to whatever is set in the env file, stops wordpress taking over the root url | |
+// when loading from wp-config.php | |
+url()->forceRootUrl(config('app.url')); | |
+ | |
+$app->bootstrapWith([ | |
+ Illuminate\Foundation\Bootstrap\RegisterProviders::class, | |
+ Illuminate\Foundation\Bootstrap\BootProviders::class, | |
+]); | |
diff --git a/resources/fields/.gitkeep b/resources/fields/.gitkeep | |
new file mode 100644 | |
index 00000000..e69de29b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment