• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP object函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中object函数的典型用法代码示例。如果您正苦于以下问题:PHP object函数的具体用法?PHP object怎么用?PHP object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: importArticles

 public function importArticles($filename, $dry_run = false)
 {
     // Open the file
     $open_ok = $self->open($filename);
     if ($open_ok !== true) {
         return JError::raiseError(500, $open_ok);
     }
     // Read the data and import the articles
     $num_records = 0;
     while ($self->readNextRecord()) {
         // Create the raw record
         $record = object();
         // Copy in the fields from the CSV data
         $this->bind($record);
         // Verify the category
         $cat_ok = $this->_verifyCategory((int) $record->catid, $record->category_title);
         if ($cat_ok !== true) {
             return JError::raiseError(500, $cat_ok);
         }
         // Verify the creator
         $creator_ok = $this->_verifyUser((int) $record->created_by, $record->created_by_name);
         if ($creator_ok !== true) {
             return JError::raiseError(500, $creator_ok);
         }
         // Save the record
         if (!$dry_run) {
             // ???
         }
         $num_records += 1;
     }
     $this->close();
 }
开发者ID:appukonrad,项目名称:attachments,代码行数:32,代码来源:importArticles.php


示例2: __init

 function __init()
 {
     access_policy('auth');
     $this->menu = $this->makeMenu('index,auth,url' . (object('user')->isAdmin() ? ',#admin,login,server' : ''));
     $this->invokeModel();
     include_once 'lib/cq-forms.php';
 }
开发者ID:hcopr,项目名称:Hubbub,代码行数:7,代码来源:settings.controller.php


示例3: friend_accept

  function friend_accept($entityKey, $groupId)
  {
    $connection = new HubbubConnection(object('user')->ds['u_entity'], $entityKey);
    $connection->group($groupId);
	  $friendEntity = new HubbubEntity($entityKey);
    return($this->friend_request($friendEntity));
  }
开发者ID:hcopr,项目名称:Hubbub,代码行数:7,代码来源:friends.model.php


示例4: check

 private function check($route)
 {
     if ($this->api->controller->method) {
         return;
     }
     $route_callback = call_user_func_array(array($this->api->controller, 'route'), func_get_args());
     $api_callback = null;
     if ($route_callback->status) {
         $this->api->controller->method = $this->api_method;
         $args_object = object(array('method' => $this->api_method, 'match' => $route_callback->match));
         if ($this->model_api_name) {
             $model_api_name = "api_" . $this->model_api_name;
             // $api_callback = $this->api->controller->model()->$model_api_name($args_object);
             $this->api->controller->model_api_processor = $object = object(array("method" => $model_api_name, "args" => $args_object));
             // $this->api->controller->api_callback = $api_callback;
         }
         if ($this->view_api_name && !\lib\router::get_storage('api')) {
             $view_api_name = "view_" . $this->view_api_name;
             if ($this->model_api_name) {
                 $args_object->api_callback = $api_callback;
             }
             // $api_callback = $this->api->controller->view()->$view_api_name($args_object);
             $this->api->controller->view_api_processor = $object = object(array("method" => $view_api_name, "args" => $args_object));
         }
     }
 }
开发者ID:evazzadeh,项目名称:Saloos,代码行数:26,代码来源:config.php


示例5: check_route

 public function check_route()
 {
     $this->match = object();
     $args = func_get_args();
     if (count($args) == 0) {
         return;
     }
     $route = $args[0];
     $fn = isset($args[1]) ? $args[1] : false;
     if (is_string($route)) {
         $this->url($route);
     } else {
         if (!isset($route['max']) && isset($route['url']) && is_array($route['url'])) {
             $route['max'] = count($route['url']);
         } elseif (!isset($route['max']) && !(isset($route['url']) && is_string($route['url']) && preg_match("/^(\\/.*\\/|#.*#|[.*])[gui]{0,3}\$/i", $route['url']))) {
             $route['max'] = 0;
         }
         foreach ($route as $key => $value) {
             if (method_exists($this, $key)) {
                 $this->{$key}($value);
             }
         }
     }
     if ($this->status === true && is_object($fn)) {
         $arg = array_splice($args, 2);
         array_push($arg, $this->match);
         call_user_func_array($fn, $arg);
     }
     return $this->status;
 }
开发者ID:evazzadeh,项目名称:Saloos,代码行数:30,代码来源:route.php


