title: How do I structure my PHP project?
body: <p>I am about to embark upon yet another large PHP project. This time, I intend to have the project folder be tidy! So I have a few questions concerning keeping my project clean and DRY:</p>
  
  <ul>
  <li><p>How do I differentiate between PHP source files and PHP files that should be accessed by the browser? In other words, how do I make it clear which PHP files gives output and which gives function or class definitions?</p></li>
  <li><p>I am planning on separating my PHP functions into static classes, separated by subject, for instance database::create() or editor::write(). What are your thoughts on this?</p></li>
  <li><p>I am planning on creating a PHP file "core.php" that will be included at the top of EVERY SINGLE PHP file in the project. This file will handle authentication and include base functions. Thoughts?</p></li>
  <li><p>The project will be heavily Ajax based. This begs the question: Should my PHP functions be actual PHP functions, or should they be individual PHP files that takes GET or POST input? My plan is doing <strong>both</strong>. I create a folder for PHP source files and one for PHP "ajax" files (or something), and have the latter folder populated with files names by the functions they will perform. The PHP file will then simply contain a call to a function and write output for Ajax. Thoughts?</p></li>
  </ul>
  
  <p>Any other comments or tips before I start this project would be great!</p>
  
  <hr>
  
  <h2>Edit</h2>
  
  <p>I may have failed to emphasize just how heavily Ajax based this web application will be. Codeigniter seems like a great tool for creating web pages or simple web applications such as a blog. My application will be a little different. Much like the uTorrent WebUI, my web application will be static on one page, having Ajax performing all the under-the-cover actions. It seems a little awkward to use Codeigniter for such a project.</p>
  
  <p>Is there a different architecture out there created with this kind of application in mind?</p>