Download the PHP package synapsestudios/synapse-base without Composer

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

Synapse Base

Build Status

Overview

Synapse Base is a bootstrapping library for PHP applications build in the Silex microframework. It's intended for REST APIs that serve and consume JSON.

This library provides an opinionated, secure starting point for your REST API using the following tools and libraries:

Setting up your Project

Quick Start

For new projects, just clone the API Template as a starting point and composer install.

Expectations of the Library

Architectural Expectations

  1. A MySQL server for app data
  2. A Redis server for job queues

Project Codebase Expectations

(If you just use API Template, you don't need to know most of this.)

  1. Some named constants are expected to exist.
  2. The APP_ENV environment variable should be set. (To development, production, or staging.)
  3. Specific config files should be set up in [APPDIR]/config/. To set up environment-specific configuration overrides, put identical config files in [APPDIR]/config/development/, etc. See API Template for examples.

Setting Up Required Config Files

The default config files contain sufficient documentation in DocBlocks. Just read those.

Database Interaction

Database Installs and Migrations

Use the console utility in API Template to perform DB installs and migrations.

When you create a new migration, it's created in [APPDIR]/src/Application/Migrations/. Use the Zend DB Adapter to perform queries like this.

Note about Generating a Database Install File: When you run ./console install:generate, it generates 2 files -- (1) a DbStructure.sql file with the table structure based on the current snapshot of your database, and (2) a DbData.sql file with data from specific tables. Specify which tables in the install config.

How to Read/Write from the Database

Use Mappers like this to perform database queries. Database results are returned as Entities.

Authentication / Login System

bshaffer's OAuth2 server is used for authentication. The user POSTs to /oauth/token with their email/password and receives an access token which can be used to make requests. (Per the OAuth2 specification.)

In order to secure endpoints, the Symfony Security module is used. Firewalls are used to constrain an endpoint to logged in users or to make it public. Access Rules are used to make an endpoint accessible only to users with certain roles. Read the Symfony Security docs for more details.

Notes:

  1. When you specify a listener in a firewall ('anonymous' => true, 'oauth-optional' => true), the code that runs is in the Listeners. (These are added in the OAuth2\SecurityServiceProvider.)
  2. There is a catch-all firewall that constrains all endpoints to be protected by OAuth (non-public) unless specified otherwise. More details here.

Utility Classes

Array Helper

DataObject

Use these to encapsulate concepts and typehint them in your app.

Test Helpers

Various abstract PHPUnit test cases are available for controllers, mappers, etc., to make it easier to test them.


All versions of synapse-base with dependencies

PHP Build Version
Package Version
Requires silex/silex Version 1.2.5
symfony/console Version 2.5.2
symfony/security Version 2.5.2
symfony/validator Version 2.5.2
zendframework/zend-db Version ~2.2.5
bshaffer/oauth2-server-php Version v1.0
bshaffer/oauth2-server-httpfoundation-bridge Version v1.0
chrisboulton/php-resque Version v1.2
mandrill/mandrill Version 1.0.52
psr/log Version v1.0.0
monolog/monolog Version ~1.18.2
rollbar/rollbar Version ~0.14
zendframework/zend-stdlib Version ~2.2.5
ircmaxell/password-compat Version dev-master
guzzle/guzzle Version ~3.7
jdesrosiers/silex-cors-provider Version ~0.1
lusitanian/oauth Version ~0.2
mustache/mustache Version ~2.5.1
mailgun/mailgun-php Version ^2.1
php-http/guzzle6-adapter Version ^1.0
xamin/handlebars.php Version ^0.10
tijsverkoyen/css-to-inline-styles Version ^2.0@dev
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 synapsestudios/synapse-base contains the following files

Loading the files please wait ....