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


PHP com_create_guid函数代码示例

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


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

示例1: GUID

function GUID()
{
    if (function_exists('com_create_guid') === true) {
        return trim(com_create_guid(), '{}');
    }
    return strtolower(sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535)));
}
开发者ID:kublermdk,项目名称:promisepay-php,代码行数:7,代码来源:GUID.php

示例2: __construct

 /**
  * AttributeUse constructor.
  *
  * @param int    $attributeSetId
  * @param int    $attributeId
  * @param int    $lineNo
  * @param string $displayId
  */
 public function __construct($attributeSetId, $attributeId, $lineNo, $displayId = null)
 {
     $this->displayId = $displayId === null ? com_create_guid() : $displayId;
     $this->attributeSetId = $attributeSetId;
     $this->attributeId = $attributeId;
     $this->lineNo = $lineNo;
 }
开发者ID:jeromeradal,项目名称:pasteque-server-2,代码行数:15,代码来源:AttributeUse.php

示例3: __construct

 /**
  * TaxCustomerCategory constructor.
  *
  * @param string $name
  * @param int    $taxCategoryId
  * @param string $displayId
  */
 public function __construct($name, $taxCategoryId = null, $displayId = null)
 {
     $this->displayId = $displayId === null ? com_create_guid() : $displayId;
     $this->name = $name;
     $this->taxCategoryId = $taxCategoryId;
     $this->taxes = array();
 }
开发者ID:jeromeradal,项目名称:pasteque-server-2,代码行数:14,代码来源:TaxCustomerCategory.php

示例4: generate_waybill_no

 public function generate_waybill_no()
 {
     if (function_exists('com_create_guid') === true) {
         return trim(com_create_guid(), '{}');
     }
     return 'NXL' . sprintf('%04X%04X%04', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));
 }
开发者ID:devarj,项目名称:design,代码行数:7,代码来源:waybill.php

示例5: genFileName

 public static function genFileName()
 {
     if (function_exists('com_create_guid') === true) {
         return trim(com_create_guid(), '{}');
     }
     return sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));
 }
开发者ID:song-yuan,项目名称:wymenujp,代码行数:7,代码来源:Helper.php

示例6: __construct

 /**
  * AttributeInstance constructor.
  *
  * @param int    $attributeSetInstanceId
  * @param int    $attributeId
  * @param string $value
  * @param string $displayId
  */
 public function __construct($attributeSetInstanceId, $attributeId, $value, $displayId = null)
 {
     $this->displayId = $displayId === null ? com_create_guid() : $displayId;
     $this->attributeSetInstanceId = $attributeSetInstanceId;
     $this->attributeId = $attributeId;
     $this->value = $value;
 }
开发者ID:jeromeradal,项目名称:pasteque-server-2,代码行数:15,代码来源:AttributeInstance.php

示例7: getNextId

 public function getNextId()
 {
     if (function_exists('com_create_guid')) {
         return trim(com_create_guid(), '{}');
     }
     return md5(uniqid(dechex(mt_rand()), true) . dechex(mt_rand()));
 }
开发者ID:hprose,项目名称:hprose-php,代码行数:7,代码来源:Service.php

