Bug #29694

\TYPO3\FLOW3\Resource\Resource is missing the __toString Method

Added by Torsten no-lastname-given almost 4 years ago. Updated about 3 years ago.

Status:Resolved Start date:2011-09-12
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Resource
Target version:TYPO3 Flow Base Distribution - 1.0.5
PHP Version: Complexity:
Has patch:No Affected Flow version:FLOW3 1.0.0

Description

Hi,
the __toString method mentioned here:

http://flow3.typo3.org/fileadmin/manual/nightly/TheDefinitiveGuide/PartIII/ResourceManagement.html

is currently not present.

Would be great if someone could add this:

public function __toString() {
  return (string)$this->getResourcePointer();
}

So the described functionality

file_get_contents('resource://' . $resource); 

will work.

Associated revisions

Revision 8cdaae41
Added by Karsten Dambekalns about 3 years ago

[FEATURE] Add __toString() and make Resource use more convenient

To use a Resource with file operations, one can use the
resource:// scheme and the __toString() method of any
ResourcePointer.

To make this a little easier, this change adds two new
methods to the Resource class:

__toString() returns the SHA1 of the ResourcePointer the
Resource is holding (as is documented for ages).

getUri() returns a ready-to-use resource://<sha1> URI of
the ResourcePointer the Resource is holding.

Change-Id: Ie3cb01214c924c8e79ae5a997dc15e3679940e86
Fixes: #29694
Resolves: #34177
Releases: 1.0, 1.1

Revision 8c7ec51b
Added by Karsten Dambekalns about 3 years ago

[FEATURE] Add __toString() and make Resource use more convenient

To use a Resource with file operations, one can use the
resource:// scheme and the __toString() method of any
ResourcePointer.

To make this a little easier, this change adds two new
methods to the Resource class:

__toString() returns the SHA1 of the ResourcePointer the
Resource is holding (as is documented for ages).

getUri() returns a ready-to-use resource://<sha1> URI of
the ResourcePointer the Resource is holding.

Change-Id: Iec342eae0662b89eaf1d281fcab26ebb94ef7c61
Fixes: #29694
Resolves: #34177
Releases: 1.0, 1.1

History

#1 Updated by Karsten Dambekalns almost 4 years ago

  • Affected Flow version set to FLOW3 1.0.0

#2 Updated by Karsten Dambekalns over 3 years ago

  • Status changed from New to Accepted
  • Assigned To set to Karsten Dambekalns
  • Target version set to 1.0.3
  • Has patch set to No

#3 Updated by Gerrit Code Review over 3 years ago

  • Status changed from Accepted to Under Review

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9145

#4 Updated by Karsten Dambekalns over 3 years ago

  • Target version changed from 1.0.3 to 1.0.4

#5 Updated by Karsten Dambekalns over 3 years ago

  • Target version changed from 1.0.4 to 1.0.5

#6 Updated by Gerrit Code Review about 3 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9145

#7 Updated by Gerrit Code Review about 3 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9145

#8 Updated by Karsten Dambekalns about 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#9 Updated by Gerrit Code Review about 3 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch FLOW3-1.0 has been pushed to the review server.
It is available at http://review.typo3.org/11106

#10 Updated by Karsten Dambekalns about 3 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF