AWS Community Day CPH - Three problems of Terraform
PHP Defines in ProdigyView
1. DEFINES
Objective
Learn how the defines are used to manipulate the system.
Requirements
Understanding of define() function.
Estimated Time
5 minutes
www.prodigyview.com
2. Follow Along With A Code
Example
1. Download a copy of the example code at
www.prodigyview.com/source.
2. Install the system in an environment you feel
comfortable testing in.
3. Proceed to DEFINES.php
www.prodigyview.com
3. What are DEFINES
In PHP defines are named constants that are global among
the code being executed.
In ProdigyView the DEFINES have two functions.
1. Specify the location of the xml configuration file and the
database configuration file
2. Structure the file system for applications, libraries and other
features
On our next slide, we will view an example of the defines file.
www.prodigyview.com
5. File Structure
In the previous slide when it was stated that Defines can
“structure the file system”, what was being referenced was
ProdigyView gives components of the system places where
they belong.
IE: All images go in the image folder
IE: All videos go in the videos folder
Changing the defines allows you to change where you want
these 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 for
clarification on any.
www.prodigyview.com
6. PV_ROOT
The PV_ROOT is the root directory of the site. All files
should in a location that can be referenced by the
PV_ROOT.
The root location can be set multiple ways such as:
$_SERVER[„DOCUMENT_ROOT‟
dir(__FILE__)
„/var/www/mysite/‟.
www.prodigyview.com
7. PV_CORE
PV_CORE is the core location of the classes that make
up ProdigyView‟s root system. All the folders and classes
that begin with PV should be in this folder.
www.prodigyview.com
8. PV_APPLICATIONS /
PV_ADMIN_APPLICATIONS
PV_APPLICATIONS is the directory that all applications
should exist that are called with PVApplications::execute
function.
In an attempt to separate front-end from backend, the
applications administrative section can be placed in a
separate locations.
www.prodigyview.com
9. PV_MODULES
Modules are components that interact with applications.
Files that contain the modules have a folder they are
assigned.
www.prodigyview.com
10. PV_LIBRARIES
PV_LIBRARIES is the location of the libraries that work
with ProdigyView. Libraries are handled through the
PVLibraries class.
www.prodigyview.com
11. PV_PLUGINS
Plugins are extensions in ProdigyView whose addition is
controlled by the database. Plugins can be object oriented
or procedural additions and are persistent once loaded.
www.prodigyview.com
12. PV_MVC
ProdigyView is a framework that allows multiple MVCs.
MVCs are defined by the developer. An example MVC
that comes with ProdigyView is Helium.
www.prodigyview.com
13. Configuration Files
The configuration files are divided into two files. The php
file contains the database connections. The xml file
contains system configurations.
www.prodigyview.com
14. PV_TEMPLATES
If the system being created allows templates, the template
directory can set.
www.prodigyview.com
15. Javascript Libraries
ProdigyView distinguishes the JavaScript files from normal
JavaScript, JQuery, Prototype and Mootools. Also it recognizes
a difference between front-end js files vs admin files. The files
do not contain the PV_ROOT because they are accessed in the
browser and having PV_ROOT might make them inaccessible
from the browser.
16. Media Files
Media files consist of images, video, audio and files.
ProdigyView allows separation of each file type. Parts of
the framework such as the CMS make use of these
defines for placing the files. These files also do not
contain PV_ROOT.
www.prodigyview.com
17. Admin
The last define is the administrative define. If this define is
set to true, applications will be allowed to access their
administrative section. If set to false, the function
PVApplication::pv_exec_admin() will not be accessible.
This is done to separate the front end from backend.
www.prodigyview.com
18. Review
As seen, there are numerous defines that can set. Those
defines are changeable to change how your system is set
up.
When you are comfortable with various aspects of the
ProdigyView, take the time to change the defines to
customize the system you build.
www.prodigyview.com