@@ 552-564 (lines=13) @@ | ||
549 | foreach ($tests_to_run as $test) { |
|
550 | switch ($test) { |
|
551 | // TEST #1 : check that section was set |
|
552 | case 1 : |
|
553 | if (empty($section)) { |
|
554 | if ($display_errors) { |
|
555 | throw new EE_Error( |
|
556 | sprintf( |
|
557 | __( |
|
558 | 'No configuration section has been provided while attempting to save "%s".', |
|
559 | 'event_espresso' |
|
560 | ), |
|
561 | $config_class |
|
562 | ) |
|
563 | ); |
|
564 | } |
|
565 | return false; |
|
566 | } |
|
567 | break; |
|
@@ 569-579 (lines=11) @@ | ||
566 | } |
|
567 | break; |
|
568 | // TEST #2 : check that settings section exists |
|
569 | case 2 : |
|
570 | if (! isset($this->{$section})) { |
|
571 | if ($display_errors) { |
|
572 | throw new EE_Error( |
|
573 | sprintf( |
|
574 | __('The "%s" configuration section does not exist.', 'event_espresso'), |
|
575 | $section |
|
576 | ) |
|
577 | ); |
|
578 | } |
|
579 | return false; |
|
580 | } |
|
581 | break; |
|
582 | // TEST #3 : check that section is the proper format |
|
@@ 602-611 (lines=10) @@ | ||
599 | } |
|
600 | break; |
|
601 | // TEST #4 : check that config section name has been set |
|
602 | case 4 : |
|
603 | if (empty($name)) { |
|
604 | if ($display_errors) { |
|
605 | throw new EE_Error( |
|
606 | __( |
|
607 | 'No name has been provided for the specific configuration section.', |
|
608 | 'event_espresso' |
|
609 | ) |
|
610 | ); |
|
611 | } |
|
612 | return false; |
|
613 | } |
|
614 | break; |
|
@@ 616-625 (lines=10) @@ | ||
613 | } |
|
614 | break; |
|
615 | // TEST #5 : check that a config class name has been set |
|
616 | case 5 : |
|
617 | if (empty($config_class)) { |
|
618 | if ($display_errors) { |
|
619 | throw new EE_Error( |
|
620 | __( |
|
621 | 'No class name has been provided for the specific configuration section.', |
|
622 | 'event_espresso' |
|
623 | ) |
|
624 | ); |
|
625 | } |
|
626 | return false; |
|
627 | } |
|
628 | break; |
|
@@ 630-642 (lines=13) @@ | ||
627 | } |
|
628 | break; |
|
629 | // TEST #6 : verify config class is accessible |
|
630 | case 6 : |
|
631 | if (! class_exists($config_class)) { |
|
632 | if ($display_errors) { |
|
633 | throw new EE_Error( |
|
634 | sprintf( |
|
635 | __( |
|
636 | 'The "%s" class does not exist. Please ensure that an autoloader has been set for it.', |
|
637 | 'event_espresso' |
|
638 | ), |
|
639 | $config_class |
|
640 | ) |
|
641 | ); |
|
642 | } |
|
643 | return false; |
|
644 | } |
|
645 | break; |