beeframework-svn Mailing List for Bee Framework (Page 5)
Brought to you by:
b_hartmann,
m_plomer
You can subscribe to this list here.
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(12) |
Jun
(5) |
Jul
(6) |
Aug
(25) |
Sep
(25) |
Oct
(6) |
Nov
(29) |
Dec
|
| 2014 |
Jan
(2) |
Feb
(10) |
Mar
(2) |
Apr
(2) |
May
|
Jun
(5) |
Jul
(35) |
Aug
(9) |
Sep
(33) |
Oct
(30) |
Nov
(4) |
Dec
(1) |
| 2015 |
Jan
(3) |
Feb
(13) |
Mar
(13) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <m_p...@us...> - 2014-08-28 08:44:52
|
Revision: 202
http://sourceforge.net/p/beeframework/code/202
Author: m_plomer
Date: 2014-08-28 08:44:41 +0000 (Thu, 28 Aug 2014)
Log Message:
-----------
- JsonService: fixed missing Content-Type header
Modified Paths:
--------------
branches/0.9-dev/framework/Bee/MVC/View/JsonService.php
Modified: branches/0.9-dev/framework/Bee/MVC/View/JsonService.php
===================================================================
--- branches/0.9-dev/framework/Bee/MVC/View/JsonService.php 2014-08-27 21:21:55 UTC (rev 201)
+++ branches/0.9-dev/framework/Bee/MVC/View/JsonService.php 2014-08-28 08:44:41 UTC (rev 202)
@@ -22,8 +22,8 @@
*/
class Bee_MVC_View_JsonService extends Bee_MVC_View_Abstract {
- protected function prepareResponse() {
- }
+// protected function prepareResponse() {
+// }
/**
* @Return void
@@ -32,6 +32,4 @@
protected function renderMergedOutputModel() {
echo json_encode(Bee_MVC_Model::getModelValues());
}
-}
-
-?>
\ No newline at end of file
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-08-27 21:22:03
|
Revision: 201
http://sourceforge.net/p/beeframework/code/201
Author: m_plomer
Date: 2014-08-27 21:21:55 +0000 (Wed, 27 Aug 2014)
Log Message:
-----------
- cleaned up Authentication Providers, fixed wrong exception class names
Modified Paths:
--------------
branches/0.9-dev/framework/Bee/Security/AbstractAuthenticationToken.php
branches/0.9-dev/framework/Bee/Security/IAuthentication.php
branches/0.9-dev/framework/Bee/Security/Provider/AbstractUserDetailsAuthentication.php
branches/0.9-dev/framework/Bee/Security/UsernamePasswordAuthenticationToken.php
Modified: branches/0.9-dev/framework/Bee/Security/AbstractAuthenticationToken.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/AbstractAuthenticationToken.php 2014-08-27 18:10:47 UTC (rev 200)
+++ branches/0.9-dev/framework/Bee/Security/AbstractAuthenticationToken.php 2014-08-27 21:21:55 UTC (rev 201)
@@ -79,6 +79,4 @@
}
return $principal;
}
-
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file
Modified: branches/0.9-dev/framework/Bee/Security/IAuthentication.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/IAuthentication.php 2014-08-27 18:10:47 UTC (rev 200)
+++ branches/0.9-dev/framework/Bee/Security/IAuthentication.php 2014-08-27 21:21:55 UTC (rev 201)
@@ -73,5 +73,9 @@
* @return void
*/
function setAuthenticated($authenticated);
-}
-?>
\ No newline at end of file
+
+ /**
+ * @return string
+ */
+ function getName();
+}
\ No newline at end of file
Modified: branches/0.9-dev/framework/Bee/Security/Provider/AbstractUserDetailsAuthentication.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/Provider/AbstractUserDetailsAuthentication.php 2014-08-27 18:10:47 UTC (rev 200)
+++ branches/0.9-dev/framework/Bee/Security/Provider/AbstractUserDetailsAuthentication.php 2014-08-27 21:21:55 UTC (rev 201)
@@ -81,10 +81,9 @@
public final function authenticate(Bee_Security_IAuthentication $authentication) {
Bee_Utils_Assert::isInstanceOf('Bee_Security_UsernamePasswordAuthenticationToken', $authentication, 'Only UsernamePasswordAuthenticationToken is supported');
- /** @var Bee_Security_UsernamePasswordAuthenticationToken $authentication */
// Determine username
- $username = is_null($authentication->getPrincipal()) ? "NONE_PROVIDED" : $authentication->getPrincipal()->getName();
+ $username = is_null($authentication->getPrincipal()) ? "NONE_PROVIDED" : $authentication->getName();
$cacheWasUsed = true;
$user = null;
Modified: branches/0.9-dev/framework/Bee/Security/UsernamePasswordAuthenticationToken.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/UsernamePasswordAuthenticationToken.php 2014-08-27 18:10:47 UTC (rev 200)
+++ branches/0.9-dev/framework/Bee/Security/UsernamePasswordAuthenticationToken.php 2014-08-27 21:21:55 UTC (rev 201)
@@ -20,42 +20,42 @@
*
*/
class Bee_Security_UsernamePasswordAuthenticationToken extends Bee_Security_AbstractAuthenticationToken {
-
- private $credentials;
- private $principal;
-
- /**
- * Enter description here...
- *
- * @param mixed $principal
- * @param mixed $credentials
- * @param Bee_Security_IGrantedAuthority[] $authorities
- */
- public function __construct($principal, $credentials, $authorities = null) {
- parent::__construct($authorities);
- $this->principal = $principal;
- $this->credentials = $credentials;
- parent::setAuthenticated(!is_null($authorities) ? true : false);
- }
-
+ private $credentials;
+
+ private $principal;
+
+ /**
+ * Enter description here...
+ *
+ * @param mixed $principal
+ * @param mixed $credentials
+ * @param Bee_Security_IGrantedAuthority[] $authorities
+ */
+ public function __construct($principal, $credentials, $authorities = null) {
+ parent::__construct($authorities);
+ $this->principal = $principal;
+ $this->credentials = $credentials;
+
+ parent::setAuthenticated(!is_null($authorities) ? true : false);
+ }
+
public function getPrincipal() {
return $this->principal;
}
-
+
public function getCredentials() {
return $this->credentials;
}
-
+
public function setAuthenticated($authenticated) {
- if ($authenticated) {
- throw new Exception("Cannot set this token to trusted - use constructor containing granted authority[]s instead");
- }
- parent::setAuthenticated(false);
+ if ($authenticated) {
+ throw new Exception("Cannot set this token to trusted - use constructor containing granted authority[]s instead");
+ }
+ parent::setAuthenticated(false);
}
- public function __toString() {
- return 'Bee_Security_UsernamePasswordAuthenticationToken['.$this->principal.']';
- }
-}
-?>
\ No newline at end of file
+ public function __toString() {
+ return 'Bee_Security_UsernamePasswordAuthenticationToken[' . $this->principal . ']';
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-08-27 18:10:56
|
Revision: 200
http://sourceforge.net/p/beeframework/code/200
Author: m_plomer
Date: 2014-08-27 18:10:47 +0000 (Wed, 27 Aug 2014)
Log Message:
-----------
- cleaned up Authentication Providers, fixed wrong exception class names
Modified Paths:
--------------
branches/0.9-dev/framework/Bee/Security/AbstractAuthenticationManager.php
branches/0.9-dev/framework/Bee/Security/IAuthenticationProvider.php
branches/0.9-dev/framework/Bee/Security/Provider/AbstractUserDetailsAuthentication.php
branches/0.9-dev/framework/Bee/Security/Provider/AnonymousAuthentication.php
branches/0.9-dev/framework/Bee/Security/Provider/DaoAuthentication.php
branches/0.9-dev/framework/Bee/Security/Provider/Manager.php
Modified: branches/0.9-dev/framework/Bee/Security/AbstractAuthenticationManager.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/AbstractAuthenticationManager.php 2014-08-27 18:05:48 UTC (rev 199)
+++ branches/0.9-dev/framework/Bee/Security/AbstractAuthenticationManager.php 2014-08-27 18:10:47 UTC (rev 200)
@@ -20,14 +20,14 @@
/**
* Enter description here...
*
- * @var booelan
+ * @var boolean
*/
private $clearExtraInformation;
public final function authenticate(Bee_Security_IAuthentication $authentication) {
try {
return $this->doAuthentication($authentication);
- } catch (Bee_Security_AuthenticationException $e) {
+ } catch (Bee_Security_Exception_Authentication $e) {
$e->setAuthentication($authentication);
if ($this->clearExtraInformation) {
@@ -43,7 +43,7 @@
*
* @param Bee_Security_IAuthentication $authentication
*
- * @throws Bee_Security_AuthenticationException
+ * @throws Bee_Security_Exception_Authentication
*/
protected abstract function doAuthentication(Bee_Security_IAuthentication $authentication);
@@ -60,5 +60,4 @@
$this->clearExtraInformation = $clearExtraInformation;
}
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file
Modified: branches/0.9-dev/framework/Bee/Security/IAuthenticationProvider.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/IAuthenticationProvider.php 2014-08-27 18:05:48 UTC (rev 199)
+++ branches/0.9-dev/framework/Bee/Security/IAuthenticationProvider.php 2014-08-27 18:10:47 UTC (rev 200)
@@ -31,7 +31,7 @@
* <code>Authentication</code> object. In such a case, the next <code>AuthenticationProvider</code> that
* supports the presented <code>Authentication</code> class will be tried.
*
- * @throws Bee_Security_AuthenticationException if authentication fails.
+ * @throws Bee_Security_Exception_Authentication if authentication fails.
*/
function authenticate(Bee_Security_IAuthentication $authentication);
@@ -43,4 +43,3 @@
*/
function supports($authenticationClass);
}
-?>
\ No newline at end of file
Modified: branches/0.9-dev/framework/Bee/Security/Provider/AbstractUserDetailsAuthentication.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/Provider/AbstractUserDetailsAuthentication.php 2014-08-27 18:05:48 UTC (rev 199)
+++ branches/0.9-dev/framework/Bee/Security/Provider/AbstractUserDetailsAuthentication.php 2014-08-27 18:10:47 UTC (rev 200)
@@ -41,7 +41,7 @@
* @param Bee_Security_IUserDetails $userDetails
* @param Bee_Security_UsernamePasswordAuthenticationToken $authentication
*
- * @throws Bee_Security_AuthenticationException
+ * @throws Bee_Security_Exception_Authentication
*/
protected abstract function additionalAuthenticationChecks(Bee_Security_IUserDetails $userDetails,
Bee_Security_UsernamePasswordAuthenticationToken $authentication);
@@ -67,18 +67,24 @@
}
}
- /**
- * Enter description here...
- *
- * @param Bee_Security_IAuthentication $authentication
- * @return Bee_Security_IAuthentication
- */
+ /**
+ * Enter description here...
+ *
+ * @param Bee_Security_IAuthentication $authentication
+ * @throws Bee_Security_Exception_AccountStatus
+ * @throws Bee_Security_Exception_Authentication
+ * @throws Bee_Security_Exception_BadCredentials
+ * @throws Bee_Security_Exception_UsernameNotFound
+ * @throws Exception
+ * @return Bee_Security_IAuthentication
+ */
public final function authenticate(Bee_Security_IAuthentication $authentication) {
Bee_Utils_Assert::isInstanceOf('Bee_Security_UsernamePasswordAuthenticationToken', $authentication, 'Only UsernamePasswordAuthenticationToken is supported');
+ /** @var Bee_Security_UsernamePasswordAuthenticationToken $authentication */
// Determine username
- $username = is_null($authentication->getPrincipal()) ? "NONE_PROVIDED" : $authentication->getName();
+ $username = is_null($authentication->getPrincipal()) ? "NONE_PROVIDED" : $authentication->getPrincipal()->getName();
$cacheWasUsed = true;
$user = null;
@@ -109,7 +115,7 @@
if ($cacheWasUsed) {
// There was a problem, so try again after checking
// we're using latest data (ie not from the cache)
- $cacheWasUsed = false;
+// $cacheWasUsed = false;
$user = $this->retrieveUser($username, $authentication);
$this->additionalAuthenticationChecks($user, $authentication);
} else {
@@ -138,12 +144,12 @@
* <p>Subclasses will usually store the original credentials the user supplied (not salted or encoded
* passwords) in the returned <code>Bee_Security_IAuthentication</code> object.</p>
*
- * @param principal that should be the principal in the returned object (defined by the {@link
+ * @param mixed $principal that should be the principal in the returned object (defined by the {@link
* #isForcePrincipalAsString()} method)
- * @param authentication that was presented to the provider for validation
- * @param user that was loaded by the implementation
+ * @param Bee_Security_IAuthentication $authentication that was presented to the provider for validation
+ * @param Bee_Security_IUserDetails $user that was loaded by the implementation
*
- * @return the successful authentication token
+ * @return Bee_Security_UsernamePasswordAuthenticationToken the successful authentication token
*/
protected function createSuccessAuthentication($principal, Bee_Security_IAuthentication $authentication, Bee_Security_IUserDetails $user) {
// Ensure we return the original credentials the user supplied,
@@ -231,6 +237,4 @@
public function setForcePrincipalAsString($forcePrincipalAsString) {
$this->forcePrincipalAsString = $forcePrincipalAsString;
}
-
}
-?>
\ No newline at end of file
Modified: branches/0.9-dev/framework/Bee/Security/Provider/AnonymousAuthentication.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/Provider/AnonymousAuthentication.php 2014-08-27 18:05:48 UTC (rev 199)
+++ branches/0.9-dev/framework/Bee/Security/Provider/AnonymousAuthentication.php 2014-08-27 18:10:47 UTC (rev 200)
@@ -22,7 +22,6 @@
* Time: 9:10:57 PM
* To change this template use File | Settings | File Templates.
*/
-
class Bee_Security_Provider_AnonymousAuthentication implements Bee_Security_IAuthenticationProvider {
private $key;
@@ -33,6 +32,7 @@
if (!$this->supports($authentication)) {
return null;
}
+ /** @var Bee_Security_AnonymousAuthenticationToken $authentication */
if (hash('md5', $this->key) != $authentication->getKeyHash()) {
throw new Bee_Security_Exception_BadCredentials('The presented AnonymousAuthenticationToken does not contain the expected key');
@@ -53,4 +53,3 @@
return Bee_Utils_Types::isAssignable($authenticationClass, 'Bee_Security_AnonymousAuthenticationToken');
}
}
-?>
\ No newline at end of file
Modified: branches/0.9-dev/framework/Bee/Security/Provider/DaoAuthentication.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/Provider/DaoAuthentication.php 2014-08-27 18:05:48 UTC (rev 199)
+++ branches/0.9-dev/framework/Bee/Security/Provider/DaoAuthentication.php 2014-08-27 18:10:47 UTC (rev 200)
@@ -137,4 +137,3 @@
$this->userDetailsService = $userDetailsService;
}
}
-?>
\ No newline at end of file
Modified: branches/0.9-dev/framework/Bee/Security/Provider/Manager.php
===================================================================
--- branches/0.9-dev/framework/Bee/Security/Provider/Manager.php 2014-08-27 18:05:48 UTC (rev 199)
+++ branches/0.9-dev/framework/Bee/Security/Provider/Manager.php 2014-08-27 18:10:47 UTC (rev 200)
@@ -28,7 +28,7 @@
/**
* Enter description here...
*
- * @var array
+ * @var Bee_Security_IAuthenticationProvider[]
*/
private $providers = array();
@@ -128,5 +128,4 @@
public final function setSessionController(Bee_Security_Concurrent_ISessionController $sessionController) {
$this->sessionController = $sessionController;
}
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-08-27 18:05:56
|
Revision: 199
http://sourceforge.net/p/beeframework/code/199
Author: m_plomer
Date: 2014-08-27 18:05:48 +0000 (Wed, 27 Aug 2014)
Log Message:
-----------
Removed branches/0.9_dev
Removed Paths:
-------------
branches/0.9_dev/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-08-27 18:04:21
|
Revision: 198
http://sourceforge.net/p/beeframework/code/198
Author: m_plomer
Date: 2014-08-27 18:04:19 +0000 (Wed, 27 Aug 2014)
Log Message:
-----------
- branched off 0.9 legacy development
Added Paths:
-----------
branches/0.9-dev/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-08-27 17:07:01
|
Revision: 197
http://sourceforge.net/p/beeframework/code/197
Author: m_plomer
Date: 2014-08-27 17:06:51 +0000 (Wed, 27 Aug 2014)
Log Message:
-----------
branched off 0.9 development
Added Paths:
-----------
branches/
branches/0.9_dev/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-27 12:44:50
|
Revision: 196
http://sourceforge.net/p/beeframework/code/196
Author: m_plomer
Date: 2014-07-27 12:44:42 +0000 (Sun, 27 Jul 2014)
Log Message:
-----------
- minor refactorings, especially in Doctrine 2 persistence APIs
Modified Paths:
--------------
trunk/framework/Bee/Persistence/Doctrine/DaoBase.php
trunk/framework/Bee/Persistence/Doctrine/ManagerAugmenter.php
trunk/framework/Bee/Persistence/Doctrine2/AbstractGenericDao.php
trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/Inject.php
trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php
trunk/framework/Bee/Persistence/Doctrine2/ConnectionAugmenter.php
trunk/framework/Bee/Persistence/Doctrine2/DaoBase.php
trunk/framework/Bee/Persistence/Doctrine2/DaoUtils.php
trunk/framework/Bee/Persistence/Doctrine2/EntityManagerHolder.php
trunk/framework/Bee/Persistence/Doctrine2/Log4PHPLogger.php
trunk/framework/Bee/Persistence/Doctrine2/Types/EnumType.php
trunk/framework/Bee/Persistence/Exception/DataAccess.php
trunk/framework/Bee/Persistence/IOrderAndLimitHolder.php
trunk/framework/Bee/Persistence/IRestrictionHolder.php
Modified: trunk/framework/Bee/Persistence/Doctrine/DaoBase.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine/DaoBase.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/Doctrine/DaoBase.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2008-2010 the original author or authors.
+ * Copyright 2008-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Modified: trunk/framework/Bee/Persistence/Doctrine/ManagerAugmenter.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine/ManagerAugmenter.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/Doctrine/ManagerAugmenter.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2008-2010 the original author or authors.
+ * Copyright 2008-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Modified: trunk/framework/Bee/Persistence/Doctrine2/AbstractGenericDao.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/AbstractGenericDao.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/Doctrine2/AbstractGenericDao.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,7 +1,7 @@
<?php
namespace Bee\Persistence\Doctrine2;
/*
- * Copyright 2008-2010 the original author or authors.
+ * Copyright 2008-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Modified: trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/Inject.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/Inject.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/Inject.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,6 +1,20 @@
<?php
namespace Bee\Persistence\Doctrine2\BeanInjection;
-
+/*
+ * Copyright 2008-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
use Doctrine\Common\Annotations\Annotation;
/**
Modified: trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,6 +1,20 @@
<?php
namespace Bee\Persistence\Doctrine2\BeanInjection;
-
+/*
+ * Copyright 2008-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
use Bee_IContext;
use Doctrine\Common\Annotations\Reader;
use Doctrine\Common\EventSubscriber;
Modified: trunk/framework/Bee/Persistence/Doctrine2/ConnectionAugmenter.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/ConnectionAugmenter.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/Doctrine2/ConnectionAugmenter.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,5 +1,20 @@
<?php
namespace Bee\Persistence\Doctrine2;
+/*
+ * Copyright 2008-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
use Doctrine\Common\EventSubscriber;
use Doctrine\DBAL\Event\ConnectionEventArgs;
use Doctrine\DBAL\Events;
Modified: trunk/framework/Bee/Persistence/Doctrine2/DaoBase.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/DaoBase.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/Doctrine2/DaoBase.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,12 +1,26 @@
<?php
namespace Bee\Persistence\Doctrine2;
+/*
+ * Copyright 2008-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
use Bee_Persistence_IOrderAndLimitHolder;
use Bee_Persistence_IRestrictionHolder;
use Bee_Utils_Strings;
use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder;
use Exception;
-use Logger;
/**
* User: mp
@@ -16,21 +30,6 @@
class DaoBase extends EntityManagerHolder {
/**
- * @var Logger
- */
- protected $log;
-
- /**
- * @return Logger
- */
- protected function getLog() {
- if (!$this->log) {
- $this->log = Logger::getLogger(get_class($this));
- }
- return $this->log;
- }
-
- /**
* @param QueryBuilder $queryBuilder
* @param Bee_Persistence_IRestrictionHolder $restrictionHolder
* @param Bee_Persistence_IOrderAndLimitHolder $orderAndLimitHolder
Modified: trunk/framework/Bee/Persistence/Doctrine2/DaoUtils.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/DaoUtils.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/Doctrine2/DaoUtils.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,7 +1,7 @@
<?php
namespace Bee\Persistence\Doctrine2;
/*
- * Copyright 2008-2010 the original author or authors.
+ * Copyright 2008-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Modified: trunk/framework/Bee/Persistence/Doctrine2/EntityManagerHolder.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/EntityManagerHolder.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/Doctrine2/EntityManagerHolder.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,7 +1,7 @@
<?php
namespace Bee\Persistence\Doctrine2;
/*
- * Copyright 2008-2010 the original author or authors.
+ * Copyright 2008-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
* limitations under the License.
*/
use \Doctrine\ORM\EntityManager;
+use Logger;
/**
* User: mp
@@ -26,6 +27,21 @@
class EntityManagerHolder {
/**
+ * @var Logger
+ */
+ protected $log;
+
+ /**
+ * @return Logger
+ */
+ public function getLog() {
+ if (!$this->log) {
+ $this->log = Logger::getLogger(get_class($this));
+ }
+ return $this->log;
+ }
+
+ /**
* @var EntityManager
*/
private $entityManager;
Modified: trunk/framework/Bee/Persistence/Doctrine2/Log4PHPLogger.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/Log4PHPLogger.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/Doctrine2/Log4PHPLogger.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,8 +1,7 @@
<?php
namespace Bee\Persistence\Doctrine2;
-
/*
- * Copyright 2008-2010 the original author or authors.
+ * Copyright 2008-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Modified: trunk/framework/Bee/Persistence/Doctrine2/Types/EnumType.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/Types/EnumType.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/Doctrine2/Types/EnumType.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,5 +1,20 @@
<?php
namespace Bee\Persistence\Doctrine2\Types;
+/*
+ * Copyright 2008-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Type;
Modified: trunk/framework/Bee/Persistence/Exception/DataAccess.php
===================================================================
--- trunk/framework/Bee/Persistence/Exception/DataAccess.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/Exception/DataAccess.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2008-2010 the original author or authors.
+ * Copyright 2008-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,5 +20,3 @@
parent::__construct($message, $cause);
}
}
-
-?>
\ No newline at end of file
Modified: trunk/framework/Bee/Persistence/IOrderAndLimitHolder.php
===================================================================
--- trunk/framework/Bee/Persistence/IOrderAndLimitHolder.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/IOrderAndLimitHolder.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,4 +1,19 @@
<?php
+/*
+ * Copyright 2008-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
interface Bee_Persistence_IOrderAndLimitHolder {
@@ -33,5 +48,3 @@
public function setCurrentPage($currentPage);
}
-
-?>
\ No newline at end of file
Modified: trunk/framework/Bee/Persistence/IRestrictionHolder.php
===================================================================
--- trunk/framework/Bee/Persistence/IRestrictionHolder.php 2014-07-27 11:59:43 UTC (rev 195)
+++ trunk/framework/Bee/Persistence/IRestrictionHolder.php 2014-07-27 12:44:42 UTC (rev 196)
@@ -1,4 +1,19 @@
<?php
+/*
+ * Copyright 2008-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
interface Bee_Persistence_IRestrictionHolder {
@@ -18,5 +33,3 @@
public function getFieldRestrictions();
}
-
-?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-27 11:59:48
|
Revision: 195
http://sourceforge.net/p/beeframework/code/195
Author: m_plomer
Date: 2014-07-27 11:59:43 +0000 (Sun, 27 Jul 2014)
Log Message:
-----------
- MVC: fixed bug in default method invocation of AnnotationBasedInvocator
Modified Paths:
--------------
trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/AnnotationBasedInvocator.php
Modified: trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/AnnotationBasedInvocator.php
===================================================================
--- trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/AnnotationBasedInvocator.php 2014-07-26 16:33:43 UTC (rev 194)
+++ trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/AnnotationBasedInvocator.php 2014-07-27 11:59:43 UTC (rev 195)
@@ -64,7 +64,7 @@
}
if (!$this->defaultMethodInvocation) {
- $methodMeta = RegexMappingInvocationResolver::getCachedMethodMetadata(new \ReflectionMethod($delegateClassName, $ctrl->getDefaultMethodName()));
+ $methodMeta = RegexMappingInvocationResolver::getCachedMethodMetadata(new \ReflectionMethod($delegateClassName, $ctrl->getDefaultMethodName()), $this->getPropertyEditorRegistry());
$this->defaultMethodInvocation = new MethodInvocation($methodMeta);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-26 16:33:53
|
Revision: 194
http://sourceforge.net/p/beeframework/code/194
Author: m_plomer
Date: 2014-07-26 16:33:43 +0000 (Sat, 26 Jul 2014)
Log Message:
-----------
intermediate tag
Added Paths:
-----------
tags/0.10.0-beta/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-26 16:32:13
|
Revision: 193
http://sourceforge.net/p/beeframework/code/193
Author: m_plomer
Date: 2014-07-26 16:32:06 +0000 (Sat, 26 Jul 2014)
Log Message:
-----------
Removed tags/0.2.2-beta
Removed Paths:
-------------
tags/0.2.2-beta/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-26 16:21:58
|
Revision: 192
http://sourceforge.net/p/beeframework/code/192
Author: m_plomer
Date: 2014-07-26 16:21:56 +0000 (Sat, 26 Jul 2014)
Log Message:
-----------
intermediate verion tag
Added Paths:
-----------
tags/0.2.2-beta/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-25 09:28:43
|
Revision: 191
http://sourceforge.net/p/beeframework/code/191
Author: m_plomer
Date: 2014-07-25 09:28:38 +0000 (Fri, 25 Jul 2014)
Log Message:
-----------
- Beans: introduced Base64StringPropertyEditor
Modified Paths:
--------------
trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/HandlerMethodMetadata.php
Modified: trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/HandlerMethodMetadata.php
===================================================================
--- trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/HandlerMethodMetadata.php 2014-07-25 09:08:52 UTC (rev 190)
+++ trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/HandlerMethodMetadata.php 2014-07-25 09:28:38 UTC (rev 191)
@@ -121,7 +121,7 @@
$value = $namespace . '\\' . $value;
}
// test if property editor exists
- $propertyEditorRegistry->getEditor($value);
+// $propertyEditorRegistry->getEditor($value);
});
return array_combine($matches[2], $types);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-25 09:09:00
|
Revision: 190
http://sourceforge.net/p/beeframework/code/190
Author: m_plomer
Date: 2014-07-25 09:08:52 +0000 (Fri, 25 Jul 2014)
Log Message:
-----------
- Beans: introduced Base64StringPropertyEditor
Modified Paths:
--------------
trunk/framework/Bee/Beans/PropertyEditor/PropertyEditorRegistry.php
trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/AnnotationBasedInvocator.php
trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/HandlerMethodMetadata.php
trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php
Added Paths:
-----------
trunk/framework/Bee/Beans/PropertyEditor/Base64StringPropertyEditor.php
Added: trunk/framework/Bee/Beans/PropertyEditor/Base64StringPropertyEditor.php
===================================================================
--- trunk/framework/Bee/Beans/PropertyEditor/Base64StringPropertyEditor.php (rev 0)
+++ trunk/framework/Bee/Beans/PropertyEditor/Base64StringPropertyEditor.php 2014-07-25 09:08:52 UTC (rev 190)
@@ -0,0 +1,45 @@
+<?php
+namespace Bee\Beans\PropertyEditor;
+/*
+ * Copyright 2008-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+use Bee\Beans\IPropertyEditor;
+
+/**
+ * Class Base64StringPropertyEditor
+ * @package Bee\Beans\PropertyEditor
+ */
+class Base64StringPropertyEditor implements IPropertyEditor {
+
+ /**
+ * Enter description here...
+ *
+ * @param mixed $value
+ * @return String
+ */
+ public function toString($value) {
+ return base64_encode($value);
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param String $value
+ * @return mixed
+ */
+ public function fromString($value) {
+ return base64_decode($value);
+ }
+}
\ No newline at end of file
Modified: trunk/framework/Bee/Beans/PropertyEditor/PropertyEditorRegistry.php
===================================================================
--- trunk/framework/Bee/Beans/PropertyEditor/PropertyEditorRegistry.php 2014-07-25 08:39:10 UTC (rev 189)
+++ trunk/framework/Bee/Beans/PropertyEditor/PropertyEditorRegistry.php 2014-07-25 09:08:52 UTC (rev 190)
@@ -134,5 +134,6 @@
PropertyEditorRegistry::registerEditor(ITypeDefinitions::IPv6, new GenericPropertyEditor(FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
PropertyEditorRegistry::registerEditor(ITypeDefinitions::UNIX_TIMESTAMP, new UnixTimestampPropertyEditor());
PropertyEditorRegistry::registerEditor(ITypeDefinitions::STRING, new StringPropertyEditor());
+PropertyEditorRegistry::registerEditor(ITypeDefinitions::BASE64, new Base64StringPropertyEditor());
PropertyEditorRegistry::registerEditor(ConstantPropertyEditor::TYPE_STRING, new ConstantPropertyEditor());
Modified: trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/AnnotationBasedInvocator.php
===================================================================
--- trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/AnnotationBasedInvocator.php 2014-07-25 08:39:10 UTC (rev 189)
+++ trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/AnnotationBasedInvocator.php 2014-07-25 09:08:52 UTC (rev 190)
@@ -122,7 +122,7 @@
* @return mixed
*/
protected function createDelegate(array $mapping) {
- return new RegexMappingInvocationResolver($mapping);
+ return new RegexMappingInvocationResolver($mapping, $this->getPropertyEditorRegistry());
}
/**
@@ -131,4 +131,11 @@
public function setBeeContext(Bee_IContext $context) {
$this->propertyEditorRegistry = new PropertyEditorRegistry($context);
}
+
+ /**
+ * @return PropertyEditorRegistry
+ */
+ public function getPropertyEditorRegistry() {
+ return $this->propertyEditorRegistry;
+ }
}
\ No newline at end of file
Modified: trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/HandlerMethodMetadata.php
===================================================================
--- trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/HandlerMethodMetadata.php 2014-07-25 08:39:10 UTC (rev 189)
+++ trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/HandlerMethodMetadata.php 2014-07-25 09:08:52 UTC (rev 190)
@@ -2,8 +2,8 @@
namespace Bee\MVC\Controller\Multiaction\HandlerMethodInvocator;
+use Bee\Beans\PropertyEditor\PropertyEditorRegistry;
use Bee\Utils\ITypeDefinitions;
-use Bee_Utils_Types;
use ReflectionClass;
use ReflectionMethod;
@@ -42,10 +42,14 @@
*/
private $parameterPositions;
- function __construct(ReflectionMethod $method) {
+ /**
+ * @param ReflectionMethod $method
+ * @param PropertyEditorRegistry $propertyEditorRegistry
+ */
+ function __construct(ReflectionMethod $method, PropertyEditorRegistry $propertyEditorRegistry) {
$this->method = $method;
- $typeNameMap = self::getDocBlockTypeHints($method);
+ $typeNameMap = self::getDocBlockTypeHints($method, $propertyEditorRegistry);
$this->typeMap = array();
$this->requestParamPos = array();
$this->parameterPositions = array();
@@ -101,20 +105,23 @@
/**
* @param ReflectionMethod $method
+ * @param PropertyEditorRegistry $propertyEditorRegistry
* @return array
*/
- protected static function getDocBlockTypeHints(ReflectionMethod $method) {
+ protected static function getDocBlockTypeHints(ReflectionMethod $method, PropertyEditorRegistry $propertyEditorRegistry) {
$importMap = self::getImportMap($method->getDeclaringClass());
$namespace = $method->getDeclaringClass()->getNamespaceName();
$matches = array();
preg_match_all(self::DOCBLOCK_PARAM_TYPE_HINT_MATCH, $method->getDocComment(), $matches);
$types = $matches[1];
- array_walk($types, function (&$value) use ($importMap, $namespace) {
+ array_walk($types, function (&$value) use ($importMap, $namespace, $propertyEditorRegistry) {
if (array_key_exists($value, $importMap)) {
$value = $importMap[$value];
- } else if(!Bee_Utils_Types::isPrimitive($value) && !class_exists($value) && !interface_exists($value)) {
+ } else if(!$propertyEditorRegistry->editorExists($value)) {
$value = $namespace . '\\' . $value;
}
+ // test if property editor exists
+ $propertyEditorRegistry->getEditor($value);
});
return array_combine($matches[2], $types);
}
Modified: trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php
===================================================================
--- trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php 2014-07-25 08:39:10 UTC (rev 189)
+++ trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php 2014-07-25 09:08:52 UTC (rev 190)
@@ -15,6 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+use Bee\Beans\PropertyEditor\PropertyEditorRegistry;
use Bee\Utils\AntPathToRegexTransformer;
use Bee_MVC_IHttpRequest;
use Logger;
@@ -55,10 +56,11 @@
/**
* @param array|ReflectionMethod[] $mapping
+ * @param PropertyEditorRegistry $propertyEditorRegistry
*/
- public function __construct(array $mapping) {
+ public function __construct(array $mapping, PropertyEditorRegistry $propertyEditorRegistry) {
foreach ($mapping as $antPathPattern => $method) {
- $methodMeta = self::getCachedMethodMetadata($method);
+ $methodMeta = self::getCachedMethodMetadata($method, $propertyEditorRegistry);
$urlParameterPositions = array();
$regex = AntPathToRegexTransformer::getRegexForParametrizedPattern($antPathPattern, $methodMeta->getTypeMap(), $urlParameterPositions);
@@ -160,10 +162,10 @@
return null;
}
- public static function getCachedMethodMetadata(ReflectionMethod $method) {
+ public static function getCachedMethodMetadata(ReflectionMethod $method, PropertyEditorRegistry $propertyEditorRegistry) {
$methodFullName = $method->getDeclaringClass()->getName() . '::' . $method->getName();
if (!array_key_exists($methodFullName, self::$methodMetadataMap)) {
- self::$methodMetadataMap[$methodFullName] = new HandlerMethodMetadata($method);
+ self::$methodMetadataMap[$methodFullName] = new HandlerMethodMetadata($method, $propertyEditorRegistry);
}
return self::$methodMetadataMap[$methodFullName];
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-25 08:39:13
|
Revision: 189
http://sourceforge.net/p/beeframework/code/189
Author: m_plomer
Date: 2014-07-25 08:39:10 +0000 (Fri, 25 Jul 2014)
Log Message:
-----------
- Beans: introduced Base64StringPropertyEditor
Modified Paths:
--------------
trunk/framework/Bee/Utils/ITypeDefinitions.php
Modified: trunk/framework/Bee/Utils/ITypeDefinitions.php
===================================================================
--- trunk/framework/Bee/Utils/ITypeDefinitions.php 2014-07-24 09:54:23 UTC (rev 188)
+++ trunk/framework/Bee/Utils/ITypeDefinitions.php 2014-07-25 08:39:10 UTC (rev 189)
@@ -43,6 +43,7 @@
const IPv4 = 'ipv4';
const IPv6 = 'ipv6';
const REGEX = 'regex';
+ const BASE64 = 'base64';
const UNIX_TIMESTAMP = 'unix_timestamp';
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-24 09:54:25
|
Revision: 188
http://sourceforge.net/p/beeframework/code/188
Author: m_plomer
Date: 2014-07-24 09:54:23 +0000 (Thu, 24 Jul 2014)
Log Message:
-----------
- Doctrine2: introduced transactional() convenience wrapper
Modified Paths:
--------------
trunk/framework/Bee/Persistence/Doctrine2/EntityManagerHolder.php
Modified: trunk/framework/Bee/Persistence/Doctrine2/EntityManagerHolder.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/EntityManagerHolder.php 2014-07-24 09:27:29 UTC (rev 187)
+++ trunk/framework/Bee/Persistence/Doctrine2/EntityManagerHolder.php 2014-07-24 09:54:23 UTC (rev 188)
@@ -46,10 +46,10 @@
/**
* Convenience wrapper around EntityManager::transactional()
- * @param callable $callback
+ * @param $callback
* @return mixed
*/
- public function transactional(callable $callback) {
+ public function transactional($callback) {
$that = $this;
return $this->getEntityManager()->transactional(function (EntityManager $em) use ($callback, $that) {
return $callback($that);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-24 09:27:32
|
Revision: 187
http://sourceforge.net/p/beeframework/code/187
Author: m_plomer
Date: 2014-07-24 09:27:29 +0000 (Thu, 24 Jul 2014)
Log Message:
-----------
- Doctrine2: introduced transactional() convenience wrapper
Modified Paths:
--------------
trunk/framework/Bee/Persistence/Doctrine2/DaoBase.php
trunk/framework/Bee/Persistence/Doctrine2/EntityManagerHolder.php
Modified: trunk/framework/Bee/Persistence/Doctrine2/DaoBase.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/DaoBase.php 2014-07-23 18:12:43 UTC (rev 186)
+++ trunk/framework/Bee/Persistence/Doctrine2/DaoBase.php 2014-07-24 09:27:29 UTC (rev 187)
@@ -133,7 +133,7 @@
* @throws Exception
* @return mixed
*
- * @deprecated use EntityManager::transactional() instead
+ * @deprecated use EntityManagerHolder::transactional() instead
*/
public function doInTransaction($func) {
$this->getLog()->info('Begin transaction.');
Modified: trunk/framework/Bee/Persistence/Doctrine2/EntityManagerHolder.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/EntityManagerHolder.php 2014-07-23 18:12:43 UTC (rev 186)
+++ trunk/framework/Bee/Persistence/Doctrine2/EntityManagerHolder.php 2014-07-24 09:27:29 UTC (rev 187)
@@ -43,4 +43,16 @@
public function setEntityManager(EntityManager $entityManager) {
$this->entityManager = $entityManager;
}
+
+ /**
+ * Convenience wrapper around EntityManager::transactional()
+ * @param callable $callback
+ * @return mixed
+ */
+ public function transactional(callable $callback) {
+ $that = $this;
+ return $this->getEntityManager()->transactional(function (EntityManager $em) use ($callback, $that) {
+ return $callback($that);
+ });
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-23 18:12:51
|
Revision: 186
http://sourceforge.net/p/beeframework/code/186
Author: m_plomer
Date: 2014-07-23 18:12:43 +0000 (Wed, 23 Jul 2014)
Log Message:
-----------
- MVC: fixed type hint detection for types from same namespace as controller delegate
- MVC: (temporarily) disabled caching of MethodInvocators in production mode due to non-serializability of ReflectionClass instances (TODO!!)
Modified Paths:
--------------
trunk/framework/Bee/MVC/Controller/Multiaction/AbstractAnnotationBasedResolver.php
trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/HandlerMethodMetadata.php
trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/Inject.php
Modified: trunk/framework/Bee/MVC/Controller/Multiaction/AbstractAnnotationBasedResolver.php
===================================================================
--- trunk/framework/Bee/MVC/Controller/Multiaction/AbstractAnnotationBasedResolver.php 2014-07-23 12:37:06 UTC (rev 185)
+++ trunk/framework/Bee/MVC/Controller/Multiaction/AbstractAnnotationBasedResolver.php 2014-07-23 18:12:43 UTC (rev 186)
@@ -102,13 +102,13 @@
if (!$this->delegates) {
$delegateClassName = get_class($this->getController()->getDelegate());
- if (Bee_Framework::getProductionMode()) {
- try {
- $this->delegates = Bee_Cache_Manager::retrieve(self::CACHE_KEY_PREFIX . $delegateClassName);
- } catch (Exception $e) {
- $this->getLog()->debug('No cached delegate resolvers for delegate "' . $delegateClassName . '" found, annotation parsing required');
- }
- }
+// if (Bee_Framework::getProductionMode()) {
+// try {
+// $this->delegates = Bee_Cache_Manager::retrieve(self::CACHE_KEY_PREFIX . $delegateClassName);
+// } catch (Exception $e) {
+// $this->getLog()->debug('No cached delegate resolvers for delegate "' . $delegateClassName . '" found, annotation parsing required');
+// }
+// }
if (!$this->delegates) {
$classReflector = new ReflectionAnnotatedClass($delegateClassName);
@@ -141,9 +141,9 @@
}
}
- if (Bee_Framework::getProductionMode()) {
- Bee_Cache_Manager::store(self::CACHE_KEY_PREFIX . $delegateClassName, $this->delegates);
- }
+// if (Bee_Framework::getProductionMode()) {
+// Bee_Cache_Manager::store(self::CACHE_KEY_PREFIX . $delegateClassName, $this->delegates);
+// }
}
}
Modified: trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/HandlerMethodMetadata.php
===================================================================
--- trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/HandlerMethodMetadata.php 2014-07-23 12:37:06 UTC (rev 185)
+++ trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/HandlerMethodMetadata.php 2014-07-23 18:12:43 UTC (rev 186)
@@ -3,6 +3,7 @@
namespace Bee\MVC\Controller\Multiaction\HandlerMethodInvocator;
use Bee\Utils\ITypeDefinitions;
+use Bee_Utils_Types;
use ReflectionClass;
use ReflectionMethod;
@@ -104,12 +105,15 @@
*/
protected static function getDocBlockTypeHints(ReflectionMethod $method) {
$importMap = self::getImportMap($method->getDeclaringClass());
+ $namespace = $method->getDeclaringClass()->getNamespaceName();
$matches = array();
preg_match_all(self::DOCBLOCK_PARAM_TYPE_HINT_MATCH, $method->getDocComment(), $matches);
$types = $matches[1];
- array_walk($types, function (&$value) use ($importMap) {
+ array_walk($types, function (&$value) use ($importMap, $namespace) {
if (array_key_exists($value, $importMap)) {
$value = $importMap[$value];
+ } else if(!Bee_Utils_Types::isPrimitive($value) && !class_exists($value) && !interface_exists($value)) {
+ $value = $namespace . '\\' . $value;
}
});
return array_combine($matches[2], $types);
Modified: trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/Inject.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/Inject.php 2014-07-23 12:37:06 UTC (rev 185)
+++ trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/Inject.php 2014-07-23 18:12:43 UTC (rev 186)
@@ -1,7 +1,7 @@
<?php
-
namespace Bee\Persistence\Doctrine2\BeanInjection;
+use Doctrine\Common\Annotations\Annotation;
/**
* Class Inject
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-23 12:37:14
|
Revision: 185
http://sourceforge.net/p/beeframework/code/185
Author: m_plomer
Date: 2014-07-23 12:37:06 +0000 (Wed, 23 Jul 2014)
Log Message:
-----------
- Doctrine2: entity injection fixed
Modified Paths:
--------------
trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php
Modified: trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php 2014-07-20 19:55:34 UTC (rev 184)
+++ trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php 2014-07-23 12:37:06 UTC (rev 185)
@@ -15,6 +15,7 @@
* Class InjectionEventListener
*/
class InjectionEventListener implements EventSubscriber, \Bee_Context_Config_IContextAware {
+
/**
* @var Reader
*/
@@ -29,24 +30,21 @@
* @param LifecycleEventArgs $eventArgs
*/
public function postLoad(LifecycleEventArgs $eventArgs) {
-
$entity = $eventArgs->getEntity();
$reflClass = new ReflectionClass($entity);
foreach($reflClass->getProperties() as $prop) {
- foreach ($this->reader->getPropertyAnnotations($prop) AS $annot) {
- if ($annot instanceof Inject) {
- $this->injectIntoProperty($entity, $prop, $annot);
- }
+ $annot = $this->reader->getPropertyAnnotation($prop, 'Bee\Persistence\Doctrine2\BeanInjection\Inject');
+ if ($annot instanceof Inject) {
+ $this->injectIntoProperty($entity, $prop, $annot);
}
}
foreach($reflClass->getMethods(ReflectionProperty::IS_PUBLIC) as $method) {
if($method->getNumberOfRequiredParameters() == 1) {
- foreach ($this->reader->getMethodAnnotations($method) AS $annot) {
- if ($annot instanceof Inject) {
- $this->injectIntoSetter($entity, $method, $annot);
- }
+ $annot = $this->reader->getMethodAnnotation($method, 'Bee\Persistence\Doctrine2\BeanInjection\Inject');
+ if ($annot instanceof Inject) {
+ $this->injectIntoSetter($entity, $method, $annot);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-20 19:55:46
|
Revision: 184
http://sourceforge.net/p/beeframework/code/184
Author: m_plomer
Date: 2014-07-20 19:55:34 +0000 (Sun, 20 Jul 2014)
Log Message:
-----------
- Doctrine2: first design of entity injection
Modified Paths:
--------------
trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php
Modified: trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php 2014-07-20 19:40:50 UTC (rev 183)
+++ trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php 2014-07-20 19:55:34 UTC (rev 184)
@@ -43,7 +43,7 @@
foreach($reflClass->getMethods(ReflectionProperty::IS_PUBLIC) as $method) {
if($method->getNumberOfRequiredParameters() == 1) {
- foreach ($this->reader->getPropertyAnnotations($method) AS $annot) {
+ foreach ($this->reader->getMethodAnnotations($method) AS $annot) {
if ($annot instanceof Inject) {
$this->injectIntoSetter($entity, $method, $annot);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-20 19:40:54
|
Revision: 183
http://sourceforge.net/p/beeframework/code/183
Author: m_plomer
Date: 2014-07-20 19:40:50 +0000 (Sun, 20 Jul 2014)
Log Message:
-----------
- Doctrine2: first design of entity injection
Modified Paths:
--------------
trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php
trunk/framework/Bee/Persistence/Doctrine2/DaoBase.php
Modified: trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php 2014-07-20 15:45:49 UTC (rev 182)
+++ trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php 2014-07-20 19:40:50 UTC (rev 183)
@@ -2,7 +2,7 @@
namespace Bee\Persistence\Doctrine2\BeanInjection;
use Bee_IContext;
-use Doctrine\Common\Annotations\AnnotationReader;
+use Doctrine\Common\Annotations\Reader;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
@@ -16,7 +16,7 @@
*/
class InjectionEventListener implements EventSubscriber, \Bee_Context_Config_IContextAware {
/**
- * @var AnnotationReader
+ * @var Reader
*/
private $reader;
@@ -94,16 +94,16 @@
}
/**
- * @return AnnotationReader
+ * @return Reader
*/
public function getReader() {
return $this->reader;
}
/**
- * @param AnnotationReader $reader
+ * @param Reader $reader
*/
- public function setReader(AnnotationReader $reader) {
+ public function setReader(Reader $reader) {
$this->reader = $reader;
}
Modified: trunk/framework/Bee/Persistence/Doctrine2/DaoBase.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/DaoBase.php 2014-07-20 15:45:49 UTC (rev 182)
+++ trunk/framework/Bee/Persistence/Doctrine2/DaoBase.php 2014-07-20 19:40:50 UTC (rev 183)
@@ -132,6 +132,8 @@
* @param callback $func
* @throws Exception
* @return mixed
+ *
+ * @deprecated use EntityManager::transactional() instead
*/
public function doInTransaction($func) {
$this->getLog()->info('Begin transaction.');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-20 15:45:57
|
Revision: 182
http://sourceforge.net/p/beeframework/code/182
Author: m_plomer
Date: 2014-07-20 15:45:49 +0000 (Sun, 20 Jul 2014)
Log Message:
-----------
- Doctrine2: first design of entity injection
Modified Paths:
--------------
trunk/framework/Bee/Context/BeanCreationException.php
trunk/framework/Bee/Context/BeanDefinitionValueResolver.php
Added Paths:
-----------
trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/
trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/Inject.php
trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php
Modified: trunk/framework/Bee/Context/BeanCreationException.php
===================================================================
--- trunk/framework/Bee/Context/BeanCreationException.php 2014-07-12 17:39:11 UTC (rev 181)
+++ trunk/framework/Bee/Context/BeanCreationException.php 2014-07-20 15:45:49 UTC (rev 182)
@@ -48,6 +48,4 @@
public function getBeanName() {
return $this->name;
}
-}
-
-?>
\ No newline at end of file
+}
\ No newline at end of file
Modified: trunk/framework/Bee/Context/BeanDefinitionValueResolver.php
===================================================================
--- trunk/framework/Bee/Context/BeanDefinitionValueResolver.php 2014-07-12 17:39:11 UTC (rev 181)
+++ trunk/framework/Bee/Context/BeanDefinitionValueResolver.php 2014-07-20 15:45:49 UTC (rev 182)
@@ -153,7 +153,7 @@
} catch (Bee_Context_BeansException $ex) {
// @todo: a lot of debug information is lost here
- throw new Bee_Context_BeanCreationException($this->beanName, "error resolving reference for argument $argName", $ex);
+ throw new Bee_Context_BeanCreationException($this->beanName, "Error resolving reference for argument $argName", $ex);
}
}
Added: trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/Inject.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/Inject.php (rev 0)
+++ trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/Inject.php 2014-07-20 15:45:49 UTC (rev 182)
@@ -0,0 +1,18 @@
+<?php
+
+namespace Bee\Persistence\Doctrine2\BeanInjection;
+
+
+/**
+ * Class Inject
+ * @package Bee\Persistence\Doctrine2\BeanInjection
+ *
+ * @Annotation
+ * @Target({"METHOD","PROPERTY"})
+ */
+class Inject {
+ /**
+ * @var string
+ */
+ public $beanName;
+}
\ No newline at end of file
Added: trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php
===================================================================
--- trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php (rev 0)
+++ trunk/framework/Bee/Persistence/Doctrine2/BeanInjection/InjectionEventListener.php 2014-07-20 15:45:49 UTC (rev 182)
@@ -0,0 +1,116 @@
+<?php
+namespace Bee\Persistence\Doctrine2\BeanInjection;
+
+use Bee_IContext;
+use Doctrine\Common\Annotations\AnnotationReader;
+use Doctrine\Common\EventSubscriber;
+use Doctrine\ORM\Event\LifecycleEventArgs;
+use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
+use Doctrine\ORM\Events;
+use ReflectionClass;
+use ReflectionMethod;
+use ReflectionProperty;
+
+/**
+ * Class InjectionEventListener
+ */
+class InjectionEventListener implements EventSubscriber, \Bee_Context_Config_IContextAware {
+ /**
+ * @var AnnotationReader
+ */
+ private $reader;
+
+ /**
+ * @var Bee_IContext
+ */
+ private $context;
+
+ /**
+ * @param LifecycleEventArgs $eventArgs
+ */
+ public function postLoad(LifecycleEventArgs $eventArgs) {
+
+ $entity = $eventArgs->getEntity();
+ $reflClass = new ReflectionClass($entity);
+
+ foreach($reflClass->getProperties() as $prop) {
+ foreach ($this->reader->getPropertyAnnotations($prop) AS $annot) {
+ if ($annot instanceof Inject) {
+ $this->injectIntoProperty($entity, $prop, $annot);
+ }
+ }
+ }
+
+ foreach($reflClass->getMethods(ReflectionProperty::IS_PUBLIC) as $method) {
+ if($method->getNumberOfRequiredParameters() == 1) {
+ foreach ($this->reader->getPropertyAnnotations($method) AS $annot) {
+ if ($annot instanceof Inject) {
+ $this->injectIntoSetter($entity, $method, $annot);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @param $entity
+ * @param ReflectionProperty $prop
+ * @param Inject $annotation
+ */
+ protected function injectIntoProperty($entity, ReflectionProperty $prop, Inject $annotation) {
+ $value = $this->context->getBean($annotation->beanName);
+ $prop->setAccessible(true);
+ $prop->setValue($entity, $value);
+ }
+
+ /**
+ * @param $entity
+ * @param ReflectionMethod $method
+ * @param Inject $annotation
+ */
+ protected function injectIntoSetter($entity, ReflectionMethod $method, Inject $annotation) {
+ $value = $this->context->getBean($annotation->beanName);
+ $method->setAccessible(true);
+ $method->invoke($entity, $value);
+ }
+
+ /**
+ * @param LoadClassMetadataEventArgs $eventArgs
+ */
+// public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs) {
+// $classMata = $eventArgs->getClassMetadata();
+// }
+
+ /**
+ * Returns an array of events this subscriber wants to listen to.
+ *
+ * @return array
+ */
+ public function getSubscribedEvents() {
+ return array(
+ Events::postLoad//,
+// Events::loadClassMetadata
+ );
+ }
+
+ /**
+ * @return AnnotationReader
+ */
+ public function getReader() {
+ return $this->reader;
+ }
+
+ /**
+ * @param AnnotationReader $reader
+ */
+ public function setReader(AnnotationReader $reader) {
+ $this->reader = $reader;
+ }
+
+ /**
+ * @param Bee_IContext $context
+ */
+ public function setBeeContext(Bee_IContext $context) {
+ $this->context = $context;
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-12 15:54:50
|
Revision: 180
http://sourceforge.net/p/beeframework/code/180
Author: m_plomer
Date: 2014-07-12 15:54:40 +0000 (Sat, 12 Jul 2014)
Log Message:
-----------
- MVC: namespaced ViewResolvers
Modified Paths:
--------------
trunk/framework/Bee/MVC/ViewResolver/Basic.php
trunk/framework/Bee/MVC/ViewResolver/Loopback.php
Added Paths:
-----------
trunk/framework/Bee/MVC/ViewResolver/BasicViewResolver.php
trunk/framework/Bee/MVC/ViewResolver/LoopbackViewResolver.php
Modified: trunk/framework/Bee/MVC/ViewResolver/Basic.php
===================================================================
--- trunk/framework/Bee/MVC/ViewResolver/Basic.php 2014-07-10 17:17:48 UTC (rev 179)
+++ trunk/framework/Bee/MVC/ViewResolver/Basic.php 2014-07-12 15:54:40 UTC (rev 180)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-use Bee\MVC\IViewResolver;
+use Bee\MVC\ViewResolver\BasicViewResolver;
/**
* Basic implementation of the IViewResolver interface. Uses a Bee_IContext for view name resolution, looking up
@@ -22,90 +22,7 @@
*
* @author Benjamin Hartmann
* @author Michael Plomer <mic...@it...>
+ * @deprecated replaced by BasicViewResolver
*/
-class Bee_MVC_ViewResolver_Basic implements IViewResolver {
-
- /**
- * @var Logger
- */
- protected $log;
-
- /**
- * @return Logger
- */
- protected function getLog() {
- if (!$this->log) {
- $this->log = Logger::getLogger(get_class($this));
- }
- return $this->log;
- }
-
- /**
- * Enter description here...
- *
- * @var Bee_IContext
- */
- private $context;
-
- /**
- * @var string
- */
- private $ajaxViewNameSuffix = '.ajax';
-
- /**
- * Enter description here...
- *
- * @param Bee_IContext $context
- * @return void
- */
- public function setContext(Bee_IContext $context) {
- $this->context = $context;
- }
-
- /**
- * Enter description here...
- *
- * @return Bee_IContext
- */
- public function getContext() {
- return $this->context;
- }
-
- /**
- * @param String $viewName
- * @param Bee_MVC_IHttpRequest $request
- * @return Bee\MVC\IView|Object
- */
- public function resolveViewName($viewName, Bee_MVC_IHttpRequest $request) {
- $modifiedViewName = $this->modifyViewName($viewName, $request);
- if ($modifiedViewName != $viewName) {
- try {
- return $this->getViewForName($viewName);
- } catch (Bee_Context_BeansException $bex) {
- if($this->getLog()->isDebugEnabled()) {
- $this->getLog()->debug('Modified view name "' . $modifiedViewName . '" not found, trying base bean name "' . $viewName . '"', $bex);
- }
- }
- }
- return $this->getViewForName($viewName);
- }
-
- /**
- * @param string $viewName
- * @return Bee\MVC\IView
- */
- protected function getViewForName($viewName) {
- return $this->context->getBean($viewName, 'Bee\MVC\IView');
- }
-
- /**
- * Modify the view name according to request specifics. By default, the suffix '.ajax' is appended to the view names
- * for AJAX requests. Otherwise, the view name is left untouched.
- * @param $viewName
- * @param Bee_MVC_IHttpRequest $request
- * @return string
- */
- protected function modifyViewName($viewName, Bee_MVC_IHttpRequest $request) {
- return $request->getAjax() ? $viewName . $this->ajaxViewNameSuffix : $viewName;
- }
+class Bee_MVC_ViewResolver_Basic extends BasicViewResolver {
}
\ No newline at end of file
Added: trunk/framework/Bee/MVC/ViewResolver/BasicViewResolver.php
===================================================================
--- trunk/framework/Bee/MVC/ViewResolver/BasicViewResolver.php (rev 0)
+++ trunk/framework/Bee/MVC/ViewResolver/BasicViewResolver.php 2014-07-12 15:54:40 UTC (rev 180)
@@ -0,0 +1,117 @@
+<?php
+namespace Bee\MVC\ViewResolver;
+/*
+ * Copyright 2008-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+use Bee\MVC\IView;
+use Bee\MVC\IViewResolver;
+use Bee_Context_BeansException;
+use Bee_IContext;
+use Bee_MVC_IHttpRequest;
+use Logger;
+
+/**
+ * Basic implementation of the IViewResolver interface. Uses a Bee_IContext for view name resolution, looking up
+ * beans of type IView by using the view name as bean name.
+ *
+ * @author Benjamin Hartmann
+ * @author Michael Plomer <mic...@it...>
+ */
+class BasicViewResolver implements IViewResolver {
+
+ /**
+ * @var Logger
+ */
+ protected $log;
+
+ /**
+ * @return Logger
+ */
+ protected function getLog() {
+ if (!$this->log) {
+ $this->log = Logger::getLogger(get_class($this));
+ }
+ return $this->log;
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @var Bee_IContext
+ */
+ private $context;
+
+ /**
+ * @var string
+ */
+ private $ajaxViewNameSuffix = '.ajax';
+
+ /**
+ * Enter description here...
+ *
+ * @param Bee_IContext $context
+ * @return void
+ */
+ public function setContext(Bee_IContext $context) {
+ $this->context = $context;
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @return Bee_IContext
+ */
+ public function getContext() {
+ return $this->context;
+ }
+
+ /**
+ * @param String $viewName
+ * @param Bee_MVC_IHttpRequest $request
+ * @return IView|Object
+ */
+ public function resolveViewName($viewName, Bee_MVC_IHttpRequest $request) {
+ $modifiedViewName = $this->modifyViewName($viewName, $request);
+ if ($modifiedViewName != $viewName) {
+ try {
+ return $this->getViewForName($viewName);
+ } catch (Bee_Context_BeansException $bex) {
+ if($this->getLog()->isDebugEnabled()) {
+ $this->getLog()->debug('Modified view name "' . $modifiedViewName . '" not found, trying base bean name "' . $viewName . '"', $bex);
+ }
+ }
+ }
+ return $this->getViewForName($viewName);
+ }
+
+ /**
+ * @param string $viewName
+ * @return IView
+ */
+ protected function getViewForName($viewName) {
+ return $this->context->getBean($viewName, 'Bee\MVC\IView');
+ }
+
+ /**
+ * Modify the view name according to request specifics. By default, the suffix '.ajax' is appended to the view names
+ * for AJAX requests. Otherwise, the view name is left untouched.
+ * @param $viewName
+ * @param Bee_MVC_IHttpRequest $request
+ * @return string
+ */
+ protected function modifyViewName($viewName, Bee_MVC_IHttpRequest $request) {
+ return $request->getAjax() ? $viewName . $this->ajaxViewNameSuffix : $viewName;
+ }
+}
\ No newline at end of file
Property changes on: trunk/framework/Bee/MVC/ViewResolver/BasicViewResolver.php
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: trunk/framework/Bee/MVC/ViewResolver/Loopback.php
===================================================================
--- trunk/framework/Bee/MVC/ViewResolver/Loopback.php 2014-07-10 17:17:48 UTC (rev 179)
+++ trunk/framework/Bee/MVC/ViewResolver/Loopback.php 2014-07-12 15:54:40 UTC (rev 180)
@@ -1,15 +1,24 @@
<?php
-class Bee_MVC_ViewResolver_Loopback extends Bee_MVC_ViewResolver_Basic implements Bee_Context_Config_IContextAware{
+/*
+ * Copyright 2008-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+use Bee\MVC\ViewResolver\LoopbackViewResolver;
- /**
- * Callback that supplies the owning context to a bean instance.
- * <p>Invoked after the population of normal bean properties
- * but before an initialization callback such as
- * {@link InitializingBean#afterPropertiesSet()} or a custom init-method.
- * @param Bee_IContext $context owning context (never <code>null</code>).
- * The bean can immediately call methods on the context.
- */
- public function setBeeContext(Bee_IContext $context) {
- $this->setContext($context);
- }
+/**
+ * Class Bee_MVC_ViewResolver_Loopback
+ * @deprecated replaced by LoopbackViewResolver
+ */
+class Bee_MVC_ViewResolver_Loopback extends LoopbackViewResolver {
}
Added: trunk/framework/Bee/MVC/ViewResolver/LoopbackViewResolver.php
===================================================================
--- trunk/framework/Bee/MVC/ViewResolver/LoopbackViewResolver.php (rev 0)
+++ trunk/framework/Bee/MVC/ViewResolver/LoopbackViewResolver.php 2014-07-12 15:54:40 UTC (rev 180)
@@ -0,0 +1,19 @@
+<?php
+namespace Bee\MVC\ViewResolver;
+use Bee_Context_Config_IContextAware;
+use Bee_IContext;
+
+class LoopbackViewResolver extends BasicViewResolver implements Bee_Context_Config_IContextAware{
+
+ /**
+ * Callback that supplies the owning context to a bean instance.
+ * <p>Invoked after the population of normal bean properties
+ * but before an initialization callback such as
+ * {@link InitializingBean#afterPropertiesSet()} or a custom init-method.
+ * @param Bee_IContext $context owning context (never <code>null</code>).
+ * The bean can immediately call methods on the context.
+ */
+ public function setBeeContext(Bee_IContext $context) {
+ $this->setContext($context);
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-10 17:17:51
|
Revision: 179
http://sourceforge.net/p/beeframework/code/179
Author: m_plomer
Date: 2014-07-10 17:17:48 +0000 (Thu, 10 Jul 2014)
Log Message:
-----------
- MVC: RegexMappingInvocationResolver - proper pattern ordering and test case
Modified Paths:
--------------
trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php
Modified: trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php
===================================================================
--- trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php 2014-07-10 17:11:32 UTC (rev 178)
+++ trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php 2014-07-10 17:17:48 UTC (rev 179)
@@ -1,6 +1,5 @@
<?php
namespace Bee\MVC\Controller\Multiaction\HandlerMethodInvocator;
-
/*
* Copyright 2008-2014 the original author or authors.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-10 17:11:39
|
Revision: 178
http://sourceforge.net/p/beeframework/code/178
Author: m_plomer
Date: 2014-07-10 17:11:32 +0000 (Thu, 10 Jul 2014)
Log Message:
-----------
- MVC: RegexMappingInvocationResolver - proper pattern ordering and test case
Modified Paths:
--------------
trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php
Modified: trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php
===================================================================
--- trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php 2014-07-10 17:10:52 UTC (rev 177)
+++ trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php 2014-07-10 17:11:32 UTC (rev 178)
@@ -169,16 +169,4 @@
return self::$methodMetadataMap[$methodFullName];
}
- public static function getWildcardCount($pattern) {
- $len = strlen(self::IGNORE_WILDCARD_TRAILING_PATTERN);
- if (substr($pattern, $len) == self::IGNORE_WILDCARD_TRAILING_PATTERN) {
- $pattern = substr(self::IGNORE_WILDCARD_TRAILING_PATTERN, 0, -$len);
- }
- return substr_count($pattern, '[^/]*') + 2 * substr_count($pattern, '(?:[^/]+/)*') + 2 * substr_count($pattern, '.*');
- }
-
- public static function getPatternLength($pattern) {
- $pattern = preg_replace('#\([^?].*?\)#', '#', $pattern);
- return strlen($pattern);
- }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <m_p...@us...> - 2014-07-10 17:10:57
|
Revision: 177
http://sourceforge.net/p/beeframework/code/177
Author: m_plomer
Date: 2014-07-10 17:10:52 +0000 (Thu, 10 Jul 2014)
Log Message:
-----------
- MVC: RegexMappingInvocationResolver - proper pattern ordering and test case
Modified Paths:
--------------
trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php
Modified: trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php
===================================================================
--- trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php 2014-07-10 17:09:13 UTC (rev 176)
+++ trunk/framework/Bee/MVC/Controller/Multiaction/HandlerMethodInvocator/RegexMappingInvocationResolver.php 2014-07-10 17:10:52 UTC (rev 177)
@@ -151,7 +151,6 @@
$matchingAntPaths = array_map(function (MethodInvocation $item) {
return $item->getAntPathPattern();
}, $matchingPatterns);
-// self::getLog()->debug('Sorted patterns for pathInfo "' . $pathInfo . '" are ' . implode("\n", array_keys($matchingPatterns)));
self::getLog()->debug('Sorted patterns for pathInfo "' . $pathInfo . '" are ' . "\n" . implode("\n", $matchingAntPaths));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|