Download the PHP package webdevbr/mvc-rest-skeleton without Composer

On this page you can find all versions of the php package webdevbr/mvc-rest-skeleton. 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 mvc-rest-skeleton

MVC Rest

O que é

MVC Rest disponibiliza uma estrutura pronta para você criar suas aplicações RESTfull, é bem simples, basta mapear o banco de dados e ele faz o resto pra você.

Instalação

Para instalar você pode usar o Composer.

Rode o comando a baixo:

composer create-project --prefer-dist webdevbr/mvc-rest-skeleton

Você ainda pode informar um diretório (o padrão é mvc-rest-slim), basta passar aonde quer instalar logo após o comando, exemplo:

composer create-project --prefer-dist webdevbr/mvc-rest-skeleton app

Ele vai instalar a aplicação em um novo diretório app.

Mapeamento dos dados

A partir de um banco de dados

Para mapear os dados a partir de um banco de dados já existente use:

bin/doctrine orm:convert-mapping --force --from-database annotation ./src/App/Mvc/Models/Entities

Toda entidade deve extender a class WebDevBr\Mvc\Models\Entity, por exemplo:

<?php

namespace App\Mvc\Models\Entities;

use WebDevBr\Mvc\Models\Entity;

/**
 * @Entity @Table(name="pages")
 **/
class Page extends Entity
{
    /** @Id @Column(type="integer") @GeneratedValue **/
    protected $id;

    /** @Column(type="string") **/
    protected $title;

    /** @Column(type="text") **/
    protected $content;

    /** @Column(type="string") **/
    protected $slug;
}

A menos que você vá usar os métodos getters e setters você não precisa cria-los, apenas o mapeamento já está bom.

Todos os atributos da entidade devem ser protected, note que o Doctrine mapeia como private, desta forma não rola.

Gerar um banco de dados a partir das entidades

Uma tarefa muito simples também, basta rodar o comando:

bin/doctrine orm:schema-tool:create

Este é o formato que eu trabalho, eu crio as entidades e o Doctrine cria o banco pra mim.


All versions of mvc-rest-skeleton with dependencies

PHP Build Version
Package Version
Requires webdevbr/mvc-rest Version 1.*
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 webdevbr/mvc-rest-skeleton contains the following files

Loading the files please wait ....