php - symfony2 serialized data replace error -
so trying move live installation onto localhost. have great deal of images in user data, images have been uploaded , inserted posts.
the problem on live server image routes are
/uploads/images/...
while on localhost environment be
/mysite/web/uploads/images/...
so gave shot using searchreplacedb2.php script found here (https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ used v2.1.0 stable) 1 recommended moving wordpress installation, , thought serialization of info in mysql should work same way on wp in sym2 app.
but perhaps not, since next error sym2 when attempts read form table did search/replace on:
contexterrorexception: notice: unserialize(): error @ offset 1672 of 1953 bytes in /users/acr/documents/www/cloudsign/vendor/doctrine/dbal/lib/doctrine/dbal/types/arraytype.php line 48
here sample of serialized info have performed replace on:
a:6:{i:0;s:11:"transparent";i:3;s:6:"repeat";i:4;s:4:"left";i:5;s:3:"top";i:6;s:1707:"<div id="object_01" class="object_image lockedaspectratio ui-draggable ui-resizable" namn="object_01" style="height:1036.5599999427795px;width:1635.5599999427795px;left:-1.994384765625px;top:-15px;position:absolute;"><img class="object_inner" src="/cloudsign/web/uploads/images/20/c274edd7f10f5d34157108658d9e7e6eebf16bb4.jpeg" alt="c274edd7f10f5d34157108658d9e7e6eebf16bb4" /><div class="ui-resizable-handle ui-resizable-e" style="z-index:1000;"></div><div class="ui-resizable-handle ui-resizable-s" style="z-index:1000;"></div><div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se" style="z-index:1000;"></div></div><div id="object_02" class="object_textbox" namn="object_02" style="z-index:2;font-family:arial;left:940.9950561523438px;top:84.98873901367188px;position:absolute;width:493.55999994277954px;height:77.55999994277954px;"><div class="object_inner" style="border:0px solid rgb(0,0,0);background-color:rgb(163,178,240);color:rgb(255,255,255);font-weight:bold;font-family:arial;font-size:44px;line-height:66px;text-align:center;">vinter kampanj!</div></div><div id="object_03" class="object_textbox" namn="object_03" style="z-index:3;font-family:arial;left:917px;top:215px;position:absolute;width:549.5599999427795px;height:625.5599999427795px;"><div class="object_inner" style="border:0px solid rgb(0,0,0);color:rgb(0,0,0);text-align:center;font-weight:bold;font-size:44px;line-height:66px;border-top-left-radius:15px;border-top-right-radius:15px;border-bottom-right-radius:15px;border-bottom-left-radius:15px;">missa inte vår stora vinter rea med upp till 70% rabatt! <br /><br /><br />många stora märken som north face, peak<br />adidas, columbia, burton m.m.</div></div>";i:7;s:8:"original";}
you utilize doctrine lifecycle callbacks alter path while in development, instead of changing database content. sentiment utilize @postload
accomplish want in more elegant way.
reference: doctrine lifecycle callbacks
php mysql symfony2 serialization replace
No comments:
Post a Comment