Skip to content

Commit

Permalink
Adds jsonapi blog post with updated composer.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
bravo-kernel committed Mar 10, 2017
1 parent 1e4e9de commit 1f09699
Show file tree
Hide file tree
Showing 76 changed files with 5,639 additions and 0 deletions.
18 changes: 18 additions & 0 deletions blog-how-to-make-your-cakephp-3-api-produce-jsonapi/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.bat]
end_of_line = crlf

[*.yml]
indent_style = space
indent_size = 2
36 changes: 36 additions & 0 deletions blog-how-to-make-your-cakephp-3-api-produce-jsonapi/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Define the line ending behavior of the different file extensions
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto
* text eol=lf

# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.php text
*.default text
*.ctp text
*.sql text
*.md text
*.po text
*.js text
*.css text
*.ini text
*.properties text
*.txt text
*.xml text
*.yml text
.htaccess text

# Declare files that will always have CRLF line endings on checkout.
*.bat eol=crlf

# Declare files that will always have LF line endings on checkout.
*.pem eol=lf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.gif binary
*.ico binary
*.mo binary
*.pdf binary
*.phar binary
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/vendor/*
/config/app.php
/tmp/*
/logs/*
5 changes: 5 additions & 0 deletions blog-how-to-make-your-cakephp-3-api-produce-jsonapi/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
18 changes: 18 additions & 0 deletions blog-how-to-make-your-cakephp-3-api-produce-jsonapi/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: php

sudo: false

php:
- 5.4
- 5.5
- 5.6

before_script:
- sh -c "composer require 'cakephp/cakephp-codesniffer:dev-master'"
- phpenv rehash

script:
- sh -c "vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests ./config ./webroot"

notifications:
email: false
5 changes: 5 additions & 0 deletions blog-how-to-make-your-cakephp-3-api-produce-jsonapi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Blog sources

## [How to prefix route a CakePHP 3 REST API](http://www.bravo-kernel.com/2015/04/how-to-prefix-route-a-cakephp-3-rest-api/)

[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/197398a609a6d233a8c2)
40 changes: 40 additions & 0 deletions blog-how-to-make-your-cakephp-3-api-produce-jsonapi/bin/cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
################################################################################
#
# Bake is a shell script for running CakePHP bake script
#
# CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
# Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
#
# Licensed under The MIT License
# For full copyright and license information, please see the LICENSE.txt
# Redistributions of files must retain the above copyright notice.
#
# @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
# @link http://cakephp.org CakePHP(tm) Project
# @since 1.2.0
# @license http://www.opensource.org/licenses/mit-license.php MIT License
#
################################################################################

# Canonicalize by following every symlink of the given name recursively
canonicalize() {
NAME="$1"
if [ -f "$NAME" ]
then
DIR=$(dirname -- "$NAME")
NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME")
fi
while [ -h "$NAME" ]; do
DIR=$(dirname -- "$NAME")
SYM=$(readlink "$NAME")
NAME=$(cd "$DIR" > /dev/null && cd $(dirname -- "$SYM") > /dev/null && pwd)/$(basename -- "$SYM")
done
echo "$NAME"
}

CONSOLE=$(dirname -- "$(canonicalize "$0")")
APP=$(dirname "$CONSOLE")

exec php "$CONSOLE"/cake.php "$@"
exit
30 changes: 30 additions & 0 deletions blog-how-to-make-your-cakephp-3-api-produce-jsonapi/bin/cake.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Bake is a shell script for running CakePHP bake script
::
:: CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
:: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
::
:: Licensed under The MIT License
:: Redistributions of files must retain the above copyright notice.
::
:: @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
:: @link http://cakephp.org CakePHP(tm) Project
:: @since 2.0.0
:: @license http://www.opensource.org/licenses/mit-license.php MIT License
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: In order for this script to work as intended, the cake\console\ folder must be in your PATH

@echo.
@echo off

SET app=%0
SET lib=%~dp0

php "%lib%cake.php" %*

echo.

exit /B %ERRORLEVEL%
20 changes: 20 additions & 0 deletions blog-how-to-make-your-cakephp-3-api-produce-jsonapi/bin/cake.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/php -q
<?php
/**
* Command-line code generation utility to automate programmer chores.
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since 2.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
include dirname(__DIR__) . '/config/bootstrap.php';

exit(Cake\Console\ShellDispatcher::run($argv));
42 changes: 42 additions & 0 deletions blog-how-to-make-your-cakephp-3-api-produce-jsonapi/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "http://cakephp.org",
"type": "project",
"license": "MIT",
"require": {
"php": ">=5.4.16",
"cakephp/cakephp": "~3.0",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/plugin-installer": "*",
"friendsofcake/crud": "^4.3",
"admad/cakephp-jwt-auth": "^2.0"
},
"require-dev": {
"psy/psysh": "@stable",
"cakephp/debug_kit": "~3.0",
"cakephp/bake": "~1.0"
},
"suggest": {
"phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
"cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
},
"autoload": {
"psr-4": {
"App\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests",
"Cake\\Test\\": "./vendor/cakephp/cakephp/tests"
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall",
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump"
},
"minimum-stability": "dev",
"prefer-stable": true
}
Loading

0 comments on commit 1f09699

Please sign in to comment.