コード例 #1
0
 public function __construct($options = array())
 {
     common_user_auth_Service::singleton()->startSession(new core_kernel_users_GenerisUser(new core_kernel_classes_Resource(TAO_INSTALLATOR)));
     $this->processExecutionService = wfEngine_models_classes_ProcessExecutionService::singleton();
     $this->localNS = common_ext_NamespaceManager::singleton()->getLocalNamespace()->getUri();
     $this->unserialize = isset($options['unserialize']) ? (int) $options['unserialize'] : 0;
 }
コード例 #2
0
ファイル: class.Service.php プロジェクト: nagyist/generis
 /**
  * Get a unique instance of the UserService.
  *
  * @access public
  * @author Jerome Bogaerts, <*****@*****.**>
  * @return common_user_auth_Service
  */
 public static function singleton()
 {
     if (!isset(self::$instance)) {
         self::$instance = new static();
     }
     return self::$instance;
 }
コード例 #3
0
 /**
  * Indicates if a user session is currently opened or not.
  * 
  * @return boolean True if a session is opened, false otherwise.
  */
 public function isASessionOpened()
 {
     return common_user_auth_Service::singleton()->isASessionOpened();
 }
コード例 #4
0
ファイル: UtilsTest.php プロジェクト: nagyist/generis
 public function testSerialisation()
 {
     $toSerialize = array('a' => "test \\ ", 'b' => new core_kernel_classes_Resource('doesnotexist'), 'c' => array('1', '2', array(common_user_auth_Service::singleton())));
     $value = eval("return " . common_Utils::toPHPVariableString($toSerialize) . ";");
     $this->assertEquals($toSerialize, $value);
 }
コード例 #5
0
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; under version 2
 * of the License (non-upgradable).
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 * 
 * Copyright (c) 2007-2010 (original work) Public Research Centre Henri Tudor & University of Luxembourg) (under the project TAO-QUAL);
 *               2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
 *               2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
 * 
 */
/**
 * @author CRP Henri Tudor - TAO Team - {@link http://www.tao.lu}
 * @license GPLv2  http://www.opensource.org/licenses/gpl-2.0.php
 * @package wfEngine
 */
require_once dirname(__FILE__) . '/../includes/raw_start.php';
set_time_limit(0);
//connec to the api
common_user_auth_Service::singleton()->startSession(new core_kernel_users_GenerisUser(new core_kernel_classes_Resource(TAO_INSTALLATOR)));
$notificationService = wfEngine_models_classes_NotificationService::singleton();
$sent = $notificationService->sendNotifications(new tao_helpers_transfert_MailAdapter());
print "\n{$sent} sent notifications\n";