Download the PHP package yuav/mogilefs without Composer

On this page you can find all versions of the php package yuav/mogilefs. 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 mogilefs

MogileFS PHP Model

image:https://travis-ci.org/Yuav/MogileFS-PHP-Model.svg?branch=master["Build Status", link="https://travis-ci.org/Yuav/MogileFS-PHP-Model"]

This library is an abstraction model for a file stored in MogileFS. The idea is to have a clearly defined api to use for storing and retrieving files from MogileFS.

On find, only paths are retrieved by default, while other properties like domain and class are lazyloaded on request.

This model also include a mysql adapter, as a hack to do bulk operations for looking up multiple paths in one operation. This adapter is likely to break for future MogileFS versions, but MogileFS currently doesn't support getting multiple paths in one query natively.

Example usage

add with composer

[source,json]

{ "require": { "yuav/mogilefs": "dev-master" } }

[source,php]

<?php // Config example $config = array( 'adapter' => array( 'tracker' => array('127.0.0.1','127.0.0.2:1234'), 'domain' => 'dev' ) );

// Save $mapper = new MogileFS_File_Mapper($config); // see tests/config.php $file = new MogileFS_File(); $file->setKey('motd'); $file->setFile('/etc/motd'); $savedFile = $mapper->save($file);

// Find $file = $mapper->find('motd'); var_dump($file->getPaths());

Config options

Options should be injected into MogileFS_File_Mapper constructor in an associative array.

For an example see: tests/config.php

=== Mapper options:

The 'adapter' option can either be an instance of MogileFS_File_Mapper_Adapter_Abstract, or a set of adapter options for the 'defaultadapter' which should contain class name of adapter to instantiate if no adapter is set.

=== Tracker adapter options:

The 'tracker' section should contain an array of MogileFS trackers.

=== Mysql adapter options:

Testing

Tests where performed on Ubuntu 12.04.

To get tests running I installed MogileFS as described in the quickstart: https://code.google.com/p/mogilefs/wiki/QuickStartGuide

I also did one additional command:

mogadm class add toast dev --mindevcount=3

tests/config.php is set up according to the above setup

Design

All properties except key and paths are lazyloaded on request. This means that no request is sent to the backend server for file info until the getClass() or similar is called within the MogileFS_File model.

MogileFS::getFile() downloads the file to a temporary local file, which should to be deleted by application after use.

Adapters interact with datasource, while mapper populate the File model from adapter output. All adapters have to produce the same output for mapper to parse it correctly.

A test adapter is implemented to allow for application testing without having a live MogileFS running

Naming convention, and design tries to follow that of the Zend Framework 1.x. This also includes sub optimal require_once calls, for compatibility. I reccomend you use an autoloader instead.


All versions of mogilefs with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
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 yuav/mogilefs contains the following files

Loading the files please wait ....