示例6: __construct

 public function __construct($object = false)
 {
     if (!$object) {
         return;
     }
     $this->controller = $object->controller;
     $this->data = new view\data();
     $this->data->url = object();
     $this->data->include = object();
     $this->data->global = object();
     $this->url = $this->data->url;
     $this->global = $this->data->global;
     $this->include = $this->data->include;
     // default data property
     $this->data->macro['forms'] = 'includes/macro/forms.html';
     // default display value
     $this->data->display['mvc'] = "includes/mvc/display.html";
     $myurl = router::get_protocol() . '://' . router::get_domain() . $_SERVER['REQUEST_URI'];
     if (isset($_SERVER['HTTP_REFERER']) && isset($_SESSION['debug'][md5($_SERVER['HTTP_REFERER'])])) {
         $myurl = $_SERVER['HTTP_REFERER'];
     }
     if (isset($_SESSION['debug'][md5($myurl)])) {
         $this->data->debug = $_SESSION['debug'][md5($myurl)];
         // if(isset($_SESSION['debug'][md5($myurl)]['show']))
         unset($_SESSION['debug'][md5($myurl)]);
         // else
         // $_SESSION['debug'][md5($myurl)]['show'] = true;
     }
     array_push($this->twig_include_path, root);
     if (method_exists($this, 'mvc_construct')) {
         $this->mvc_construct();
     }
 }
开发者ID:Ermile,项目名称:Saloos,代码行数:33,代码来源:view.php


示例7: createform

 function createform($_name, $_type = null)
 {
     $this->data->extendForm = true;
     if (!$this->form) {
         $this->twig_macro('form');
         $this->form = new \lib\form();
         $this->data->form = object();
     }
     $args = func_get_args();
     if (count($args) === 2) {
         $submit_value = T_('submit');
         if ($_type == 'add') {
             $submit_value = T_('submit');
         } elseif ($_type == 'edit') {
             $submit_value = T_('save');
         } elseif ($_type == 'login') {
             $submit_value = T_('sing in');
         } elseif ($_type == 'register') {
             $submit_value = T_('create an account');
         } elseif (!empty($_type)) {
             $submit_value = $_type;
         }
         array_push($args, $submit_value);
     }
     $form = call_user_func_array(array($this->form, 'make'), $args);
     if (get_class($form) == 'lib\\form' || preg_match("/cls\\\\form/", get_class($form))) {
         preg_match("/^(@[^\\.]+)*\\.(.+)\$/", $_name, $sName);
         $this->data->form->{$sName[2]} = $form;
     }
     // if type of form is edit then fill it with related data
     if ($_type == 'edit') {
         $this->form_fill($form, $sName[2]);
     }
     return $form;
 }
开发者ID:evazzadeh,项目名称:Saloos,代码行数:35,代码来源:optimize.php


示例8: getAll

 /**
  * @desc - obtiene todos los registros de events
  * @access public
  * @author Iparra
  * @return object
  */
 public function getAll()
 {
     $query = $this->db->get('events');
     if ($query->num_rows() > 0) {
         return $query->result();
     }
     return object();
 }
开发者ID:CDPS,项目名称:SGTVA,代码行数:14,代码来源:Event.php


示例9: __construct

 public function __construct($object = false)
 {
     if (!$object) {
         return;
     }
     $this->querys = object();
     $this->controller = $object->controller;
     if (method_exists($this, '_construct')) {
         $this->_construct();
     }
 }
开发者ID:Ermile,项目名称:Saloos,代码行数:11,代码来源:model.php


示例10: object

 /**
  * @param array $array
  *
  * @return object
  */
 function object($array = [])
 {
     $obj = (object) NULL;
     foreach ($array as $key => $value) {
         if (is_array($value)) {
             $value = object($value);
         }
         $obj->{$key} = $value;
     }
     return $obj;
 }
开发者ID:tapiau,项目名称:muyo,代码行数:16,代码来源:object.php


示例11: manifest_include_file

 /**
  * require an execommand manifest file
  * @param  string $_file_name manifest file name
  */
 public function manifest_include_file($_file_name)
 {
     if (!array_key_exists($_file_name, manifest::$manifest_file_return)) {
         $manifest = object();
         $req = (require_once $_file_name);
         $manifest = (array) $manifest;
         $manifest = is_array($req) ? $req : $manifest;
         manifest::$manifest_file_return[$_file_name] = $manifest;
     } else {
         $manifest = manifest::$manifest_file_return[$_file_name];
     }
     if (is_array($manifest)) {
         $this->manifest_analyzer($manifest);
     }
 }
开发者ID:Ermile,项目名称:Saloos,代码行数:19,代码来源:manifest.php


