2017 © Pedro Peláez
 

library modern_php_scanner

Scan URLs from an array and return an array of inaccessible URLs. An example component from Josh Lockhart's book "Modern PHP" (2015)

image

volt/modern_php_scanner

Scan URLs from an array and return an array of inaccessible URLs. An example component from Josh Lockhart's book "Modern PHP" (2015)

  • Sunday, March 20, 2016
  • by volt
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

volt/modern_php_scanner

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

It is just an educational test project. It is a slightly modified example from Josh Lockhart's book "Modern PHP" by O'Reilly (2015)., (*2)

For original code see a related GitHub page. You may as well look througgh [a forked version] (https://github.com/frankperez87/scanner/blob/master/src/Url/Scanner.php) for some code modifications., (*3)

This component uses PSR-4 autoload and utilizes Oreilly\ModernPhp\ namespace.
For class identification use \Oreilly\ModernPhp\Url\Scanner class name., (*4)

Install

Via Composer, (*5)

``` bash $ composer require volt/modern_php_scanner, (*6)


## Usage **** ```php // an array of test links $a_urls = array( 'http://www.pravda.com.ua', 'http://www.xpravda.ua', 'http://php.net/manual/ru/wrappers.php.php', 'http://uberhumor.com/', 'https://github.com/frankperez87/scanner/blob/master/src/Url/Scanner.php', 'https://www.google.com.ua/maps/' ); $o_scanner = new \Oreilly\ModernPhp\Url\Scanner($a_urls); // instantiate the component class $a_invalid_urls_arrays = $o_scanner->getInvalidUrls(); // get an array with resutls of scan // print_r($a_invalid_urls_arrays); // == the end == // the rest of the code below is compiling html markup for output in $c_html_url_result // from array of arrays ($a_invalid_urls_arrays) $c_html_url_result = null; if (empty($a_invalid_urls_arrays)) { $c_html_url_result = "<h2>All provided URLs are valid</h2>"; } else { $c_html_lis = null; foreach((array)$a_invalid_urls_arrays as $a_url_data){ $c_url = array_key_exists('url', $a_url_data)? $a_url_data['url'] : 'N/A'; $n_status_code = array_key_exists('status_code', $a_url_data)? $a_url_data['status_code'] : 'N/A'; $c_html_url = htmlspecialchars($c_url, ENT_QUOTES); $c_html_lis .= "<li><span>{$c_html_url}</span> Status message: <code>{$n_status_code}</code></li>"; }//endforeach $c_html_url_result = "<h2>The following URLs are invalid:</h2>" . "<ul>" . $c_html_lis . "</ul>"; }//endif echo $c_html_url_result;

Change log

Don't bother looking at CHANGELOG for no additional information on changes is planned to be added., (*7)

Testing

bash $ composer test, (*8)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*9)

Security

Bare in mind, this is just a test project. If you discover any security related issues, please ignore them. You may as well use the issue tracker., (*10)

Credits

License

The MIT License (MIT). Please see License File for more information., (*11)

The Versions

20/03 2016

dev-master

9999999-dev https://github.com/voltel/scanner

Scan URLs from an array and return an array of inaccessible URLs. An example component from Josh Lockhart's book "Modern PHP" (2015)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Volodymyr Telnov

url scanner volt modern php josh lockhart oreilly

20/03 2016

0.1.1

0.1.1.0 https://github.com/voltel/scanner

Scan URLs from an array and return an array of inaccessible URLs. An example component from Josh Lockhart's book "Modern PHP" (2015)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Volodymyr Telnov

url scanner volt modern php josh lockhart oreilly

20/03 2016

0.1.0

0.1.0.0 https://github.com/voltel/scanner

Scan URLs from an array and return an array of inaccessible URLs. An example component from Josh Lockhart's book "Modern PHP" (2015)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Volodymyr Telnov

url scanner volt modern php josh lockhart