title: MVC, how do I write my config file?
body: <p>I've decided to rewrite my uploader using the MVC design pattern because my code was messy. The files are organized that way:</p>
  
  <p>-model.php:
  Basically, it's a class that has all the functions needed to retrieve data from my database, such as the last uploaded files, the number of files the current user has uploaded, etc. There's a private variable called db_link that keeps the resource created by PDO (the PDO object).</p>
  
  <p>-index.php:
  It's the controller. It checks if there's a file being uploaded, checks if it has a valid extension, etc. It calls functions from the class contained in model.php (I create an object of this class first).</p>
  
  <p>-settings.php:
  My config file. This is where I determine my database username, password, also the max file size, the allowed extensions, etc.
  I simply do the following:
  $allowed_extension = array('swf', 'txt', 'jpg', 'gif', 'png');</p>
  
  <p>But, if I include it in index.php and try to use this variable in a function, it doesn't work, because it isn't in the same scope (unless I include it inside the function itself, but I don't want to do that). I just need a better way to organize my settings.</p>
  
  <p>Also, I create a db object with the class I talked about earlier. I need to pass the object to the function I want to call, which is a pain in the neck too. Is there another way I could do that?</p>