PHP?

Permalink
Hello all,

I have a site with a searchable database (of bibliographic citations) designed by someone else, and I'm interested in seeing the PHP code for my edification. I've searched through the database, but I can't find it. Any help is greatly appreciated.

Steve

 
mlocati replied on at Permalink Reply
mlocati
Your question is quite unclear to me...
Are you looking for php code inside the database?

Usually the php code is written in files. These php files then connects to the database and work on the data contained in it...
stevemacguy replied on at Permalink Reply
Yes, I am looking for the page. When I say database, I mean the cms database that contains all the Concrete5 files. In what directory can I find the pages? For a regular HTML site, I would just look in the directory under, for example, database.html. I am having trouble finding something similar in this situation.

Thank for your reply,
Steve
mesuva replied on at Permalink Best Answer Reply
mesuva
I think you might be mixing up your terminology, or misunderstanding how a system like concrete5 works.

With concrete5:

- There is a MySQL database. The database is actually where all the data for a site is contained, so it has little pieces of data for things like the individual blocks, as well data entries for the actual pages in the site map. When you edit a concrete5 site you are effectively editing this database to make changes to a site.

- There are the PHP scripts/files that drive the actual site. These do the work of connecting to the database, building the pages on the fly and outputting them. These files don't really change or get written to.

So you won't really find files in a concrete5 install that matches page on the actual site - the pages are actually represented via data in the database. The exception to this though is that it's possible to run custom written PHP scripts in the form of concrete5's 'single pages', where a page in a site effectively maps to some specific PHP scripts. Even in these cases you'd not find an individual file, you'd find a 'controller' file to handle the logic of the page (i.e. going and fetching some info, doing calculations, etc), and a 'view' file, that is passed information from the controller to handle the actual output.

So with what you've described, a searchable database, there are two main ways I can think of this would be built with concrete5:

- The original developer simply used concrete5's built in search block on a page, putting the citations into the site as actual pages. In this case, you're not going to really find files that control this, it's more about exploring how the site has been configured.

- If the citations are in a separate database, they may have written a 'single page' to do the searching and display of search results. In this case, you'd look at the top level folders for the site, looking in both the /controllers and /single_pages directories for any files that perhaps match the name of a search page. If the developer built something more sophisticated, they may have built a concrete5 'package', which is really like a plug-in for concrete5. You can look in you top level /packages folder to see if anything looks relevant.

Where you DONT need to look is the top level /concrete folder - that's where all of the default concrete5 php files are and are custom to a project. Everywhere else is either going to be empty folders (leave them in place though), or have customisations/overrides specific to the website.