2017 © Pedro Peláez
 

package fileloader

image

devjet/fileloader

  • Wednesday, December 14, 2016
  • by devjet
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

File Loader

A simple composer package example

Example of usage library, (*1)

Installation, (*2)

Inside your webroot init Composer: composer init * add package: composer require "devjet/fileloader":"dev-master", (*3)

  • create [webroot]/public/index.php file with following code example:
<?php

/* 
in case you place index.php in PUBLIC directory inside webroot
otherwise, correct bootstrap path to autoload.php
*/
require_once __DIR__ . '/../vendor/autoload.php';


use devjet\fileloader\FileLoader;

try {

    $loaderObject = FileLoader::getLoader()
        ->setLoadURL('http://images.all-free-download.com/images/graphiclarge/cat_having_a_stretch_205116.jpg')
        ->setSavePath('folder', true) //Create "folder" directory and put file there
        ->addExtension('tiff', 'zip') //add additional extensions
        ->load();

    echo $loaderObject->getLoadedFilePath(); //print absolute path to file 

} catch (Exception $exception) {
    echo $exception->getMessage();
}

...and you have to get picture of starching cat., (*4)

To run tests, (*5)

phpunit ./vendor/devjet --bootstrap vendor/autoload.php

The Versions

14/12 2016

dev-master

9999999-dev

  Sources   Download

MIT