diff --git a/lib/Pinpoint/Common/AbstractClassFile.php b/lib/Pinpoint/Common/AbstractClassFile.php index 5b52cfa..87e0dbe 100644 --- a/lib/Pinpoint/Common/AbstractClassFile.php +++ b/lib/Pinpoint/Common/AbstractClassFile.php @@ -120,8 +120,13 @@ public function markHasYield() public function done() { - - $fullPath = Utils::$CLS_DIR . '/' . str_replace('\\', '/', $this->className) . '.php'; + // only for support phpunit test + if (defined('PHPUNIT_COMPOSER_INSTALL')) { + $fullPath = Utils::$CLS_DIR . '/' . str_replace('\\', '/', $this->className) . '.php'; + } else { + $file_uuid_name = uniqid("pinpoint_"); + $fullPath = Utils::$CLS_DIR . '/' . $file_uuid_name . '.php'; + } $context = $this->_astPrinter->prettyPrintFile($this->newAstNode); MonitorClass::getInstance()->insertMapping($this->className, $fullPath); Logger::Inst()->debug("map/save new class '$this->className' to '$fullPath' ");