/** * tear down tests */ protected function tearDown() { parent::tearDown(); Tinebase_FileSystem::getInstance()->clearStatCache(); Tinebase_FileSystem::getInstance()->clearDeletedFilesFromFilesystem(); Tinebase_Cache_PerRequest::getInstance()->reset(); }
/** * Sets up the fixture. * This method is called before a test is executed. * * @access protected */ protected function setUp() { parent::setUp(); $this->_instance = new Crm_Frontend_Json(); $this->_fsController = Tinebase_FileSystem::getInstance(); Crm_Controller_Lead::getInstance()->duplicateCheckFields(array()); }
/** * Renames the node * * @throws Sabre_DAV_Exception_Forbidden * @param string $name The new name * @return void */ public function setName($name) { self::checkForbiddenFile($name); if (!Tinebase_Core::getUser()->hasGrant($this->_getContainer(), Tinebase_Model_Grants::GRANT_EDIT)) { throw new Sabre_DAV_Exception_Forbidden('Forbidden to rename file: ' . $this->_path); } list($dirname, $basename) = Sabre_DAV_URLUtil::splitPath($this->_path); Tinebase_FileSystem::getInstance()->rename($this->_path, $dirname . '/' . $name); }
/** * create vacation templates folder */ public static function createVacationTemplatesFolder() { $templateContainer = Tinebase_Container::getInstance()->createSystemContainer('Expressomail', 'Vacation Templates', Expressomail_Config::VACATION_TEMPLATES_CONTAINER_ID); try { Tinebase_FileSystem::getInstance()->createContainerNode($templateContainer); } catch (Tinebase_Exception_Backend $teb) { if (Tinebase_Core::isLogLevel(Zend_Log::ERR)) { Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ . ' Could not create vacation template folder: ' . $teb); } } }
/** * create reporting templates folder */ public static function createReportTemplatesFolder() { $templateContainer = Tinebase_Container::getInstance()->createSystemContainer('HumanResources', 'Report Templates', HumanResources_Config::REPORT_TEMPLATES_CONTAINER_ID); try { Tinebase_FileSystem::getInstance()->createContainerNode($templateContainer); } catch (Tinebase_Exception_Backend $teb) { if (Tinebase_Core::isLogLevel(Zend_Log::ERR)) { Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ . ' Could not create template folder: ' . $teb); } } }
/** * Creates a new subdirectory * * @param string $name name of the new subdirectory * @throws Sabre\DAV\Exception\Forbidden * @return Tinebase_Model_Container */ public function createDirectory($name) { $container = parent::createDirectory($name); $path = '/' . $this->_getApplication()->getId() . '/folders/' . $container->type . '/'; if ($container->type == Tinebase_Model_Container::TYPE_PERSONAL) { $path .= Tinebase_Core::getUser()->accountId . '/'; } $path .= $container->getId(); if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' create directory: ' . $path); } Tinebase_FileSystem::getInstance()->mkdir($path); }
public function put($data) { if (!Tinebase_Core::getUser()->hasGrant($this->_getContainer(), Tinebase_Model_Grants::GRANT_EDIT)) { throw new Sabre_DAV_Exception_Forbidden('Forbidden to edit file: ' . $this->_path); } $handle = Tinebase_FileSystem::getInstance()->fopen($this->_path, 'w'); if (!is_resource($handle)) { throw new Sabre_DAV_Exception_Forbidden('Permission denied to create file:' . $this->_path); } if (is_resource($data)) { stream_copy_to_stream($data, $handle); } Tinebase_FileSystem::getInstance()->fclose($handle); }
/** * create vacation templates folder */ public static function createVacationTemplatesFolder() { if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) { Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Creating vacation template in vfs ...'); } $templateContainer = Tinebase_Container::getInstance()->createSystemContainer('Felamimail', 'Vacation Templates', Felamimail_Config::VACATION_TEMPLATES_CONTAINER_ID, null, 'Tinebase_Model_Tree_Node'); try { Tinebase_FileSystem::getInstance()->createContainerNode($templateContainer); } catch (Tinebase_Exception_Backend $teb) { if (Tinebase_Core::isLogLevel(Zend_Log::ERR)) { Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ . ' Could not create vacation template folder: ' . $teb); } } }
/** * import one purchase imvoice file * * a new invoice with default data will be created and the invoice file will be attached * * @param string $name name of the invoice * @param resource $data binary data of the invoice (aka a pdf) * @throws Sabre\DAV\Exception\Forbidden * @return Sales_Model_PurchaseInvoice */ public function importPurchaseInvoice($name, $data) { // create invoice $purchaseInvoice = new Sales_Model_PurchaseInvoice(array('number' => '', 'description' => '', 'date' => Tinebase_DateTime::now(), 'discount' => 0, 'due_in' => 0, 'due_at' => Tinebase_DateTime::now(), 'price_gross' => 0, 'price_net' => 0, 'price_tax' => 0, 'sales_tax' => 0)); $invoice = $this->create($purchaseInvoice); // attach invoice file (aka a pdf) $attachmentPath = Tinebase_FileSystem_RecordAttachments::getInstance()->getRecordAttachmentPath($purchaseInvoice, TRUE); $handle = Tinebase_FileSystem::getInstance()->fopen($attachmentPath . '/' . $name, 'w'); if (!is_resource($handle)) { throw new Sabre\DAV\Exception\Forbidden('Permission denied to create file:' . $attachmentPath . '/' . $name); } if (is_resource($data)) { stream_copy_to_stream($data, $handle); } Tinebase_FileSystem::getInstance()->fclose($handle); return $this->get($purchaseInvoice); }
public function put($data) { if (!Tinebase_Core::getUser()->hasGrant($this->_getContainer(), Tinebase_Model_Grants::GRANT_EDIT)) { throw new Sabre\DAV\Exception\Forbidden('Forbidden to edit file: ' . $this->_path); } $handle = Tinebase_FileSystem::getInstance()->fopen($this->_path, 'w'); if (!is_resource($handle)) { throw new Sabre\DAV\Exception\Forbidden('Permission denied to create file:' . $this->_path); } if (is_resource($data)) { stream_copy_to_stream($data, $handle); } // save file object Tinebase_FileSystem::getInstance()->fclose($handle); // refetch data $this->_node = Tinebase_FileSystem::getInstance()->stat($this->_path); return $this->getETag(); }
/** * gets image info and data * * @param string $application application which manages the image * @param string $identifier identifier of image/record * @param string $location optional additional identifier * @return Tinebase_Model_Image * @throws Tinebase_Exception_NotFound * @throws Tinebase_Exception_UnexpectedValue */ public function getImage($application, $identifier, $location = '') { if ($location === 'vfs') { $node = Tinebase_FileSystem::getInstance()->get($identifier); $path = Tinebase_Model_Tree_Node_Path::STREAMWRAPPERPREFIX . Tinebase_FileSystem::getInstance()->getPathOfNode($node, true); $image = Tinebase_ImageHelper::getImageInfoFromBlob(file_get_contents($path)); } else { if ($application == 'Tinebase' && $location == 'tempFile') { $tempFile = Tinebase_TempFile::getInstance()->getTempFile($identifier); $image = Tinebase_ImageHelper::getImageInfoFromBlob(file_get_contents($tempFile->path)); } else { $appController = Tinebase_Core::getApplicationInstance($application); if (!method_exists($appController, 'getImage')) { throw new Tinebase_Exception_NotFound("{$application} has no getImage function."); } $image = $appController->getImage($identifier, $location); } } if (!$image instanceof Tinebase_Model_Image) { if (is_array($image)) { $image = new Tinebase_Model_Image($image + array('application' => $application, 'id' => $identifier, 'location' => $location)); } else { throw new Tinebase_Exception_UnexpectedValue('broken image'); } } return $image; }
public function testRename() { $testPath = $this->testMkdir(); $this->testCreateFile(); $testPath2 = $testPath . '/RENAMED'; Tinebase_FileSystem::getInstance()->mkdir($testPath2); Tinebase_FileSystem::getInstance()->rename($testPath . '/phpunit.txt', $testPath2 . '/phpunit2.txt'); $nameOfChildren = Tinebase_FileSystem::getInstance()->scandir($testPath)->name; $this->assertFalse(in_array('phpunit.txt', $nameOfChildren)); $nameOfChildren = Tinebase_FileSystem::getInstance()->scandir($testPath2)->name; $this->assertTrue(in_array('phpunit2.txt', $nameOfChildren)); }
/** * test cleanup of deleted files */ public function testDeletedFileCleanup() { // remove all files with size 0 first $size0Nodes = Tinebase_FileSystem::getInstance()->searchNodes(new Tinebase_Model_Tree_Node_Filter(array(array('field' => 'size', 'operator' => 'equals', 'value' => 0)))); foreach ($size0Nodes as $node) { Tinebase_FileSystem::getInstance()->deleteFileNode($node); } $this->testDeleteFileNodes(); $result = Tinebase_FileSystem::getInstance()->clearDeletedFiles(); $this->assertGreaterThan(0, $result, 'should cleanup one file or more'); $this->tearDown(); $this->testDeleteFileNodes(); $result = Tinebase_FileSystem::getInstance()->clearDeletedFiles(); $this->assertEquals(1, $result, 'should cleanup one file'); }
/** * the constructor */ public function __construct() { $this->_fsController = Tinebase_FileSystem::getInstance(); }
/** * download file attachment * * @param string $nodeId * @param string $recordId * @param string $modelName */ public function downloadRecordAttachment($nodeId, $recordId, $modelName) { if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Downloading attachment of ' . $modelName . ' record with id ' . $recordId); } $recordController = Tinebase_Core::getApplicationInstance($modelName); $record = $recordController->get($recordId); $node = Tinebase_FileSystem::getInstance()->get($nodeId); $path = Tinebase_Model_Tree_Node_Path::STREAMWRAPPERPREFIX . Tinebase_FileSystem_RecordAttachments::getInstance()->getRecordAttachmentPath($record) . '/' . $node->name; $this->_downloadFileNode($node, $path); exit; }
/** * test cleanup of deleted files (filesystem) */ public function testDeletedFileCleanupFromFilesystem() { // remove all files with size 0 first $size0Nodes = Tinebase_FileSystem::getInstance()->searchNodes(new Tinebase_Model_Tree_Node_Filter(array(array('field' => 'type', 'operator' => 'equals', 'value' => Tinebase_Model_Tree_FileObject::TYPE_FILE), array('field' => 'size', 'operator' => 'equals', 'value' => 0)))); foreach ($size0Nodes as $node) { Tinebase_FileSystem::getInstance()->deleteFileNode($node); } $this->testDeleteFileNodes(); $result = Tinebase_FileSystem::getInstance()->clearDeletedFilesFromFilesystem(); $this->assertGreaterThan(0, $result, 'should cleanup one file or more'); $this->tearDown(); Tinebase_TransactionManager::getInstance()->startTransaction(Tinebase_Core::getDb()); $this->testDeleteFileNodes(); $result = Tinebase_FileSystem::getInstance()->clearDeletedFilesFromFilesystem(); $this->assertEquals(1, $result, 'should cleanup one file'); }
/** * get child by name * * @param string $name * @throws Sabre\DAV\Exception\NotFound * @return Tinebase_Frontend_WebDAV_File */ public function getChild($path) { $basePath = Tinebase_FileSystem::getInstance()->getApplicationBasePath($this->_appName, Tinebase_FileSystem::FOLDER_TYPE_RECORDS); $filePath = preg_replace('@^' . $this->_appName . '/' . Tinebase_FileSystem::FOLDER_TYPE_RECORDS . '@', $basePath, $this->_path); return new Tinebase_Frontend_WebDAV_File($filePath . '/' . $path); }
/** * Deleted the current node * * @todo use filesystem controller to delete directories recursive * @throws Sabre_DAV_Exception_Forbidden * @return void */ public function delete() { if (!Tinebase_Core::getUser()->hasGrant($this->_getContainer(), Tinebase_Model_Grants::GRANT_DELETE)) { throw new Sabre_DAV_Exception_Forbidden('Forbidden to delete directory: ' . $this->_path); } if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' delete directory: ' . $this->_path); } foreach ($this->getChildren() as $child) { $child->delete(); } if (!Tinebase_FileSystem::getInstance()->rmdir($this->_path)) { throw new Sabre_DAV_Exception_Forbidden('Permission denied to delete node'); } }
/** * return etag * * @return string */ public function getETag() { return '"' . Tinebase_FileSystem::getInstance()->stat($this->_path)->hash . '"'; }
/** * validate node/container existance * * @throws Tinebase_Exception_NotFound */ public function validateExistance() { if (!$this->containerType || !$this->statpath) { $this->_parsePath(); } if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) { Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' Validate statpath: ' . $this->statpath); } $pathParts = $this->_getPathParts(); if (!$this->container) { $containerPart = $this->containerType === Tinebase_Model_Container::TYPE_PERSONAL ? 5 : 4; if (count($pathParts) >= $containerPart) { throw new Tinebase_Exception_NotFound('Container not found'); } } else { if (!Tinebase_FileSystem::getInstance()->fileExists($this->statpath)) { throw new Tinebase_Exception_NotFound('Node not found'); } } }
/** * get available vacation message templates * * @return array * * @todo perhaps we should use the node controller for the search and move it to tinebase */ public function getVacationMessageTemplates() { try { $templateContainer = Tinebase_Container::getInstance()->getContainerById(Expressomail_Config::getInstance()->{Expressomail_Config::VACATION_TEMPLATES_CONTAINER_ID}); $path = Tinebase_FileSystem::getInstance()->getContainerPath($templateContainer); $parentNode = Tinebase_FileSystem::getInstance()->stat($path); $filter = new Tinebase_Model_Tree_Node_Filter(array(array('field' => 'parent_id', 'operator' => 'equals', 'value' => $parentNode->getId()))); $templates = Tinebase_FileSystem::getInstance()->searchNodes($filter); $result = $this->_multipleRecordsToJson($templates, $filter); } catch (Exception $e) { if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) { Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' Could not get vacation template files: ' . $e); } $result = array(); } return array('totalcount' => count($result), 'results' => $result); }
/** * adds parent id filter sql * * @param Zend_Db_Select $_select * @param Tinebase_Backend_Sql_Abstract $_backend */ protected function _addParentIdFilter($_select, $_backend) { $node = Tinebase_FileSystem::getInstance()->stat($this->_path->statpath); $parentIdFilter = new Tinebase_Model_Filter_Text('parent_id', 'equals', $node->getId()); $parentIdFilter->appendFilterSql($_select, $_backend); }
/** * the constructor * * don't use the constructor. use the singleton */ private function __construct() { $this->_backend = Tinebase_FileSystem::getInstance(); }
/** * get available templates by containerId * * @param integer $containerId * @return array */ public function getTemplates($containerId = NULL) { if (!$containerId) { return array('totalcount' => 0, 'results' => array()); } try { $nodes = Tinebase_FileSystem::getInstance()->getNodesByContainer($containerId); $result = $this->_multipleRecordsToJson($nodes); } catch (Exception $e) { if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) { Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' Could not get template files: ' . $e); } $result = array(); } return array('totalcount' => count($result), 'results' => $result); }
/** * clears deleted files from filesystem + database * @return boolean */ public function clearDeletedFiles() { if (!$this->_checkAdminRight()) { return FALSE; } $this->_addOutputLogWriter(); Tinebase_FileSystem::getInstance()->clearDeletedFiles(); return 0; }
/** * the constructor * * don't use the constructor. use the singleton */ private function __construct() { $this->_currentAccount = Tinebase_Core::getUser(); $this->_backend = Tinebase_FileSystem::getInstance(); }
/** * Tears down the fixture * This method is called after a test is executed. * * @access protected */ protected function tearDown() { Tinebase_TransactionManager::getInstance()->rollBack(); Tinebase_FileSystem::getInstance()->clearStatCache(); Tinebase_FileSystem::getInstance()->clearDeletedFiles(); }
/** * url_stat * * @param string $_path * @param array $_flags * @return boolean|array */ public function url_stat($_path, $_flags) { $statLink = (bool) ($_flags & STREAM_URL_STAT_LINK); $quiet = (bool) ($_flags & STREAM_URL_STAT_QUIET); try { $node = Tinebase_FileSystem::getInstance()->stat(substr($_path, 9)); } catch (Tinebase_Exception_InvalidArgument $teia) { if (!$quiet) { trigger_error($teia->getMessage(), E_USER_WARNING); } return false; } catch (Tinebase_Exception_NotFound $tenf) { if (!$quiet) { trigger_error($tenf->getMessage(), E_USER_WARNING); } return false; } $timestamp = $node->last_modified_time instanceof Tinebase_DateTime ? $node->last_modified_time->getTimestamp() : $node->creation_time->getTimestamp(); $mode = 0; // set node type (directory, file, link) $mode = $node->type == Tinebase_Model_Tree_FileObject::TYPE_FOLDER ? $mode | 040000 : $mode | 0100000; $stat = array(0 => 0, 1 => crc32($node->object_id), 2 => $mode, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => $node->size, 8 => $timestamp, 9 => $timestamp, 10 => $node->creation_time->getTimestamp(), 11 => -1, 12 => -1, 'dev' => 0, 'ino' => crc32($node->object_id), 'mode' => $mode, 'nlink' => 0, 'uid' => 0, 'gid' => 0, 'rdev' => 0, 'size' => $node->size, 'atime' => $timestamp, 'mtime' => $timestamp, 'ctime' => $node->creation_time->getTimestamp(), 'blksize' => -1, 'blocks' => -1); return $stat; }
/** * Handles POST requests * * @param string $method * @param string $uri * @return bool */ public function httpPOSTHandler($method, $uri) { if ($method != 'POST') { return; } $getVars = array(); parse_str($this->server->httpRequest->getQueryString(), $getVars); if (!isset($getVars['action']) || !in_array($getVars['action'], array('attachment-add', 'attachment-update', 'attachment-remove'))) { return; } try { $node = $this->server->tree->getNodeForPath($uri); } catch (DAV\Exception\NotFound $e) { // We're simply stopping when the file isn't found to not interfere // with other plugins. if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->DEBUG(__METHOD__ . '::' . __LINE__ . " did not find node -> stopping"); } return; } if (!$node instanceof Calendar_Frontend_WebDAV_Event) { if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->DEBUG(__METHOD__ . '::' . __LINE__ . " node is no event -> stopping "); } return; } $name = 'NO NAME'; $disposition = $this->server->httpRequest->getHeader('Content-Disposition'); $contentType = $this->server->httpRequest->getHeader('Content-Type'); if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->DEBUG(__METHOD__ . '::' . __LINE__ . " disposition/contentType: " . $disposition . ' / ' . $contentType); } $managedId = isset($getVars['managed-id']) ? $getVars['managed-id'] : NULL; $rid = $this->getRecurranceIds($getVars); list($contentType) = explode(';', $contentType); if (preg_match("/filename\\*=utf-8''(.*)/", $disposition, $matches)) { // handle utf-8 dispositions (like this: filename=\"Reservierungsbesta?tigung _ OTTER.txt\";filename*=utf-8''Reservierungsbesta%CC%88tigung%20_%20OTTER.txt) $name = $matches[1]; } else { if (preg_match('/filename=(.*)[ ;]{0,1}/', $disposition, $matches)) { $name = $matches[1]; } } $name = trim($name, " \t\n\r\v\"'"); // NOTE inputstream can not be rewinded $inputStream = fopen('php://temp', 'r+'); stream_copy_to_stream($this->server->httpRequest->getBody(), $inputStream); rewind($inputStream); list($attachmentId) = Tinebase_FileSystem::getInstance()->createFileBlob($inputStream); switch ($getVars['action']) { case 'attachment-add': $attachment = new Tinebase_Model_Tree_Node(array('name' => rawurldecode($name), 'type' => Tinebase_Model_Tree_Node::TYPE_FILE, 'contenttype' => $contentType, 'hash' => $attachmentId), true); $this->_iterateByRid($node->getRecord(), $rid, function ($event) use($name, $attachment) { $existingAttachment = $event->attachments->filter('name', $name)->getFirstRecord(); if ($existingAttachment) { // yes, ... iCal does this :-( $existingAttachment->hash = $attachment->hash; } else { $event->attachments->addRecord(clone $attachment); } }); $node->update($node->getRecord()); break; case 'attachment-update': $eventsToUpdate = array(); // NOTE: iterate base & all exceptions @see 3.5.2c of spec $this->_iterateByRid($node->getRecord(), NULL, function ($event) use($managedId, $attachmentId, &$eventsToUpdate) { $attachmentToUpdate = $event->attachments->filter('hash', $managedId)->getFirstRecord(); if ($attachmentToUpdate) { $eventsToUpdate[] = $event; $attachmentToUpdate->hash = $attachmentId; } }); if (!$eventsToUpdate) { throw new Sabre\DAV\Exception\PreconditionFailed("no attachment with id {$managedId} found"); } $node->update($node->getRecord()); break; case 'attachment-remove': $eventsToUpdate = array(); $this->_iterateByRid($node->getRecord(), $rid, function ($event) use($managedId, &$eventsToUpdate) { $attachmentToDelete = $event->attachments->filter('hash', $managedId)->getFirstRecord(); if ($attachmentToDelete) { $eventsToUpdate[] = $event; $event->attachments->removeRecord($attachmentToDelete); } }); if (!$eventsToUpdate) { throw new Sabre\DAV\Exception\PreconditionFailed("no attachment with id {$managedId} found"); } $node->update($node->getRecord()); break; } // @TODO respect Prefer header $this->server->httpResponse->setHeader('Content-Type', 'text/calendar; charset="utf-8"'); $this->server->httpResponse->setHeader('Content-Length', $node->getSize()); $this->server->httpResponse->setHeader('ETag', $node->getETag()); if ($getVars['action'] != 'attachment-remove') { $this->server->httpResponse->setHeader('Cal-Managed-ID', $attachmentId); } // only at create! $this->server->httpResponse->sendStatus(201); $this->server->httpResponse->sendBody($node->get()); return false; }
/** * get vacation message from template file * * @param string $templateId * @return string * * @todo generalize and move to Tinebase_FileSystem / Node controller */ protected function _getMessageFromTemplateFile($templateId) { $template = Tinebase_FileSystem::getInstance()->searchNodes(new Tinebase_Model_Tree_Node_Filter(array(array('field' => 'id', 'operator' => 'equals', 'value' => $templateId))))->getFirstRecord(); if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) { Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' ' . print_r($template->toArray(), TRUE)); } $templateContainer = Tinebase_Container::getInstance()->getContainerById(Expressomail_Config::getInstance()->{Expressomail_Config::VACATION_TEMPLATES_CONTAINER_ID}); $path = Tinebase_FileSystem::getInstance()->getContainerPath($templateContainer) . '/' . $template->name; $templateHandle = Tinebase_FileSystem::getInstance()->fopen($path, 'r'); $message = stream_get_contents($templateHandle); Tinebase_FileSystem::getInstance()->fclose($templateHandle); if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) { Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' ' . $message); } return $message; }