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

  • SEARCH
  • Home
  • 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 8979645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:53:41+00:00 2026-06-15T19:53:41+00:00

I am writing a script that talks to a database, and transforms the content

  • 0

I am writing a script that talks to a database, and transforms the content and puts it into an XML file.

I am trying to utilize best practices, and as part of library re-use, I have found the following classes to be beneficial:

Symfony components:

  • Yaml : for parsing and loading database info.,
  • DI Container : for injecting dependencies

Others:

  • PHPExcel, the amazing excel library
  • Doctrine DBAL to get an easy PDO wrapper
  • Mockery for obtaining easy mocks during testing

My core business class, ExcelExporter, will need all these files functioning harmoniously with each other. I also need a place where I can initialize by own class, and inject these dependencies in.

I am confused as to where to do this. If I were building a web page, I’d say I’d put the initialization & configuration process inside index.php and finally call ExcelExporter to do its thing when a user loads index.php in the browser. Is there a better way for this bootstrapping process? What’s the most common approach?

  • 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-15T19:53:43+00:00Added an answer on June 15, 2026 at 7:53 pm

    I assume you are not using any framework. Only using symphony components. If you were using a framework it would have been done by the framework. But for vanila framework you need

    1. A single entry point for the application (say index.php)
    2. A bootstrap.php file that loads initial classes and external resources. Many framework uses this bootstrap files. Just look at the file structure you’ll find them. The name might not be bootstrap.php.
    3. Once your application is loaded use a autoloader to load on-demand classes. This autoloader should be initialized on bootstrap.

      function my_autoloader($class) {
          include 'classes/' . $class . '.class.php';
      }
      spl_autoload_register('my_autoloader');
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a script that is retrieving information from file places.sqlite (history) and
I am writing a python script that parses a 3D model file from one
I'll be writing a script to parse text documents into a MySQL database. I'll
I'm writing a script that uploads a file to a cgi script that expects
I'm writing a script that is supposed to look at the content of a
i'm writing a script that reads two .txt file in two vectors. After that
I'm writing a script that has two inputs: a file containing a list of
I am writing a shell script that will perform 2 tasks. One task will
I'm writing a script that will constantly scan iTunes for new dialog boxes and
I'm writing a script that asks the user for several options and then, via

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.