Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8067613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:22:40+00:00 2026-06-05T12:22:40+00:00

Maybe dumb question, I’m new to Symfony2 and I’m using it for one of

  • 0

Maybe dumb question, I’m new to Symfony2 and I’m using it for one of my projects.
I’d like to be able to use a third party library, namely SSRSReport (an API for SSRS Reports).

I have put the library into Symfony/vendor/ssrs/lib/Ssrs/src.
There are many classes defined here, I don’t need them to be autoloaded.

I simply don’t know how to require and call them from a controller.

For sure this doesn’t work

require_once '/vendor/ssrs/lib/Ssrs/src/SSRSReport.php';
class DefaultController extends Controller
{
    public function viewAction()
    {
        define("UID", "xxxxxxxx");
        define("PASWD", "xxxxxxxx");
        define("SERVICE_URL", "http://xxx.xxx.xxx.xxx/ReportServer/");
        $report = new SSRSReport(new Credentials(UID, PASWD), SERVICE_URL);
        return $this->render('myBundle:Default:view.html.twig'
            , array('report' => $report)
        );
    }
}

SSRSReport() and Credentials() used here, are 2 of many classes contained into the API.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:22:44+00:00Added an answer on June 5, 2026 at 12:22 pm

    First of all, I don’t recommend putting non-symfony-managed libraries into /vendors. Since you’re managing this library, put it into /src.

    Secondly, when using classes that aren’t namespace (i.e., are in the root namespace), make sure you reference them properly or else PHP will look in the current namespace (which, in this case, is your controller namespace)

    Thirdly, the quick-and-dirty solution is to just properly include the files from the controller:

    class DefaultController extends Controller
    {
        protected function includeSsrsSdk()
        {
          require_once(
              $this->container->getParameter( 'kernel.root_dir' )
            . '/../src/ssrs/lib/Ssrs/src/SSRSReport.php'
          );
        }
    
        public function viewAction()
        {
            $this->includeSsrsSdk();
            define("UID", "xxxxxxxx");
            define("PASWD", "xxxxxxxx");
            define("SERVICE_URL", "http://xxx.xxx.xxx.xxx/ReportServer/");
            $report = new \SSRSReport(new \Credentials(UID, PASWD), SERVICE_URL);
            return $this->render('myBundle:Default:view.html.twig'
                , array('report' => $report)
            );
        }
    }
    

    But that locks your logic for including the library into this one controller. You could make a separate wrapper for the SDK that does this, or even register it as a service.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe this is a dumb question, but do event listeners use CPU cycles like
my question is maybe a dumb one, but i cant help myself - i
maybe this is a dumb question. How do I achieve in sql like '%test%'
Maybe it is a dumb question but I would like to know when we
Maybe this is a dumb question, but I use cc to refer to the
Sorry for maybe dumb question, but i have HUGE problem with one case when
Yeah, I know this seems like a dumb question, its just a one-off hack
Beginner in Symfony2, so maybe it's a dumb question. I would need to get
Maybe dumb question: I'm trying to realize a little server in Java with com.sun.net.httpserver
Maybe is a dumb question, but I can't find the proper function: I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.