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


PHP uuid函数代码示例

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


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

示例1: handle

 /**
  * Execute the job.
  *
  * @return bool
  */
 public function handle()
 {
     // Set the inquiry model data.
     $this->inquiry->user_id = auth()->id();
     $this->inquiry->uuid = uuid();
     $this->inquiry->category_id = $this->category->id;
     $this->inquiry->title = $this->request->input('title');
     $this->inquiry->description = $this->request->input('description');
     if ($this->category->manager === true) {
         // If the category requires manager approval, we'll retrieve the manager record.
         $manager = User::whereHas('roles', function (Builder $query) {
             $query->whereName('managers');
         })->findOrFail($this->request->input('manager'));
         $this->inquiry->manager_id = $manager->id;
         // We'll send the manager a notification.
         $notification = new Notification($manager, 'emails.inquiries.created', ['inquiry' => $this->inquiry], function (Message $message) use($manager) {
             $message->subject('A New Request Requires Your Approval');
             $message->to($manager->email);
         });
     }
     if ($this->inquiry->save()) {
         // If the inquiry was successfully created, we'll
         // send out the notification if one has been set.
         if (isset($notification)) {
             $this->dispatch($notification);
         }
         return true;
     }
     return false;
 }
开发者ID:stevebauman,项目名称:ithub,代码行数:35,代码来源:Store.php

示例2: signup

function signup($post, $connect)
{
    if (!empty($post['mail']) && !empty($post['password1']) && !empty($post['password1'])) {
        if (preg_match('/@.+\\./', $post['mail'])) {
            $sql = "SELECT uuid, mail, password, create_at, rank, accesstoken FROM users WHERE mail='" . htmlspecialchars($post['mail']) . "'";
            $result = mysqli_query($connect, $sql);
            if (mysqli_num_rows($result) == 0) {
                if ($post['password1'] === $post['password2']) {
                    $sql = "INSERT INTO users (uuid, mail, password, rank, create_at)\n\t\t\t\t\t\tVALUES ('" . uuid() . "', '" . $post['mail'] . "', '" . pass_hash($post['mail'], $post['password1']) . "', 0, NOW())";
                    if (mysqli_query($connect, $sql)) {
                        $_SESSION['error'] = "";
                        return true;
                    } else {
                        $_SESSION['error'] = "Une erreur est survenue.";
                    }
                } else {
                    $_SESSION['error'] = "Les mots de passes de correspondent pas.";
                }
            } else {
                $_SESSION['error'] = "L'adresse email est déjà prise.";
            }
        } else {
            $_SESSION['error'] = "L'adresse email doit être correctement formatée.";
        }
    }
    return false;
}
开发者ID:ItsJimi,项目名称:42,代码行数:27,代码来源:auth.php

示例3: tracking

 public function tracking()
 {
     // if we have a hash in get parameters and it is active, we create a new tracking log
     if (Request::has('h')) {
         $track = Tracking::getByHash(Request::input('h'));
         if ($track->isActive()) {
             $data = ['tracking_id' => $track->tracking_id, 'data' => json_encode(Request::except('h'))];
             Tracking::log($data);
         }
     }
     // if we have a mail_id, we update the mail status and the date where it is opened
     if (Request::has(Tracking::MAIL_ID)) {
         if (Mail::exists(uuid('bytes', Request::input(Tracking::MAIL_ID)))) {
             $mail = Mail::getById(uuid('bytes', Request::input(Tracking::MAIL_ID)));
             if ($mail->mail_status_id != Mail::STATUS_OPENED) {
                 $mail->mail_status_id = Mail::STATUS_OPENED;
                 $mail->opened_at = Carbon::now();
                 $mail->save();
             }
         }
     }
     header('Content-type:image/jpg');
     header("Pragma: no-cache");
     header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public");
     header("Expires: 0");
     exit;
 }
开发者ID:frenchfrogs,项目名称:tracker,代码行数:27,代码来源:TrackerController.php

示例4: persist

 /**
  * Persist the changes.
  *
  * @param PasswordFolder $folder
  *
  * @return bool
  */
 public function persist(PasswordFolder $folder)
 {
     $folder->user_id = Auth::user()->id;
     $folder->locked = true;
     $folder->uuid = uuid();
     $folder->pin = $this->input('pin');
     return $folder->save();
 }
开发者ID:stevebauman,项目名称:ithub,代码行数:15,代码来源:SetupRequest.php

