-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 22acc98
Showing
10 changed files
with
429 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# CakePHP 3 | ||
|
||
/vendor/* | ||
/config/app.php | ||
|
||
/tmp/cache/models/* | ||
!/tmp/cache/models/empty | ||
/tmp/cache/persistent/* | ||
!/tmp/cache/persistent/empty | ||
/tmp/cache/views/* | ||
!/tmp/cache/views/empty | ||
/tmp/sessions/* | ||
!/tmp/sessions/empty | ||
/tmp/tests/* | ||
!/tmp/tests/empty | ||
|
||
/logs/* | ||
!/logs/empty | ||
|
||
# SonarQube | ||
|
||
/.scannerwork/* | ||
|
||
|
||
# PHPStorm | ||
|
||
/.idea/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Smart Solutions S.r.l. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# cakephp-manifest | ||
[](LICENSE) | ||
[](https://packagist.org/packages/smartsolutionsitaly/cakephp-manifest) | ||
[](https://github.com/smartsolutionsitaly/cakephp-manifest/issues) | ||
[](https://github.com/cakephp/cakephp) | ||
|
||
Manifest support for [CakePHP](https://github.com/cakephp/cakephp) | ||
|
||
## Installation | ||
|
||
You can install _cakephp-manifest_ into your project using [Composer](https://getcomposer.org). | ||
|
||
``` bash | ||
composer require smartsolutionsitaly/cakephp-manifest | ||
``` | ||
|
||
## Setup | ||
|
||
You can load this plugin running following command in terminal: | ||
|
||
``` bash | ||
bin/cake plugin load SmartSolutionsItaly\CakePHP\Manifest -r | ||
``` | ||
|
||
or editing your _config/bootstrap.php_ adding this line at the end of the file: | ||
|
||
```php | ||
Plugin::load('SmartSolutionsItaly\CakePHP\Manifest', ['routes' => true]); | ||
``` | ||
|
||
## License | ||
Licensed under The MIT License | ||
For full copyright and license information, please see the [LICENSE](LICENSE) | ||
Redistributions of files must retain the above copyright notice. | ||
|
||
## Copyright | ||
Copyright (c) 2019 Smart Solutions S.r.l. (https://smartsolutions.it) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name" : "smartsolutionsitaly/cakephp-manifest", | ||
"description" : "Manifest support for CakePHP", | ||
"keywords" : [ | ||
"cakephp", | ||
"controller", | ||
"manifest" | ||
], | ||
"type" : "cakephp-plugin", | ||
"license" : "MIT", | ||
"require-dev" : { | ||
"php" : ">=7.0", | ||
"cakephp/cakephp" : "^3.6", | ||
"smartsolutionsitaly/cakephp-marketplace" : "^1.0" | ||
}, | ||
"autoload" : { | ||
"psr-4" : { | ||
"SmartSolutionsItaly\\CakePHP\\Manifest\\" : "src" | ||
} | ||
}, | ||
"autoload-dev" : { | ||
"psr-4" : { | ||
"SmartSolutionsItaly\\CakePHP\\Manifest\\Test\\" : "tests", | ||
"Cake\\Test\\" : "./vendor/cakephp/cakephp/tests" | ||
} | ||
}, | ||
"homepage" : "https://github.com/smartsolutionsitaly/cakephp-manifest", | ||
"authors" : [{ | ||
"name" : "Lucio Benini", | ||
"email" : "dev@smartsolutions.it", | ||
"homepage" : "https://smartsolutions.it", | ||
"role" : "Web Developer" | ||
} | ||
], | ||
"support" : { | ||
"email" : "info@smartsolutions.it", | ||
"issues" : "https://github.com/smartsolutionsitaly/cakephp-manifest/issues", | ||
"wiki" : "https://github.com/smartsolutionsitaly/cakephp-manifest/wiki", | ||
"source" : "https://github.com/smartsolutionsitaly/cakephp-manifest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* cakephp-manifest (https://github.com/smartsolutionsitaly/cakephp-manifest) | ||
* Copyright (c) 2019 Smart Solutions S.r.l. (https://smartsolutions.it) | ||
* | ||
* Licensed under The MIT License | ||
* For full copyright and license information, please see the LICENSE | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @category cakephp-plugin | ||
* @package cakephp-manifest | ||
* @author Lucio Benini <dev@smartsolutions.it> | ||
* @copyright 2019 Smart Solutions S.r.l. (https://smartsolutions.it) | ||
* @license https://opensource.org/licenses/mit-license.php MIT License | ||
* @link https://smartsolutions.it Smart Solutions S.r.l. | ||
* @since 1.0.0 | ||
*/ | ||
|
||
namespace SmartSolutionsItaly\CakePHP\Manifest\Config; | ||
|
||
use Cake\Routing\Router; | ||
|
||
Router::plugin('SmartSolutionsItaly/CakePHP/Manifest', function ($routes) { | ||
$routes->connect('/manifest', ['controller' => 'manifest', 'action' => 'index']) | ||
->setExtensions(['json']); | ||
|
||
$routes->connect('/ieconfig', ['controller' => 'manifest', 'action' => 'ieconfig']) | ||
->setExtensions(['xml']); | ||
|
||
$routes->connect('/site', ['controller' => 'manifest', 'action' => 'chrome']) | ||
->setExtensions(['webmanifest']); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
sonar.projectKey=cakephp-manifest | ||
sonar.projectName=CakePHP Manifest | ||
sonar.projectVersion=1.0 | ||
sonar.sources=src | ||
sonar.language=php | ||
sonar.sourceEncoding=UTF-8 | ||
sonar.issue.ignore.multicriteria=e1 | ||
sonar.issue.ignore.multicriteria.e1.ruleKey=php:S1192 | ||
sonar.issue.ignore.multicriteria.e1.resourceKey=**/*.php | ||
sonar.tests=tests | ||
sonar.php.tests.reportPath=.tests/junit.xml | ||
sonar.php.coverage.reportPath=.tests/coverage-clover.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
/** | ||
* cakephp-manifest (https://github.com/smartsolutionsitaly/cakephp-manifest) | ||
* Copyright (c) 2019 Smart Solutions S.r.l. (https://smartsolutions.it) | ||
* | ||
* Licensed under The MIT License | ||
* For full copyright and license information, please see the LICENSE | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @category cakephp-plugin | ||
* @package cakephp-manifest | ||
* @author Lucio Benini <dev@smartsolutions.it> | ||
* @copyright 2019 Smart Solutions S.r.l. (https://smartsolutions.it) | ||
* @license https://opensource.org/licenses/mit-license.php MIT License | ||
* @link https://smartsolutions.it Smart Solutions S.r.l. | ||
* @since 1.0.0 | ||
*/ | ||
|
||
namespace SmartSolutionsItaly\CakePHP\Manifest\Controller; | ||
|
||
use SmartSolutionsItaly\CakePHP\Manifest\Manifest; | ||
|
||
/** | ||
* Manifest controller. | ||
* @package SmartSolutionsItaly\CakePHP\Manifest\Controller | ||
* @author Lucio Benini <dev@smartsolutions.it> | ||
* @since 1.0.0 | ||
*/ | ||
class ManifestController extends AppController | ||
{ | ||
/** | ||
* Handles the "index" action. | ||
* @return \Cake\Http\Response | ||
* @since 1.0.0 | ||
*/ | ||
public function index() | ||
{ | ||
$manifest = Manifest::generate(); | ||
|
||
$this->set(compact($manifest)); | ||
$this->set('_serialize', [ | ||
'manifest' | ||
]); | ||
|
||
return $this->getResponse() | ||
->withType('json') | ||
->withStringBody(json_encode($manifest)); | ||
} | ||
|
||
/** | ||
* Generates the "ieconfig.xml" file and returns it. | ||
* @return \Cake\Http\Response | ||
* @since 1.0.0 | ||
*/ | ||
public function ieconfig() | ||
{ | ||
return $this->getResponse() | ||
->withType('xml') | ||
->withStringBody(Manifest::ieconfig()); | ||
} | ||
|
||
/** | ||
* Generates the "site.webmanifest" file and returns it. | ||
* @return \Cake\Http\Response | ||
* @since 1.0.0 | ||
*/ | ||
public function chrome() | ||
{ | ||
return $this->getResponse() | ||
->withType('json') | ||
->withStringBody(json_encode(Manifest::chrome())); | ||
} | ||
} |
Oops, something went wrong.