示例8: mdi_guid

 function mdi_guid()
 {
     if (function_exists('com_create_guid') === true) {
         return str_replace('-', '', trim(com_create_guid(), '{}'));
     }
     return sprintf('%04X%04X%04X%04X%04X%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));
 }
开发者ID:mehulsbhatt,项目名称:MDIgniter,代码行数:7,代码来源:mdi_generators.php

示例9: uuid

function uuid()
{
    if (function_exists('com_create_guid')) {
        return com_create_guid();
    } else {
        mt_srand((double) microtime() * 10000);
        //optional for php 4.2.0 and up.随便数播种,4.2.0以后不需要了。
        $charid = strtoupper(md5(uniqid(rand(), true)));
        //根据当前时间(微秒计)生成唯一id.
        $hyphen = chr(45);
        // "-"
        $uuid = '' . substr($charid, 0, 8) . $hyphen . substr($charid, 8, 4) . $hyphen . substr($charid, 12, 4) . $hyphen . substr($charid, 16, 4) . $hyphen . substr($charid, 20, 12);
        //.chr(125);// "}"
        return $uuid;
    }
    function createGuid($namespace = '')
    {
        static $guid = '';
        $uid = uniqid("", true);
        $data = $namespace;
        $data .= $_SERVER['REQUEST_TIME'];
        $data .= $_SERVER['HTTP_USER_AGENT'];
        $data .= $_SERVER['LOCAL_ADDR'];
        $data .= $_SERVER['LOCAL_PORT'];
        $data .= $_SERVER['REMOTE_ADDR'];
        $data .= $_SERVER['REMOTE_PORT'];
        $hash = strtoupper(hash('ripemd128', $uid . $guid . md5($data)));
        $guid = '{' . substr($hash, 0, 8) . '-' . substr($hash, 8, 4) . '-' . substr($hash, 12, 4) . '-' . substr($hash, 16, 4) . '-' . substr($hash, 20, 12) . '}';
        return $guid;
    }
}
开发者ID:ppxj,项目名称:eighteenlong,代码行数:31,代码来源:Common.php

示例10: generate

 /**
  * {@inheritdoc}
  */
 public function generate(EntityManager $em, $entity)
 {
     if (defined('PHP_WINDOWS_VERSION_BUILD')) {
         return substr(com_create_guid(), 1, 36);
     }
     return uuid_create(UUID_TYPE_RANDOM);
 }
开发者ID:creof,项目名称:doctrine2-php-uuid-generator,代码行数:10,代码来源:PhpUuidGenerator.php

示例11: __construct

 /**
  * @param string $name
  * @param string $image
  * @param string $displayId
  */
 public function __construct($name, $image = null, $displayId = null)
 {
     $this->displayId = $displayId === null ? com_create_guid() : $displayId;
     $this->name = $name;
     $this->image = $image;
     $this->places = array();
 }
开发者ID:jeromeradal,项目名称:pasteque-server-2,代码行数:12,代码来源:Floor.php

示例12: __construct

 /**
  * Receipt constructor.
  *
  * @param int       $cashId
  * @param \DateTime $date
  * @param string    $attributes
  * @param string    $displayId
  */
 public function __construct($cashId, \DateTime $date, $attributes = null, $displayId = null)
 {
     $this->displayId = $displayId === null ? com_create_guid() : $displayId;
     $this->cashId = $cashId;
     $this->date = $date;
     $this->attributes = $attributes;
 }
开发者ID:jeromeradal,项目名称:pasteque-server-2,代码行数:15,代码来源:Receipt.php

示例13: CreateStream

 /**
  *
  * @param string $SessionID
  * @param string $StreamName
  * @param string $Keywords
  * @return string
  */
 public function CreateStream($SessionID, $StreamName, $Keywords)
 {
     //check if the $SessionID is valid then create a record in the video table with stream id
     //returns the stream id
     $Message = com_create_guid();
     return $Message;
 }
开发者ID:BGCX067,项目名称:fall2011-cis553-svn-to-git,代码行数:14,代码来源:AuthWebService.php

示例14: newFund

function newFund($username, $password, $xml_url, $user_email, $fundName, $numMembers, $stateLaw, $fundAddressCareOf, $fundAddressLevel, $fundAddressStreet, $fundAddressSuburb, $fundAddressState, $fundAddressPostcode, $teeMtgAddressLevel, $teeMtgAddressStreet, $teeMtgAddressSuburb, $teeMtgAddressState, $teeMtgAddressPostcode, $m1MemberNamePrefix, $m1MemberGivenNames, $m1MemberFamilyName, $m1MemberDOB, $m1MemberTFN, $m1AddressLevel, $m1AddressStreet, $m1AddressSuburb, $m1AddressState, $m1AddressPostcode, $m2MemberNamePrefix, $m2MemberGivenNames, $m2MemberFamilyName, $m2MemberDOB, $m2MemberTFN, $m2AddressLevel, $m2AddressStreet, $m2AddressSuburb, $m2AddressState, $m2AddressPostcode, $m3MemberNamePrefix, $m3MemberGivenNames, $m3MemberFamilyName, $m3MemberDOB, $m3MemberTFN, $m3AddressLevel, $m3AddressStreet, $m3AddressSuburb, $m3AddressState, $m3AddressPostcode, $m4MemberNamePrefix, $m4MemberGivenNames, $m4MemberFamilyName, $m4MemberDOB, $m4MemberTFN, $m4AddressLevel, $m4AddressStreet, $m4AddressSuburb, $m4AddressState, $m4AddressPostcode, $t2NonMemberNamePrefix, $t2NonMemberGivenNames, $t2NonMemberFamilyName, $t2NonMemberAddressLevel, $t2NonMemberAddressStreet, $t2NonMemberAddressSuburb, $t2NonMemberAddressState, $t2NonMemberAddressPostcode, $corpTeeName, $corpTeeACN, $corpTeeAddressCareOf, $corpTeeAddressLevel, $corpTeeAddressStreet, $corpTeeAddressSuburb, $corpTeeAddressState, $corpTeeAddressPostcode, $d2NonMemberNamePrefix, $d2NonMemberGivenNames, $d2NonMemberFamilyName, $d2NonMemberAddressLevel, $d2NonMemberAddressStreet, $d2NonMemberAddressSuburb, $d2NonMemberAddressState, $d2NonMemberAddressPostcode, $chairmanTrustee)
{
    $ch = curl_init();
    $timeout = 3600;
    curl_setopt($ch, CURLOPT_URL, $xml_url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    //    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    $data = curl_exec($ch);
    //    $response  = curl_getinfo($ch);
    curl_close($ch);
    $xml = simplexml_load_string($data);
    if (!simplexml_load_string($data) && !$xml) {
        global $wpdb;
        $wp_hasher = new PasswordHash(8, TRUE);
        $sql = "SELECT * FROM wp_users  WHERE user_login = '{$username}' ";
        $resultuser = $wpdb->get_results($sql);
        if ($resultuser) {
            foreach ($resultuser as $results) {
                if ($wp_hasher->CheckPassword($password, $results->user_pass)) {
                    $unique = trim(com_create_guid(), '{}');
                    $result = $wpdb->insert('service_nsf', array('unique_code' => $unique, 'user_email' => $user_email, 'fundName' => $fundName, 'numMembers' => $numMembers, 'stateLaw' => $stateLaw, 'fundAddressCareOf' => $fundAddressCareOf, 'fundAddressLevel' => $fundAddressLevel, 'fundAddressStreet' => $fundAddressStreet, 'fundAddressSuburb' => $fundAddressSuburb, 'fundAddressState' => $fundAddressState, 'fundAddressPostcode' => $fundAddressPostcode, 'teeMtgAddressLevel' => $teeMtgAddressLevel, 'teeMtgAddressStreet' => $teeMtgAddressStreet, 'teeMtgAddressSuburb' => $teeMtgAddressSuburb, 'teeMtgAddressState' => $teeMtgAddressState, 'teeMtgAddressPostcode' => $teeMtgAddressPostcode, 'm1MemberNamePrefix' => $m1MemberNamePrefix, 'm1MemberGivenNames' => $m1MemberGivenNames, 'm1MemberFamilyName' => $m1MemberFamilyName, 'm1MemberDOB' => $m1MemberDOB, 'm1MemberTFN' => $m1MemberTFN, 'm1AddressLevel' => $m1AddressLevel, 'm1AddressStreet' => $m1AddressStreet, 'm1AddressSuburb' => $m1AddressSuburb, 'm1AddressState' => $m1AddressState, 'm1AddressPostcode' => $m1AddressPostcode, 'm2MemberNamePrefix' => $m2MemberNamePrefix, 'm2MemberGivenNames' => $m2MemberGivenNames, 'm2MemberFamilyName' => $m2MemberFamilyName, 'm2MemberDOB' => $m2MemberDOB, 'm2MemberTFN' => $m2MemberTFN, 'm2AddressLevel' => $m2AddressLevel, 'm2AddressStreet' => $m2AddressStreet, 'm2AddressSuburb' => $m2AddressSuburb, 'm2AddressState' => $m2AddressState, 'm2AddressPostcode' => $m2AddressPostcode, 'm3MemberNamePrefix' => $m3MemberNamePrefix, 'm3MemberGivenNames' => $m3MemberGivenNames, 'm3MemberFamilyName' => $m3MemberFamilyName, 'm3MemberDOB' => $m3MemberDOB, 'm3MemberTFN' => $m3MemberTFN, 'm3AddressLevel' => $m3AddressLevel, 'm3AddressStreet' => $m3AddressStreet, 'm3AddressSuburb' => $m3AddressSuburb, 'm3AddressState' => $m3AddressState, 'm3AddressPostcode' => $m3AddressPostcode, 'm4MemberNamePrefix' => $m4MemberNamePrefix, 'm4MemberGivenNames' => $m4MemberGivenNames, 'm4MemberFamilyName' => $m4MemberFamilyName, 'm4MemberDOB' => $m4MemberDOB, 'm4MemberTFN' => $m4MemberTFN, 'm4AddressLevel' => $m4AddressLevel, 'm4AddressStreet' => $m4AddressStreet, 'm4AddressSuburb' => $m4AddressSuburb, 'm4AddressState' => $m4AddressState, 'm4AddressPostcode' => $m4AddressPostcode, 't2NonMemberNamePrefix' => $t2NonMemberNamePrefix, 't2NonMemberGivenNames' => $t2NonMemberGivenNames, 't2NonMemberFamilyName' => $t2NonMemberFamilyName, 't2NonMemberAddressLevel' => $t2NonMemberAddressLevel, 't2NonMemberAddressStreet' => $t2NonMemberAddressStreet, 't2NonMemberAddressSuburb' => $t2NonMemberAddressSuburb, 't2NonMemberAddressState' => $t2NonMemberAddressState, 't2NonMemberAddressPostcode' => $t2NonMemberAddressPostcode, 'corpTeeName' => $corpTeeName, 'corpTeeACN' => $corpTeeACN, 'corpTeeAddressCareOf' => $corpTeeAddressCareOf, 'corpTeeAddressLevel' => $corpTeeAddressLevel, 'corpTeeAddressStreet' => $corpTeeAddressStreet, 'corpTeeAddressSuburb' => $corpTeeAddressSuburb, 'corpTeeAddressState' => $corpTeeAddressState, 'corpTeeAddressPostcode' => $corpTeeAddressPostcode, 'd2NonMemberNamePrefix' => $d2NonMemberNamePrefix, 'd2NonMemberGivenNames' => $d2NonMemberGivenNames, 'd2NonMemberFamilyName' => $d2NonMemberFamilyName, 'd2NonMemberAddressLevel' => $d2NonMemberAddressLevel, 'd2NonMemberAddressStreet' => $d2NonMemberAddressStreet, 'd2NonMemberAddressSuburb' => $d2NonMemberAddressSuburb, 'd2NonMemberAddressState' => $d2NonMemberAddressState, 'd2NonMemberAddressPostcode' => $d2NonMemberAddressPostcode, 'chairmanTrustee' => $chairmanTrustee), array('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s'));
                    return array('unique_code' => $unique);
                } else {
                    return array('username' => 'Invalid username or password1');
                }
            }
        } else {
            return array('username' => 'Invalid username or password2' . $result);
        }
    } else {
        return @nsf_parser($username, $password, $xml_url);
    }
}
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:34,代码来源:service_nsf.php

示例15: encodeMimeMultipart

 /**
  * Given array of MIME parts in raw string, this function converts them into MIME
  * representation. 
  * 
  * @param array $bodyPartContents The MIME body parts.
  * 
  * @return array Returns array with two elements 'headers' and 'body' which
  * represents the MIME message.
  */
 public function encodeMimeMultipart($bodyPartContents)
 {
     $count = count($bodyPartContents);
     $mimeType = Resources::MULTIPART_MIXED_TYPE;
     $batchGuid = strtolower(trim(com_create_guid(), '{}'));
     $batchId = sprintf('batch_%s', $batchGuid);
     $contentType1 = array('content_type' => "{$mimeType}");
     $changeSetGuid = strtolower(trim(com_create_guid(), '{}'));
     $changeSetId = sprintf('changeset_%s', $changeSetGuid);
     $contentType2 = array('content_type' => "{$mimeType}; boundary={$changeSetId}");
     $options = array('encoding' => 'binary', 'content_type' => Resources::HTTP_TYPE);
     // Create changeset MIME part
     $changeSet = new \Mail_mimePart();
     for ($i = 0; $i < $count; $i++) {
         $changeSet->addSubpart($bodyPartContents[$i], $options);
     }
     // Encode the changeset MIME part
     $changeSetEncoded = $changeSet->encode($changeSetId);
     // Create the batch MIME part
     $batch = new \Mail_mimePart(Resources::EMPTY_STRING, $contentType1);
     // Add changeset encoded to batch MIME part
     $batch->addSubpart($changeSetEncoded['body'], $contentType2);
     // Encode batch MIME part
     $batchEncoded = $batch->encode($batchId);
     return $batchEncoded;
 }
开发者ID:pankajadhyapak,项目名称:um_new,代码行数:35,代码来源:MimeReaderWriter.php


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