additional output on failure to find/create cache directory
This commit is contained in:
parent
5dcffefefd
commit
f9125ca8cf
@ -20,6 +20,7 @@ class App {
|
|||||||
/**
|
/**
|
||||||
* Any logic that needs executed when the plugin is activated.
|
* Any logic that needs executed when the plugin is activated.
|
||||||
*
|
*
|
||||||
|
* @package PluginNamespace\App
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
@ -37,18 +38,21 @@ class App {
|
|||||||
/**
|
/**
|
||||||
* Any logic that needs executed when the plugin is deactivated.
|
* Any logic that needs executed when the plugin is deactivated.
|
||||||
*
|
*
|
||||||
|
* @package PluginNamespace\App
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function plugin_deactivation(): void {
|
public static function plugin_deactivation(): void {
|
||||||
//
|
// phpcs:disable
|
||||||
|
// phpcs:enable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check that the cache directory for Blade exists and
|
* Check that the cache directory for Blade exists and
|
||||||
* if not then attempt to create it.
|
* if not then attempt to create it.
|
||||||
*
|
*
|
||||||
|
* @package PluginNamespace\App
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
@ -59,13 +63,13 @@ class App {
|
|||||||
if ( ! file_exists( NMSP_PLUGIN_BASE_DIR . '/cache/blade/.gitignore' ) ) {
|
if ( ! file_exists( NMSP_PLUGIN_BASE_DIR . '/cache/blade/.gitignore' ) ) {
|
||||||
try {
|
try {
|
||||||
mkdir( NMSP_PLUGIN_BASE_DIR . '/cache/blade', 0755, true );
|
mkdir( NMSP_PLUGIN_BASE_DIR . '/cache/blade', 0755, true );
|
||||||
} catch ( Exception $e ) {
|
} catch ( Exception $exp ) {
|
||||||
$error_payload = array(
|
$error_payload = array(
|
||||||
'level' => 'critical',
|
'level' => 'critical',
|
||||||
'message' => $e->getMessage(),
|
'message' => $exp->getMessage(),
|
||||||
'context' => array(
|
'context' => array(
|
||||||
'file' => $e->getFile(),
|
'file' => $exp->getFile(),
|
||||||
'line' => $e->getLine(),
|
'line' => $exp->getLine(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
error_log( json_encode( $error_payload, JSON_PRETTY_PRINT ) );
|
error_log( json_encode( $error_payload, JSON_PRETTY_PRINT ) );
|
||||||
@ -77,12 +81,13 @@ class App {
|
|||||||
* Return an instance of this plugin class. If it has
|
* Return an instance of this plugin class. If it has
|
||||||
* not been initialized, do so then return it.
|
* not been initialized, do so then return it.
|
||||||
*
|
*
|
||||||
|
* @package PluginNamespace\App
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*
|
*
|
||||||
* @return \PluginNamespace\App
|
* @return \PluginNamespace\App
|
||||||
*/
|
*/
|
||||||
public static function get_instance(): App {
|
public static function get_instance(): App {
|
||||||
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof App ) ) {
|
if ( ! ( self::$instance instanceof App ) ) {
|
||||||
self::$instance = new App();
|
self::$instance = new App();
|
||||||
|
|
||||||
self::$instance->load_plugin_textdomain();
|
self::$instance->load_plugin_textdomain();
|
||||||
@ -96,6 +101,7 @@ class App {
|
|||||||
/**
|
/**
|
||||||
* Load your translation files for this plugin.
|
* Load your translation files for this plugin.
|
||||||
*
|
*
|
||||||
|
* @package PluginNamespace\App
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
@ -107,14 +113,17 @@ class App {
|
|||||||
/**
|
/**
|
||||||
* Steps to take when initializing this plugin??
|
* Steps to take when initializing this plugin??
|
||||||
*
|
*
|
||||||
|
* @package PluginNamespace\App
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function scaffold_plugin(): void {
|
public function scaffold_plugin(): void {
|
||||||
|
// phpcs:disable
|
||||||
if ( is_admin() ) {
|
if ( is_admin() ) {
|
||||||
// admin only logic here
|
// admin only logic here, remove phpcs calls around this
|
||||||
}
|
}
|
||||||
|
// phpcs:enable
|
||||||
|
|
||||||
// other logic here
|
// other logic here
|
||||||
}
|
}
|
||||||
@ -126,6 +135,7 @@ class App {
|
|||||||
*
|
*
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*
|
*
|
||||||
|
* @package PluginNamespace\App
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
@ -148,6 +158,7 @@ class App {
|
|||||||
/**
|
/**
|
||||||
* Load BladeOne as the templating engine for the plugin.
|
* Load BladeOne as the templating engine for the plugin.
|
||||||
*
|
*
|
||||||
|
* @package PluginNamespace\App
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*
|
*
|
||||||
* @param \eftec\bladeone\BladeOne $blade
|
* @param \eftec\bladeone\BladeOne $blade
|
||||||
|
Loading…
x
Reference in New Issue
Block a user