本文整理汇总了PHP中unknown类的典型用法代码示例。如果您正苦于以下问题:PHP unknown类的具体用法?PHP unknown怎么用?PHP unknown使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了unknown类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOrRegister
/**
*
* @param unknown $user
* @return ZfJoacubUsersOnline\Entity\Register
*/
protected function getOrRegister($user)
{
if (isset($this->userRegister[$user->getId()])) {
return $this->userRegister[$user->getId()];
}
$em = $this->sl->get('zf_joacub_users_online_doctrine_em');
$em instanceof EntityManager;
$repo = $em->getRepository('ZfJoacubUsersOnline\\Entity\\Register');
$registerEntity = $repo->findOneBy(array('user' => $user));
if (!$registerEntity) {
$registerEntity = new Register();
$registerEntity->setUser($user);
$auth = $this->sl->get('zfcuser_auth_service');
if ($auth->hasIdentity()) {
if ($auth->getIdentity()->getId() == $user->getId()) {
$registerEntity->setLastConnect(new \DateTime('now'));
} else {
$registerEntity->setLastConnect($user->getCreated());
}
}
$registerEntity->setLastConnect($user->getCreated());
$em->persist($registerEntity);
$em->flush($registerEntity);
}
$this->userRegister[$user->getId()] = $registerEntity;
return $registerEntity;
}
示例2: smarty_core_display_debug_console
/**
* Smarty debug_console function plugin
*
* Type: core<br>
* Name: display_debug_console<br>
* Purpose: display the javascript debug console window
*
* @param array Format: null
* @param Smarty
* @param unknown $params
* @param unknown $smarty (reference)
* @return unknown
*/
function smarty_core_display_debug_console($params, &$smarty)
{
// we must force compile the debug template in case the environment
// changed between separate applications.
if (empty($smarty->debug_tpl)) {
// set path to debug template from SMARTY_DIR
$smarty->debug_tpl = SMARTY_DIR . 'debug.tpl';
if ($smarty->security && is_file($smarty->debug_tpl)) {
$smarty->secure_dir[] = dirname(realpath($smarty->debug_tpl));
}
}
$_ldelim_orig = $smarty->left_delimiter;
$_rdelim_orig = $smarty->right_delimiter;
$smarty->left_delimiter = '{';
$smarty->right_delimiter = '}';
$_compile_id_orig = $smarty->_compile_id;
$smarty->_compile_id = null;
$_compile_path = $smarty->_get_compile_path($smarty->debug_tpl);
if ($smarty->_compile_resource($smarty->debug_tpl, $_compile_path)) {
ob_start();
$smarty->_include($_compile_path);
$_results = ob_get_contents();
ob_end_clean();
} else {
$_results = '';
}
$smarty->_compile_id = $_compile_id_orig;
$smarty->left_delimiter = $_ldelim_orig;
$smarty->right_delimiter = $_rdelim_orig;
return $_results;
}
示例3: getReceivedData
/**
* 获取消息接收数量信息
* @param unknown $receivedVO
* 备注:发送采用https需要修改php.ini打开extension=php_openssl.dll
*
*/
public function getReceivedData($receivedVO, $revResult)
{
//echo "1111";
//加密字符串
$secretEncode = new SecretEncode();
$authStr = $secretEncode->getBase64Encode($receivedVO->getAuthStr());
$receivedVO->setAuth($authStr);
//url
$url = $this->RECEIVE_API_URL . "?" . $receivedVO->getParams();
$header = 'Authorization: Basic ' . $receivedVO->getAuth();
//请求头信息
$context = array('http' => array('method' => 'GET', 'header' => $header));
$stream_context = stream_context_create($context);
//echo $stream_context;
$httpPostClient = new HttpPostClient();
$code = 200;
try {
$rs = $httpPostClient->request_tools($url, $stream_context);
//echo $rs;
} catch (Exception $e) {
echo $e;
$code = 404;
}
//echo $rs["body"];
$revResult->setResultStr($rs, $code);
//echo $revResult->getResultStr();
return $revResult;
}
示例4: userCreate
/**
* ユーザ情報を登録する
* @param unknown $db
*/
public function userCreate($db)
{
try {
// 現在日時を取得
$user_date = date('Y-m-d H:i:s');
// SQL文を作成
$sql = 'INSERT INTO user_table (user_id, user_name, user_email, user_password,
user_age, user_gender, user_profile, user_profile_photo, user_profile_background, user_date)
VALUES (:user_id, :user_name, :user_email, :user_password, :user_age,
:user_gender, :user_profile, :user_profile_photo, :user_profile_background, :user_date);';
$prepare = $db->prepare($sql);
// SQL文のプレースホルダーに値をバインドする
$prepare->bindValue(':user_id', $_SESSION['user_id'], PDO::PARAM_STR);
$prepare->bindValue(':user_name', $_SESSION['user_name'], PDO::PARAM_STR);
$prepare->bindValue(':user_email', $_SESSION['user_email'], PDO::PARAM_STR);
// パスワードをハッシュ化
$prepare->bindValue(':user_password', crypt($_SESSION['user_password']), PDO::PARAM_STR);
$prepare->bindValue(':user_age', $_SESSION['user_age'], PDO::PARAM_STR);
$prepare->bindValue(':user_gender', $_SESSION['user_gender'], PDO::PARAM_STR);
$prepare->bindValue(':user_profile', $_SESSION['user_profile'], PDO::PARAM_STR);
$prepare->bindValue(':user_profile_photo', $_SESSION['user_profile_photo'], PDO::PARAM_STR);
$prepare->bindValue(':user_profile_background', $_SESSION['user_profile_background'], PDO::PARAM_STR);
$prepare->bindValue(':user_date', $user_date, PDO::PARAM_STR);
$prepare->execute();
} catch (PDOException $e) {
echo 'エラー' . entity_str($e->getMessage());
}
}
示例5: beforeRenderView
/**
* Gets/Saves information about views and stores truncated viewParams.
*
* @param unknown $event
* @param unknown $view
* @param unknown $file
*/
public function beforeRenderView($event, $view, $file)
{
$params = array();
$toView = $view->getParamsToView();
$toView = !$toView ? array() : $toView;
foreach ($toView as $k => $v) {
if (is_object($v)) {
$params[$k] = get_class($v);
} elseif (is_array($v)) {
$array = array();
foreach ($v as $key => $value) {
if (is_object($value)) {
$array[$key] = get_class($value);
} elseif (is_array($value)) {
$array[$key] = 'Array[...]';
} else {
$array[$key] = $value;
}
}
$params[$k] = $array;
} else {
$params[$k] = (string) $v;
}
}
$this->_viewsRendered[] = array('path' => $view->getActiveRenderPath(), 'params' => $params, 'controller' => $view->getControllerName(), 'action' => $view->getActionName());
}
示例6: beforeRenderView
/**
* Gets/Saves information about views and stores truncated viewParams.
*
* @param unknown $event
* @param unknown $view
* @param unknown $file
*/
public function beforeRenderView($event, $view, $file)
{
$router = $this->getDI()->getRouter();
$phalconDir = $this->getDI()->getConfig()->path->phalconDir;
$params = [];
$toView = $view->getParamsToView();
$toView = !$toView ? [] : $toView;
foreach ($toView as $k => $v) {
if (is_object($v)) {
$params[$k] = get_class($v);
} elseif (is_array($v)) {
$array = [];
foreach ($v as $key => $value) {
if (is_object($value)) {
$array[$key] = get_class($value);
} elseif (is_array($value)) {
$array[$key] = 'Array[...]';
} else {
$array[$key] = $value;
}
}
$params[$k] = $array;
} else {
$params[$k] = (string) $v;
}
}
$path = str_replace($phalconDir, '', $view->getActiveRenderPath());
$path = preg_replace('/^modules\\/[a-z]+\\/views\\/..\\/..\\/..\\//', '', $path);
$this->viewsRendered[] = ['path' => $path, 'params' => $params, 'module' => $router->getModuleName(), 'controller' => $view->getControllerName(), 'action' => $view->getActionName()];
}
示例7: __invoke
/**
*
* @param unknown $entries
* @param unknown $template
* @param unknown $media
*/
public function __invoke($entries, $template, $media)
{
$templateKey = static::VIEW_TEMPLATE;
if (isset($entries['modulFormat'])) {
$templateKey = $entries['modulFormat'];
}
$this->setTemplate($template->plugins->{$templateKey});
$active = false;
if (strlen($this->view->paramter['article']) > 1) {
$active = $this->view->paramter['article'];
}
$html = '';
$elements = $this->elements->toArray();
foreach ($entries['modulContent'] as $entry) {
$elements = $this->elements->toArray();
$elements["grid"]["attr"]['href'] = '/' . $entry['url'] . '/tag/' . $entry['tag_scope'];
$elements["grid"]["attr"]['title'] = $this->linktitle . ' ' . $entry['tag_name'];
if ($active === $entry['tag_scope']) {
$elements["grid"]["attr"]['class'] .= ' disabled';
}
$html .= $this->deployRow($elements, $entry['tag_name']);
$elements = null;
}
if (strlen($html) > 1) {
$wrapper = $this->wrapper->toArray();
if (isset($wrapper['row'])) {
$wrapper['row']['content:before'] = '<h3>' . $this->headline . '</h3>';
}
$html = $this->deployRow($wrapper, $html);
}
return $html;
}
示例8: scopeCustomer
/**
* Named scope for customer users
* @param unknown $query
*/
public function scopeCustomer($query)
{
$query->leftJoin('user_to_role', 'user.id', '=', 'user_to_role.user_id');
$query->leftJoin('role', 'role.id', '=', 'user_to_role.role_id');
$query->groupBy('user.id');
return $query->where('role.value', '=', 'role_customer');
}
示例9: admin_plugin_rss_run
/**
*
*
* @param unknown $bBlog (reference)
*/
function admin_plugin_rss_run(&$bBlog)
{
$pole = "";
for ($i = 1; $i < 10; $i++) {
if (isset($_POST['sending']) && $_POST['sending'] == "true") {
$id = $_POST[id . $i];
$ch = $_POST[ch . $i];
$update_query = "UPDATE " . T_RSS . " SET `url` = '" . $id . "',`input_charset` = '" . $ch . "' WHERE `id` = '" . $i . "' LIMIT 1 ;";
$bBlog->query($update_query);
}
$query = "select * from " . T_RSS . " where id=" . $i . ";";
$row = $bBlog->get_row($query);
$rssurl = $row->url;
$w1250 = "";
if ($row->input_charset == "W1250") {
$w1250 = " selected";
}
$utf8 = "";
if ($row->input_charset == "UTF8") {
$utf8 = " selected";
}
if ($i / 2 == floor($i / 2)) {
$class = 'high';
} else {
$class = 'low';
}
$pole .= '<tr class="' . $class . '"><td>' . $i . '</td><td><input type="text" name="id' . $i . '" size="20" value="' . $rssurl . '" class="text" /></td><td><select name="ch' . $i . '">';
$pole .= '<option>I88592</option>';
$pole .= '<option' . $w1250 . '>W1250</option>';
$pole .= '<option' . $utf8 . '>UTF8</option>';
$pole .= '</select></td></tr>';
}
$bBlog->assign('pole', $pole);
}
示例10: equals
/**
* Compares the specified object with this collection for equality.
* @param unknown $object
* @return boolean
*/
public function equals($object)
{
if (!$object instanceof CollectionInterface) {
return false;
}
return $this->hashCode() === $object->hashCode();
}
示例11: login
/**
*
* @param unknown $user
* @param unknown $pwd
* @param unknown $DBH
* @return found boolean false jos annettua käyttäjää ja salasanaa löydy
*/
function login($user, $pwd, $DBH)
{
// !! on suola, jotta kantaan taltioitu eri hashkoodi vaikka salasana olisi tiedossa
//kokeile !! ja ilman http://www.danstools.com/md5-hash-generator/
//Tukevampia salauksia hash('sha256', $pwd ) tai hash('sha512', $pwd )
//MD5 on 128 bittinen
$hashpwd = hash('md5', $pwd . '!!');
//An array of values with as many elements as there are bound parameters in the
//SQL statement being executed. All values are treated as PDO::PARAM_STR
$data = array('kayttaja' => $user, 'passu' => $hashpwd);
//print_r($data);
try {
//print_r($data);
//echo "Login 1<br />";
$STH = $DBH->prepare("SELECT * FROM 0mrb_users WHERE email=:kayttaja AND\n\t\tpwd = :passu");
$STH->execute($data);
$STH->setFetchMode(PDO::FETCH_OBJ);
$row = $STH->fetch();
//print_r($row);
if ($STH->rowCount() > 0) {
//echo "Login 4<br />";
return $row;
} else {
//echo "Login 5<br />";
return false;
}
} catch (PDOException $e) {
echo "Login DB error.";
file_put_contents('log/DBErrors.txt', 'Login: ' . $e->getMessage() . "\n", FILE_APPEND);
}
}
示例12: getDomainByRoute
/**
* todo: this shouldn't be a concern of this class and should be moved
* either to the dispatcher or a somewhere more practical
*
* @param unknown $request
*/
private function getDomainByRoute($request)
{
$route = $this->dispatcher->dispatch($request->getMethod(), $request->getUri()->getPath());
$fullDomainName = $route[1]->getDomain();
$domain = end(explode('\\', $fullDomainName));
return $domain;
}
示例13: smarty_function_debug
/**
* Smarty {debug} function plugin
*
* Type: function<br>
* Name: debug<br>
* Date: July 1, 2002<br>
* Purpose: popup debug window
*
* @link http://smarty.php.net/manual/en/language.function.debug.php {debug}
* (Smarty online manual)
* @author Monte Ohrt <monte@ispi.net>
* @version 1.0
* @param array
* @param Smarty
* @param unknown $params
* @param unknown $smarty (reference)
* @return string output from {@link Smarty::_generate_debug_output()}
*/
function smarty_function_debug($params, &$smarty)
{
if ($params['output']) {
$smarty->assign('_smarty_debug_output', $params['output']);
}
require_once SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.display_debug_console.php';
return smarty_core_display_debug_console(null, $smarty);
}
示例14: countRow
/**
* Count Row
*
* @param unknown $query
* @return boolean
*/
function countRow($query)
{
if ($query->num_rows() > 0) {
return $query->num_rows();
} else {
return false;
}
}
示例15: onBootstrap
/**
* on bootstrap
* @param unknown $e event
* @return void
*/
public function onBootstrap($e)
{
// You may not need to do this if you're doing it elsewhere in your
// application
$eventManager = $e->getApplication()->getEventManager();
$moduleRouteListener = new ModuleRouteListener();
$moduleRouteListener->attach($eventManager);
}