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


PHP strings::create方法代码示例

本文整理汇总了PHP中strings::create方法的典型用法代码示例。如果您正苦于以下问题:PHP strings::create方法的具体用法?PHP strings::create怎么用?PHP strings::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在strings的用法示例。


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

示例1: special_storage

 public function special_storage($prop_key, $prop_val)
 {
     global $APP;
     if (strpos($prop_key, "str_") !== FALSE) {
         if ($this->obj_debug) {
             echo "In Special_storage function() for prop: {$prop_key}<br/><br/>";
         }
         $content_mime_type = "text/plain";
         $content_extension = "txt";
         $original_content_extension = $content_extension;
         $sha1_string = sha1(microtime() . $prop_key . $prop_val . rand(3, 5));
         $keyname = $GLOBALS['settings'][$APP['fs']->kind]['paths']['strings']['@attributes']['value'] . "/" . $sha1_string . "." . $content_extension;
         $bucket_name = $GLOBALS['settings'][$APP['fs']->kind][$APP['fs']->bucket_syntax()]['@attributes']['value'];
         $content_detection_info = get_mime_and_extension($prop_val);
         // GIVES MIME TYPE, EXTENSION
         $content_mime_type = $content_detection_info[0];
         $content_extension = $content_detection_info[1];
         if (!stringEndsWith($keyname, $content_extension)) {
             $keyname = str_lreplace($original_content_extension, $content_extension, $keyname);
         }
         $APP['fs']->create_object(false, $bucket_name, $keyname, $prop_val, $content_mime_type);
         $string_url = $APP['fs']->key_url($bucket_name, $keyname);
         $sha1_string2 = sha1($prop_key . microtime() . $prop_val . rand(1, 20));
         $props_string = array();
         $props_string['id'] = $sha1_string2;
         $props_string['val'] = $string_url;
         $new_string = new strings();
         $new_string->create($props_string);
         $prop_val = $sha1_string2;
     }
     // end if
     return $prop_val;
 }
开发者ID:hisapi,项目名称:metamodelexecutor,代码行数:33,代码来源:object_database_mapping.php

示例2: give_ids

 public function give_ids()
 {
     global $APP;
     $found_expression_id_and_set = "";
     foreach ($this->obj_me_settings as &$me) {
         $me->id_me = $this->id_expr . "@" . $this->idx_id;
         if ($me->name == "str_expression") {
             if (isset($this->obj_expression)) {
                 $found_expression_id_and_set = sha1(microtime() . $this->int_order . $this->id_expr . $this->idx_id . rand(1, 1000));
                 $this->obj_expression->id = $found_expression_id_and_set;
                 $sha1_string = sha1(microtime() . $this->obj_expression->id . $me->name . $this->obj_expression->val . rand(3, 1000));
                 $keyname = $GLOBALS['settings'][$APP['fs']->kind]['paths']['strings']['@attributes']['value'] . "/" . $sha1_string . ".txt";
                 $bucket_name = $GLOBALS['settings'][$APP['fs']->kind][$APP['fs']->bucket_syntax()]['@attributes']['value'];
                 $APP['fs']->create_object(false, $bucket_name, $keyname, $this->obj_expression->val, "text/plain");
                 $string_url = $APP['fs']->key_url($bucket_name, $keyname);
                 $this->obj_expression->val = $string_url;
                 $this->obj_expression->give_ids();
                 $me->str_value = $this->obj_expression->id;
             }
         } else {
             /*
             if ( isset($this->obj_expression->val) )
             {
             	//echo "<pre>";
             	//print_r($this);
             	$sha1_string=sha1(microtime().$me->id_me.$me->name.rand(3,1000));
             	$keyname=$GLOBALS['settings'][$APP['fs']->kind]['paths']['strings']['@attributes']['value']."/".$sha1_string.".txt";
             	$bucket_name=$GLOBALS['settings'][$APP['fs']->kind][$APP['fs']->bucket_syntax()]['@attributes']['value'];
             	$APP['fs']->create_object(false,$bucket_name,$keyname,$this->obj_expression->val,"text/plain");
             	$string_url=$APP['fs']->key_url($bucket_name,$keyname);
             
             	$sha2_string=sha1(microtime().$string_url.$me->name.rand(3,1000));
             
             	$NEW_STRING = new strings();
             	$props=array();
             	$props['id']=$sha2_string;
             	$props['val']=$string_url;
             	$NEW_STRING->create($props);
             
             	$me->str_value=$sha2_string;
             }
             else
             {
             */
             $sha1_string = sha1(microtime() . $me->id_me . $me->name . rand(3, 1000));
             $keyname = $GLOBALS['settings'][$APP['fs']->kind]['paths']['strings']['@attributes']['value'] . "/" . $sha1_string . ".txt";
             $bucket_name = $GLOBALS['settings'][$APP['fs']->kind][$APP['fs']->bucket_syntax()]['@attributes']['value'];
             $APP['fs']->create_object(false, $bucket_name, $keyname, $me->str_value, "text/plain");
             $string_url = $APP['fs']->key_url($bucket_name, $keyname);
             $sha2_string = sha1(microtime() . $string_url . $me->name . rand(3, 1000));
             $NEW_STRING = new strings();
             $props = array();
             $props['id'] = $sha2_string;
             $props['val'] = $string_url;
             $NEW_STRING->create($props);
             $me->str_value = $sha2_string;
             //}
         }
     }
     // END FOREACH
     /*
     if ($found_expression_id_and_set!="")
     {
     	//echo "<pre>";
     	//print_r($this);
     	$sha1_string=sha1(microtime().$me->id_me.$me->name.rand(3,1000));
     	$keyname=$GLOBALS['settings'][$APP['fs']->kind]['paths']['strings']['@attributes']['value']."/".$sha1_string.".txt";
     	$bucket_name=$GLOBALS['settings'][$APP['fs']->kind][$APP['fs']->bucket_syntax()]['@attributes']['value'];
     	$APP['fs']->create_object(false,$bucket_name,$keyname,$this->obj_expression->val,"text/plain");
     	$string_url=$APP['fs']->key_url($bucket_name,$keyname);
     
     	$sha2_string=sha1(microtime().$string_url.$me->name.rand(3,1000));
     
     	$NEW_STRING = new strings();
     	$props=array();
     	$props['id']=$sha2_string;
     	$props['val']=$string_url;
     	$NEW_STRING->create($props);
     
     	$me->str_value=$sha2_string;
     
     }
     */
 }
