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)
- 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
- Correct timezone on Created_At field HOT 1
- You have requested a non-existent parameter "dh_auditor.provider.doctrine.configuration". HOT 4
- Invalid audit table name with schema
- Inject the entity in the UserProvider HOT 1
- `ignored_columns` as a callback or as a service
- Route name on transaction
- Wrong migration when using Postgres HOT 4
- DoctrineSubscriber throw deprecation when Driver is wrapped with another class HOT 11
- Nested LoggerChain DoctrineSubscriber HOT 3
- Multiple Logs Updates with Decimal values HOT 1
- Mass import generate same hash for all operations
- ORM 3 HOT 1
- Invalid table name on Postgresql
- Update SimpleFilter value type to accept int
- Importing Audit data from another system
- Remove the final keyword for some classes?
- No routes after updating to Symfony 6.4
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.