mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 21:13:26 +00:00
Fix tests on PHP 5.4
This commit is contained in:
@@ -745,14 +745,6 @@ return call_user_func(function($environment = 'prod') {
|
|||||||
return $response;
|
return $response;
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* Temporary fix for https://github.com/fabpot/Silex/issues/438
|
|
||||||
*/
|
|
||||||
$app['dispatcher']->addListener(KernelEvents::RESPONSE, function(FilterResponseEvent $event) {
|
|
||||||
if ($event->getResponse() instanceof \API_V1_Response) {
|
|
||||||
$event->getResponse()->setStatusCode($event->getResponse()->getOriginalStatusCode());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return $app;
|
return $app;
|
||||||
}, $environment ? : null
|
}, $environment ? : null
|
||||||
|
@@ -502,7 +502,7 @@ class Manager
|
|||||||
* @param File $file The file
|
* @param File $file The file
|
||||||
* @return \Doctrine\ORM\EntityManager
|
* @return \Doctrine\ORM\EntityManager
|
||||||
*/
|
*/
|
||||||
protected function addMediaAttributes(File &$file)
|
protected function addMediaAttributes(File $file)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (method_exists($file->getMedia(), 'getWidth')) {
|
if (method_exists($file->getMedia(), 'getWidth')) {
|
||||||
|
@@ -65,7 +65,7 @@ class API_OAuth2_Token
|
|||||||
* @param API_OAuth2_Account $account
|
* @param API_OAuth2_Account $account
|
||||||
* @return API_OAuth2_Token
|
* @return API_OAuth2_Token
|
||||||
*/
|
*/
|
||||||
public function __construct(appbox &$appbox, API_OAuth2_Account &$account)
|
public function __construct(appbox $appbox, API_OAuth2_Account $account)
|
||||||
{
|
{
|
||||||
$this->appbox = $appbox;
|
$this->appbox = $appbox;
|
||||||
$this->account = $account;
|
$this->account = $account;
|
||||||
@@ -300,7 +300,7 @@ class API_OAuth2_Token
|
|||||||
* @param string $scope
|
* @param string $scope
|
||||||
* @return API_OAuth2_Token
|
* @return API_OAuth2_Token
|
||||||
*/
|
*/
|
||||||
public static function create(appbox &$appbox, API_OAuth2_Account &$account, $scope = null)
|
public static function create(appbox $appbox, API_OAuth2_Account $account, $scope = null)
|
||||||
{
|
{
|
||||||
$sql = 'INSERT INTO api_oauth_tokens
|
$sql = 'INSERT INTO api_oauth_tokens
|
||||||
(oauth_token, session_id, api_account_id, expires, scope)
|
(oauth_token, session_id, api_account_id, expires, scope)
|
||||||
|
@@ -245,7 +245,7 @@ interface API_V1_Interface
|
|||||||
* Parameters :
|
* Parameters :
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function search_publications(Request $request, User_Adapter &$user);
|
public function search_publications(Request $request, User_Adapter $user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Route : /publications/PUBLICATION_ID/remove/FORMAT/
|
* Route : /publications/PUBLICATION_ID/remove/FORMAT/
|
||||||
@@ -267,11 +267,11 @@ interface API_V1_Interface
|
|||||||
* PUBLICATION_ID : required INT
|
* PUBLICATION_ID : required INT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function get_publication(Request $request, $publication_id, User_Adapter &$user);
|
public function get_publication(Request $request, $publication_id, User_Adapter $user);
|
||||||
|
|
||||||
public function get_publications(Request $request, User_Adapter &$user);
|
public function get_publications(Request $request, User_Adapter $user);
|
||||||
|
|
||||||
public function get_feed_entry(Request $request, $entry, User_Adapter &$user);
|
public function get_feed_entry(Request $request, $entry, User_Adapter $user);
|
||||||
/**
|
/**
|
||||||
* Route : /users/search/FORMAT/
|
* Route : /users/search/FORMAT/
|
||||||
*
|
*
|
||||||
|
@@ -676,7 +676,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
|
|
||||||
$reasons = $output = null;
|
$reasons = $output = null;
|
||||||
|
|
||||||
$callback = function($element, $visa, $code) use(&$reasons, &$output) {
|
$callback = function($element, $visa, $code) use (&$reasons, &$output) {
|
||||||
if ( ! $visa->isValid()) {
|
if ( ! $visa->isValid()) {
|
||||||
$reasons = array();
|
$reasons = array();
|
||||||
|
|
||||||
@@ -1420,7 +1420,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
* @param User_Adapter $user
|
* @param User_Adapter $user
|
||||||
* @return API_V1_result
|
* @return API_V1_result
|
||||||
*/
|
*/
|
||||||
public function search_publications(Request $request, User_Adapter &$user)
|
public function search_publications(Request $request, User_Adapter $user)
|
||||||
{
|
{
|
||||||
$result = new API_V1_result($request, $this);
|
$result = new API_V1_result($request, $this);
|
||||||
|
|
||||||
@@ -1455,7 +1455,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
* @param User_Adapter $user
|
* @param User_Adapter $user
|
||||||
* @return API_V1_result
|
* @return API_V1_result
|
||||||
*/
|
*/
|
||||||
public function get_publication(Request $request, $publication_id, User_Adapter &$user)
|
public function get_publication(Request $request, $publication_id, User_Adapter $user)
|
||||||
{
|
{
|
||||||
$result = new API_V1_result($request, $this);
|
$result = new API_V1_result($request, $this);
|
||||||
|
|
||||||
@@ -1478,7 +1478,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_publications(Request $request, User_Adapter &$user)
|
public function get_publications(Request $request, User_Adapter $user)
|
||||||
{
|
{
|
||||||
$result = new API_V1_result($request, $this);
|
$result = new API_V1_result($request, $this);
|
||||||
|
|
||||||
@@ -1501,7 +1501,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_feed_entry(Request $request, $entry_id, User_Adapter &$user)
|
public function get_feed_entry(Request $request, $entry_id, User_Adapter $user)
|
||||||
{
|
{
|
||||||
$result = new API_V1_result($request, $this);
|
$result = new API_V1_result($request, $this);
|
||||||
|
|
||||||
@@ -1644,7 +1644,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
* @param media_subdef $media
|
* @param media_subdef $media
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function list_embedable_media(media_subdef &$media, registryInterface &$registry)
|
protected function list_embedable_media(media_subdef $media, registryInterface $registry)
|
||||||
{
|
{
|
||||||
if ( ! $media->is_physically_present()) {
|
if ( ! $media->is_physically_present()) {
|
||||||
return null;
|
return null;
|
||||||
@@ -1675,7 +1675,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
* @param registryInterface $registry
|
* @param registryInterface $registry
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
protected function list_permalink(media_Permalink_Adapter &$permalink, registryInterface &$registry)
|
protected function list_permalink(media_Permalink_Adapter $permalink, registryInterface $registry)
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'created_on' => $permalink->get_created_on()->format(DATE_ATOM),
|
'created_on' => $permalink->get_created_on()->format(DATE_ATOM),
|
||||||
|
@@ -80,7 +80,7 @@ class Bridge_Account
|
|||||||
* @param int $id
|
* @param int $id
|
||||||
* @return Bridge_Account
|
* @return Bridge_Account
|
||||||
*/
|
*/
|
||||||
public function __construct(Application $app, Bridge_Api &$api, $id)
|
public function __construct(Application $app, Bridge_Api $api, $id)
|
||||||
{
|
{
|
||||||
$this->id = (int) $id;
|
$this->id = (int) $id;
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
@@ -292,7 +292,7 @@ class Bridge_Account
|
|||||||
* @param int $quantity
|
* @param int $quantity
|
||||||
* @return Bridge_Account
|
* @return Bridge_Account
|
||||||
*/
|
*/
|
||||||
public static function get_accounts_by_api(Application $app, Bridge_Api &$api, $quantity = 50)
|
public static function get_accounts_by_api(Application $app, Bridge_Api $api, $quantity = 50)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT id FROM bridge_accounts WHERE api_id = :api_id
|
$sql = 'SELECT id FROM bridge_accounts WHERE api_id = :api_id
|
||||||
LIMIT 0,' . (int) $quantity;
|
LIMIT 0,' . (int) $quantity;
|
||||||
@@ -317,7 +317,7 @@ class Bridge_Account
|
|||||||
* @param user_adapter $user
|
* @param user_adapter $user
|
||||||
* @return Bridge_Account
|
* @return Bridge_Account
|
||||||
*/
|
*/
|
||||||
public static function get_accounts_by_user(Application $app, user_adapter &$user)
|
public static function get_accounts_by_user(Application $app, user_adapter $user)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT id, api_id FROM bridge_accounts WHERE usr_id = :usr_id';
|
$sql = 'SELECT id, api_id FROM bridge_accounts WHERE usr_id = :usr_id';
|
||||||
|
|
||||||
@@ -353,7 +353,7 @@ class Bridge_Account
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* @return Bridge_Account
|
* @return Bridge_Account
|
||||||
*/
|
*/
|
||||||
public static function create(Application $app, Bridge_Api &$api, User_Adapter &$user, $dist_id, $name)
|
public static function create(Application $app, Bridge_Api $api, User_Adapter $user, $dist_id, $name)
|
||||||
{
|
{
|
||||||
$sql = 'INSERT INTO bridge_accounts
|
$sql = 'INSERT INTO bridge_accounts
|
||||||
(id, api_id, dist_id, usr_id, name, created_on, updated_on)
|
(id, api_id, dist_id, usr_id, name, created_on, updated_on)
|
||||||
|
@@ -35,7 +35,7 @@ class Bridge_AccountSettings
|
|||||||
* @param Bridge_Account $account
|
* @param Bridge_Account $account
|
||||||
* @return Bridge_AccountSettings
|
* @return Bridge_AccountSettings
|
||||||
*/
|
*/
|
||||||
public function __construct(appbox &$appbox, Bridge_Account &$account)
|
public function __construct(appbox $appbox, Bridge_Account $account)
|
||||||
{
|
{
|
||||||
$this->appbox = $appbox;
|
$this->appbox = $appbox;
|
||||||
$this->account = $account;
|
$this->account = $account;
|
||||||
|
@@ -172,7 +172,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function list_elements($type, $offset_start = 0, $quantity = 10)
|
public function list_elements($type, $offset_start = 0, $quantity = 10)
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) use ($type, $offset_start, $quantity ) {
|
$action = function(Bridge_Api $obj) use ($type, $offset_start, $quantity ) {
|
||||||
return $obj->get_connector()->list_elements($type, $offset_start, $quantity);
|
return $obj->get_connector()->list_elements($type, $offset_start, $quantity);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function list_containers($type, $offset_start = 0, $quantity = 10)
|
public function list_containers($type, $offset_start = 0, $quantity = 10)
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) use ($type, $offset_start, $quantity ) {
|
$action = function(Bridge_Api $obj) use ($type, $offset_start, $quantity ) {
|
||||||
return $obj->get_connector()->list_containers($type, $offset_start, $quantity);
|
return $obj->get_connector()->list_containers($type, $offset_start, $quantity);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function update_element($object, $object_id, Array $datas)
|
public function update_element($object, $object_id, Array $datas)
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) use ($object, $object_id, $datas) {
|
$action = function(Bridge_Api $obj) use ($object, $object_id, $datas) {
|
||||||
return $obj->get_connector()->update_element($object, $object_id, $datas);
|
return $obj->get_connector()->update_element($object, $object_id, $datas);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function create_container($container_type, Request $request)
|
public function create_container($container_type, Request $request)
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) use ($container_type, $request) {
|
$action = function(Bridge_Api $obj) use ($container_type, $request) {
|
||||||
return $obj->get_connector()->create_container($container_type, $request);
|
return $obj->get_connector()->create_container($container_type, $request);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function add_element_to_container($element_type, $element_id, $destination, $container_id)
|
public function add_element_to_container($element_type, $element_id, $destination, $container_id)
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) use ($element_type, $element_id, $destination, $container_id) {
|
$action = function(Bridge_Api $obj) use ($element_type, $element_id, $destination, $container_id) {
|
||||||
return $obj->get_connector()->add_element_to_container($element_type, $element_id, $destination, $container_id);
|
return $obj->get_connector()->add_element_to_container($element_type, $element_id, $destination, $container_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -251,7 +251,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function delete_object($object, $object_id)
|
public function delete_object($object, $object_id)
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) use ($object, $object_id) {
|
$action = function(Bridge_Api $obj) use ($object, $object_id) {
|
||||||
return $obj->get_connector()->delete_object($object, $object_id);
|
return $obj->get_connector()->delete_object($object, $object_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function acceptable_records()
|
public function acceptable_records()
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) {
|
$action = function(Bridge_Api $obj) {
|
||||||
return $obj->get_connector()->acceptable_records();
|
return $obj->get_connector()->acceptable_records();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -279,7 +279,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function get_element_from_id($element_id, $type)
|
public function get_element_from_id($element_id, $type)
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) use ($element_id, $type) {
|
$action = function(Bridge_Api $obj) use ($element_id, $type) {
|
||||||
return $obj->get_connector()->get_element_from_id($element_id, $type);
|
return $obj->get_connector()->get_element_from_id($element_id, $type);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function get_container_from_id($element_id, $type)
|
public function get_container_from_id($element_id, $type)
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) use ($element_id, $type) {
|
$action = function(Bridge_Api $obj) use ($element_id, $type) {
|
||||||
return $obj->get_connector()->get_container_from_id($element_id, $type);
|
return $obj->get_connector()->get_container_from_id($element_id, $type);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function get_category_list()
|
public function get_category_list()
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) {
|
$action = function(Bridge_Api $obj) {
|
||||||
return $obj->get_connector()->get_category_list();
|
return $obj->get_connector()->get_category_list();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -321,7 +321,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function get_element_status(Bridge_Element $element)
|
public function get_element_status(Bridge_Element $element)
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) use ($element) {
|
$action = function(Bridge_Api $obj) use ($element) {
|
||||||
return $obj->get_connector()->get_element_status($element);
|
return $obj->get_connector()->get_element_status($element);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -335,7 +335,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function map_connector_to_element_status($status)
|
public function map_connector_to_element_status($status)
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) use ($status) {
|
$action = function(Bridge_Api $obj) use ($status) {
|
||||||
return $obj->get_connector()->map_connector_to_element_status($status);
|
return $obj->get_connector()->map_connector_to_element_status($status);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -349,7 +349,7 @@ class Bridge_Api
|
|||||||
*/
|
*/
|
||||||
public function get_error_message_from_status($connector_status)
|
public function get_error_message_from_status($connector_status)
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) use ($connector_status) {
|
$action = function(Bridge_Api $obj) use ($connector_status) {
|
||||||
return $obj->get_connector()->get_error_message_from_status($connector_status);
|
return $obj->get_connector()->get_error_message_from_status($connector_status);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -362,9 +362,9 @@ class Bridge_Api
|
|||||||
* @param array $options specific option, regarding the connector
|
* @param array $options specific option, regarding the connector
|
||||||
* @return string The distant_id of the created element
|
* @return string The distant_id of the created element
|
||||||
*/
|
*/
|
||||||
public function upload(record_adapter &$record, array $options = array())
|
public function upload(record_adapter $record, array $options = array())
|
||||||
{
|
{
|
||||||
$action = function(Bridge_Api &$obj) use ($record, $options) {
|
$action = function(Bridge_Api $obj) use ($record, $options) {
|
||||||
return $obj->get_connector()->upload($record, $options);
|
return $obj->get_connector()->upload($record, $options);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ abstract class Bridge_Api_Abstract
|
|||||||
* @param Bridge_AccountSettings $settings
|
* @param Bridge_AccountSettings $settings
|
||||||
* @return Bridge_Api_Abstract
|
* @return Bridge_Api_Abstract
|
||||||
*/
|
*/
|
||||||
public function set_auth_settings(Bridge_AccountSettings &$settings)
|
public function set_auth_settings(Bridge_AccountSettings $settings)
|
||||||
{
|
{
|
||||||
$this->_auth->set_settings($settings);
|
$this->_auth->set_settings($settings);
|
||||||
$this->set_transport_authentication_params();
|
$this->set_transport_authentication_params();
|
||||||
@@ -154,7 +154,7 @@ abstract class Bridge_Api_Abstract
|
|||||||
* @param Exception $e
|
* @param Exception $e
|
||||||
* @return Void
|
* @return Void
|
||||||
*/
|
*/
|
||||||
public function handle_exception(Exception &$e)
|
public function handle_exception(Exception $e)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -462,7 +462,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
|||||||
*/
|
*/
|
||||||
public function acceptable_records()
|
public function acceptable_records()
|
||||||
{
|
{
|
||||||
return function (record_adapter &$record) {
|
return function (record_adapter $record) {
|
||||||
return $record->get_type() === 'video';
|
return $record->get_type() === 'video';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -545,7 +545,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
|||||||
* @param Exception $e
|
* @param Exception $e
|
||||||
* @return Void
|
* @return Void
|
||||||
*/
|
*/
|
||||||
public function handle_exception(Exception &$e)
|
public function handle_exception(Exception $e)
|
||||||
{
|
{
|
||||||
if ($e instanceof DailymotionAuthException) {
|
if ($e instanceof DailymotionAuthException) {
|
||||||
$e = new Bridge_Exception_ActionAuthNeedReconnect($e->getMessage());
|
$e = new Bridge_Exception_ActionAuthNeedReconnect($e->getMessage());
|
||||||
@@ -562,7 +562,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
|||||||
* @param array $options
|
* @param array $options
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function upload(record_adapter &$record, array $options = array())
|
public function upload(record_adapter $record, array $options = array())
|
||||||
{
|
{
|
||||||
switch ($record->get_type()) {
|
switch ($record->get_type()) {
|
||||||
case self::ELEMENT_TYPE_VIDEO :
|
case self::ELEMENT_TYPE_VIDEO :
|
||||||
|
@@ -511,7 +511,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
|||||||
* @param array $options
|
* @param array $options
|
||||||
* @return string The new distant Id
|
* @return string The new distant Id
|
||||||
*/
|
*/
|
||||||
public function upload(record_adapter &$record, Array $options = array())
|
public function upload(record_adapter $record, Array $options = array())
|
||||||
{
|
{
|
||||||
$uploader = new Phlickr_Uploader($this->_api);
|
$uploader = new Phlickr_Uploader($this->_api);
|
||||||
|
|
||||||
@@ -534,7 +534,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
|||||||
*/
|
*/
|
||||||
public function acceptable_records()
|
public function acceptable_records()
|
||||||
{
|
{
|
||||||
return function (record_adapter &$record) {
|
return function (record_adapter $record) {
|
||||||
return in_array($record->get_type(), array('image'));
|
return in_array($record->get_type(), array('image'));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -62,7 +62,7 @@ interface Bridge_Api_Interface
|
|||||||
*
|
*
|
||||||
* @return Bridge_Api_Interface
|
* @return Bridge_Api_Interface
|
||||||
*/
|
*/
|
||||||
public function set_auth_settings(Bridge_AccountSettings &$settings);
|
public function set_auth_settings(Bridge_AccountSettings $settings);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -150,7 +150,7 @@ interface Bridge_Api_Interface
|
|||||||
|
|
||||||
public function get_error_message_from_status($connector_status);
|
public function get_error_message_from_status($connector_status);
|
||||||
|
|
||||||
public function upload(record_adapter &$record, array $options = array());
|
public function upload(record_adapter $record, array $options = array());
|
||||||
|
|
||||||
public function is_valid_object_id($object_id);
|
public function is_valid_object_id($object_id);
|
||||||
|
|
||||||
|
@@ -428,7 +428,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
|||||||
*/
|
*/
|
||||||
public function acceptable_records()
|
public function acceptable_records()
|
||||||
{
|
{
|
||||||
return function (record_adapter &$record) {
|
return function (record_adapter $record) {
|
||||||
return $record->get_type() === 'video';
|
return $record->get_type() === 'video';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -525,7 +525,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
|||||||
* @param Exception $e
|
* @param Exception $e
|
||||||
* @return Void
|
* @return Void
|
||||||
*/
|
*/
|
||||||
public function handle_exception(Exception &$e)
|
public function handle_exception(Exception $e)
|
||||||
{
|
{
|
||||||
if ($e instanceof Zend_Gdata_App_HttpException) {
|
if ($e instanceof Zend_Gdata_App_HttpException) {
|
||||||
$response = $e->getResponse();
|
$response = $e->getResponse();
|
||||||
@@ -655,7 +655,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
|||||||
* @param array $options
|
* @param array $options
|
||||||
* @return string The new distant Id
|
* @return string The new distant Id
|
||||||
*/
|
*/
|
||||||
public function upload(record_adapter &$record, array $options = array())
|
public function upload(record_adapter $record, array $options = array())
|
||||||
{
|
{
|
||||||
switch ($record->get_type()) {
|
switch ($record->get_type()) {
|
||||||
case 'video':
|
case 'video':
|
||||||
|
@@ -116,7 +116,7 @@ class Bridge_Element
|
|||||||
* @param int $id
|
* @param int $id
|
||||||
* @return Bridge_Element
|
* @return Bridge_Element
|
||||||
*/
|
*/
|
||||||
public function __construct(Application $app, Bridge_Account &$account, $id)
|
public function __construct(Application $app, Bridge_Account $account, $id)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->account = $account;
|
$this->account = $account;
|
||||||
@@ -484,7 +484,7 @@ class Bridge_Element
|
|||||||
* @param array $datas
|
* @param array $datas
|
||||||
* @return Bridge_Element
|
* @return Bridge_Element
|
||||||
*/
|
*/
|
||||||
public static function create(Application $app, Bridge_Account &$account, record_adapter &$record, $title, $status, $type, Array $datas = array())
|
public static function create(Application $app, Bridge_Account $account, record_adapter $record, $title, $status, $type, Array $datas = array())
|
||||||
{
|
{
|
||||||
$sql = 'INSERT INTO bridge_elements
|
$sql = 'INSERT INTO bridge_elements
|
||||||
(id, account_id, sbas_id, record_id, dist_id, title, `type`
|
(id, account_id, sbas_id, record_id, dist_id, title, `type`
|
||||||
|
@@ -472,7 +472,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea
|
|||||||
* @param int $id
|
* @param int $id
|
||||||
* @return Feed_Adapter
|
* @return Feed_Adapter
|
||||||
*/
|
*/
|
||||||
public static function load_with_user(Application $app, User_Adapter &$user, $id)
|
public static function load_with_user(Application $app, User_Adapter $user, $id)
|
||||||
{
|
{
|
||||||
$feed = new self($app, $id);
|
$feed = new self($app, $id);
|
||||||
$coll = $feed->get_collection();
|
$coll = $feed->get_collection();
|
||||||
|
@@ -220,7 +220,7 @@ class Feed_Aggregate extends Feed_Abstract implements Feed_Interface
|
|||||||
* @param User_Adapter $user
|
* @param User_Adapter $user
|
||||||
* @return Feed_Aggregate
|
* @return Feed_Aggregate
|
||||||
*/
|
*/
|
||||||
public static function load_with_user(Application $app, User_Adapter &$user)
|
public static function load_with_user(Application $app, User_Adapter $user)
|
||||||
{
|
{
|
||||||
$feeds = Feed_Collection::load_all($app, $user);
|
$feeds = Feed_Collection::load_all($app, $user);
|
||||||
|
|
||||||
|
@@ -116,9 +116,9 @@ class Feed_Collection implements Feed_CollectionInterface, cache_cacheableInterf
|
|||||||
return new self($app, $feeds);
|
return new self($app, $feeds);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function retrieve_public_feed_ids(appbox &$appbox)
|
protected static function retrieve_public_feed_ids(appbox $appbox)
|
||||||
{
|
{
|
||||||
$key = self::get_cache_key(self::CACHE_PUBLIC);
|
$key = 'feedcollection_' . self::CACHE_PUBLIC;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return $appbox->get_data_from_cache($key);
|
return $appbox->get_data_from_cache($key);
|
||||||
|
@@ -100,7 +100,7 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa
|
|||||||
* @param int $id
|
* @param int $id
|
||||||
* @return Feed_Entry_Adapter
|
* @return Feed_Entry_Adapter
|
||||||
*/
|
*/
|
||||||
public function __construct(Application $app, Feed_Adapter &$feed, $id)
|
public function __construct(Application $app, Feed_Adapter $feed, $id)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->feed = $feed;
|
$this->feed = $feed;
|
||||||
|
@@ -20,7 +20,7 @@ use Alchemy\Phrasea\Application;
|
|||||||
interface Feed_Entry_Interface
|
interface Feed_Entry_Interface
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct(Application $app, Feed_Adapter &$feed, $id);
|
public function __construct(Application $app, Feed_Adapter $feed, $id);
|
||||||
|
|
||||||
public function get_feed();
|
public function get_feed();
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@ class Feed_Entry_Item implements Feed_Entry_ItemInterface, cache_cacheableInterf
|
|||||||
* @param int $id
|
* @param int $id
|
||||||
* @return Feed_Entry_Item
|
* @return Feed_Entry_Item
|
||||||
*/
|
*/
|
||||||
public function __construct(appbox &$appbox, Feed_Entry_Adapter &$entry, $id)
|
public function __construct(appbox $appbox, Feed_Entry_Adapter $entry, $id)
|
||||||
{
|
{
|
||||||
$this->appbox = $appbox;
|
$this->appbox = $appbox;
|
||||||
$this->id = (int) $id;
|
$this->id = (int) $id;
|
||||||
@@ -173,7 +173,7 @@ class Feed_Entry_Item implements Feed_Entry_ItemInterface, cache_cacheableInterf
|
|||||||
* @param record_adapter $record
|
* @param record_adapter $record
|
||||||
* @return Feed_Entry_Item
|
* @return Feed_Entry_Item
|
||||||
*/
|
*/
|
||||||
public static function create(appbox &$appbox, Feed_Entry_Adapter &$entry, record_adapter &$record)
|
public static function create(appbox $appbox, Feed_Entry_Adapter $entry, record_adapter $record)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT (MAX(ord)+1) as sorter FROM feed_entry_elements
|
$sql = 'SELECT (MAX(ord)+1) as sorter FROM feed_entry_elements
|
||||||
WHERE entry_id = :entry_id';
|
WHERE entry_id = :entry_id';
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
interface Feed_Entry_ItemInterface
|
interface Feed_Entry_ItemInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct(appbox &$appbox, Feed_Entry_Adapter &$entry, $id);
|
public function __construct(appbox $appbox, Feed_Entry_Adapter $entry, $id);
|
||||||
|
|
||||||
public function get_id();
|
public function get_id();
|
||||||
|
|
||||||
@@ -28,5 +28,5 @@ interface Feed_Entry_ItemInterface
|
|||||||
|
|
||||||
public function delete();
|
public function delete();
|
||||||
|
|
||||||
public static function create(appbox &$appbox, Feed_Entry_Adapter &$entry, record_adapter &$record);
|
public static function create(appbox $appbox, Feed_Entry_Adapter $entry, record_adapter $record);
|
||||||
}
|
}
|
||||||
|
@@ -183,7 +183,7 @@ class Feed_Publisher_Adapter implements Feed_Publisher_Interface, cache_cacheabl
|
|||||||
* @param boolean $owner
|
* @param boolean $owner
|
||||||
* @return Feed_Publisher_Adapter
|
* @return Feed_Publisher_Adapter
|
||||||
*/
|
*/
|
||||||
public static function create(Application $app, User_Adapter &$user, Feed_Adapter &$feed, $owner)
|
public static function create(Application $app, User_Adapter $user, Feed_Adapter $feed, $owner)
|
||||||
{
|
{
|
||||||
$sql = 'INSERT INTO feed_publishers (id, usr_id, feed_id, owner, created_on, added_by)
|
$sql = 'INSERT INTO feed_publishers (id, usr_id, feed_id, owner, created_on, added_by)
|
||||||
VALUES (null, :usr_id, :feed_id, :owner, NOW(), :added_by)';
|
VALUES (null, :usr_id, :feed_id, :owner, NOW(), :added_by)';
|
||||||
@@ -208,7 +208,7 @@ class Feed_Publisher_Adapter implements Feed_Publisher_Interface, cache_cacheabl
|
|||||||
* @param User_Adapter $user
|
* @param User_Adapter $user
|
||||||
* @return Feed_Publisher_Adapter
|
* @return Feed_Publisher_Adapter
|
||||||
*/
|
*/
|
||||||
public static function getPublisher(appbox &$appbox, Feed_Adapter &$feed, User_Adapter &$user)
|
public static function getPublisher(appbox $appbox, Feed_Adapter $feed, User_Adapter $user)
|
||||||
{
|
{
|
||||||
foreach ($feed->get_publishers() as $publisher) {
|
foreach ($feed->get_publishers() as $publisher) {
|
||||||
if ($publisher->get_user()->get_id() === $user->get_id()) {
|
if ($publisher->get_user()->get_id() === $user->get_id()) {
|
||||||
|
@@ -34,7 +34,7 @@ interface Feed_Publisher_Interface
|
|||||||
|
|
||||||
public function delete();
|
public function delete();
|
||||||
|
|
||||||
public static function create(Application $app, User_Adapter &$user, Feed_Adapter &$feed, $owner);
|
public static function create(Application $app, User_Adapter $user, Feed_Adapter $feed, $owner);
|
||||||
|
|
||||||
public static function getPublisher(appbox &$appbox, Feed_Adapter &$feed, User_Adapter &$user);
|
public static function getPublisher(appbox $appbox, Feed_Adapter $feed, User_Adapter $user);
|
||||||
}
|
}
|
||||||
|
@@ -200,7 +200,7 @@ abstract class Feed_XML_Abstract
|
|||||||
* @param string $tagcontent
|
* @param string $tagcontent
|
||||||
* @return DOMElement
|
* @return DOMElement
|
||||||
*/
|
*/
|
||||||
protected function addTag(DOMDocument &$document, DOMNode &$node, $tagname, $tagcontent = null)
|
protected function addTag(DOMDocument $document, DOMNode $node, $tagname, $tagcontent = null)
|
||||||
{
|
{
|
||||||
$tag = $document->createElement($tagname);
|
$tag = $document->createElement($tagname);
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ class Session_Logger
|
|||||||
* @param int $log_id
|
* @param int $log_id
|
||||||
* @return Session_Logger
|
* @return Session_Logger
|
||||||
*/
|
*/
|
||||||
public function __construct(Application $app, databox &$databox, $log_id)
|
public function __construct(Application $app, databox $databox, $log_id)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->databox = $databox;
|
$this->databox = $databox;
|
||||||
@@ -97,7 +97,7 @@ class Session_Logger
|
|||||||
* @param Browser $browser
|
* @param Browser $browser
|
||||||
* @return Session_Logger
|
* @return Session_Logger
|
||||||
*/
|
*/
|
||||||
public static function create(Application $app, databox &$databox, Browser &$browser)
|
public static function create(Application $app, databox $databox, Browser $browser)
|
||||||
{
|
{
|
||||||
$colls = array();
|
$colls = array();
|
||||||
$registry = $app['phraseanet.registry'];
|
$registry = $app['phraseanet.registry'];
|
||||||
|
@@ -60,7 +60,7 @@ class appbox extends base
|
|||||||
*
|
*
|
||||||
* @return appbox
|
* @return appbox
|
||||||
*/
|
*/
|
||||||
public static function get_instance(Application $app, registryInterface &$registry = null)
|
public static function get_instance(Application $app, registryInterface $registry = null)
|
||||||
{
|
{
|
||||||
if (!self::$_instance instanceof self) {
|
if (!self::$_instance instanceof self) {
|
||||||
self::$_instance = new static($app, $registry);
|
self::$_instance = new static($app, $registry);
|
||||||
@@ -331,7 +331,7 @@ class appbox extends base
|
|||||||
return self::BASE_TYPE;
|
return self::BASE_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function forceUpgrade(Setup_Upgrade &$upgrader, Application $app)
|
public function forceUpgrade(Setup_Upgrade $upgrader, Application $app)
|
||||||
{
|
{
|
||||||
$from_version = $this->get_version();
|
$from_version = $this->get_version();
|
||||||
|
|
||||||
@@ -441,7 +441,7 @@ class appbox extends base
|
|||||||
return $advices;
|
return $advices;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function post_upgrade(Setup_Upgrade &$upgrader, Application $app)
|
protected function post_upgrade(Setup_Upgrade $upgrader, Application $app)
|
||||||
{
|
{
|
||||||
$upgrader->add_steps(1 + count($this->get_databoxes()));
|
$upgrader->add_steps(1 + count($this->get_databoxes()));
|
||||||
$this->apply_patches($this->get_version(), $app['phraseanet.version']->getNumber(), true, $upgrader, $app);
|
$this->apply_patches($this->get_version(), $app['phraseanet.version']->getNumber(), true, $upgrader, $app);
|
||||||
@@ -465,7 +465,7 @@ class appbox extends base
|
|||||||
* @param type $write_file
|
* @param type $write_file
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public static function create(Application $app, registryInterface &$registry, connection_interface $conn, $dbname, Version $version, $write_file = false)
|
public static function create(Application $app, registryInterface $registry, connection_interface $conn, $dbname, Version $version, $write_file = false)
|
||||||
{
|
{
|
||||||
$credentials = $conn->get_credentials();
|
$credentials = $conn->get_credentials();
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@ class appbox_register
|
|||||||
* @param appbox $appbox
|
* @param appbox $appbox
|
||||||
* @return appbox_register
|
* @return appbox_register
|
||||||
*/
|
*/
|
||||||
public function __construct(appbox &$appbox)
|
public function __construct(appbox $appbox)
|
||||||
{
|
{
|
||||||
$this->appbox = $appbox;
|
$this->appbox = $appbox;
|
||||||
|
|
||||||
|
@@ -258,7 +258,7 @@ abstract class base implements cache_cacheableInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function upgradeDb($apply_patches, Setup_Upgrade &$upgrader, Application $app)
|
protected function upgradeDb($apply_patches, Setup_Upgrade $upgrader, Application $app)
|
||||||
{
|
{
|
||||||
$recommends = array();
|
$recommends = array();
|
||||||
|
|
||||||
@@ -771,7 +771,7 @@ abstract class base implements cache_cacheableInterface
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function apply_patches($from, $to, $post_process, Setup_Upgrade &$upgrader, Application $app)
|
protected function apply_patches($from, $to, $post_process, Setup_Upgrade $upgrader, Application $app)
|
||||||
{
|
{
|
||||||
if (version_compare($from, $to, '=')) {
|
if (version_compare($from, $to, '=')) {
|
||||||
return true;
|
return true;
|
||||||
|
@@ -362,7 +362,7 @@ class caption_Field_Value implements cache_cacheableInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function create(Application $app, databox_field &$databox_field, record_Interface $record, $value, Vocabulary\ControlProvider\ControlProviderInterface $vocabulary = null, $vocabularyId = null)
|
public static function create(Application $app, databox_field $databox_field, record_Interface $record, $value, Vocabulary\ControlProvider\ControlProviderInterface $vocabulary = null, $vocabularyId = null)
|
||||||
{
|
{
|
||||||
$connbas = $databox_field->get_connection();
|
$connbas = $databox_field->get_connection();
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@ class caption_field implements cache_cacheableInterface
|
|||||||
* @param int $id
|
* @param int $id
|
||||||
* @return caption_field
|
* @return caption_field
|
||||||
*/
|
*/
|
||||||
public function __construct(Application $app, databox_field &$databox_field, record_Interface $record)
|
public function __construct(Application $app, databox_field $databox_field, record_Interface $record)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->record = $record;
|
$this->record = $record;
|
||||||
|
@@ -20,7 +20,7 @@ use Alchemy\Phrasea\Application;
|
|||||||
interface caption_interface
|
interface caption_interface
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct(Application $app, record_Interface &$record, databox &$databox);
|
public function __construct(Application $app, record_Interface $record, databox $databox);
|
||||||
|
|
||||||
public function get_highlight_fields($highlight = '', Array $grep_fields = null, searchEngine_adapter $searchEngine = null);
|
public function get_highlight_fields($highlight = '', Array $grep_fields = null, searchEngine_adapter $searchEngine = null);
|
||||||
}
|
}
|
||||||
|
@@ -49,7 +49,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
|
|||||||
* @param databox $databox
|
* @param databox $databox
|
||||||
* @return caption_record
|
* @return caption_record
|
||||||
*/
|
*/
|
||||||
public function __construct(Application $app, record_Interface &$record, databox &$databox)
|
public function __construct(Application $app, record_Interface $record, databox $databox)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->sbas_id = $record->get_sbas_id();
|
$this->sbas_id = $record->get_sbas_id();
|
||||||
|
@@ -40,7 +40,7 @@ class collection implements cache_cacheableInterface
|
|||||||
const PIC_STAMP = 'stamp';
|
const PIC_STAMP = 'stamp';
|
||||||
const PIC_PRESENTATION = 'presentation';
|
const PIC_PRESENTATION = 'presentation';
|
||||||
|
|
||||||
protected function __construct(Application $app, $coll_id, databox &$databox)
|
protected function __construct(Application $app, $coll_id, databox $databox)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->databox = $databox;
|
$this->databox = $databox;
|
||||||
@@ -115,7 +115,7 @@ class collection implements cache_cacheableInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function enable(appbox &$appbox)
|
public function enable(appbox $appbox)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE bas SET active = "1" WHERE base_id = :base_id';
|
$sql = 'UPDATE bas SET active = "1" WHERE base_id = :base_id';
|
||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
@@ -131,7 +131,7 @@ class collection implements cache_cacheableInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function disable(appbox &$appbox)
|
public function disable(appbox $appbox)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE bas SET active=0 WHERE base_id = :base_id';
|
$sql = 'UPDATE bas SET active=0 WHERE base_id = :base_id';
|
||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
@@ -534,11 +534,13 @@ class collection implements cache_cacheableInterface
|
|||||||
|
|
||||||
phrasea::reset_baseDatas($appbox);
|
phrasea::reset_baseDatas($appbox);
|
||||||
|
|
||||||
|
$collection = self::get_from_coll_id($app, $databox, $new_id);
|
||||||
|
|
||||||
if (null !== $user) {
|
if (null !== $user) {
|
||||||
self::set_admin($new_bas, $user);
|
$collection->set_admin($new_bas, $user);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::get_from_coll_id($app, $databox, $new_id);
|
return $collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set_admin($base_id, user_adapter $user)
|
public function set_admin($base_id, user_adapter $user)
|
||||||
|
@@ -375,7 +375,7 @@ class databox extends base
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function create(Application $app, connection_pdo &$connection, \SplFileInfo $data_template, registryInterface $registry)
|
public static function create(Application $app, connection_pdo $connection, \SplFileInfo $data_template, registryInterface $registry)
|
||||||
{
|
{
|
||||||
if ( ! file_exists($data_template->getRealPath())) {
|
if ( ! file_exists($data_template->getRealPath())) {
|
||||||
throw new \InvalidArgumentException($data_template->getRealPath() . " does not exist");
|
throw new \InvalidArgumentException($data_template->getRealPath() . " does not exist");
|
||||||
@@ -607,7 +607,7 @@ class databox extends base
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function addZeros($n, $length = 5)
|
private static function addZeros($n, $length = 5)
|
||||||
{
|
{
|
||||||
while (strlen($n) < $length) {
|
while (strlen($n) < $length) {
|
||||||
$n = '0' . $n;
|
$n = '0' . $n;
|
||||||
|
@@ -159,7 +159,7 @@ class databox_field implements cache_cacheableInterface
|
|||||||
* @param <type> $id
|
* @param <type> $id
|
||||||
* @return databox_field
|
* @return databox_field
|
||||||
*/
|
*/
|
||||||
protected function __construct(Application $app, databox &$databox, $id)
|
protected function __construct(Application $app, databox $databox, $id)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->set_databox($databox);
|
$this->set_databox($databox);
|
||||||
@@ -248,7 +248,7 @@ class databox_field implements cache_cacheableInterface
|
|||||||
* @param int $id
|
* @param int $id
|
||||||
* @return \databox_field
|
* @return \databox_field
|
||||||
*/
|
*/
|
||||||
public static function get_instance(Application $app, databox &$databox, $id)
|
public static function get_instance(Application $app, databox $databox, $id)
|
||||||
{
|
{
|
||||||
$cache_key = 'field_' . $id;
|
$cache_key = 'field_' . $id;
|
||||||
$instance_id = $databox->get_sbas_id() . '_' . $id;
|
$instance_id = $databox->get_sbas_id() . '_' . $id;
|
||||||
@@ -268,7 +268,7 @@ class databox_field implements cache_cacheableInterface
|
|||||||
*
|
*
|
||||||
* @param databox $databox
|
* @param databox $databox
|
||||||
*/
|
*/
|
||||||
public function set_databox(databox &$databox)
|
public function set_databox(databox $databox)
|
||||||
{
|
{
|
||||||
$this->databox = $databox;
|
$this->databox = $databox;
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ class databox_subdefsStructure implements IteratorAggregate, Countable
|
|||||||
* @param databox $databox
|
* @param databox $databox
|
||||||
* @return Array
|
* @return Array
|
||||||
*/
|
*/
|
||||||
public function __construct(databox &$databox)
|
public function __construct(databox $databox)
|
||||||
{
|
{
|
||||||
$this->databox = $databox;
|
$this->databox = $databox;
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@ abstract class eventsmanager_eventAbstract
|
|||||||
*/
|
*/
|
||||||
protected $broker;
|
protected $broker;
|
||||||
|
|
||||||
public function __construct(Application $app, eventsmanager_broker &$broker)
|
public function __construct(Application $app, eventsmanager_broker $broker)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->broker = $broker;
|
$this->broker = $broker;
|
||||||
|
@@ -260,7 +260,9 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
|
|||||||
public function is_available()
|
public function is_available()
|
||||||
{
|
{
|
||||||
$bool = false;
|
$bool = false;
|
||||||
if ( ! $this->app->isAuthenticated() || ! login::register_enabled($this->app)) {
|
$login = new \login();
|
||||||
|
|
||||||
|
if ( ! $this->app->isAuthenticated() || ! $login->register_enabled($this->app)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
|
|||||||
*
|
*
|
||||||
* @return notify_orderdeliver
|
* @return notify_orderdeliver
|
||||||
*/
|
*/
|
||||||
public function __construct(Application $app, eventsmanager_broker &$broker)
|
public function __construct(Application $app, eventsmanager_broker $broker)
|
||||||
{
|
{
|
||||||
$this->group = _('Commande');
|
$this->group = _('Commande');
|
||||||
parent::__construct($app, $broker);
|
parent::__construct($app, $broker);
|
||||||
|
@@ -24,7 +24,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac
|
|||||||
*/
|
*/
|
||||||
public $events = array('__ORDER_NOT_DELIVERED__');
|
public $events = array('__ORDER_NOT_DELIVERED__');
|
||||||
|
|
||||||
public function __construct(Application $app, eventsmanager_broker &$broker)
|
public function __construct(Application $app, eventsmanager_broker $broker)
|
||||||
{
|
{
|
||||||
$this->group = _('Commande');
|
$this->group = _('Commande');
|
||||||
parent::__construct($app, $broker);
|
parent::__construct($app, $broker);
|
||||||
|
@@ -264,8 +264,9 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
|
|||||||
public function is_available()
|
public function is_available()
|
||||||
{
|
{
|
||||||
$bool = false;
|
$bool = false;
|
||||||
|
$login = new \login();
|
||||||
|
|
||||||
if ( !$this->app->isAuthenticated() || ! login::register_enabled($this->app)) {
|
if ( !$this->app->isAuthenticated() || ! $login->register_enabled($this->app)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract
|
|||||||
*
|
*
|
||||||
* @return notify_validate
|
* @return notify_validate
|
||||||
*/
|
*/
|
||||||
public function __construct(Application $app, eventsmanager_broker &$broker)
|
public function __construct(Application $app, eventsmanager_broker $broker)
|
||||||
{
|
{
|
||||||
$this->group = _('Validation');
|
$this->group = _('Validation');
|
||||||
parent::__construct($app, $broker);
|
parent::__construct($app, $broker);
|
||||||
|
@@ -29,7 +29,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
|
|||||||
*
|
*
|
||||||
* @return notify_validationdone
|
* @return notify_validationdone
|
||||||
*/
|
*/
|
||||||
public function __construct(Application $app, eventsmanager_broker &$broker)
|
public function __construct(Application $app, eventsmanager_broker $broker)
|
||||||
{
|
{
|
||||||
$this->group = _('Validation');
|
$this->group = _('Validation');
|
||||||
parent::__construct($app, $broker);
|
parent::__construct($app, $broker);
|
||||||
|
@@ -29,7 +29,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
|
|||||||
*
|
*
|
||||||
* @return notify_validationreminder
|
* @return notify_validationreminder
|
||||||
*/
|
*/
|
||||||
public function __construct(Application $app, eventsmanager_broker &$broker)
|
public function __construct(Application $app, eventsmanager_broker $broker)
|
||||||
{
|
{
|
||||||
$this->group = _('Validation');
|
$this->group = _('Validation');
|
||||||
parent::__construct($app, $broker);
|
parent::__construct($app, $broker);
|
||||||
|
@@ -74,7 +74,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
|
|||||||
* @param media_subdef $media_subdef
|
* @param media_subdef $media_subdef
|
||||||
* @return media_Permalink_Adapter
|
* @return media_Permalink_Adapter
|
||||||
*/
|
*/
|
||||||
protected function __construct(Application $app, databox &$databox, media_subdef &$media_subdef)
|
protected function __construct(Application $app, databox $databox, media_subdef $media_subdef)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->databox = $databox;
|
$this->databox = $databox;
|
||||||
@@ -305,7 +305,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
|
|||||||
* @param media_subdef $media_subdef
|
* @param media_subdef $media_subdef
|
||||||
* @return media_Permalink_Adapter
|
* @return media_Permalink_Adapter
|
||||||
*/
|
*/
|
||||||
public static function getPermalink(Application $app, databox &$databox, media_subdef &$media_subdef)
|
public static function getPermalink(Application $app, databox $databox, media_subdef $media_subdef)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return new self($app, $databox, $media_subdef);
|
return new self($app, $databox, $media_subdef);
|
||||||
@@ -322,7 +322,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
|
|||||||
* @param media_subdef $media_subdef
|
* @param media_subdef $media_subdef
|
||||||
* @return media_Permalink_Adapter
|
* @return media_Permalink_Adapter
|
||||||
*/
|
*/
|
||||||
public static function create(Application $app, databox &$databox, media_subdef &$media_subdef)
|
public static function create(Application $app, databox $databox, media_subdef $media_subdef)
|
||||||
{
|
{
|
||||||
$sql = 'INSERT INTO permalinks
|
$sql = 'INSERT INTO permalinks
|
||||||
(id, subdef_id, token, activated, created_on, last_modified, label)
|
(id, subdef_id, token, activated, created_on, last_modified, label)
|
||||||
@@ -353,7 +353,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea
|
|||||||
* @param string $name
|
* @param string $name
|
||||||
* @return record_adapter
|
* @return record_adapter
|
||||||
*/
|
*/
|
||||||
public static function challenge_token(Application $app, databox &$databox, $token, $record_id, $name)
|
public static function challenge_token(Application $app, databox $databox, $token, $record_id, $name)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT p.id
|
$sql = 'SELECT p.id
|
||||||
FROM permalinks p, subdef s
|
FROM permalinks p, subdef s
|
||||||
|
@@ -40,7 +40,7 @@ interface media_Permalink_Interface
|
|||||||
|
|
||||||
public function set_label($label);
|
public function set_label($label);
|
||||||
|
|
||||||
public static function getPermalink(Application $app, databox &$databox, media_subdef &$media_subdef);
|
public static function getPermalink(Application $app, databox $databox, media_subdef $media_subdef);
|
||||||
|
|
||||||
public static function create(Application $app, databox &$databox, media_subdef &$media_subdef);
|
public static function create(Application $app, databox $databox, media_subdef $media_subdef);
|
||||||
}
|
}
|
||||||
|
@@ -146,7 +146,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
* @param type $substitute
|
* @param type $substitute
|
||||||
* @return media_subdef
|
* @return media_subdef
|
||||||
*/
|
*/
|
||||||
public function __construct(Application $app, record_adapter &$record, $name, $substitute = false)
|
public function __construct(Application $app, record_adapter $record, $name, $substitute = false)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->app = $app;
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
|
@@ -85,7 +85,7 @@ class module_console_systemConfigCheck extends Command
|
|||||||
return (int) ! $ok;
|
return (int) ! $ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processConstraints(Setup_ConstraintsIterator $constraints, OutputInterface &$output)
|
protected function processConstraints(Setup_ConstraintsIterator $constraints, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$hasError = false;
|
$hasError = false;
|
||||||
foreach ($constraints as $constraint) {
|
foreach ($constraints as $constraint) {
|
||||||
@@ -97,7 +97,7 @@ class module_console_systemConfigCheck extends Command
|
|||||||
return ! $hasError;
|
return ! $hasError;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processConstraint(Setup_Constraint $constraint, OutputInterface &$output)
|
protected function processConstraint(Setup_Constraint $constraint, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$ok = true;
|
$ok = true;
|
||||||
if ($constraint->is_ok()) {
|
if ($constraint->is_ok()) {
|
||||||
|
@@ -64,7 +64,7 @@ class module_console_tasklist extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function printTask(task_abstract $task, OutputInterface &$output)
|
protected function printTask(task_abstract $task, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$message = $task->getID() . "\t" . ($task->getState() ) . "\t" . $task->getTitle();
|
$message = $task->getID() . "\t" . ($task->getState() ) . "\t" . $task->getTitle();
|
||||||
$output->writeln($message);
|
$output->writeln($message);
|
||||||
|
@@ -54,7 +54,7 @@ class patch_303 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$this->update_users_log_datas($appbox);
|
$this->update_users_log_datas($appbox);
|
||||||
$this->update_users_search_datas($appbox);
|
$this->update_users_search_datas($appbox);
|
||||||
@@ -66,7 +66,7 @@ class patch_303 implements patchInterface
|
|||||||
*
|
*
|
||||||
* @return patch_303
|
* @return patch_303
|
||||||
*/
|
*/
|
||||||
public function update_users_log_datas(appbox &$appbox)
|
public function update_users_log_datas(appbox $appbox)
|
||||||
{
|
{
|
||||||
$col = array('fonction', 'societe', 'activite', 'pays');
|
$col = array('fonction', 'societe', 'activite', 'pays');
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ class patch_303 implements patchInterface
|
|||||||
*
|
*
|
||||||
* @return patch_303
|
* @return patch_303
|
||||||
*/
|
*/
|
||||||
public function update_users_search_datas(appbox &$appbox)
|
public function update_users_search_datas(appbox $appbox)
|
||||||
{
|
{
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
$date_debut = '0000-00-00 00:00:00';
|
$date_debut = '0000-00-00 00:00:00';
|
||||||
|
@@ -54,7 +54,7 @@ class patch_304 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT id FROM pref WHERE prop = "indexes"';
|
$sql = 'SELECT id FROM pref WHERE prop = "indexes"';
|
||||||
$stmt = $databox->get_connection()->prepare($sql);
|
$stmt = $databox->get_connection()->prepare($sql);
|
||||||
|
@@ -54,7 +54,7 @@ class patch_305 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'REPLACE INTO usr_settings
|
$sql = 'REPLACE INTO usr_settings
|
||||||
(SELECT usr_id, "start_page_query" as prop, last_query as value
|
(SELECT usr_id, "start_page_query" as prop, last_query as value
|
||||||
|
@@ -54,7 +54,7 @@ class patch_306 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$dom = $databox->get_dom_structure();
|
$dom = $databox->get_dom_structure();
|
||||||
$xpath = $databox->get_xpath_structure();
|
$xpath = $databox->get_xpath_structure();
|
||||||
|
@@ -54,7 +54,7 @@ class patch_310 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$dom_structure = $databox->get_dom_structure();
|
$dom_structure = $databox->get_dom_structure();
|
||||||
$sx_structure = $databox->get_sxml_structure();
|
$sx_structure = $databox->get_sxml_structure();
|
||||||
|
@@ -54,7 +54,7 @@ class patch_3103 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@ class patch_311 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE record SET jeton = '
|
$sql = 'UPDATE record SET jeton = '
|
||||||
. (JETON_WRITE_META_DOC | JETON_WRITE_META_SUBDEF);
|
. (JETON_WRITE_META_DOC | JETON_WRITE_META_SUBDEF);
|
||||||
|
@@ -54,7 +54,7 @@ class patch_320 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE record SET parent_record_id = "1"
|
$sql = 'UPDATE record SET parent_record_id = "1"
|
||||||
WHERE parent_record_id != "0"';
|
WHERE parent_record_id != "0"';
|
||||||
|
@@ -53,7 +53,7 @@ class patch_320a implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT * FROM usr WHERE nonce IS NULL';
|
$sql = 'SELECT * FROM usr WHERE nonce IS NULL';
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ class patch_320aa implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
if (is_file(__DIR__ . '/../../../config/_GV.php')) {
|
if (is_file(__DIR__ . '/../../../config/_GV.php')) {
|
||||||
require __DIR__ . '/../../../config/_GV.php';
|
require __DIR__ . '/../../../config/_GV.php';
|
||||||
|
@@ -53,7 +53,7 @@ class patch_320ab implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'REPLACE INTO records_rights
|
$sql = 'REPLACE INTO records_rights
|
||||||
(SELECT null as id, usr_id, b.sbas_id, record_id, "1" as document
|
(SELECT null as id, usr_id, b.sbas_id, record_id, "1" as document
|
||||||
|
@@ -53,7 +53,7 @@ class patch_320b implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE basusr SET nowatermark=1 WHERE needwatermark=0';
|
$sql = 'UPDATE basusr SET nowatermark=1 WHERE needwatermark=0';
|
||||||
$stmt = $appbox->get_connection()->prepare($sql);
|
$stmt = $appbox->get_connection()->prepare($sql);
|
||||||
|
@@ -53,7 +53,7 @@ class patch_320c implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'TRUNCATE metadatas';
|
$sql = 'TRUNCATE metadatas';
|
||||||
$stmt = $databox->get_connection()->prepare($sql);
|
$stmt = $databox->get_connection()->prepare($sql);
|
||||||
|
@@ -53,7 +53,7 @@ class patch_320d implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = 'SELECT base_id, usr_id FROM order_masters';
|
$sql = 'SELECT base_id, usr_id FROM order_masters';
|
||||||
|
@@ -53,7 +53,7 @@ class patch_320e implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE record r, subdef s
|
$sql = 'UPDATE record r, subdef s
|
||||||
SET r.mime = s.mime
|
SET r.mime = s.mime
|
||||||
|
@@ -53,7 +53,7 @@ class patch_320f implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$feeds = array();
|
$feeds = array();
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ class patch_320f implements patchInterface
|
|||||||
}
|
}
|
||||||
protected static $feeds = array();
|
protected static $feeds = array();
|
||||||
|
|
||||||
protected function get_feed(appbox &$appbox, User_Adapter &$user, $pub_restrict, $homelink)
|
protected function get_feed(appbox $appbox, User_Adapter $user, $pub_restrict, $homelink)
|
||||||
{
|
{
|
||||||
$user_key = 'user_' . $user->get_id();
|
$user_key = 'user_' . $user->get_id();
|
||||||
if ($homelink == '1')
|
if ($homelink == '1')
|
||||||
|
@@ -53,7 +53,7 @@ class patch_320h implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$sql = 'DELETE FROM basusr WHERE actif = "0"';
|
$sql = 'DELETE FROM basusr WHERE actif = "0"';
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ class patch_360 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$tables = array('StoryWZ', 'ValidationDatas', 'ValidationParticipants', 'ValidationSessions', 'BasketElements', 'Baskets');
|
$tables = array('StoryWZ', 'ValidationDatas', 'ValidationParticipants', 'ValidationSessions', 'BasketElements', 'Baskets');
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ class patch_3602 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$sql = 'ALTER TABLE `metadatas` DROP INDEX `unique`';
|
$sql = 'ALTER TABLE `metadatas` DROP INDEX `unique`';
|
||||||
|
@@ -53,7 +53,7 @@ class patch_3603 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = 'UPDATE usr SET usr_mail = NULL
|
$sql = 'UPDATE usr SET usr_mail = NULL
|
||||||
|
@@ -53,7 +53,7 @@ class patch_3604 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Fail if upgrade has previously failed, no problem
|
* Fail if upgrade has previously failed, no problem
|
||||||
|
@@ -54,7 +54,7 @@ class patch_361 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ class patch_370 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$conn = $databox->get_connection();
|
$conn = $databox->get_connection();
|
||||||
|
|
||||||
|
@@ -54,7 +54,7 @@ class patch_370a3 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
\API_OAuth2_Application::load_from_client_id($app, \API_OAuth2_Application_Navigator::CLIENT_ID);
|
\API_OAuth2_Application::load_from_client_id($app, \API_OAuth2_Application_Navigator::CLIENT_ID);
|
||||||
|
@@ -53,7 +53,7 @@ class patch_370a4 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = 'SELECT id, src FROM metadatas_structure';
|
$sql = 'SELECT id, src FROM metadatas_structure';
|
||||||
|
@@ -53,7 +53,7 @@ class patch_370a5 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = 'SELECT id, src FROM metadatas_structure';
|
$sql = 'SELECT id, src FROM metadatas_structure';
|
||||||
|
@@ -53,7 +53,7 @@ class patch_370a6 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
$structure = $databox->get_structure();
|
$structure = $databox->get_structure();
|
||||||
|
|
||||||
|
@@ -55,7 +55,7 @@ class patch_370a7 implements patchInterface
|
|||||||
return $this->concern;
|
return $this->concern;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
|
|
||||||
|
@@ -60,7 +60,7 @@ class patch_370a8 implements patchInterface
|
|||||||
* @param base $appbox
|
* @param base $appbox
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$task_manager = new task_manager($app);
|
$task_manager = new task_manager($app);
|
||||||
|
|
||||||
|
@@ -58,7 +58,7 @@ class patch_370a9 implements patchInterface
|
|||||||
* Add new border manager service to services.yml & config.yml configuration files
|
* Add new border manager service to services.yml & config.yml configuration files
|
||||||
* @param base $appbox
|
* @param base $appbox
|
||||||
*/
|
*/
|
||||||
public function apply(base &$appbox, Application $app)
|
public function apply(base $appbox, Application $app)
|
||||||
{
|
{
|
||||||
$services = $app['phraseanet.configuration']->getServices();
|
$services = $app['phraseanet.configuration']->getServices();
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ class patch_371 implements patchInterface
|
|||||||
/**
|
/**
|
||||||
* @param base $databox
|
* @param base $databox
|
||||||
*/
|
*/
|
||||||
public function apply(base &$databox, Application $app)
|
public function apply(base $databox, Application $app)
|
||||||
{
|
{
|
||||||
foreach($databox->get_meta_structure() as $databox_field) {
|
foreach($databox->get_meta_structure() as $databox_field) {
|
||||||
$databox_field->save();
|
$databox_field->save();
|
||||||
|
@@ -11,5 +11,5 @@ interface patchInterface
|
|||||||
|
|
||||||
public function require_all_upgrades();
|
public function require_all_upgrades();
|
||||||
|
|
||||||
public function apply(base &$base, Application $app);
|
public function apply(base $base, Application $app);
|
||||||
}
|
}
|
||||||
|
@@ -57,7 +57,7 @@ interface record_Interface
|
|||||||
|
|
||||||
public function get_duration();
|
public function get_duration();
|
||||||
|
|
||||||
public function move_to_collection(collection &$collection, appbox &$appbox);
|
public function move_to_collection(collection $collection, appbox $appbox);
|
||||||
|
|
||||||
public function get_rollover_thumbnail();
|
public function get_rollover_thumbnail();
|
||||||
|
|
||||||
|
@@ -489,7 +489,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
* @param appbox $appbox
|
* @param appbox $appbox
|
||||||
* @return record_adapter
|
* @return record_adapter
|
||||||
*/
|
*/
|
||||||
public function move_to_collection(collection &$collection, appbox &$appbox)
|
public function move_to_collection(collection $collection, appbox $appbox)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE record SET coll_id = :coll_id WHERE record_id =:record_id";
|
$sql = "UPDATE record SET coll_id = :coll_id WHERE record_id =:record_id";
|
||||||
|
|
||||||
|
@@ -148,7 +148,7 @@ abstract class set_abstract implements IteratorAggregate
|
|||||||
* @param record_Interface $record
|
* @param record_Interface $record
|
||||||
* @return set
|
* @return set
|
||||||
*/
|
*/
|
||||||
public function add_element(record_Interface &$record)
|
public function add_element(record_Interface $record)
|
||||||
{
|
{
|
||||||
$this->elements[$record->get_serialize_key()] = $record;
|
$this->elements[$record->get_serialize_key()] = $record;
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ abstract class set_abstract implements IteratorAggregate
|
|||||||
* @param record_Interface $record
|
* @param record_Interface $record
|
||||||
* @return set
|
* @return set
|
||||||
*/
|
*/
|
||||||
public function remove_element(record_Interface &$record)
|
public function remove_element(record_Interface $record)
|
||||||
{
|
{
|
||||||
$key = $record->get_serialize_key();
|
$key = $record->get_serialize_key();
|
||||||
if (isset($this->elements[$key]))
|
if (isset($this->elements[$key]))
|
||||||
|
@@ -836,7 +836,7 @@ abstract class task_abstract
|
|||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
':active' => 1
|
':active' => 1
|
||||||
, ':name' => $class_name::getName()
|
, ':name' => ''
|
||||||
, ':class' => $class_name
|
, ':class' => $class_name
|
||||||
, ':settings' => $settings
|
, ':settings' => $settings
|
||||||
);
|
);
|
||||||
@@ -846,7 +846,10 @@ abstract class task_abstract
|
|||||||
|
|
||||||
$tid = $dependencyContainer['phraseanet.appbox']->get_connection()->lastInsertId();
|
$tid = $dependencyContainer['phraseanet.appbox']->get_connection()->lastInsertId();
|
||||||
|
|
||||||
return new $class_name($tid, $dependencyContainer, $dependencyContainer['monolog']);
|
$task = new $class_name($tid, $dependencyContainer, $dependencyContainer['monolog']);
|
||||||
|
$task->setTitle($task->getName());
|
||||||
|
|
||||||
|
return $task;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUsage()
|
public function getUsage()
|
||||||
|
@@ -138,7 +138,7 @@ class task_period_apibridge extends task_appboxAbstract
|
|||||||
* @param Bridge_Element $element
|
* @param Bridge_Element $element
|
||||||
* @return task_period_apibridge
|
* @return task_period_apibridge
|
||||||
*/
|
*/
|
||||||
protected function update_element(Bridge_Element &$element)
|
protected function update_element(Bridge_Element $element)
|
||||||
{
|
{
|
||||||
$account = $element->get_account();
|
$account = $element->get_account();
|
||||||
$connector_status = $account->get_api()->get_element_status($element);
|
$connector_status = $account->get_api()->get_element_status($element);
|
||||||
|
@@ -25,7 +25,8 @@ class Feed_Publisher_AdapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
$auth = new Session_Authentication_None(self::$DI['user']);
|
$auth = new Session_Authentication_None(self::$DI['user']);
|
||||||
self::$DI['app']->openAccount($auth);
|
self::$DI['app']->openAccount($auth);
|
||||||
self::$feed = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], self::$title, self::$subtitle);
|
self::$feed = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], self::$title, self::$subtitle);
|
||||||
self::$object = array_pop(self::$feed->get_publishers());
|
$publishers = self::$feed->get_publishers();
|
||||||
|
self::$object = array_pop($publishers);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
|
@@ -13,6 +13,7 @@ class API_OAuth2_AuthCodeTest extends PhraseanetPHPUnitAbstract
|
|||||||
protected $code;
|
protected $code;
|
||||||
|
|
||||||
protected $account;
|
protected $account;
|
||||||
|
protected $application;
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
|
@@ -49,7 +49,8 @@ class caption_recordTest extends PhraseanetPHPUnitAbstract
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$tagname = $field->get_name();
|
$tagname = $field->get_name();
|
||||||
$value = array_pop($field->get_values());
|
$data = $field->get_values();
|
||||||
|
$value = array_pop($data);
|
||||||
$this->assertEquals($value->getValue(), (string) $sxe->description->$tagname);
|
$this->assertEquals($value->getValue(), (string) $sxe->description->$tagname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,8 @@ class databox_Field_DCES_ContributorTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_label()
|
public function testGet_label()
|
||||||
{
|
{
|
||||||
$name = str_replace('Test', '', array_pop(explode('_', __CLASS__)));
|
$data = explode('_', __CLASS__);
|
||||||
|
$name = str_replace('Test', '', array_pop($data));
|
||||||
$this->assertEquals($name, $this->object->get_label());
|
$this->assertEquals($name, $this->object->get_label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,8 @@ class databox_Field_DCES_CoverageTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_label()
|
public function testGet_label()
|
||||||
{
|
{
|
||||||
$name = str_replace('Test', '', array_pop(explode('_', __CLASS__)));
|
$data = explode('_', __CLASS__);
|
||||||
|
$name = str_replace('Test', '', array_pop($data));
|
||||||
$this->assertEquals($name, $this->object->get_label());
|
$this->assertEquals($name, $this->object->get_label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,8 @@ class databox_Field_DCES_CreatorTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_label()
|
public function testGet_label()
|
||||||
{
|
{
|
||||||
$name = str_replace('Test', '', array_pop(explode('_', __CLASS__)));
|
$data = explode('_', __CLASS__);
|
||||||
|
$name = str_replace('Test', '', array_pop($data));
|
||||||
$this->assertEquals($name, $this->object->get_label());
|
$this->assertEquals($name, $this->object->get_label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,8 @@ class databox_Field_DCES_DateTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_label()
|
public function testGet_label()
|
||||||
{
|
{
|
||||||
$name = str_replace('Test', '', array_pop(explode('_', __CLASS__)));
|
$data = explode('_', __CLASS__);
|
||||||
|
$name = str_replace('Test', '', array_pop($data));
|
||||||
$this->assertEquals($name, $this->object->get_label());
|
$this->assertEquals($name, $this->object->get_label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,8 @@ class databox_Field_DCES_DescriptionTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_label()
|
public function testGet_label()
|
||||||
{
|
{
|
||||||
$name = str_replace('Test', '', array_pop(explode('_', __CLASS__)));
|
$data = explode('_', __CLASS__);
|
||||||
|
$name = str_replace('Test', '', array_pop($data));
|
||||||
$this->assertEquals($name, $this->object->get_label());
|
$this->assertEquals($name, $this->object->get_label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,8 @@ class databox_Field_DCES_FormatTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_label()
|
public function testGet_label()
|
||||||
{
|
{
|
||||||
$name = str_replace('Test', '', array_pop(explode('_', __CLASS__)));
|
$data = explode('_', __CLASS__);
|
||||||
|
$name = str_replace('Test', '', array_pop($data));
|
||||||
$this->assertEquals($name, $this->object->get_label());
|
$this->assertEquals($name, $this->object->get_label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,8 @@ class databox_Field_DCES_IdentifierTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_label()
|
public function testGet_label()
|
||||||
{
|
{
|
||||||
$name = str_replace('Test', '', array_pop(explode('_', __CLASS__)));
|
$data = explode('_', __CLASS__);
|
||||||
|
$name = str_replace('Test', '', array_pop($data));
|
||||||
$this->assertEquals($name, $this->object->get_label());
|
$this->assertEquals($name, $this->object->get_label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,8 @@ class databox_Field_DCES_LanguageTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_label()
|
public function testGet_label()
|
||||||
{
|
{
|
||||||
$name = str_replace('Test', '', array_pop(explode('_', __CLASS__)));
|
$data = explode('_', __CLASS__);
|
||||||
|
$name = str_replace('Test', '', array_pop($data));
|
||||||
$this->assertEquals($name, $this->object->get_label());
|
$this->assertEquals($name, $this->object->get_label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,8 @@ class databox_Field_DCES_PublisherTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_label()
|
public function testGet_label()
|
||||||
{
|
{
|
||||||
$name = str_replace('Test', '', array_pop(explode('_', __CLASS__)));
|
$data = explode('_', __CLASS__);
|
||||||
|
$name = str_replace('Test', '', array_pop($data));
|
||||||
$this->assertEquals($name, $this->object->get_label());
|
$this->assertEquals($name, $this->object->get_label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,8 @@ class databox_Field_DCES_RelationTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_label()
|
public function testGet_label()
|
||||||
{
|
{
|
||||||
$name = str_replace('Test', '', array_pop(explode('_', __CLASS__)));
|
$data = explode('_', __CLASS__);
|
||||||
|
$name = str_replace('Test', '', array_pop($data));
|
||||||
$this->assertEquals($name, $this->object->get_label());
|
$this->assertEquals($name, $this->object->get_label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,8 @@ class databox_Field_DCES_RightsTest extends PhraseanetPHPUnitAbstract
|
|||||||
|
|
||||||
public function testGet_label()
|
public function testGet_label()
|
||||||
{
|
{
|
||||||
$name = str_replace('Test', '', array_pop(explode('_', __CLASS__)));
|
$data = explode('_', __CLASS__);
|
||||||
|
$name = str_replace('Test', '', array_pop($data));
|
||||||
$this->assertEquals($name, $this->object->get_label());
|
$this->assertEquals($name, $this->object->get_label());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user