Skip to content

Commit

Permalink
Merge branch 'release/2.1.0-beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
cundd committed Dec 1, 2015
2 parents 2d6d538 + 6ddc1fc commit dc1c116
Show file tree
Hide file tree
Showing 136 changed files with 14,072 additions and 11,190 deletions.
10 changes: 10 additions & 0 deletions .idea/bashsupport_project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 2 additions & 13 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/dictionaries/COD.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/magicento.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 0 additions & 21 deletions .idea/misc.xml

This file was deleted.

10 changes: 7 additions & 3 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions .idea/rest.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/sqldialects.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 74 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
language: php
php:
- 5.5
- 5.6
- hhvm
- nightly

env:
- TYPO3=master REPO="rest" CLI_HOME=`pwd` DB=mysql UNIT_TESTS=yes FUNCTIONAL_TESTS=yes
- TYPO3=TYPO3_7-3 REPO="rest" CLI_HOME=`pwd` DB=mysql UNIT_TESTS=yes FUNCTIONAL_TESTS=yes
- TYPO3=TYPO3_7-0 REPO="rest" CLI_HOME=`pwd` DB=mysql UNIT_TESTS=yes FUNCTIONAL_TESTS=yes
- TYPO3=TYPO3_6-2 REPO="rest" CLI_HOME=`pwd` DB=mysql UNIT_TESTS=yes FUNCTIONAL_TESTS=yes

matrix:
fast_finish: true
allow_failures:
- php: nightly
- php: hhvm

include:
- php: 5.3
env: TYPO3=TYPO3_6-2 REPO="rest" CLI_HOME=`pwd` DB=mysql UNIT_TESTS=yes FUNCTIONAL_TESTS=yes
- php: 5.4
env: TYPO3=TYPO3_6-2 REPO="rest" CLI_HOME=`pwd` DB=mysql UNIT_TESTS=yes FUNCTIONAL_TESTS=yes

sudo: false

before_script:
# Install build dependencies
- >
echo "Install dependencies";
composer --version;
COMPOSER=cundd_composer.json composer install --verbose;
cd ..;
echo "Get TYPO3 source";
git clone --single-branch --branch $TYPO3 --depth 1 git://git.typo3.org/Packages/TYPO3.CMS.git;
cd TYPO3.CMS;
composer install;
rm -rf typo3/sysext/compatibility6;
mkdir -p ./typo3conf/ext/;
ln -s $CLI_HOME ./typo3conf/ext/$REPO;
cd ..;
mysql -e 'create database typo3_test;';
script:
- >
cd $CLI_HOME;
if [ -d "../TYPO3.CMS" ]; then
cd ../TYPO3.CMS/;
else
echo "TYPO3.CMS folder not found";
exit 1;
fi;
- >
if [[ "$UNIT_TESTS" == "yes" ]]; then
echo;
echo "Running unit tests";
./bin/phpunit --colors -c typo3/sysext/core/Build/UnitTests.xml typo3conf/ext/$REPO/Tests/Unit;
fi
- >
if [[ "$FUNCTIONAL_TESTS" == "yes" ]]; then
echo;
export typo3DatabaseName="typo3";
export typo3DatabaseHost="localhost";
export typo3DatabaseUsername="root";
export typo3DatabasePassword="";
./bin/phpunit --colors -c typo3/sysext/core/Build/FunctionalTests.xml ./typo3conf/ext/$REPO/Tests/Functional;
fi
93 changes: 46 additions & 47 deletions Classes/Cundd/Rest/Access/AbstractAccessController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
*/

/**
* Created by JetBrains PhpStorm.
* User: daniel
Expand All @@ -36,54 +36,53 @@
use Cundd\Rest\Dispatcher;

abstract class AbstractAccessController implements AccessControllerInterface {
/**
* The current request
* @var \Cundd\Rest\Request
*/
protected $request;

/**
* @var \Cundd\Rest\ObjectManager
* @inject
*/
protected $objectManager;
/**
* The current request
*
* @var \Cundd\Rest\Request
*/
protected $request;

/**
* Sets the current request
*
* @param \Cundd\Rest\Request $request
*/
public function setRequest(\Cundd\Rest\Request $request) {
$this->request = $request;
}
/**
* @var \Cundd\Rest\ObjectManager
* @inject
*/
protected $objectManager;

/**
* Returns the current request
*
* @return \Bullet\Request
*/
public function getRequest() {
return $this->request;
}
/**
* Sets the current request
*
* @param \Cundd\Rest\Request $request
*/
public function setRequest(\Cundd\Rest\Request $request) {
$this->request = $request;
}

/**
* Checks if a valid user is logged in
*
* @throws \Exception
* @return AccessControllerInterface::ACCESS
*/
protected function checkAuthentication() {
try {
$isAuthenticated = $this->objectManager->getAuthenticationProvider()->authenticate();
} catch (\Exception $exception) {
Dispatcher::getSharedDispatcher()->logException($exception);
$isAuthenticated = FALSE;
/**
* Returns the current request
*
* @return \Bullet\Request
*/
public function getRequest() {
return $this->request;
}

throw $exception;
}
if ($isAuthenticated === FALSE) {
return self::ACCESS_UNAUTHORIZED;
}
return self::ACCESS_ALLOW;
}
/**
* Checks if a valid user is logged in
*
* @throws \Exception
* @return AccessControllerInterface::ACCESS
*/
protected function checkAuthentication() {
try {
$isAuthenticated = $this->objectManager->getAuthenticationProvider()->authenticate();
} catch (\Exception $exception) {
Dispatcher::getSharedDispatcher()->logException($exception);
throw $exception;
}
if ($isAuthenticated === FALSE) {
return self::ACCESS_UNAUTHORIZED;
}
return self::ACCESS_ALLOW;
}
}
Loading

0 comments on commit dc1c116

Please sign in to comment.