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

PHP uuid函数代码示例

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

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



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


示例16: perform

 /**
  * Uploads files to the specified batch.
  *
  * @param UploadRequest $request
  * @param string $uuid
  */
 public function perform(UploadRequest $request, $uuid)
 {
     // Locate the batch
     $batch = $this->batch->locate($uuid);
     // Retrieve the file from the request
     $file = $request->file('file');
     // Double check the file instance
     if ($file instanceof UploadedFile) {
         // Validate file name length
         if (strlen($file->getClientOriginalName()) > 70) {
             abort(422, 'File name is too large');
         }
         // Generate a file name with UUID and its extension
         $name = uuid() . "." . $file->getClientOriginalExtension();
         // Get the storage path
         $path = $batch->uuid . DIRECTORY_SEPARATOR . $name;
         // Move the file into storage
         Storage::put($path, file_get_contents($file->getRealPath()));
         // Add the file to the batch
         $batch->addFile($file->getClientOriginalName(), $file->getClientMimeType(), $file->getClientSize(), $path);
     } else {
         abort(404);
     }
 }
开发者ID:stevebauman,项目名称:quickly-share-it,代码行数:30,代码来源:UploadController.php


示例17: handle

 /**
  * Uploads and attaches files for the current relation.
  *
  * @param Filesystem $filesystem
  *
  * @return bool|array
  */
 public function handle(Filesystem $filesystem)
 {
     $files = $this->request->file('files');
     if (is_array($files)) {
         $uploaded = [];
         foreach ($files as $file) {
             // Double check that we have an uploaded file instance.
             if ($file instanceof UploadedFile) {
                 // Generates the unique file name.
                 $name = implode('.', [uuid(), $file->getClientOriginalExtension()]);
                 // Generates the complete storage path.
                 $path = implode(DIRECTORY_SEPARATOR, [$this->path, $name]);
                 // Try and move the uploaded file into storage.
                 if ($filesystem->put($path, file_get_contents($file->getRealPath()))) {
                     // Successfully moved uploaded file, create the record.
                     $attributes = ['user_id' => auth()->id(), 'name' => $file->getClientOriginalName(), 'file_name' => $name, 'file_path' => $path];
                     $uploaded[] = $this->relation->create($attributes);
                 }
             }
         }
         return $uploaded;
     }
     return false;
 }
开发者ID:stevebauman,项目名称:maintenance,代码行数:31,代码来源:Store.php


示例18: unset

        $fax_email_connection_mailbox = $row["fax_email_connection_mailbox"];
        $fax_email_inbound_subject_tag = $row["fax_email_inbound_subject_tag"];
        $fax_email_outbound_subject_tag = $row["fax_email_outbound_subject_tag"];
        $fax_email_outbound_authorized_senders = $row["fax_email_outbound_authorized_senders"];
        $fax_caller_id_name = $row["fax_caller_id_name"];
        $fax_caller_id_number = $row["fax_caller_id_number"];
        $fax_forward_number = $row["fax_forward_number"];
        $fax_description = $row["fax_description"];
    }
    unset($prep_statement);
}
//replace the dash with a space
$fax_name = str_replace("-", " ", $fax_name);
//set the dialplan_uuid
if (strlen($dialplan_uuid) == 0) {
    $dialplan_uuid = uuid();
}
//show the header
require_once "resources/header.php";
//advanced button js
echo "<script type='text/javascript' language='JavaScript'>\n";
echo "\tfunction toggle_advanced(advanced_id) {\n";
echo "\t\t\$('#'+advanced_id).toggle();\n";
echo "\t\tif (\$('#'+advanced_id).is(':visible')) {\n";
echo "\t\t\t\$('#page').animate({scrollTop: \$('#'+advanced_id).offset().top - 80}, 'slow');\n";
echo "\t\t}\n";
echo "\t}\n";
echo "\tfunction add_sender() {\n";
echo "\t\tvar newdiv = document.createElement('div');\n";
echo "\t\tnewdiv.innerHTML = \"<input type='text' class='formfld' style='width: 225px; min-width: 225px; max-width: 225px; margin-top: 3px;' name='fax_email_outbound_authorized_senders[]' maxlength='255'>\";";
echo "\t\tdocument.getElementById('authorized_senders').appendChild(newdiv);";
开发者ID:reliberate,项目名称:fusionpbx,代码行数:31,代码来源:fax_edit.php


示例19: build_attachments

 /**
  * @return null|string
  */
 protected function build_attachments()
 {
     $result = array();
     if (count($this->attachments) == 0) {
         return;
     }
     foreach ($this->attachments as $file) {
         if (!file_exists($file)) {
             $file = PATH_APP . $file;
             if (!file_exists($file)) {
                 continue;
             }
         }
         $fname = array_pop(explode('/', $file));
         $data = file_get_contents($file);
         $content_id = uuid();
         $result[] = "--{$this->boundary}";
         $result[] = "Content-Type: " . mime_content_type($file) . "; name=\"{$fname}\"";
         $result[] = "Content-Transfer-Encoding: base64";
         $result[] = "Content-ID: " . uuid();
         $result[] = "Content-Disposition: attachment;";
         $result[] = " filename=\"{$fname}\"";
         $result[] = "";
         $result[] = chunk_split(base64_encode($data), 68, PHP_EOL);
         $result[] = "";
     }
     if (count($result) == 0) {
         return null;
     }
     $message[] = "--{$this->boundary}--";
     $message[] = "";
     return implode(PHP_EOL, $result);
 }
开发者ID:jawngee,项目名称:HeavyMetal,代码行数:36,代码来源:email.php


示例20: persistformvar

 if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
     require_once "resources/header.php";
     require_once "resources/persist_form_var.php";
     echo "<div align='center'>\n";
     echo "<table><tr><td>\n";
     echo $msg . "<br />";
     echo "</td></tr></table>\n";
     persistformvar($_POST);
     echo "</div>\n";
     require_once "resources/footer.php";
     return;
 }
 //add or update the database
 if ($_POST["persistformvar"] != "true") {
     if ($action == "add" && permission_exists('schema_add')) {
         $schema_field_uuid = uuid();
         $sql = "insert into v_schema_fields ";
         $sql .= "(";
         $sql .= "domain_uuid, ";
         $sql .= "schema_uuid, ";
         $sql .= "schema_field_uuid, ";
         $sql .= "field_label, ";
         $sql .= "field_name, ";
         $sql .= "field_type, ";
         $sql .= "field_value, ";
         $sql .= "field_list_hidden, ";
         $sql .= "field_search_by, ";
         $sql .= "field_column, ";
         $sql .= "field_required, ";
         $sql .= "field_order, ";
         $sql .= "field_order_tab, ";
开发者ID:architek360,项目名称:fusionpbx-apps,代码行数:31,代码来源:schema_field_edit.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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