Comments (4)
Thanks @SanderVerkuil for the report and the test. I'll try to make fix shortly.
from auditor.
Well your PR already fixes the issue, thanks ππ½
When reading this issue I thought it only contains a failing test
Anyway, it's merged now.
from auditor.
I also replied to your question about blob field handling in the PR conversation
from auditor.
I thought fixing it would be a bit more difficult, but the fix was quite simple as it was the same as the binary
column type.
The question is more generic though, like, currently when the value is a resource
, the diff
will show resource#<resource-id>
, which is fine if the data is indeed a binary file (or a blob) containing multiple megabytes of data. However, in some cases, the actual value is a couple of bytes, for instance when the blob
type is used because the column contains unstructured data, like only 1 or 0, or a float/numeric value.
A possibility for this would be to do something like:
$stream = $value;
stream_rewind($stream);
$possibleValue= stream_get_contents($stream);
if (strlen($possibleValue) > (32 * 1024)) {
$convertedValue = get_resource_type($value).'#'.get_resource_id($value);
} else {
$convertedValue = $possibleValue;
}
though this is very inefficiΓ«nt because if the binary or blob data was in fact 2GiB of data, the whole file would be read into memory.
So, due to how Doctrine works, and how I mostly use these values, when I call setData('test data')
, the new
field will be 'test data'
, because it is not a string. So in that case the auditor will specify that the new data will be 'test data'
, and the old
field will be <resource_type>#<resource_id>
. Or am I seeing this differently?
from auditor.
Related Issues (20)
- Add whitelist option to audit columns HOT 2
- Incorrect primary key name on render HOT 2
- Deprecation of Doctrine\DBAL\Logging\SQLLogger Interface HOT 3
- Linking changes in child entities to their parent entity HOT 1
- BackedEnum could not be converted to int HOT 1
- Json column is double encoded HOT 3
- exception while creating audit table schema when using single table inheritance HOT 8
- Laravel support HOT 1
- Error on upgrading symfony 6.2 HOT 20
- Breaking Change in PR#137 HOT 1
- Attempted to call an undefined method named "introspectSchema" of class "Doctrine\DBAL\Schema\PostgreSQLSchemaManager" HOT 1
- How to define a storage mapper? HOT 4
- Deprecation spam HOT 11
- UTF-8 Character Encoding fails in TransactionProcessor HOT 1
- 2.4.4 broke enum compatibility HOT 2
- Laminas Framework HOT 1
- Warning: mb_convert_encoding(): Object is not supported HOT 2
- Make DoctrineODM / MongoDB compatible?
- Custom columns and custom data in the audit tables
- Example use statement shown for Auditing Configuration in Docs Undefined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auditor.