Giter Club home page Giter Club logo

php-image-cache's Introduction

Image Cache v. 1.0.0

Image Cache is a very simple PHP class that accepts an image source and will compress and cache the file, move it to a new directory, and returns the new source for the image.

Current Status

Build Status

Employing travis-ci.org for continuous integration testing and assurance of code validity.

Installation

Install Composer by opening Terminal and navigating to the directory in which you'd like to install Image Cache.

Download Composer:

curl -sS https://getcomposer.org/installer | php

Create a composer.json file:

	{
		"require" : {
			"nielse63/phpimagecache": "dev-master"
		}
	}

Navigate to your project root and run the install command.

$ php composer.phar install

From there, include the vendor/autoload.php file in your project, and initialize the class as normal.

More information on installing and using Composer can be found at getcomposer.org, and dependency information on the package can be found at packagist.org.

Testing

Manual Testing

To test the script manually by receiving visual output, setup a virtual host and load demo/index.php in your browser. Three examples are set in that file: the original image called from an outside source; a cached example referencing the outside source via an absolute URL; and an internal source referencing a file path.

Using Chrome Developer Tools you can see the difference in load times between the external source (non-cached image) and the internally stored and cached image.

Unit Testing

Some extremely basic unit tests are included with the script and can be run using PHP Unit. I'm working on continuing to build up these tests and would more than welcome any contributions to the tests.

To execute the tests in a bundled script (along with rebuilding the docs), clone the repository, navigate to the root of the repo in terminal, and execute:

$: sh build

Assuming you have the phpunit and phpdoc commands intalled, the tests will pass and docs will be rebuilt.

What's Next

See the source for a full to do list of changes that I wish to accomplish moving forward.

Contributing

Contributing to the project would be a massive help in maintaining and extending the script. The module is being used on a larger scale than I initially imagined, and continuing to maintain it is becoming a little time consuming for just me.

If you're interested in contributing, issue a pull request on Github or email me directly at [email protected].

For any issues found or extensions you'd like to see, feel free to submit an issue ticket so we can start a discussion about the viability of the problem and how it can be resolved.

License

Creative Commons Attribution Lisence:

http://freedomdefined.org/Licenses/CC-BY

Bitdeli Badge

php-image-cache's People

Contributors

nielse63 avatar solleer avatar williamcarril-trendi avatar neemzy avatar 4selected avatar alegueleres avatar bitdeli-chef avatar tjefford avatar mhor avatar salkhwlani avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.