示例12: objectize

 public function objectize($data)
 {
     if (is_array($data)) {
         $ret = object($data);
     }
     if (is_string($data)) {
         //see if it's a json struct?
         $tmp = json_decode($data);
         if (is_object($tmp)) {
             $ret = $tmp;
         } else {
             throw new NinjaException("Couldn't convert {$data}", 50);
         }
     }
     return $ret;
 }
开发者ID:sherdog,项目名称:wnd,代码行数:16,代码来源:Util.php


示例13: locale

 /**
  * @param string $lang
  */
 function locale($lang)
 {
     global $config;
     $lang = str_replace('..', '', $lang);
     $lang = str_replace('/', '', $lang);
     if (file_exists($file = '../locale/' . $lang . '.php')) {
         require_once $file;
     } elseif (file_exists($file = '../locale/en_US.php')) {
         require_once $file;
     } else {
         $locale = array();
     }
     if (debug_assert(isset($locale), "locale {$lang} isn't defined")) {
         $config->lang = $lang;
         $config->locale = object($locale);
     }
 }
开发者ID:tapiau,项目名称:muyo,代码行数:20,代码来源:locale.php


示例14: use_powerup

 public function use_powerup($playerID)
 {
     Validate::player($playerID);
     $playerModel = new PlayerModel();
     if ($_POST['payload'] == 'true') {
         Log::add("Payload pre hash: " . print_r($_POST, true));
         $_POST['payload'] = Util::hashPost($_POST);
     }
     $remaining = $playerModel->removePowerup($playerID, $_POST['payload']);
     if ($remaining) {
         $response['status'] = 'ok';
         $response['player'] = object(array("powerups" => $remaining));
     } else {
         $response['status'] = 'error';
     }
     $this->printJson($response);
 }
开发者ID:sherdog,项目名称:wnd,代码行数:17,代码来源:player.php


示例15: setUsername

  function setUsername($username)
	{
	  $userObj = object('user');
	  
	  $userObj->isNewUser = $this->ds['u_entity'] == 0;
	  $userObj->server = new HubbubServer(cfg('service/server'), true);
		$userObj->loadEntity();
		
		$userObj->entityDS['user'] = safename($username);
		$userObj->entityDS['url'] = getDefault($userObj->entityDS['url'], cfg('service/server').'/'.(cfg('service/url_rewrite') ? '' : '?').$username);
		$userObj->entityDS['_local'] = 'Y';
		$userObj->entityDS['_serverkey'] = $userObj->server->ds['s_key'];
		$userObj->entityDS['server'] = cfg('service/server');
		
		if(trim($userObj->entityDS['user']) != '') $ekey = DB_UpdateDataset('entities', $userObj->entityDS);
		$userObj->ds['u_entity'] = $ekey;
		
		if(trim($userObj->ds['u_name']) != '') DB_UpdateDataset('users', $userObj->ds);
    if($userObj->isNewUser) h2_execute_event('user_new', $userObj->entityDS, $userObj->ds);
	}
开发者ID:hcopr,项目名称:Hubbub,代码行数:20,代码来源:profile.model.php


示例16: toCCCP

 public function toCCCP($configIn = null)
 {
     $ret = array();
     if ($configIn === null) {
         $config = $this->_config;
     } else {
         $config = $configIn;
     }
     if (is_iterable($config)) {
         foreach ($config as $key => $value) {
             if ($key != 'db') {
                 $ret[$key] = $this->toCCCP($value);
             }
         }
     }
     if ($configIn === null) {
         $ret = Zend_Json::encode(object($ret));
     }
     return $ret;
 }
开发者ID:tapiau,项目名称:muyo,代码行数:20,代码来源:Config.php


