Download the PHP package aptoma/silex-extras without Composer

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

Silex Extras

Build Status Coverage Status

Package consisting of reusable stuff for Silex powered applications.

It is collection of various services that will ease bootsrapping new Silex applications, keep best practices in sync across projects, and ensure we do stuff in a similar manner whenever we do something.

What's In It?

Aptoma\Ftp

Wraps native PHP FTP functions in an object oriented manner. It's designed for working with Level3 CDN, and thus has a concept of multiple paths for upload.

Usage:

``

The class has a few more features for validating upload integrity and moving the file to publish location after upload. Read the source :)

Aptoma\Service\Level3Service

Provides an abstraction for uploading files to Level3. You need to provide a an Ftp instance and various paths, and can then simply do: $service->upload($fileContents, $targetFileName, $relativeLocalTempDir);.

After upload, the file will be renamed and put in a folder matching it's checksum, in order to avoid duplicate uploads, and to deal with Level3's (sensible) limitation of max number of files in a directory. The full public url is returned. Strictly speaking, this isn't actually Level3 specific, but more a two-step strategy for validated uploads.

There's also a bundled Level3ServiceProvider for simpler integration with Silex.

Aptoma\Log

This folder provides two classes:

Usage is simple:

``

Aptoma\Silex\Provider\ExtendedLoggerServiceProvider

This is a service provider that automatically adds the above mentioned RequestProcessor, as well as a LogstashFormatter if you have specified monolog.logstashfile.

The LogstashFormatter can also add some extra context to each record:

``

These extra fields will help us classify records in our consolidated logging infrastructure (Loggly, Logstash and friends), and lead to great success.

Aptoma\Silex\Provider\ConsoleLoggerServiceProvider

This service provider makes it easy to show log messages from services in the console, without having to inject an instance of OutputInterface into the services. This requires version ~2.4 of Symfony Components. More info about the change is at the Symfony Blog.

In your console application, you can now do something like this:

``

You will still use the normal OutputInterface instance for command feedback in your commands, but you will now also get output from anything your services are logging.

The console logger overrides the default monolog.handler in order to allow setting a custom log file. If defined, it will use monolog.console_logfile, and if not, it will fall back to monolog.logfile.

This Provider is also available as standalone package: https://github.com/glensc/ConsoleLoggerServiceProvider

Aptoma\Silex\Application

This is a base application you can extend. It will add a json formatter for errors, register ServiceControllerServiceProvider and UrlGeneratorServiceProvider, automatically log execution time for scripts (up until the response has been sent), and also exposes registerTwig and registerLogger, which you can use to set up those with one line of code.

This class should include functionality that we always use, meaning it's not a collection of "nice to haves".

Aptoma\JsonErrorHandler

This class simply formats exceptions as JsonResponses, provided the client has sent an Accept: application/json header. It will be loaded automatically by the base Application class mentioned above, or it can be registered manually:

``

Aptoma\TestToolkit

This includes a BaseWebTestCase you can use to bootstrap your test, and an associated TestClient with shortcuts for postJson($url, $data) and putJson($url, $data).

To use it, you need to have your tests extend it, and probably also add the path to your bootstrap file:

``

Aptoma\Security

Component for API key user authentication.

All it requires is a UserProvider and an encoder to encode the API key. It'll typically be used in your app like this:

``

It can then be attached to any firewall of your choice:

``

CacheServiceProvider

Registers services for cache.memcached and cache.predis, as well as a generic cache, which can be configured to return either of these (Memcached by default).

``

See below for config options for Memcached.

MemcachedServiceProvider

Registers Memcached as a service, and takes care of prefixes and persistent connections. It returns an instance of \Memcached.

``

PredisServiceProvider

Registers Predis as a service. It returns an instance of \Predis\Client.

``

GuzzleServiceProvider

Extends the base GuzzleServiceProvider to allow registering global plugins, and also adds a few plugins:

To configure which cache storage to use, define $app['guzzle.default_cache'], which should be a string referencing the cache service to use, ie. 'cache.memcached'.

``

Guzzle HttpCallInterceptorPlugin

Guzzle plugin for use in unit testing to ensure there are no calls made to any external services. In your test setup, do something like this:

``


All versions of silex-extras with dependencies

PHP Build Version
Package Version
Requires monolog/monolog Version ~1.8
silex/silex Version ~1.0
symfony/http-foundation Version ~2.4
symfony/browser-kit Version ~2.2
symfony/css-selector Version ~2.2
symfony/monolog-bridge Version ~2.2
symfony/security Version ~2.3
symfony/finder Version ~2.2
symfony/filesystem Version ~2.2
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 aptoma/silex-extras contains the following files

Loading the files please wait ....