Download the PHP package the-matrix/slim-dic-example without Composer

On this page you can find all versions of the php package the-matrix/slim-dic-example. 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 slim-dic-example

the-matrix/slim-dic-example

PHP 5.6 PHP 7.1

Use this skeleton application to quickly setup and start working on a new Slim Framework 3 application incorporating the power of the Symfony 2 Dependency Injection component or Symfony 4 Dependency Injection component.

Symfony 2 is supported by PHP 5.6.. Symfony 4 is supported by PHP 7.1.

This demo also uses Sensio Labs' Twig template library, but you don't have to - use Smarty instead, or native PHP for your view scripts - it's up to you, - just configure the DIC definition files per your requirements. (Don't forget to add/remove dependencies in composer.json if you do.)

Also included is a minimal Controller (MVC) implementation, that allows you to seperate out the routing from the site application logic. Again, you don't need to use it if you don't want to.

This skeleton application was built for Composer. This makes setting up a new Slim Framework application quick and easy. You are not intended to include this as a composer requirement, but to create a new Composer app with it and move on.

This is a PHP5.6+ application

Install Composer

Install [Composer] (https://getcomposer.org/). It is useful to symlink the composer.phar file into /usr/local/bin or your ~/bin directory, dependent on your circumstances e.g.

    cd ~/bin
    ln -s /path/to/composer.phar composer
    chmod u+x composer

Install the Application

After you install Composer, run this command from the directory below the one in which you want to install your new Slimdic application.

composer create-project the-matrix/slim-dic-example my-app-name 3.*

Replace my-app-name with the desired directory name for your new application. When the installer asks Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]?

then enter 'Y'.

(NB. If you want the Slim 2 + Symfony 2 version of this library, use 1.* as the version number above.)

The rest of this section comes under the general heading of 'Teaching Grandma to Suck Eggs', but hey - someone out there is a newby!

You'll want to:

    sudo chgrp -R apache my-app-name
    sudo chmod -R g+r my-app-name
    sudo chmod -R g+w my-app-name/spool

ensures that both you and the server can read and write. NB, check the user name that your server is running under, something like:

    ps aux | grep httpd
    # or
    ps aux | grep apache

normally does the trick.

Have a care for security. Dependent on your server, set the vhost to allow public access to the ./public directory only. The app needs to be able to see everything from one directory below, and no more.

Dependent on how you have set up your vhost, you may need to add an entry to the /etc/hosts file. I like to set each app I'm developing on it's own dns name so typically, I'll add something like

127.0.0.1 my-app.localhost

to /etc/hosts. Obviously, the name needs to match your web server vhost name

Now assuming you've got all that, point your browser at the the vhost name and off you go - you should be seeing a nice page. Now browse to /logon and check out the cool demo logon. It doesn't matter if you get it wrong - the answer will be revealed.

So you did the demo. Now look at the code - it's all in there under the Site directory and in the public/index.php file.

And remember, once you've installed this demo template, you can change it without worrying that a composer update is going to override any code that you write. That will just update any packages you have defined in your composer.json file.

More reading

The Site Directory

Using the Controller

Find more

Check out ZF4 Packages for more packages

History

V1.0.0 Slim 2 + Symfony 2

V2.0.0 Slim 3 + Symfony 2

V2.0.1 Add link to packages

V2.0.2 bug fix from Nigel Greenway

V2.0.3 code clean. readme typos. bug fix from Nigel Greenway

V2.1.0 Update for PHP 7.1

V2.1.1 update composer - forced by packagist composer.json format change

V3.0.0 BC Break. Remove support for PHP <5.6


All versions of slim-dic-example with dependencies

PHP Build Version
Package Version
Requires php Version ~5.6|~7.1
monolog/monolog Version ~1.12
slim/twig-view Version ~1.2
chippyash/slim-symfony-dic Version ~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 the-matrix/slim-dic-example contains the following files

Loading the files please wait ...