Browse files

MINOR Workaround for duplicate require_once calls of same class in tw…

…o locations (SS core and Zend_Translate_RailsYAML)
  • Loading branch information...
chillu committed Apr 15, 2012
1 parent d3b63da commit c649fa3acfcdc5a341f3a9e43f0bdfb4eaddd31e
@@ -481,6 +481,7 @@ public function write($entities, $locale, $path) {
public function getYaml($entities, $locale) {
+ // Check required because Zend_Translate_RailsYAML also includes the lib, from a different location
if(!class_exists('sfYamlDumper', false)) require_once 'thirdparty/symfony-yaml/lib/sfYamlDumper.php';
// Unflatten array
@@ -6,7 +6,11 @@
/** Zend_Translate_Adapter */
require_once 'Zend/Translate/Adapter.php';
-// require_once 'thirdparty/sfYaml/lib/sfYaml.php';
+// ischommer CUSTOM Check required because SS core also includes the lib, from a different location
+if(!class_exists('sfYaml')) require_once 'thirdparty/sfYaml/lib/sfYaml.php';
+if(!class_exists('sfYamlParser')) require_once 'thirdparty/sfYaml/lib/sfYamlParser.php';
+if(!class_exists('sfYamlDumper')) require_once 'thirdparty/sfYaml/lib/sfYamlDumper.php';
+// ischommer END_CUSTOM
class Translate_Adapter_RailsYaml extends Zend_Translate_Adapter {

0 comments on commit c649fa3

Please sign in to comment.