Download the PHP package cjci/res_storage without Composer

On this page you can find all versions of the php package cjci/res_storage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package res_storage

CI_Resource_Management

Resource Management Class for Codeigniter framework. It allows to store and process files w/wo encryption


What is CI Resource Management


This is a library coded to work in CodeIgniter Framework that helps in the process of management resources - files - and storing them in your filesystem with or without encryption. By default it uses rijndael-256 - commonly known as AES256 - to store files.

If your web application handles a lot of files, that you must secure in some way and want to have a common library to do all the hard work of storing and encrypting files in your application. This library is for you.


Installation


1.a (If you use composer) Execute: composer require cjci/res_storage and fill in your desired version (dev-master for latest changes).

1.b (Manually) Download desired version of this project to application/libraries/

  1. Create your own res_storage.php config file in application/config to configure your path and encryption key. (see Usage for more details)

Usage


Codeigniters wrapper to loader class

This class can be used in anywhere in your code just by its FQNS CJCI/ResStorage/ResStorage But, if you want to use $this->load->('res_storage') in your code, because you are familiar with CI Loader. Just create a res_storage.php file in your application/libraries folder. Contents as follows:

Now we need to configure where to store files and a new clear secretkey. (It will be the basis of a new hashed secret key)

Creating a res_storage.php file in your CodeIgniter's config dir:

$config['clearkey'] = "YourSecretKey" ;

$config['storage_dir'] = "/Path/To/Your/Filesystem/";

Or as a parameter when using CI Loader Class:

$this->load->library('res_storage',array('clearkey' => 'MyKey','storage_dir' => '/Path'));

Instantiate $this->load->library('res_storage');

Store a file When storing files it will store a copy of that file. It wont move or delete original file. $uuid = $this->res_storage->store_file('/Path/to/File.txt');

$uuid is auniq a string identifier that identifies that file in the future.

Storing a file will store a copy of a document. using a file handler class (Encrypted AES256 32IV by default) And also will store metadata of that document into res_storage table.

Read Metadata var_dump($this->res_storage->metadata($uuid));

Returns

Get File contents $contents = $this->res_storage->file_get_contents($uuid);

Output contents to browser using metadata Uses metadata to write some headers and then file contents $this->res_storage->readfile($uuid);

Delete File $this->res_storage->delete($uuid)

Everything will throw an Exception if something goes wrong. So if you want to be safe and not have halfloaded pages... try using try-catch:


Creating your own FileHandle with your own encryption


Extend and include somewhere in your code RSFile Class if you don't want to use MCRYPT to store your files encrypted. Otherwise extend RSFileEncrypted and modify it's properties to fit your needs.

Add to your config/res_storage.php: $config['file_handler'] = 'My_File_Handler' ;

Or Extend ResStorage and override the following to use your FileHandler:


License


GPL V3


All versions of res_storage with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cjci/res_storage contains the following files

Loading the files please wait ....