PHP Defines in ProdigyView


Published on

Learn how to use defines to manipulate the file structure in ProdigyView.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

PHP Defines in ProdigyView

  1. 1. DEFINESObjectiveLearn how the defines are used to manipulate the system.Requirements Understanding of define() function.Estimated Time5 minutes
  2. 2. Follow Along With A Code Example1. Download a copy of the example code at Install the system in an environment you feel comfortable testing in.3. Proceed to DEFINES.php
  3. 3. What are DEFINESIn PHP defines are named constants that are global amongthe code being executed.In ProdigyView the DEFINES have two functions.1. Specify the location of the xml configuration file and the database configuration file2. Structure the file system for applications, libraries and other featuresOn our next slide, we will view an example of the defines file.
  4. 4. Example Of Defines File
  5. 5. File StructureIn the previous slide when it was stated that Defines can“structure the file system”, what was being referenced wasProdigyView gives components of the system places wherethey belong.IE: All images go in the image folderIE: All videos go in the videos folderChanging the defines allows you to change where you wantthese resources to exist. Libraries do not have to be in/resources/libraries/, they can be in another folder such as/system/libs/ if you change it in the defines.So lets run through the defines if you are looking forclarification on any.
  6. 6. PV_ROOTThe PV_ROOT is the root directory of the site. All filesshould in a location that can be referenced by thePV_ROOT.The root location can be set multiple ways such as: $_SERVER[„DOCUMENT_ROOT‟ dir(__FILE__) „/var/www/mysite/‟.
  7. 7. PV_COREPV_CORE is the core location of the classes that makeup ProdigyView‟s root system. All the folders and classesthat begin with PV should be in this folder.
  8. 8. PV_APPLICATIONS / PV_ADMIN_APPLICATIONSPV_APPLICATIONS is the directory that all applicationsshould exist that are called with PVApplications::executefunction.In an attempt to separate front-end from backend, theapplications administrative section can be placed in aseparate locations.
  9. 9. PV_MODULESModules are components that interact with applications.Files that contain the modules have a folder they areassigned.
  10. 10. PV_LIBRARIESPV_LIBRARIES is the location of the libraries that workwith ProdigyView. Libraries are handled through thePVLibraries class.
  11. 11. PV_PLUGINSPlugins are extensions in ProdigyView whose addition iscontrolled by the database. Plugins can be object orientedor procedural additions and are persistent once loaded.
  12. 12. PV_MVCProdigyView is a framework that allows multiple MVCs.MVCs are defined by the developer. An example MVCthat comes with ProdigyView is Helium.
  13. 13. Configuration FilesThe configuration files are divided into two files. The phpfile contains the database connections. The xml filecontains system configurations.
  14. 14. PV_TEMPLATESIf the system being created allows templates, the templatedirectory can set.
  15. 15. Javascript LibrariesProdigyView distinguishes the JavaScript files from normalJavaScript, JQuery, Prototype and Mootools. Also it recognizesa difference between front-end js files vs admin files. The filesdo not contain the PV_ROOT because they are accessed in thebrowser and having PV_ROOT might make them inaccessiblefrom the browser.
  16. 16. Media FilesMedia files consist of images, video, audio and files.ProdigyView allows separation of each file type. Parts ofthe framework such as the CMS make use of thesedefines for placing the files. These files also do notcontain PV_ROOT.
  17. 17. AdminThe last define is the administrative define. If this define isset to true, applications will be allowed to access theiradministrative section. If set to false, the functionPVApplication::pv_exec_admin() will not be accessible.This is done to separate the front end from backend.
  18. 18. ReviewAs seen, there are numerous defines that can set. Thosedefines are changeable to change how your system is setup.When you are comfortable with various aspects of theProdigyView, take the time to change the defines tocustomize the system you build.