Skip to content

buglloc/php-smd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Show Me Dependencies Build Status

The main goal is to identify all dependencies on user input. Soon there will be more details;)

Requires PHP7+ so far.

Examples

Boring

<?php
echo $_GET['foo'];

print_r(smd_pump());

/*
Output: Array
(
    [get] => Array
        (
            [0] => foo
        )

    [post] => Array
        (
        )

    [request] => Array
        (
        )

    [cookie] => Array
        (
        )

)
*/

Custom storage

<?php
class Request
{
	protected $storage = [];

	function store(array $settings) {
		$this->storage = array_merge($this->storage, $settings);
		return $this;
	}

	function get($name) {
		return $this->storage[$name];
	}

	function exists($name) {
		return isset($this->storage[$name]);
	}
}

$get = (new Request)->store($_GET);
$post = (new Request)->store($_POST);

// Check isset
$get->exists('isset_get');
// Check fetch from _GET
$get->get('fetch_get');
// Check fetch from _POST
$post->get('fetch_post');

print_r(smd_pump());

/*
Output: Array
(
    [get] => Array
        (
            [0] => isset_get
            [1] => fetch_get
        )

    [post] => Array
        (
            [0] => fetch_post
        )

    [request] => Array
        (
        )

    [cookie] => Array
        (
        )

)
*/

About

Show Me Dependencies - PoC for identification all dependencies on user input

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published