当前位置: 首页>>代码示例>>PHP>>正文


PHP jClasses::create方法代码示例

本文整理汇总了PHP中jClasses::create方法的典型用法代码示例。如果您正苦于以下问题:PHP jClasses::create方法的具体用法?PHP jClasses::create怎么用?PHP jClasses::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jClasses的用法示例。


在下文中一共展示了jClasses::create方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _createInstance

 protected function _createInstance()
 {
     if ($this->toSelector === null) {
         $this->instance = null;
         $this->toSelector = $this->_getClassSelector();
     }
     return jClasses::create($this->toSelector->toString());
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:8,代码来源:jClassBinding.class.php

示例2: _prepareTpl

 /**
  * function to manage data before assigning to the template of its zone
  */
 protected function _prepareTpl()
 {
     list($nbAnonymous, $members, $bots) = jClasses::create('activeusers~connectedusers')->getConnectedList();
     $this->_tpl->assign('nbAnonymous', $nbAnonymous);
     $this->_tpl->assign('members', $members);
     $this->_tpl->assign('nbMembers', count($members));
     $this->_tpl->assign('bots', $bots);
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:11,代码来源:onlineusers.zone.php

示例3: verifyPassword

 public function verifyPassword($login, $password)
 {
     if (trim($password) == '') {
         return false;
     }
     $classuser = jClasses::create($this->_params['class']);
     $user = $classuser->getByLoginPassword($login, $this->cryptPassword($password));
     return $user ? $user : false;
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:9,代码来源:class.auth.php

示例4: _prepareTpl

 /**
  * function to manage data before assigning to the template of its zone
  */
 protected function _prepareTpl()
 {
     $today = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
     list($nbAnonymous, $members, $bots) = jClasses::create('activeusers~connectedusers')->getConnectedList($today, true);
     $this->_tpl->assign('nbAnonymous', $nbAnonymous);
     $this->_tpl->assign('members', $members);
     $this->_tpl->assign('nbMembers', count($members));
     $this->_tpl->assign('bots', $bots);
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:12,代码来源:online_today.zone.php

示例5: getInstance

 /**
  * Get the binded instance
  *
  * @return mixed
  */
 public function getInstance()
 {
     if ($this->instance === null) {
         if ($this->toSelector === null) {
             $this->toSelector = $this->_getClassSelector();
         }
         $this->instance = jClasses::create($this->toSelector->toString());
     }
     return $this->instance;
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:15,代码来源:jBinding.class.php

示例6: testBindingInCodeToInstance

 public function testBindingInCodeToInstance()
 {
     $instance = jClasses::create('jelix_tests~myclass');
     jClasses::bind('jelix_tests~test')->toInstance($instance);
     $class = jClasses::getBindedService('jelix_tests~test');
     $this->assertTrue($class instanceof myclass);
     jClasses::bind('jelix_tests~test')->toInstance($instance);
     $classname = jClasses::bind('jelix_tests~test')->getClassName();
     $this->assertTrue($classname === 'myclass');
 }
开发者ID:hadrienl,项目名称:jelix,代码行数:10,代码来源:utils.jclasses.html_cli.php

示例7: _prepareTpl

 /**
  * function to manage data before assigning to the template of its zone
  */
 protected function _prepareTpl()
 {
     $login = $this->param('login');
     $status = 'offline';
     if ($login) {
         if (jClasses::create('connectedusers')->isConnected($login)) {
             $status = 'online';
         } else {
             $status = 'offline';
         }
     }
     $this->_tpl->assign('status', $status);
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:16,代码来源:onlinestatus.zone.php

示例8: save

 function save()
 {
     $rep = $this->getResponse('redirect');
     $rep->action = 'default:index';
     $form = jForms::fill('config');
     if (!$form) {
         return $rep;
     }
     if (!$form->check()) {
         return $rep;
     }
     $activeusers = jClasses::create('activeusers~connectedusers');
     try {
         $activeusers->saveVisitTimeout($form->getData('timeout_visit'));
         jMessage::add(jLocale::get('main.config.save.ok'));
     } catch (Exception $e) {
         jMessage::add('Error: ' . $e->getMessage(), 'error');
     }
     return $rep;
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:20,代码来源:default.classic.php

示例9: verifyPassword

 public function verifyPassword($login, $password)
 {
     if (trim($password) == '') {
         return false;
     }
     $class = jClasses::create($this->_params['class']);
     $user = $class->getByLogin($login);
     if (!$user) {
         return false;
     }
     $result = $this->checkPassword($password, $user->password);
     if ($result === false) {
         return false;
     }
     if ($result !== true) {
         // it is a new hash for the password, let's update it persistently
         $user->password = $result;
         $class->updatePassword($login, $result);
     }
     return $user;
 }
开发者ID:medali1990,项目名称:medsite,代码行数:21,代码来源:class.auth.php

示例10: single

 function single()
 {
     $rep = $this->_prepareResponse();
     $module = $this->param('mod');
     $testname = $this->param('test');
     $category = $this->category ? ' ' . $this->category : '';
     if (isset($this->testsList[$module])) {
         $reporter = jClasses::create($this->responseType);
         jClasses::inc('junittests~junittestcase');
         jClasses::inc('junittests~junittestcasedb');
         $reporter->setResponse($rep);
         foreach ($this->testsList[$module] as $test) {
             if ($test[1] == $testname) {
                 $group = new TestSuite('"' . $module . '" module , ' . $test[2]);
                 $group->addFile(jApp::config()->_modulesPathList[$module] . 'tests/' . $test[0]);
                 jApp::pushCurrentModule($module);
                 $result = $group->run($reporter);
                 if (!$result) {
                     $rep->setExitCode(jResponseCmdline::EXIT_CODE_ERROR);
                 }
                 jApp::popCurrentModule();
                 break;
             }
         }
     } else {
         $this->output("\n" . 'no' . $category . ' tests for "' . $module . '" module.' . "\n");
     }
     return $this->_finishResponse($rep);
 }
开发者ID:CREASIG,项目名称:lizmap-web-client,代码行数:29,代码来源:default.cmdline.php

示例11: onservinfoGetInfo

 function onservinfoGetInfo($event)
 {
     $nbMembers = jClasses::create('activeusers~connectedusers')->getCount();
     $label = jLocale::get('activeusers_admin~main.server.infos.online.users');
     $event->add(new serverinfoData('user-online', $label, $nbMembers));
 }
开发者ID:havefnubb,项目名称:havefnubb,代码行数:6,代码来源:activeusersadmin.listener.php

示例12: single

 function single()
 {
     $rep = $this->_prepareResponse();
     $module = $this->param('mod');
     $testname = $this->param('test');
     if (isset($this->testsList[$module])) {
         $reporter = jClasses::create("junittests~jtextrespreporter");
         jClasses::inc('junittests~junittestcase');
         jClasses::inc('junittests~junittestcasedb');
         $reporter->setResponse($rep);
         foreach ($this->testsList[$module] as $test) {
             if ($test[1] == $testname) {
                 $group = new GroupTest('"' . $module . '" module , ' . $test[2]);
                 $group->addTestFile($GLOBALS['gJConfig']->_modulesPathList[$module] . 'tests/' . $test[0]);
                 jContext::push($module);
                 $result = $group->run($reporter);
                 if (!$result) {
                     $rep->setExitCode(jResponseCmdline::EXIT_CODE_ERROR);
                 }
                 jContext::pop();
                 break;
             }
         }
     } else {
         $rep->addContent("\n" . 'no tests for "' . $module . '" module.' . "\n");
     }
     return $this->_finishResponse($rep);
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:28,代码来源:default.cmdline.php

示例13: _prepareResponse

 protected function _prepareResponse()
 {
     $rep = $this->getResponse('html', true);
     $rep->bodyTpl = 'junittests~main';
     $rep->body->assign('page_title', 'Unit Tests');
     $rep->body->assign('versionphp', phpversion());
     $rep->body->assign('versionjelix', JELIX_VERSION);
     $rep->body->assign('basepath', jApp::config()->urlengine['basePath']);
     $rep->body->assign('isurlsig', jApp::config()->urlengine['engine'] == 'significant');
     $runnerPreparer = jClasses::create('junittests~jrunnerpreparer');
     $this->allTestsList = $runnerPreparer->getTestsList('html');
     $this->category = $this->param('categ', false);
     $this->testsList = $runnerPreparer->filterTestsByCategory($this->category, $this->allTestsList);
     $rep->body->assign('modules', $this->allTestsList);
     return $rep;
 }
开发者ID:medali1990,项目名称:medsite,代码行数:16,代码来源:default.classic.php

示例14: single

 function single()
 {
     if (!isset($GLOBALS['gJConfig']->enableTests) || !$GLOBALS['gJConfig']->enableTests) {
         // security
         $rep = $this->getResponse('html', true);
         $rep->title = 'Error';
         $rep->setHttpStatus('404', 'Not found');
         $rep->addContent('<p>404 Not Found</p>');
         return $rep;
     }
     $rep = $this->_prepareResponse();
     $module = $this->param('mod');
     $testname = $this->param('test');
     if (isset($this->testsList[$module])) {
         $reporter = jClasses::create("junittests~jhtmlrespreporter");
         jClasses::inc('junittests~junittestcase');
         jClasses::inc('junittests~junittestcasedb');
         $reporter->setResponse($rep);
         foreach ($this->testsList[$module] as $test) {
             if ($test[1] == $testname) {
                 $group = new GroupTest('"' . $module . '" module , ' . $test[2]);
                 $group->addTestFile($GLOBALS['gJConfig']->_modulesPathList[$module] . 'tests/' . $test[0]);
                 jContext::push($module);
                 $group->run($reporter);
                 jContext::pop();
                 break;
             }
         }
     } else {
         $rep->body->assign('MAIN', '<p>no tests for "' . $module . '" module.</p>');
     }
     return $this->_finishResponse($rep);
 }
开发者ID:alienpham,项目名称:helenekling,代码行数:33,代码来源:default.classic.php


注:本文中的jClasses::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。