PHP Defines in ProdigyView
-
Upload
prodigyview -
Category
Technology
-
view
742 -
download
0
description
Transcript of PHP Defines in ProdigyView
![Page 1: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/1.jpg)
DEFINESObjective
Learn how the defines are used to manipulate the system.
Requirements
Understanding of define() function.
Estimated Time
5 minutes
www.prodigyview.com
![Page 2: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/2.jpg)
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
![Page 3: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/3.jpg)
What are DEFINESIn 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
![Page 4: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/4.jpg)
Example Of Defines File
![Page 5: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/5.jpg)
File StructureIn 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
![Page 6: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/6.jpg)
PV_ROOTThe 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
![Page 7: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/7.jpg)
PV_COREPV_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
![Page 8: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/8.jpg)
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
![Page 9: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/9.jpg)
PV_MODULESModules are components that interact with applications. Files that contain the modules have a folder they are assigned.
www.prodigyview.com
![Page 10: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/10.jpg)
PV_LIBRARIESPV_LIBRARIES is the location of the libraries that work with ProdigyView. Libraries are handled through the PVLibraries class.
www.prodigyview.com
![Page 11: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/11.jpg)
PV_PLUGINSPlugins 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
![Page 12: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/12.jpg)
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
![Page 13: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/13.jpg)
Configuration FilesThe configuration files are divided into two files. The php file contains the database connections. The xml file contains system configurations.
www.prodigyview.com
![Page 14: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/14.jpg)
PV_TEMPLATESIf the system being created allows templates, the template directory can set.
www.prodigyview.com
![Page 15: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/15.jpg)
Javascript LibrariesProdigyView 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.
![Page 16: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/16.jpg)
Media FilesMedia 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
![Page 17: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/17.jpg)
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
![Page 18: PHP Defines in ProdigyView](https://reader034.fdocuments.us/reader034/viewer/2022051412/5482881b5806b5f7048b469f/html5/thumbnails/18.jpg)
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