本文整理汇总了PHP中someloader函数的典型用法代码示例。如果您正苦于以下问题:PHP someloader函数的具体用法?PHP someloader怎么用?PHP someloader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了someloader函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: open
function open($save_path, $session_name)
{
//echo "open($save_path, $session_name)<br />";
someloader('some.database.row');
$this->row = SomeRow::getRow('session');
return true;
}
开发者ID:EmmiSiitonen,项目名称:Hops-palvelu,代码行数:7,代码来源:database.php
示例2: create
/**
* @return true if user is created, false if not.
*/
public function create()
{
$user = SomeFactory::getUser();
if ($user->getUserrole() === SomeUser::ROLE_HEADTEACHER) {
someloader('some.user.user');
$someuser = new SomeUser();
$this->userdata = array('username' => SomeRequest::getVar('tunnus', ''), 'fname' => SomeRequest::getVar('etunimi', ''), 'lname' => SomeRequest::getVar('sukunimi', ''), 'unit' => SomeRequest::getVar('yksikko', ''), 'email' => SomeRequest::getVar('sposti', ''), 'phone' => SomeRequest::getVar('puh', ''), 'password' => SomeRequest::getVar('salasana', ''));
$someuser->setUsername($this->userdata['username']);
// DO THE PASSWORD HASHING HERE
$someuser->setPassword($this->userdata['password']);
$someuser->setUserrole('teacher');
$this->userdata['userrole'] = $someuser->getUserrole();
$someuser->create();
//Yritetään lisäksi tehdä uusi tuutori
$db = SomeFactory::getDBO();
$stmt = $db->prepare("INSERT INTO tuutori VALUES(?, ?, ?, ?, ?, ?, 'Tuutori')");
$ok = $stmt->execute(array($this->userdata['username'], $this->userdata['fname'], $this->userdata['lname'], $this->userdata['email'], $this->userdata['phone'], $this->userdata['unit']));
if ($someuser->getId() > 0 && $ok > 0) {
$this->userdata['id'] = $someuser->getId();
return true;
} else {
return false;
}
}
}
开发者ID:EmmiSiitonen,项目名称:Hops-palvelu,代码行数:28,代码来源:register.php
示例3: someloader
<?php
someloader('some.application.view');
class SomeViewInfo extends SomeView
{
public function display($tmpl = null)
{
$model = $this->getModel();
$this->confwritable = $model->isConfigurationWriteable();
$this->dpengineselected = $model->isDbSelected();
$conf_array = $model->getConfiguration();
$this->databasedriver = $conf_array['database']['databasedriver'];
$this->databasehost = $conf_array['database']['databasehost'];
$this->database = $conf_array['database']['database'];
$this->dbuser = $conf_array['database']['dbuser'];
$this->dbpass = $conf_array['database']['dbpass'];
$this->connected = $model->getConnected();
$this->errors = $model->getErrors();
$this->issomeuserinstalled = $model->getSomeuserStatus();
if ($this->issomeuserinstalled) {
$this->someuserstatus = 'SomeUser table is installed';
$this->someuseraction = '<span class="greenok">No action required.</span>';
} else {
$this->someuserstatus = 'SomeUser table is NOT installed';
$this->someuseraction = '<a href="index.php?app=configuration&cntr=install&view=install&table=someuser"><span class="redfail">INSTALL</span></a>';
}
$this->issomesessioninstalled = $model->getSomesessionStatus();
if ($this->issomesessioninstalled) {
$this->somesessionstatus = 'Somesession table is installed';
$this->somesessionaction = '<span class="greenok">No action required.</span>';
} else {
开发者ID:EmmiSiitonen,项目名称:Hops-palvelu,代码行数:31,代码来源:info.php
示例4: someloader
<?php
/**
* @package content
* @subpackage account
*/
someloader('some.application.model');
/**
* @package content
* @subpackage account
*/
class SomeModelTest extends SomeModel
{
public $results;
public function __construct(array $options = array())
{
parent::__construct($options);
}
public function prepare()
{
//if run test, run test
$runtest = SomeRequest::getVar('runtest', 0);
if ($runtest) {
$this->runtest();
}
}
public function runtest()
{
//create someuser just to test, so do not get from factory
//create
$someuser = new SomeUser();
开发者ID:EmmiSiitonen,项目名称:Hops-palvelu,代码行数:31,代码来源:test.php
示例5: someloader
<?php
/**
* This is controller file.
* @package content
* @subpackage account
*/
someloader('some.application.controller');
/**
* This is controller file.
* @package content
* @subpackage account
*/
class SomeControllerDefault extends SomeController
{
/**
* default flow function.
* if no view is set, register form is shown. If the user is not logged in.
*
*/
function display()
{
// if the user is logged in, then it is sort of wrong to show register form...
$user = SomeFactory::getUser();
if (!$user->getId()) {
$view = SomeRequest::getVar('view', 'register');
$model = $this->getModel($view);
$view = $this->getView($view);
$tmpl = SomeRequest::getVar('tmpl', 'default');
$view->setModel($model);
$view->display($tmpl);
开发者ID:EmmiSiitonen,项目名称:Hops-palvelu,代码行数:31,代码来源:default.php
示例6: someloader
<?php
someloader("some.application.controller");
class SomeControllerStudentHops extends SomeController
{
public function display()
{
$model = $this->getModel('default');
$view = $this->getView('default');
$view->setModel($model);
$view->display();
}
public function listHops()
{
//Listataan hopsit jotka on taytetty ja linkki mahdolliseen uuteen lomakepohjaan.
$model = $this->getModel('hops');
$model->listHops();
$view = $this->getView('hops');
$view->setModel($model);
$view->display('list');
}
public function fillHops()
{
//Hopsin täyttäminen
$model = $this->getModel('hops');
$model->doHopsForm();
$view = $this->getView('hops');
$view->setModel($model);
$view->display('fill');
}
public function showFilled()
开发者ID:EmmiSiitonen,项目名称:Hops-palvelu,代码行数:31,代码来源:student_hops.php
示例7: printf
* @access public
* @param format The format string
* @param mixed Mixed number of arguments for the sprintf function
*/
public static function printf($string)
{
$lang = SomeFactory::getLanguage();
$args = func_get_args();
if (count($args) > 0) {
$args[0] = $lang->_($args[0]);
return call_user_func_array('printf', $args);
}
return '';
}
}
someloader('some.rbac.rbac');
/**
* class SomeAuth to authenticate users and action
*/
class SomeAuth
{
public static function _($user, $action = 'none')
{
$rbac = SomeRbac::getInstance();
$role = $user->getUserrole();
return $rbac->hasAccess($role, $action);
}
}
class SomeUri
{
public static function getScheme()
开发者ID:EmmiSiitonen,项目名称:Hops-palvelu,代码行数:31,代码来源:common.php
示例8: delete
public function delete()
{
//echo "delete()<br />";
//var_dump($this);
someloader('some.database.row');
$userrow = SomeRow::getRow('user');
$userrow->id = $this->id;
$userrow->delete();
//var_dump($userrow);
}
开发者ID:EmmiSiitonen,项目名称:Hops-palvelu,代码行数:10,代码来源:user.php
示例9: define
/**
* SOME_PATH
*/
define('SOME_PATH', dirname(__FILE__));
/** */
require_once SOME_PATH . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'defines.php';
/** */
require_once SOME_PATH . DS . 'includes' . DS . 'someexception.php';
#/** */
#require_once( SOME_PATH.DS.'includes'.DS.'errorhandler.php' );
try {
/**
* initialize someloader()
*/
require_once SOME_LIBRARY . DS . 'loader.php';
someloader('some.csrf.csrf');
/**
* more initializing, library classes that are always loaded.
* trying to get framework. Failing to do so means that there is bugs or something broken at the server.
*/
require_once SOME_LIBRARY . DS . 'some' . DS . 'common.php';
$framework = SomeFactory::getApplication();
$debug = $framework->getDebug();
} catch (SomeException $e) {
//get error template from root and exit, can not even build
require SOME_PATH . DS . 'error.php';
exit;
} catch (Exception $e) {
require SOME_PATH . DS . 'error.php';
exit;
}
开发者ID:EmmiSiitonen,项目名称:Hops-palvelu,代码行数:31,代码来源:index.php
示例10: getDocument
public static function getDocument()
{
someloader('some.document.documenthtml');
if (!class_exists('SomeDocumentHTML')) {
throw new SomeFrameworkException('Can not create instance from non-existing class SomeDocumentHTML.');
}
return SomeDocumentHTML::getInstance();
}
开发者ID:EmmiSiitonen,项目名称:Hops-palvelu,代码行数:8,代码来源:factory.php
注:本文中的someloader函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论