Welcome to the ProdigyView Toolkit, a powerful PHP enhancement tool designed to make PHP coding faster, less mundane and highly extendable. The toolkit was designed too:
- Tackle Inversion Of Control in more targeted way than current solutions such as dependency injection
- Provide tools to build applications without enforcing a structure or requiring a framework
- Quickly build and easily maintain micro-applications and micro-frameworks
This document will go over how to install the toolkit, use some of the features, and extend objects with the built-in design patterns.
Installation can be done either with Composer or downloading the packages manually.
The easy way to install the application is with composer. Start by running the require command in composer
composer require prodigyview/prodigyview
After it has successfully been installed, simply make sure the autoload generated by Composer is being included in your application.
<?php
include_once ('/path/to/vendor/autoload.php');
?>
And you are done!
If you wish to install manually without a package manager, the task is fairly easy.
In this git repo, there are several version available for download. Download the latest and put it in a folder in your project.
Inside the main folder, there is a file called _classLoader.php. Include that file any page you want use the toolkit like so:
include_once ('/path/to/toolkit/src/_classLoader.php');
And you are done with the installation.
Before getting into the examples below, there are several materials available to help you learn how to use the toolkit:
- The Blog: https://medium.com/helium-mvc
- Examples: https://github.com/ProdigyView-Toolkit/examples
- Documentation: https://prodigyview-toolkit.github.io/docs/
- MVC Created Using The Toolkit: https://github.com/Helium-MVC/Helium
Please feel free to use any of the resources to help you get started.
Below are various examples of how the toolkit can make programming easier with built-in functions:
<?php
use prodigyview\util\FileManager;
$mime = FileManager::getFileMimeType($file);
?>
<?php
use prodigyview\util\Validator;
$is_image = Validator::check('image_file', $mime); ?>
?>
<?php
use prodigyview\network\Curl;
$url = 'http://api.example.com';
$data = array('abc' => '123');
$communicator = new Curl($url);
$communicator ->send('post',$data);
<?php
use prodigyview\network\Request;
$request = new Request();
$is_ajax = $request -> isAjaxRequest();
$is_mobile = $request -> isMobile();
There are a lot of other tools from hashing, generating a random string, connecting with databases, etc. Using these tools can help speed up your application development.
Forks and contributors are more than welcome!!!!
- Redo the PVDatabase. Seperate into different classes per database and potentially used DI or another pattern for referencing connection. Important to allow connection pooling to continue in implementation. Checkout the db_rewrite branch.
- Work on PVCommunicator SOAP and Socket Implementation
For hardcore developers that focus on IoC, S.O.L.I.D and other principles, this section is for you.As you get started with ProdigyView, it is good to understand some of the principles behind the framework.
- A New Approach To Inversion of Control
- Programming Principles For Early Stage Startups
- How Helium and ProdigyView Is Designed For Startups
- Debunking The Myth Of Static Classes, Methods and Variables
Another great feature the toolkit provides is helping you to extend and better design your applications. The framework focuses on 3 design patterns that can be implemented on any object: Adapters, Observers, Intercepting Filters.
Adapters are is a design pattern that is meant as an alternative to Dependency Injection. Adapters allow you to change the underlying functionality of an object without directly manipulating the code of the object.
https://medium.com/helium-mvc/the-adapter-pattern-a-replacement-to-dependency-injection-835c9bfbe4f4
Observers allow other objects to subscribe to an objects actions and be notified when actions are executed. https://medium.com/helium-mvc/observer-design-pattern-others-apps-are-following-you-ef5553b61f77
The Intercepting Design Pattern allows both pre-processing and post-processing of variables within a function.