@@ 478-490 (lines=13) @@ | ||
475 | foreach ( $tests_to_run as $test ) { |
|
476 | switch ( $test ) { |
|
477 | // TEST #1 : check that section was set |
|
478 | case 1 : |
|
479 | if ( empty( $section ) ) { |
|
480 | if ( $display_errors ) { |
|
481 | throw new EE_Error( |
|
482 | sprintf( |
|
483 | __( |
|
484 | 'No configuration section has been provided while attempting to save "%s".', |
|
485 | 'event_espresso' |
|
486 | ), |
|
487 | $config_class |
|
488 | ) |
|
489 | ); |
|
490 | } |
|
491 | return false; |
|
492 | } |
|
493 | break; |
|
@@ 495-505 (lines=11) @@ | ||
492 | } |
|
493 | break; |
|
494 | // TEST #2 : check that settings section exists |
|
495 | case 2 : |
|
496 | if ( ! isset( $this->{$section} ) ) { |
|
497 | if ( $display_errors ) { |
|
498 | throw new EE_Error( |
|
499 | sprintf( |
|
500 | __( 'The "%s" configuration section does not exist.', 'event_espresso' ), |
|
501 | $section |
|
502 | ) |
|
503 | ); |
|
504 | } |
|
505 | return false; |
|
506 | } |
|
507 | break; |
|
508 | // TEST #3 : check that section is the proper format |
|
@@ 528-537 (lines=10) @@ | ||
525 | } |
|
526 | break; |
|
527 | // TEST #4 : check that config section name has been set |
|
528 | case 4 : |
|
529 | if ( empty( $name ) ) { |
|
530 | if ( $display_errors ) { |
|
531 | throw new EE_Error( |
|
532 | __( |
|
533 | 'No name has been provided for the specific configuration section.', |
|
534 | 'event_espresso' |
|
535 | ) |
|
536 | ); |
|
537 | } |
|
538 | return false; |
|
539 | } |
|
540 | break; |
|
@@ 542-551 (lines=10) @@ | ||
539 | } |
|
540 | break; |
|
541 | // TEST #5 : check that a config class name has been set |
|
542 | case 5 : |
|
543 | if ( empty( $config_class ) ) { |
|
544 | if ( $display_errors ) { |
|
545 | throw new EE_Error( |
|
546 | __( |
|
547 | 'No class name has been provided for the specific configuration section.', |
|
548 | 'event_espresso' |
|
549 | ) |
|
550 | ); |
|
551 | } |
|
552 | return false; |
|
553 | } |
|
554 | break; |
|
@@ 556-568 (lines=13) @@ | ||
553 | } |
|
554 | break; |
|
555 | // TEST #6 : verify config class is accessible |
|
556 | case 6 : |
|
557 | if ( ! class_exists( $config_class ) ) { |
|
558 | if ( $display_errors ) { |
|
559 | throw new EE_Error( |
|
560 | sprintf( |
|
561 | __( |
|
562 | 'The "%s" class does not exist. Please ensure that an autoloader has been set for it.', |
|
563 | 'event_espresso' |
|
564 | ), |
|
565 | $config_class |
|
566 | ) |
|
567 | ); |
|
568 | } |
|
569 | return false; |
|
570 | } |
|
571 | break; |