示例17: __construct

 /**
  * constructor
  * @param boolean $object controller
  */
 public function __construct($object = false)
 {
     if (!$object) {
         return;
     }
     $this->controller = $object->controller;
     $this->data = new view\data();
     $this->data->url = object();
     $this->data->include = object();
     $this->data->global = object();
     $this->url = $this->data->url;
     $this->global = $this->data->global;
     $this->include = $this->data->include;
     // default data property
     $this->data->macro['forms'] = 'includes/macro/forms.html';
     $this->data->display['mvc'] = "includes/mvc/display.html";
     $this->data->display['main'] = "content/main/layout.html";
     $this->data->display['home'] = "content/home/display.html";
     $this->data->display['cp'] = "content_cp/home/layout.html";
     $this->data->display['account'] = "content_account/home/layout.html";
     $this->data->template['header'] = 'content/template/header.html';
     $this->data->template['sidebar'] = 'content/template/sidebar.html';
     $this->data->template['footer'] = 'content/template/footer.html';
     $this->data->saloos['version'] = \lib\saloos::getLastVersion();
     $this->data->saloos['lastUpdate'] = \lib\saloos::getLastUpdate();
     $this->data->saloos['langlist'] = ['fa_IR' => 'Persian - فارسی', 'en_US' => 'English', 'ar_SU' => 'Arabic - العربية'];
     $myurl = router::get_protocol() . '://' . router::get_domain() . $_SERVER['REQUEST_URI'];
     if (isset($_SERVER['HTTP_REFERER']) && isset($_SESSION['debug'][md5($_SERVER['HTTP_REFERER'])])) {
         $myurl = $_SERVER['HTTP_REFERER'];
     }
     if (isset($_SESSION['debug'][md5($myurl)])) {
         $this->data->debug = $_SESSION['debug'][md5($myurl)];
         // if(isset($_SESSION['debug'][md5($myurl)]['show']))
         unset($_SESSION['debug'][md5($myurl)]);
         // else
         // $_SESSION['debug'][md5($myurl)]['show'] = true;
     }
     if (method_exists($this, 'mvc_construct')) {
         $this->mvc_construct();
     }
 }
开发者ID:evazzadeh,项目名称:Saloos,代码行数:45,代码来源:view.php


示例18: translate

                <?= translate('In {category}', array('category' => $category)); ?>
            </span>
        <? endif; ?>

        <? // Downloads ?>
        <? if ($params->show_document_hits && $document->hits): ?>
            <meta itemprop="interactionCount" content="UserDownloads:<?= $document->hits ?>">
            <span class="hits-label">
                <?= object('translator')->choose(array('{number} download', '{number} downloads'), $document->hits, array('number' => $document->hits)) ?>
            </span>
        <? endif ?>
    </p>
    <? endif; ?>

    <? // Download area ?>
    <? if (!object('user')->isAuthentic() || $document->canPerform('download')): ?>
    <div class="docman_download<?php if ($document->description != '') echo " docman_download--right"; ?>">
        <a class="btn btn-large <?= $buttonstyle; ?> btn-block docman_download__button docman_track_download"
           href="<?= $document->download_link; ?>"
           data-title="<?= escape($document->title); ?>"
           data-id="<?= $document->id; ?>"
           <?= $params->download_in_blank_page ? 'target="_blank"' : ''; ?>
            >

            <? // Text  ?>
            <?= translate('Download'); ?>

            <? // Filetype and Filesize  ?>
            <? if (($params->show_document_size && $document->size) || ($document->storage_type == 'file' && $params->show_document_extension)): ?>
                <span class="docman_download__info">(<!--
                --><? if ($document->storage_type == 'file' && $params->show_document_extension): ?><!--
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:31,代码来源:document.html.php


示例19: l10n_load

function l10n_load($filename_base)
{
    if (isset($GLOBALS['l10n_files'][$filename_base])) {
        return;
    }
    $lang_try = array();
    $usr = object('user');
    if ($usr != null) {
        $lang = $usr->lang;
    }
    if ($lang != '') {
        $lang_try[] = $lang;
    }
    $lang_try[] = 'en';
    foreach ($lang_try as $ls) {
        $lang_file = $filename_base . '.' . $ls . '.cfg';
        if (file_exists($lang_file)) {
            foreach (stringsToStringlist(file($lang_file)) as $k => $v) {
                $GLOBALS['l10n'][$k] = $v;
            }
            $GLOBALS['l10n_files'][$filename_base] = $lang_file;
            if (cfg('l10ndebug') == true) {
                $GLOBALS['l10n_files_last'] = $lang_file;
            }
        }
    }
}
开发者ID:hcopr,项目名称:Hubbub,代码行数:27,代码来源:genlib.php


示例20:

/**
 * @package     Nooku_Server
 * @subpackage  Application
 * @copyright   Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */
?>

<head>
    <base href="<?php 
echo @url();
?>
" />
    <title><?php 
echo @escape(@object('application')->getCfg('sitename'));
?>
</title>

    <meta content="text/html; charset=utf-8" http-equiv="content-type"  />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <ktml:meta />
    <ktml:link />
    <ktml:style />
    <ktml:script />

    <link href="media://application/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />

    <style src="media://application/stylesheets/default.css" />
    <style src="media://application/stylesheets/print.css" media="print" />
开发者ID:janssit,项目名称:nickys.janss.be,代码行数:31,代码来源:page_head.html.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP object2array函数代码示例发布时间:2022-05-15
下一篇:
PHP obj_to_array函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap