ProdigyView: The Toolkit For Building Micro: Frameworks / Applications / Services
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
Installation can be done either with Composer or downloading the packages manually.
Composer
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!
Manual Installation
If you wish to install manually without a package manager, the task is fairly easy.
1) Download The Application
In this git repo, there are several version available for download. Download the latest and put it in a folder in your project.
2) Include The ClassLoader
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.
Learning Resources
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.
Toolkit Examples
Below are various examples of how the toolkit can make programming easier with built-in functions:
Get A File Mime Type
<?php
use prodigyview\util\FileManager;
$mime = FileManager::getFileMimeType($file);
?>
Validate If A File Is An Image
<?php
use prodigyview\util\Validator;
$is_image = Validator::check('image_file', $mime); ?>
?>
Execute a CURL post
<?php
use prodigyview\network\Curl;
$url = 'http://api.example.com';
$data = array('abc' => '123');
$communicator = new Curl($url);
$communicator ->send('post',$data);
Is an Ajax Request and Mobile Request
<?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.
RoadMap
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
Development Principles
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
Application Design Patterns
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
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
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
Intercepting Filters
The Intercepting Design Pattern allows both pre-processing and post-processing of variables within a function.