summaryrefslogtreecommitdiff
path: root/cpp/src/slice2php/Main.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2009-06-25 09:41:49 -0700
committerMark Spruiell <mes@zeroc.com>2009-06-25 09:41:49 -0700
commite5b38b6bea1556fc3792d88cb1fd4a31e247cb16 (patch)
treeb280a35e5876932121ac8b4a8a5783604ff528ec /cpp/src/slice2php/Main.cpp
parentfixing Windows compilation bug in defaultServant test (diff)
downloadice-e5b38b6bea1556fc3792d88cb1fd4a31e247cb16.tar.bz2
ice-e5b38b6bea1556fc3792d88cb1fd4a31e247cb16.tar.xz
ice-e5b38b6bea1556fc3792d88cb1fd4a31e247cb16.zip
PHP fixes:
- adding namespace support to test suite and demos - doc edits - bug fix in translator
Diffstat (limited to 'cpp/src/slice2php/Main.cpp')
-rw-r--r--cpp/src/slice2php/Main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/cpp/src/slice2php/Main.cpp b/cpp/src/slice2php/Main.cpp
index 9ad5e42935e..3f465fb4544 100644
--- a/cpp/src/slice2php/Main.cpp
+++ b/cpp/src/slice2php/Main.cpp
@@ -942,7 +942,14 @@ CodeVisitor::visitConst(const ConstPtr& p)
_out << sp << nl << "if(!defined('" << escapeName(abs) << "'))";
_out << sb;
- _out << sp << nl << "define('" << name << "', ";
+ if(_ns)
+ {
+ _out << sp << nl << "define(__NAMESPACE__ . '\\\\" << name << "', ";
+ }
+ else
+ {
+ _out << sp << nl << "define('" << name << "', ";
+ }
Slice::BuiltinPtr b = Slice::BuiltinPtr::dynamicCast(valueType);
Slice::EnumPtr en = Slice::EnumPtr::dynamicCast(valueType);