File tree Expand file tree Collapse file tree 1 file changed +2
-31
lines changed
Expand file tree Collapse file tree 1 file changed +2
-31
lines changed Original file line number Diff line number Diff line change 1515function bootstrap () {
1616 Widget \bootstrap ();
1717
18- if ( parsedown_enabled () ) {
19- require_once composer_autoloader ();
20- }
21-
2218 if ( ! defined ( 'JSDC_REPOSITORY ' ) ) {
2319 add_action ( 'admin_init ' , __NAMESPACE__ . '\\add_setting ' );
2420 }
@@ -30,39 +26,14 @@ function bootstrap() {
3026 * @return bool
3127 */
3228function parsedown_enabled () : bool {
33- // Bail if the autoloader doesn't exist.
34- if ( ! file_exists ( composer_autoloader () ) ) {
35- error_log ( __ ( 'Autoloader file not found. ' , 'dashboard-changelog ' ) );
36- return false ;
37- }
38-
39- // Bail if the Parsedown library doesn't exist.
40- if ( ! file_exists ( get_vendor_dir () . 'erusev/parsedown/Parsedown.php ' ) ) {
41- error_log ( __ ( 'Parsedown file does not exist ' , 'dashboard-changelog ' ) );
29+ if ( ! class_exists ( 'Parsedown ' ) ) { var_dump ( 'no parsedown ' );
30+ error_log ( __ ( 'Parsedown class does not exist. ' , 'dashboard-changelog ' ) );
4231 return false ;
4332 }
4433
4534 return true ;
4635}
4736
48- /**
49- * Returns the vendor directory.
50- *
51- * @return string
52- */
53- function get_vendor_dir () : string {
54- return dirname ( __DIR__ ) . '/vendor/ ' ;
55- }
56-
57- /**
58- * Returns the path to the Composer autoload file.
59- *
60- * @return string
61- */
62- function composer_autoloader () : string {
63- return get_vendor_dir () . 'autoload.php ' ;
64- }
65-
6637/**
6738 * Get the cache expiration time.
6839 * We default to one day, but this can be filtered.
You can’t perform that action at this time.
0 commit comments