Download the PHP package corneltek/universal without Composer

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

Universal

Universal is a general proprose PHP library.

Build Status

Components

Classloader

SplClassLoader

use Universal\ClassLoader\SplClassLoader;
$loader = new \UniversalClassLoader\SplClassLoader( array(  
        'Vendor\Onion' => 'path/to/Onion',
        'Vendor\CLIFramework' => 'path/to/CLIFramework',
));
$loader->addNamespace(array( 
    'NS' => 'path'
));
$loader->useIncludePath();
$loader->register();

BasePathClassLoader

$loader = new BasePathClassLoader( array( 
    'vendor/pear', 'external_vendor/src'
) );
$loader->useEnvPhpLib();
$loader->register();

Include Path Manipulator

Include Path manipulator

$includer = new PathIncluder(array( 'to/path', ... ));
$includer->add( 'path/to/lib' );
$includer->setup();   // write set_include_path

Http

StreamResponse

MXHR support

HttpRequest

For multiple files:

To get FILE:

$req = new HttpRequest;

Get $_FILES['uploaded'] hash:

$req->files->uploaded;

Get file size:

$req->files->uploaded->size;

Get file mime type:

$req->files->uploaded->type; // plain/text

Get upload error:

$req->files->uploaded->error;

Foreach file:

foreach( $req->files->uploaded as $f ) {
    $f->size;
}

ObjectContainer

Construct a $container object or inherit from it:

$container = new Universal\Container\ObjectContainer;

Register a object builder for lazy building.

$container->mailer = function() {
    return new YourMailer;
};

To get singleton object via __get magic method:

$mailer = $container->mailer;

Or get singleton object from instance method:

$mailer = $container->instance('mailer');

To build a new object:

$mailer = $container->build('mailer');

To build a new object with arguments:

$mailer = $container->build('mailer', array( ... ));

Session

Supported Session Storage backend:

use ObjectContainer to pass options:

$container = new Universal\Container\ObjectContainer;
$container->state = function() {
    return new Universal\Session\State\NativeState;
};
$container->storage = function() {
    return new Universal\Session\Storage\NativeStorage;
};

Native Session:

$session = new Universal\Session\Session(array(  
    'state'   => new Universal\Session\State\NativeState,
    'storage' => new Universal\Session\Storage\NativeStorage,
));
$counter = $session->get( 'counter' );
$session->set( 'counter' , ++$counter );
echo $session->get( 'counter' );

Session with memcache backend:

$session = new Universal\Session\Session(array(  
    'state'   => new Universal\Session\State\CookieState,
    'storage' => new Universal\Session\Storage\MemcacheStorage,
));
$counter = $session->get( 'counter' );
$session->set( 'counter' , ++$counter );
echo $session->get( 'counter' );

Event

use Universal\Event\PhpEvent;
$e = PhpEvent::getInstance();

// register your handler
$e->register( 'test', function($a,$b,$c) {
    // do what you want

});

// trigger event handlers
$e->trigger( 'test' , 1,2,3  );

Requirement Checker

try {
    $require = new Universal\Requirement\Requirement;
    $require->extensions( 'apc','mbstring' );
    $require->classes( 'ClassName' , 'ClassName2' );
    $require->functions( 'func1' , 'func2' , 'function3' )
}
catch( RequireExtensionException $e ) {

}
catch( RequireFunctionException $e ) {

}
catch( RequireClassException $e ) {

}

All versions of universal 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 corneltek/universal contains the following files

Loading the files please wait ....