2dcf721cea
- ext_* functions that call Unit::lookupClass were not correctly handling denormalized names (ex. \FooNS\Bar), this adds a wrapper for this pattern and calling it. - ReflectionClass::subclassOf should be using f_is_subclass_of Closes #827 Differential Revision: D945363
36 linhas
1.5 KiB
C++
36 linhas
1.5 KiB
C++
/*
|
|
+----------------------------------------------------------------------+
|
|
| HipHop for PHP |
|
|
+----------------------------------------------------------------------+
|
|
| Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) |
|
|
| Copyright (c) 1997-2010 The PHP Group |
|
|
+----------------------------------------------------------------------+
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
| available through the world-wide-web at the following url: |
|
|
| http://www.php.net/license/3_01.txt |
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
| license@php.net so we can mail you a copy immediately. |
|
|
+----------------------------------------------------------------------+
|
|
*/
|
|
|
|
#include "hphp/runtime/vm/unit.h"
|
|
|
|
namespace HPHP {
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
Class* lookup_class(CStrRef className) {
|
|
auto cls = Unit::lookupClass(className.get());
|
|
if (!cls) {
|
|
auto normName = normalizeNS(className.get());
|
|
if (normName) {
|
|
cls = Unit::lookupClass(normName.get());
|
|
}
|
|
}
|
|
return cls;
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
}
|