示例5: save

 /**
  * saves current search
  *
  * @param string $name name to save search as
  * @param integer $tabledefid table definition's id
  * @param string $userid uuid of user
  */
 function save($name, $tabledefid, $userid)
 {
     $uuid = getUuid($this->db, "tbld:5c9d645f-26ab-5003-b98e-89e9049f8ac3", $tabledefid);
     $querystatement = "\n            SELECT\n                `prefix`\n            FROM\n                `tabledefs`\n            WHERE\n                `uuid` = '" . $uuid . "'";
     $queryresult = $this->db->query($querystatement);
     $therecord = $this->db->fetchArray($queryresult);
     $prefix = $therecord["prefix"];
     $insertstatement = "\n                INSERT INTO\n                        usersearches\n                (\n                        userid,\n                        tabledefid,\n                        name,\n                        `type`,\n                        sqlclause,\n                        `uuid`\n                ) VALUES (\n                        '" . mysql_real_escape_string($userid) . "',\n                        '" . mysql_real_escape_string($uuid) . "',\n                        '" . mysql_real_escape_string($name) . "',\n                        'SCH',\n                        '" . addslashes($_SESSION["tableparams"][$tabledefid]["querywhereclause"]) . "',\n                        '" . uuid($prefix . ":") . "'\n                )";
     $this->db->query($insertstatement);
     echo "search saved";
 }
开发者ID:Jacquesvw,项目名称:phpBMS,代码行数:18,代码来源:loadsearch.php

示例6: intellispireNetworkClient

 function intellispireNetworkClient($repository, $channels, $isnid = null, $machineid = null)
 {
     $this->repository = $repository;
     $this->isnid = new isnid($isnid);
     $this->channels = $channels;
     if ($machineid) {
         $this->machineid = $machineid;
     } else {
         $this->machineid = uuid();
     }
 }
开发者ID:ntemple,项目名称:com_updater,代码行数:11,代码来源:intellispireNetworkClient.class.php

示例7: check_uuid

 public function check_uuid()
 {
     $uuid = C('version', 'uuid');
     if (!empty($uuid)) {
         return $uuid;
     } else {
         $uuid = uuid(C('version', 'product') . '-');
         \Leaps\Base\Config::modify('version', array('uuid' => $uuid));
         return $uuid;
     }
 }
开发者ID:hubs,项目名称:yuncms,代码行数:11,代码来源:Update.php

示例8: let

 function let()
 {
     $config = new Config();
     $config->set(MonologConfig::LOG_CHANNEL_FILE_PATH('channel1'), path('/tmp', uuid(), 'channel1.log'));
     $config->set(MonologConfig::LOG_CHANNEL_FILE_PATH('channel2'), path('/tmp', uuid(), 'channel2.log'));
     $config->set(MonologConfig::LOG_CHANNEL_LOG_LEVEL('channel1'), 'debug');
     $config->set(MonologConfig::LOG_CHANNEL_LOG_LEVEL('channel2'), 'debug');
     $config->set(MonologConfig::DEFAULT_CHANNEL_NAME, 'channel1');
     $monologConfig = new MonologConfig($config);
     $this->beConstructedWith($monologConfig);
 }
开发者ID:weew,项目名称:app-monolog,代码行数:11,代码来源:MonologChannelManagerSpec.php

示例9: store

 /**
  * Store a newly created resource in storage.
  *
  * @param \Illuminate\Http\Request $request
  *
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['vote' => 'required|array|vote_count|vote_unique|sane_votes']);
     $user = $request->user();
     if ($user->uuid === null) {
         $user->update(['uuid' => uuid()]);
     }
     foreach ($request->get('vote') as $vote) {
         Vote::create(['candidate_id' => Candidate::findOrFail($vote)->id, 'user_id' => $user->id, 'term_id' => nextTerm()->id]);
     }
     Session::flash('message', 'Your votes were successfully counted.');
     return redirect('/');
 }
开发者ID:wearehx,项目名称:voting,代码行数:20,代码来源:VoteController.php

示例10: handle

 /**
  * Execute creating a new batch.
  *
  * @return bool|Batch
  */
 public function handle()
 {
     $batch = new Batch();
     $batch->locked = false;
     $batch->session_id = Session::getId();
     $batch->uuid = uuid();
     $batch->lifetime = $this->lifetime;
     $batch->description = $this->description;
     $batch->name = $this->name;
     if ($batch->save()) {
         return $batch;
     }
     return false;
 }