开发者ID:hisapi,项目名称:his,代码行数:84,代码来源:model.classes.php

示例3: logger

         $NEW_STRING->create($props);
         $JOB->update_raw(array("str_response" => $NEW_STRING->id));
         $JOB->update(array("id_status" => "paused", "dt_modified" => get_time()));
         logger("\t\t" . "SETTING STATUS TO 'PAUSED'" . "\n");
     }
     // END IF (JOB IS NOT ALREADY PAUSED)
 } else {
     if ($JOB->id_status != "paused" && $JOB->id_status != "done") {
         logger("\t" . "THIS WAS *NOT* A PARENT JOB BEING RUN, IT CREATED NO NEW PH_PARENT/CHILD ENTRIES\n");
         // THIS WAS *NOT* A PARENT JOB BEING RUN, NO PH_PARENT/CHILD ENTRIES CREATED
         $NEW_STRING = new strings();
         $sha1_string = sha1(microtime() . rand(1, 1000));
         $props = array();
         $props['id'] = $sha1_string;
         $props['val'] = $OUTPUT_CONTENT;
         $NEW_STRING->create($props);
         $this_time_epoch = get_time();
         $JOB->update_raw(array("str_response" => $NEW_STRING->id));
         $JOB->update(array("id_status" => "done", "dt_modified" => $this_time_epoch, "dt_done" => $this_time_epoch));
         $JOB->delete_ph_decendants();
         logger("\t\t" . "SETTING STATUS TO 'DONE'" . "\n");
     }
 }
 // END IF - IS THIS JOB A PARENT JOB?
 // THIS "WHILE" ROUTINE WILL TAKE THIS COMPLETED JOB'S ID, AND IF JOB IS A CHILD JOB,
 //	CHECKS IF ALL SIBLING JOBS HAVE ALSO COMPLETED - IF THEY HAVE ALL COMPLETED,
 //	RUN A REPLACEMENT ROUTINE AGAINST THE JOB'S PARENT USING THE JOB'S
 //	SIBLINGS AS REPLACEMENTS FOR THE PARENT JOB'S PLACEHOLDER VALUES
 //	SET THE CURRENT JOB = PARENT JOB & REPEAT UNTIL TOP OF TREE IS REACHED
 //	OR NON-DONE JOB IS ENCOUNTERED
 $JID_MERGE_CHECK = $JOB->id;
开发者ID:hisapi,项目名称:his,代码行数:31,代码来源:controller.server.php


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