Skip to content

Instantly share code, notes, and snippets.

@andriesss
Created March 27, 2012 14:06
Show Gist options
  • Save andriesss/2216166 to your computer and use it in GitHub Desktop.
Save andriesss/2216166 to your computer and use it in GitHub Desktop.
make zend_log work with namespaces
Index: library/Zend/Log.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- library/Zend/Log.php (revision 5616)
+++ library/Zend/Log.php (revision )
@@ -260,6 +260,7 @@
$params = isset($config[ $type .'Params' ]) ? $config[ $type .'Params' ] : array();
$className = $this->getClassName($config, $type, $namespace);
+
if (!class_exists($className)) {
require_once 'Zend/Loader.php';
Zend_Loader::loadClass($className);
@@ -298,8 +299,11 @@
$namespace = $config[ $type . 'Namespace' ];
}
- $fullClassName = $namespace . '_' . $className;
- return $fullClassName;
+ if (substr($namespace, -1) == '\\') {
+ return $namespace . $className;
+ }
+
+ return $namespace . '_' . $className;
}
/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment