-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from ComiR/3.x
!!! TASK: Upgrade for Neos 3.0
- Loading branch information
Showing
18 changed files
with
675 additions
and
270 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,64 @@ | ||
<?php | ||
namespace Networkteam\Neos\Shariff; | ||
|
||
/*************************************************************** | ||
* (c) 2015 networkteam GmbH - all rights reserved | ||
***************************************************************/ | ||
|
||
use Heise\Shariff\Backend; | ||
use Neos\Flow\Annotations as Flow; | ||
use Neos\Flow\Http\Request; | ||
use Neos\Flow\Http\Uri; | ||
|
||
class BackendFactory | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
protected static $supportedServices = [ | ||
'AddThis', | ||
'Facebook', | ||
'Flattr', | ||
'GooglePlus', | ||
'LinkedIn', | ||
'Pinterest', | ||
'Reddit', | ||
'StumbleUpon', | ||
'Xing', | ||
]; | ||
|
||
/** | ||
* @Flow\InjectConfiguration(path="options") | ||
* @var array | ||
*/ | ||
protected $options; | ||
|
||
/** | ||
* @Flow\InjectConfiguration(path="http.baseUri", package="Neos.Flow") | ||
* @var string | ||
*/ | ||
protected $baseUri; | ||
|
||
/** | ||
* Auto-detect the domain (if not set) and restrict services to available backends | ||
*/ | ||
public function initializeObject() | ||
{ | ||
if (!isset($this->options['domains'])) { | ||
$request = Request::createFromEnvironment(); | ||
if ((string)$this->baseUri !== '') { | ||
$request->setBaseUri(new Uri($this->baseUri)); | ||
} | ||
$this->options['domains'] = [$request->getBaseUri()->getHost()]; | ||
} | ||
$this->options['services'] = array_intersect($this->options['services'], static::$supportedServices); | ||
} | ||
|
||
/** | ||
* @return Backend | ||
*/ | ||
public function create() | ||
{ | ||
return new Backend($this->options); | ||
} | ||
} |
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,31 @@ | ||
<?php | ||
namespace Networkteam\Neos\Shariff\Controller; | ||
|
||
/*************************************************************** | ||
* (c) 2015 networkteam GmbH - all rights reserved | ||
***************************************************************/ | ||
|
||
use Heise\Shariff\Backend; | ||
use Neos\Flow\Annotations as Flow; | ||
use Neos\Flow\Mvc\Controller\ActionController; | ||
|
||
class ShariffController extends ActionController | ||
{ | ||
/** | ||
* @var Backend | ||
* @Flow\Inject | ||
*/ | ||
protected $shariff; | ||
|
||
/** | ||
* @param string $url | ||
* | ||
* @return string | ||
*/ | ||
public function countsAction($url = null) | ||
{ | ||
$this->response->getHeaders()->set('Content-Type', 'application/json'); | ||
|
||
return json_encode($this->shariff->get($url)); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
Classes/Networkteam/Neos/Shariff/Controller/ShariffController.php
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'Networkteam.Neos.Shariff:Shariff': | ||
superTypes: | ||
'TYPO3.Neos:Content': true | ||
'Neos.Neos:Content': true | ||
ui: | ||
label: 'Social Plugins' | ||
icon: icon-ellipsis-horizontal |
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
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
- | ||
name: 'shariff' | ||
uriPattern: 'counts' | ||
name: 'Networkteam.Neos.Shariff' | ||
uriPattern: 'shariff' | ||
defaults: | ||
'@package': 'Networkteam.Neos.Shariff' | ||
'@controller': 'Shariff' | ||
'@action': 'counts' | ||
'@format': 'json' | ||
appendExceedingArguments: true | ||
appendExceedingArguments: true |
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
Oops, something went wrong.