{"id":6462,"date":"2014-04-18T05:39:39","date_gmt":"2014-04-18T05:39:39","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/symfony2related-issues-collection-of-common-programming-errors\/"},"modified":"2014-04-18T05:39:39","modified_gmt":"2014-04-18T05:39:39","slug":"symfony2related-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/symfony2related-issues-collection-of-common-programming-errors\/","title":{"rendered":"symfony2Related issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/333e1db8f46b789bebf0bc8cad1aee28?s=128&amp;d=identicon&amp;r=PG\" \/><br \/>\nTouki<br \/>\nsymfony2 bundle snappy<br \/>\nI have a fatal error when I try to install Knp Snappy BundleFatal error: Interface &#8216;Knp\\Bundle\\SnappyBundle\\Snappy\\GeneratorInterface&#8217; not found in \/&#8230;\/vendor\/bundles\/Knp\/Bundle\/SnappyBundle\/Snappy\/LoggableGenerator.php on line 13 Any idea?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/WxGsO.jpg?s=32&amp;g=1\" \/><br \/>\ncampagnolo_1<br \/>\nclass symfony2<br \/>\nThe project works in my local environment but when I deploy it on shared web server it doesn&#8217;t work.Server\/home\/app\/src\/gestor\/UsuarioBundle&#8230; \/vendors&#8230;.\/public_html\/webapp.php&#8230;If I go to host\/app.php -&gt;Fatal error:Class &#8216;Gestor\\UsuarioBundle\\UsuarioBundle&#8217; not found in \/home\/esdrhazc\/app\/AppKernel.php on line 19AppKernel.phpuse Symfony\\Component\\HttpKernel\\Kernel; use Symfony\\Component\\Config\\Loader\\LoaderInterface;class AppKernel extends Kernel {public function registerBundles(){$bundle<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f0def25f69a114e8f9b7e79eca23005a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrichsage<br \/>\nsymfony2<br \/>\nI&#8217;m trying to install symfony for a week now and i have plenty of errors everytime !!! i couldn&#8217;t find a solution to this specific error :Fatal error: Class &#8216;Doctrine\\Common\\Annotations\\AnnotationRegistry&#8217; not found in C:\\wamp\\www\\Symfony\\app\\autoload.php on line 35here&#8217;s what i have in the autoload.php file :$loader-&gt;register();AnnotationRegistry::registerLoader(function($class) use ($loader) { $loader-&gt;loadClass($class);return class_exists($class, false);});Any ideas please?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2dbd93a1c63c93bf5ff77c47387b3acc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKevinM1<br \/>\nsymfony2 doctrine2<br \/>\nNames changed due to NDA.I&#8217;m trying to come up with a survey form. Each survey question can have multiple answers\/scores, so there&#8217;s a natural 1:* relationship to them. That said, for the public-facing form, I need to have a 1:1 relationship between the score and the question it relates to, which is what I&#8217;m working on now. Right now, the survey is open to the public, so each completed survey is not related to a user.The interesting parts of my current setup are as follows&#8230;Question:namespac<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/MGhY2.png?s=32&amp;g=1\" \/><br \/>\nhakre<br \/>\nphp symfony2 assetic<br \/>\nwhen I dump my assets using the following commandapp\/console assetic:dump &#8211;env=dev &#8211;watchI receive this errorFatal error: Method Symfony\\Bundle\\AsseticBundle\\Factory\\Resource\\FileResource::__toString() must not throw an exception in vendor\/assetic\/src\/Assetic\/Factory\/Loader\/CachedFormulaLoader.php on line 0It doesn&#8217;t happen when dumping using app\/console assetic:dump &#8211;env=prod &#8211;no-debug<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/50e808be74d583c9e58b67586e100c40?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\navowkind<br \/>\nsymfony2 phpunit<br \/>\nusing the classical phpunit style I generate:test with the symfony2 helper. I can get the service and I can assert it ok. \/\/ testspublic function testGetServiceUrl() {$ecservice = $this-&gt;getModule(&#8216;Symfony2&#8217;)-&gt;grabServiceFromContainer(&#8220;ecservice&#8221;);$this-&gt;assertEquals(&#8220;https:\/\/ecoconnect2.niwa.co.nz\/services&#8221;, $ecservice-&gt;getServiceUrl());$this-&gt;assertEquals(&#8220;xxx&#8221;, $ecservice-&gt;getServiceUrl());}However in the second case where the assertion fails I get an exception:Trying to test get<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/8d77fe1e52b32256e3c5f57e6db0c7c6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMattia Premoli<br \/>\nsymfony2 doctrine2 entity classnotfound<br \/>\nThis is NewEventController.php:namespace Passtuff\\RestBundle\\Controller;use Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller; use Symfony\\Component\\HttpFoundation\\Response; use Passtuff\\RestBundle\\Entity\\Event;class NewEventController extends Controller { public function createAction(){$event = new Event(); \/\/line 14\/\/&#8230;}}and this is Event.phpnamespace Passtuff\\RestBundle\\Entity;use Doctrine\\ORM\\Mapping as ORM;\/*** @ORM\\Entity* @ORM\\Table(name=&#8221;event&#8221;)*\/ class Event {\/\/&#8230; }I get this<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/331582449435f5efa35be870ab76f1a9?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nWouter J<br \/>\nphp symfony2 symfony-cmf<br \/>\nI&#8217;m trying to install Symfony CMF but I&#8217;m getting the following error while creating the database:Fatal error: Class &#8216;PHPCR\\Util\\Console\\Command\\MoveCommand&#8217; not foundin\/vendor\/doctrine\/phpcr-bundle\/Doctrine\/Bundle\/PHPCRBundle\/Command\/NodeMoveCommand.phpon line 34My composer.json is as follows:&#8221;require&#8221;: {&#8220;php&#8221;: &#8220;&gt;=5.3.3&#8243;,&#8221;symfony\/symfony&#8221;: &#8220;2.2.*&#8221;,&#8221;doctrine\/orm&#8221;: &#8220;2.3.*&#8221;,&#8221;doctrine\/doctrine-bundle&#8221;: &#8220;1.2.*&#8221;,&#8221;twig\/extensions&#8221;: &#8220;1.0.*&#8221;,&#8221;symfony\/assetic-bundle&#8221;: &#8220;2.1.*&#8221;,&#8221;symfony\/swiftmailer-bund<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bad8fc8c24f4fa4c84ad436f2bdf4270?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nLion<br \/>\nphp symfony2<br \/>\nI am getting Class &#8216;Splash\\\\SiteBundle\\\\Util\\\\Resize&#8217; not found when running my app on prod. This does not happen on dev.Here is the code from the error:$resize = new \\Splash\\SiteBundle\\Util\\Resize($this-&gt;getAbsolutePath());I have a file called Splash\\SiteBundle\\Util\\Resize.php with this namespacenamespace Splash\\SiteBundle\\Util;Class Resize{ &#8230; }Any thoughts?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7075d8cc2c371c1eb4eb22b15d8abae0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nlinuxatico<br \/>\nsymfony2 doctrine2<br \/>\nI can&#8217;t launch my simple Fixture, I installed the bundle in the right way and put the 2 lines in autoload.php and Appkernel.php like stated at here, and then I created my fixture class as it follows:&lt;?phpnamespace ABCBundle\\DataFixtures\\ORM;use Doctrine\\Common\\DataFixtures\\FixtureInterface; use ABCBundle\\Entity\\Rubrica;class LoadRubricaData implements FixtureInterface {public function load(ObjectManager $manager){$rubrica = new Rubrica();$rubrica-&gt;setX(&#8220;XXX&#8221;);$manager-&gt;persist($rubrica)<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Touki symfony2 bundle snappy I have a fatal error when I try to install Knp Snappy BundleFatal error: Interface &#8216;Knp\\Bundle\\SnappyBundle\\Snappy\\GeneratorInterface&#8217; not found in \/&#8230;\/vendor\/bundles\/Knp\/Bundle\/SnappyBundle\/Snappy\/LoggableGenerator.php on line 13 Any idea? campagnolo_1 class symfony2 The project works in my local environment but when I deploy it on shared web server it doesn&#8217;t work.Server\/home\/app\/src\/gestor\/UsuarioBundle&#8230; \/vendors&#8230;.\/public_html\/webapp.php&#8230;If I go to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6462","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6462"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6462\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}