Download the PHP package cethyworks/invitation-bundle without Composer

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

Cethyworks/InvitationBundle

Provides a way to secure routes behind a special "invitation code only" security firewall.

CircleCI

Install

1. Composer require

$ composer require cethyworks/invitation-bundle 

2. Register bundles

// AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new Cethyworks\InvitationBundle\CethyworksInvitationBundle(),
        ];
        // ...

How to use

Invitation codes in memory

1. Update security.yml to add the invitation provider, invitations and firewall :

security:
    # ...
    providers:
        in_memory_invitation_provider:
            invitation_memory:
                invitations:
                    - { code: foo }
                    - { code: bar }
    # ...
    firewalls:
        # ...            
        invitation:
            pattern: ^/invite-only-url
            provider: in_memory_invitation_provider
            guard:
                authenticator:
                    cethyworks_invitation.authenticator
            anonymous: false
        # ...

4. Go to /invite-only-url?code=foo. That's it.

To use emails with in memory provider :

1. Update config.yml :

cethyworks_invitation:
    invitation_class: Cethyworks\InvitationBundle\Model\Invitation

2. Update security.yml :

security:
        # ...
        providers:
            in_memory_invitation_provider:
                invitation_memory:
                    invitations:
                        - { code: foo, email: [email protected] }
                        - { code: bar, email: [email protected] }
        # ...

Invitation codes in database

1. Extends Cethyworks\InvitationBundle\Model\Invitation to persit it :

<?php
namespace AppBundle\Entity;

use Cethyworks\InvitationBundle\Model\GenerateCodeTrait;
use Cethyworks\InvitationBundle\Model\Invitation as BaseInvitation;
use Doctrine\ORM\Mapping as ORM;

/**
 * Invitation
 *
 * @ORM\Table()
 * @ORM\Entity()
 */
class Invitation extends BaseInvitation
{
    // optional, provides a shortcut to generate random code
    use GenerateCodeTrait;

    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * Invitation constructor.
     */
    public function __construct()
    {
        $this->generateCode();
    }
}

2. Update config.yml with the new Invitation class :

cethyworks_invitation:
    invitation_class: AppBundle\Entity\Invitation

3. Update security.yml to add the invitation provider and firewall :

security:
    # ...
    providers:
        cethyworks_invitation_entity_provider:
            invitation_entity: ~
                # entity_property: 'code'
                # repository_method: 'findOneBy'
                # manager_name: null
    # ...
    firewalls:
        # ...            
        invitation:
            pattern: ^/invite-only-url
            provider: cethyworks_invitation_entity_provider
            guard:
                authenticator:
                    cethyworks_invitation.authenticator
            anonymous: false
        # ...

4. Go to /invite-only-url?code=some_code. That's it.

Todo


All versions of invitation-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.17
symfony/dependency-injection Version ^3.3
symfony/config Version ^3.3
symfony/http-kernel Version ^3.3
symfony/security Version ^3.3
symfony/security-bundle Version ^3.3
symfony/security-guard Version ^3.3
symfony/routing Version ^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 cethyworks/invitation-bundle contains the following files

Loading the files please wait ....