开发者ID:stevebauman,项目名称:quickly-share-it,代码行数:19,代码来源:CreateBatch.php

示例11: insertAndSetId

 /**
  * Insert the given attributes and set the ID on the model.
  *
  * @param  \Illuminate\Database\Eloquent\Builder  $query
  * @param  array  $attributes
  * @return void
  */
 protected function insertAndSetId(Builder $query, $attributes)
 {
     $keyName = $this->getKeyName();
     // uuid management
     if ($this->uuid) {
         $id = uuid();
         $attributes[$keyName] = $id;
         $query->insert($attributes);
         // auto increment
     } else {
         $id = $query->insertGetId($attributes, $keyName);
     }
     $this->setAttribute($keyName, $id);
 }
开发者ID:frenchfrogs,项目名称:framework,代码行数:21,代码来源:Model.php

示例12: addAction

function addAction()
{
    $bind['proName'] = $_POST['proName'];
    $bind['proPrice'] = $_POST['proPrice'];
    $imagename = $_FILES['proImage']['name'];
    $error = $_FILES['proImage']['error'];
    $tmpname = $_FILES['proImage']['tmp_name'];
    $bind['proImage'] = uuid() . '.' . getExtesion($imagename);
    if ($error === UPLOAD_ERR_OK) {
        move_uploaded_file($tmpname, '../proimages/' . $bind['proImage']);
    }
    insert('products', $bind);
    $message = '添加成功';
    $redirect = '<a href="addPro.html">继续添加</a>/<a href="listPro.php">返回列表页面</a>';
    require_once 'thems/a.html';
}
开发者ID:denson7,项目名称:phpstudy,代码行数:16,代码来源:productAction.inc.php

示例13: create

 /**
  * Create new file and return file key (id)
  *
  * @param string $fileName [optional]
  * @param string $content [optional]
  * @return string key
  */
 public function create($fileName = null, $content = null)
 {
     // Create new key
     $key = sha1(uuid());
     // Create data file
     $dataFilename = $this->getDataFileName($key);
     $this->touchFile($dataFilename);
     $this->write($key, $content);
     // Create info file
     $info = array('filename' => $fileName, 'datafile' => $dataFilename);
     $infoFilename = $this->getInfoFileName($key);
     $this->touchFile($infoFilename);
     $this->setInfo($key, $info);
     $this->keys[] = $key;
     return $key;
 }
开发者ID:odan,项目名称:molengo,代码行数:23,代码来源:MetaFile.php

示例14: addAdminuserHandle

 public function addAdminuserHandle()
 {
     // p($_POST);
     // $a=uniqid();
     // $a=md5(time() . mt_rand(1,1000000));
     $username = trim($_POST['UserName']);
     $password = trim($_POST['PassWord']);
     $confirmpassword = trim($_POST['ConfirmPassWord']);
     $admuser = M('adminusers');
     $data['AdminUserToken'] = trim(uuid(), '{' . '}');
     $data['UserName'] = $username;
     $data['PassWord'] = sha1($password);
     if ($password != $confirmpassword) {
         $this->error("两次密码输入不一致,请重新输入");
     } elseif ($username == '' || $password == '' || $confirmpassword == '') {
         $this->error("用户名或密码不能为空!");
     } elseif ($admuser->add($data)) {
         // p($data);
         // die();
         $this->success('管理员添加成功!');
     }
 }
开发者ID:ppxj,项目名称:eighteenlong,代码行数:22,代码来源:SystemAction.class.php

示例15: user_info

/**
 * 用户信息管理
 * @param string $name
 * @param string $value
 * @return mix
 */
function user_info($name = '', $value = '')
{
    $time = 3600 * 24;
    $key = cookie('identity');
    if (!$key) {
        $key = uuid();
        cookie('identity', $key, array('httponly' => true));
    }
    $info = S($key);
    //清除数据
    if ($name === null) {
        S($key, null);
        return null;
    }
    if (empty($value)) {
        if (empty($name)) {
            return $info;
        }
        if (isset($info[$name])) {
            return $info[$name];
        }
    } else {
        if (empty($name)) {
            $info = $value;
            if (isset($info['password'])) {
                unset($info['password']);
            }
            if (isset($info['encrypt'])) {
                unset($info['encrypt']);
            }
        } else {
            $info[$name] = $value;
        }
        S($key, $info, $time);
    }
    return null;
}
开发者ID:easytp,项目名称:easytp,代码行数:43,代码来源:function.php


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