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