Skip to content
This repository has been archived by the owner on Aug 12, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from Bigpoint/fix_sceleton
Browse files Browse the repository at this point in the history
Fix broken Skeleton
  • Loading branch information
Karsten Bruckmann committed Jan 27, 2015
2 parents 85951da + 14d2a0d commit 243b167
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ In order to configure your webserver to pass all requests in a proper way to the
## Setup Skeleton API
Create a folder for your new api and run the follwing command there.

Set `<YOUR_NAMESPACE>` in the following one liner to your API namespace (camel case) name and execute this line. It will load the framework and create a sceleton structure:
Set `<YOUR_NAMESPACE>` in the following one liner to your API namespace (camel case) name and execute this line. It will load the framework and create a skeleton structure:

~~~
NAMESPACE="<YOUR_NAMESPACE>" && composer init -n && composer require "bigpoint/slim-bootstrap:*" && ./vendor/bin/slim-bootstrap-generator "${NAMESPACE}" && composer dumpautoload
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"bigpoint/SlimBootstrap": "1.*"
"bigpoint/slim-bootstrap": "1.*"
},
"autoload": {
"psr-0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
namespace ###NAMESPACE###\Endpoint\V1\Collection;

use \###NAMESPACE###;
use \Rest\Api;
use \SlimBootstrap;

/**
* Class Dummy
*
* @package ###NAMESPACE###\Endpoint\V1\Collection
*/
class Dummy implements Api\Endpoint\CollectionGet
class Dummy implements SlimBootstrap\Endpoint\CollectionGet
{
/**
* This function is called on a GET request to get all data for this
Expand All @@ -22,7 +22,7 @@ class Dummy implements Api\Endpoint\CollectionGet
public function get(array $filters)
{
$data = array(
new Api\DataObject(
new SlimBootstrap\DataObject(
array(
'dummyId' => 1,
),
Expand All @@ -32,7 +32,7 @@ public function get(array $filters)
'value' => 'dummyValue1',
)
),
new Api\DataObject(
new SlimBootstrap\DataObject(
array(
'dummyId' => 2,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
namespace ###NAMESPACE###\Endpoint\V1\Ressource;

use \###NAMESPACE###;
use \Rest\Api;
use \SlimBootstrap;

/**
* Class Dummy
*
* @package ###NAMESPACE###\Endpoint\V1\Ressource
*/
class Dummy implements Api\Endpoint\RessourceGet
class Dummy implements SlimBootstrap\Endpoint\RessourceGet
{
/**
* This function is called on a GET request to get all data for this
Expand All @@ -18,9 +18,9 @@ class Dummy implements Api\Endpoint\RessourceGet
* @param array $parameters The parameters for the endpoint from the GET
* request.
*
* @return Api\DataObject
* @return SlimBootstrap\DataObject
*
* @throws Api\Exception
* @throws SlimBootstrap\Exception
*/
public function get(array $parameters)
{
Expand All @@ -31,7 +31,7 @@ public function get(array $parameters)
'value' => 'dummyValue',
);

return new Api\DataObject(
return new SlimBootstrap\DataObject(
array(
'dummyId' => $dummyId,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@
$bootstrap->init();

// --- V1 Endpoints - begin ---
$bootstrap->addRessourceGetEndpoint(
$bootstrap->addRessourceEndpoint(
\SlimBootstrap\Bootstrap::HTTP_METHOD_GET,
'/v1/dummy/:dummyId',
'dummy',
array(
'dummyId' => '\\d+',
),
new \###NAMESPACE###\Endpoint\V1\Ressource\Dummy()
);
$bootstrap->addCollectionGetEndpoint(
$bootstrap->addCollectionEndpoint(
\SlimBootstrap\Bootstrap::HTTP_METHOD_GET,
'/v1/dummy',
'dummy',
new \###NAMESPACE###\Endpoint\V1\Collection\Dummy()
Expand Down
4 changes: 2 additions & 2 deletions generator/slim-bootstrap-generator
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

basefolder="./vendor/bigpoint/slim-bootstrap/generator/sceleton/"
basefolder="./vendor/bigpoint/slim-bootstrap/generator/skeleton/"

if [ $# -ne 1 ]; then
echo "Usage: $0 <namespace>"
Expand All @@ -10,7 +10,7 @@ fi
namespace="$1"
namespace_lower="$(echo ${namespace} | tr '[:upper:]' '[:lower:]')"

echo -e "\e[1mGenerating sceleton for \e[34m${namespace}\e[1;39m ...\e[0m"
echo -e "\e[1mGenerating skeleton for \e[34m${namespace}\e[1;39m ...\e[0m"

for template in $(find "${basefolder}" -type f -not -name ".lock"); do
file=${template//${basefolder}/}
Expand Down

0 comments on commit 243b167

Please sign in to comment.