2017 © Pedro Peláez
 

library assets-finder

image

nexuslinkservices/assets-finder

  • Friday, March 24, 2017
  • by nexuslinkservices
  • Repository
  • 1 Watchers
  • 0 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

assets-finder

Extension to get array of media assets like MP3, MP4 and JPG., (*1)

Latest Version Software License Scrutinizer Code Quality Build Status, (*2)

Installation

If you use composer, you can add this package by running, (*3)

composer require galiteintechnologies/assets-finder

Usage

Define and set value of media parameters in configuration yml file like this., (*4)

media_options:
    mp3: true
    mp4: true
    jpg: true

You can enable or disable parse media options with true/false value., (*5)

If you do not set media options in your configuration file then it will take true values for all options by default., (*6)

Example usage:, (*7)

<?php

use AssetsFinder\MediaParser;

$assetsFinder = new MediaParser;

$content = "First sample file http://www.mywebsite.com/firstsample.mp3 and second file is https://www.mywebsite.com/secondsample.mp4. This is the image link <img src='http://www.mywebsite.com/assets/images/sampleimage.jpg' alt='sample image' title='sample image'> and second image <img src='http://www.mywebsite.com/assets/images/sampleimage2.png' alt='test png image' title='test png image'>";
$result = $assetsFinder->FindMedia($content);

Output

Array
(
    [mp3] => Array
        (
            [0] => http://www.mywebsite.com/firstsample.mp3
        )

    [mp4] => Array
        (
            [0] => https://www.mywebsite.com/secondsample.mp4
        )

    [jpg] => Array
        (
            [0] => http://www.mywebsite.com/assets/images/sampleimage.jpg
        )

)

CONTRIBUTING:

Pull requests are always welcome., (*8)

The Versions

24/03 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.6.2

 

The Development Requires

by Nexuslink Services

06/09 2016

v1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

  • php >=5.6.2

 

The Development Requires

by Nexuslink Services