本文整理汇总了PHP中getObject函数的典型用法代码示例。如果您正苦于以下问题:PHP getObject函数的具体用法?PHP getObject怎么用?PHP getObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getObject函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: doSomething
function doSomething()
{
if (($object = getObject()) < 0) {
return $object;
}
return $object;
}
开发者ID:robertblackwell,项目名称:srmn,代码行数:7,代码来源:test.php
示例2: getStreamByObject
function getStreamByObject($object)
{
$query = "SELECT * FROM MSTREAMT WHERE oid={$object} ORDER BY(sid) DESC";
$result = mysql_query($query);
$ret = "<table class='table' style='width:300px;'>";
while ($row = mysql_fetch_array($result)) {
$o = getObject($row["oid"]);
$id = $row["oid"];
$im = getImgUri($o["oimgid"]);
$ret .= "<tr><td>" . $row["message"] . "</td><td>" . dateify($row["postedon"]) . "</td></tr>";
}
$ret .= "</table>";
return $ret;
}
开发者ID:neshkatrapati,项目名称:chatalot,代码行数:14,代码来源:stlib.php
示例3: listMessages
public function listMessages()
{
$user = $this->registry > getObject('authenticate')->getUser()->getUserID();
$data = array();
$sql = "SELECT * FROM `messages` WHERE `sender`=" . $user . " OR `recipient`=" . $user;
$this->registry->getObject('db')->executeQuery($sql);
if ($this->registry->getObject('db')->numRows() > 0) {
$this->empty = false;
while ($fields = $this->registry->getObject('db')->getRows) {
$this->IDs = $fields['ID'];
$data[] = $fields;
}
$this->registry->getObject('template')->buildFromTemplate('header.php', 'messages_main.php', 'footer.php');
$cacheableIDs = array();
foreach ($this->IDs as $id) {
$i = array();
$i['message_id'] = $id;
$cacheableIDs[] = $i;
}
$cache = $this->registry->getObject('db')->cacheData($cacheableIDs);
$this->registry->getObject('template')->getPage()->addTag('message', array('DATA', $cache));
$daTags = array();
$type = $this->getType($d['type']);
foreach ($data as $d) {
foreach ($d as $f => $v) {
$daTags['message_' . $f] = $v;
}
if ($d['sender'] == $this->registry->getObject('authenticate')->getUser()->getUserID() && $d['read'] == 0 && $d['reply'] != 0) {
$this->listReply($d, 'messages/' . $type . '-replySelf-unread.php', $daTags);
} elseif ($d['sender'] == $this->registry->getObject('authenticate')->getUser()->getUserID() && $d['read'] == 1 && $d['reply'] != 0) {
$this->listReply($d, 'messages/' . $type . '-replySelf-read.php', $daTags);
} elseif ($d['read'] == 0 && $d['reply'] != 0) {
$this->listReply($d, 'messages/' . $type . '-reply-unread.php', $daTags);
} elseif ($d['read'] == 1 && $d['reply'] != 0) {
$this->listReply($d, 'messages/' . $type . '-reply-read.php', $daTags);
} elseif ($d['sender'] == $this->registry->getObject('authenticate')->getUser()->getUserID() && $d['read'] == 0) {
$this->registry->getObject('template')->addTemplateBit('message-' . $d['ID'], 'messages/' . $type . '-fromSelf-unread.php', $daTags);
} elseif ($d['sender'] == $this->registry->getObject('authenticate')->getUser()->getUserID() && $d['read'] == 1) {
$this->registry->getObject('template')->addTemplateBit('message-' . $d['ID'], 'messages/' . $type . '-fromSelf-read.php', $daTags);
} elseif ($d['read'] == 0) {
$this->registry->getObject('template')->addTemplateBit('message-' . $d['ID'], 'messages/' . $type . '-unread.php', $daTags);
} else {
$daTags['message_replyFrom'] = '';
$this->registry->getObject('template')->addTemplateBit('message-' . $d['ID'], 'messages/' . $type . '-read.php', $daTags);
}
}
}
}
开发者ID:maxzeroedge,项目名称:social,代码行数:48,代码来源:messages.php
示例4: define
define(ROOT, $_SERVER['DOCUMENT_ROOT']);
include_once ROOT . "/functions/database_management.php";
//TODO: Reemplazar por $_SESSION['username']
switch ($_POST["functionCalled"]) {
case "hasCompleted":
echo 'ret=' . var_export(hasCompleted($_POST["eventName"], $_POST["username"], $_POST["puzzle"]), true);
break;
case "complete":
echo complete($_POST["eventName"], $_POST["username"], $_POST["puzzle"]);
break;
case "isAvailable":
echo 'ret=' . var_export(isAvailable($_POST["eventName"], $_POST["username"], $_POST["object"]), true);
break;
case "hasObject":
echo 'ret=' . var_export(hasObject($_POST["eventName"], $_POST["username"], $_POST["object"]), true);
break;
case "usedObject":
echo 'ret=' . var_export(usedObject($_POST["eventName"], $_POST["username"], $_POST["object"]), true);
break;
case "releaseObject":
releaseObject($_POST["eventName"], $_POST["username"], $_POST["object"]);
break;
case "getObject":
getObject($_POST["eventName"], $_POST["username"], $_POST["object"]);
break;
case "useObject":
useObject($_POST["eventName"], $_POST["username"], $_POST["object"]);
break;
}
?>
开发者ID:tcolloca,项目名称:EasterEvent,代码行数:30,代码来源:index.php
示例5: callMethod
/**
* Title
*
* Description
*
* @access public
*/
function callMethod($method_name, $params = 0)
{
$tmp = explode('.', $method_name);
if ($tmp[2]) {
$object_name = $tmp[0] . '.' . $tmp[1];
$varname = $tmp[2];
} elseif ($tmp[1]) {
$object_name = $tmp[0];
$method_name = $tmp[1];
} else {
$object_name = 'ThisComputer';
}
$obj = getObject($object_name);
if ($obj) {
return $obj->callMethod($method_name, $params);
} else {
return 0;
}
}
开发者ID:AirKing555,项目名称:majordomo,代码行数:26,代码来源:objects.class.php
示例6: header
<?php
header('Content-Type: text/html; charset=utf-8');
include '../../includes/classes/core.php';
include '../../includes/classes/barcode/tfpdf.php';
include '../../includes/classes/logger.class.php';
$object_id = $_REQUEST['id'];
$status = $_REQUEST['status'];
$res = mysql_query("SELECT \t\tproduction.`name` AS `name`,\n\t\t\t\t\t\t\t\tCONCAT(sale_transaction_detail.product_quantity, ' ', production_unit.`name`) AS `quantity`\n\t\t\t\t\tFROM \t\tsale_transaction\n\t\t\t\t\tLEFT JOIN \tsale_transaction_detail ON sale_transaction.id = sale_transaction_detail.transaction_id\n\t\t\t\t\tRIGHT JOIN \tproduction ON production.id = sale_transaction_detail.production_id\n\t\t\t\t\tLEFT JOIN production_unit ON production.unit = production_unit.id\n\t\t\t\t\tWHERE \t\tsale_transaction.object_id = {$object_id} AND sale_transaction.`status` = {$status} AND sale_transaction_detail.production_id NOT IN (SELECT recipie.recipie_id FROM recipie)");
$res1 = mysql_query("SELECT \t\t\tsale_transaction_detail.id,\n\t\t\t\t\t\t\t\t\t\tpr1.`name` AS `name`,\n\t\t\t\t\t\t\t\t\t\tCONCAT(sale_transaction_detail.product_quantity, ' ', pu1.`name`) AS `quantity`,\n\t\t\t\t\t\t\t\t\t\tpr2.`name`AS `ingredient`,\n\t\t\t\t\t\t\t\t\t\trecipie_producing.quantity / recipie.quantity AS `ing_quantity`\n\t\t\t\t\t\tFROM \t\t\tsale_transaction\n\t\t\t\t\t\tLEFT JOIN \t\tsale_transaction_detail ON sale_transaction.id = sale_transaction_detail.transaction_id\n\t\t\t\t\t\tLEFT JOIN \trecipie_producing ON recipie_producing.recipie_id = sale_transaction_detail.production_id AND recipie_producing.transaction_detail_id = sale_transaction_detail.id\n\t\t\t\t\t\tLEFT JOIN \trecipie ON recipie_producing.recipie_id = recipie.recipie_id AND recipie_producing.production_id = recipie.ingredient_id\n\t\t\t\t\t\tLEFT JOIN\t\tproduction AS pr2 ON recipie_producing.production_id = pr2.id\n\t\t\t\t\t\tLEFT JOIN \t\tproduction AS pr1 ON pr1.id = sale_transaction_detail.production_id\n\t\t\t\t\t\tLEFT JOIN \tproduction_unit AS pu1 ON pr1.unit = pu1.id\n\t\t\t\t\t\tLEFT JOIN \tproduction_unit AS pu2 ON pr2.unit = pu2.id\n\t\t\t\t\t\tWHERE \t\t\tsale_transaction.object_id = {$object_id} AND sale_transaction.`status` = {$status} AND recipie_producing.quantity > 0 AND `recipie`.`visible` = 1 ");
$res3 = mysql_query("SELECT \t\tproduction.`name`,\n\t\t\t\t\t\t\t\t\tCONCAT(sale_transaction_detail.product_quantity, ' ', production_unit.`name`) AS `quantity` \n\t\t\t\t\tFROM \t\t\tsale_transaction\n\t\t\t\t\tLEFT JOIN\t \tsale_transaction_detail ON sale_transaction.id = sale_transaction_detail.transaction_id\n\t\t\t\t\tRIGHT JOIN\t \tproduction ON production.id = sale_transaction_detail.production_id\n\t\t\t\t\tLEFT JOIN \t\tproduction_unit ON production.unit = production_unit.id\n\t\t\t\t\tLEFT JOIN \trecipie ON recipie.recipie_id = production.id\n\t\t\t\t\tWHERE \t\t\tsale_transaction.object_id = 136 AND sale_transaction.`status` = 4 AND sale_transaction_detail.production_id \n\t\t\t\t\tGROUP BY recipie.recipie_id\n\t\t\t\t\tHAVING sum(recipie.visible)=0\n\t\t\t\t\t\t");
echo '<p align=center style=" font-size: 15px;"><u>' . date('Y-m-d H:i') . '</u></p>';
echo '<p align=center style=" font-size: 15px;">ობიექტი: <u>' . getObject($object_id) . '</u></p></br>';
echo '<table style="width: 100%; " cellspacing="0" cellpadding="6">';
while ($row = mysql_fetch_assoc($res)) {
echo '<tr>';
echo '<td style=" font-size: 14px; width: 35%; border-bottom:1px solid black;"><p>   ' . $row['name'] . '</p></td>';
echo '<td style=" font-size: 14px; width: 15%; border-bottom:1px solid black;"><p>' . $row['quantity'] . '</p></td>';
}
$array = array();
while ($row1 = mysql_fetch_assoc($res1)) {
echo '<tr>';
if (in_array($row1[id], $array)) {
echo '<td style=" font-size: 12px; width: 80%; border-bottom:1px solid black;"><p>      ' . $row1['ingredient'] . '</p></td>';
echo '<td style=" font-size: 12px; width: 15%; border-bottom:1px solid black;"><p>      ' . round($row1['ing_quantity'] / $row1['quantity'], 0) . '</p></td>';
} else {
echo '</tr>';
echo '<tr>';
echo '<td style=" font-size: 14px; width: 80%; border-bottom:1px solid black;"><b>   ' . $row1['name'] . '</b></td>';
echo '<td style=" font-size: 14px; width: 15%; border-bottom:1px solid black;"><p> ' . $row1['quantity'] . '</p></td>';
echo '</tr>';
开发者ID:aleqsandre553,项目名称:buildmarket_new,代码行数:31,代码来源:print.action.php
示例7: SQLSelect
$sortby = $sortby . " DESC";
}
}
$session->data['commands_sort'] = $sortby;
}
$sortby = "PRIORITY DESC, TITLE";
$out['SORTBY'] = $sortby;
// SEARCH RESULTS
$res = SQLSelect("SELECT * FROM commands WHERE {$qry} ORDER BY {$sortby}");
if ($res[0]['ID']) {
if ($this->action != 'admin') {
$dynamic_res = array();
$total = count($res);
for ($i = 0; $i < $total; $i++) {
if ($res[$i]['SMART_REPEAT'] && $res[$i]['LINKED_OBJECT']) {
$obj = getObject($res[$i]['LINKED_OBJECT']);
$objects = getObjectsByClass($obj->class_id);
$total_o = count($objects);
for ($io = 0; $io < $total_o; $io++) {
$rec = $res[$i];
$rec['ID'] = $res[$i]['ID'] . '_' . $objects[$io]['ID'];
$rec['LINKED_OBJECT'] = $objects[$io]['TITLE'];
$rec['DATA'] = str_replace('%' . $res[$i]['LINKED_OBJECT'] . '.', '%' . $rec['LINKED_OBJECT'] . '.', $rec['DATA']);
$rec['CUR_VALUE'] = getGlobal($rec['LINKED_OBJECT'] . '.' . $rec['LINKED_PROPERTY']);
$rec['TITLE'] = $objects[$io]['TITLE'];
$dynamic_res[] = $rec;
}
} else {
$dynamic_res[] = $res[$i];
}
}
开发者ID:AirKing555,项目名称:majordomo,代码行数:31,代码来源:commands_search.inc.php
示例8: foreach
}
}
foreach ($bt_devices as $k => $v) {
if ($v != $last_scan) {
//device removed
echo date('Y/m/d H:i:s') . " Device gone: {$k}\n";
$user = array();
$rec = SQLSelectOne("SELECT * FROM btdevices WHERE MAC LIKE '" . $k . "'");
if ($rec['ID']) {
$rec['LOG'] = 'Device lost ' . date('Y/m/d H:i:s') . "\n" . $rec['LOG'];
SQLUpdate('btdevices', $rec);
if ($rec['USER_ID']) {
$user = SQLSelectOne("SELECT * FROM users WHERE ID='" . $rec['USER_ID'] . "'");
}
}
getObject('BlueDev')->raiseEvent("Lost", array('mac' => $k, 'user' => $user['NAME']));
unset($bt_devices[$k]);
}
}
}
} else {
echo "Running Bluetooth monitor.";
}
$first_run = 0;
if (file_exists('./reboot') || $_GET['onetime']) {
$db->Disconnect();
exit;
}
sleep(1);
}
// closing database connection
开发者ID:vasvlad,项目名称:majordomo,代码行数:31,代码来源:cycle_bluetooth.php
示例9: getRenditions
function getRenditions($objectId, $options = array(OPT_RENDITION_FILTER => "*"))
{
return getObject($objectId, $options);
}
开发者ID:rohdev,项目名称:gmap,代码行数:4,代码来源:cmis_repository_wrapper.php
示例10: getDynamicElements
/**
* Title
*
* Description
*
* @access public
*/
function getDynamicElements($qry = '1')
{
$elements = SQLSelect("SELECT elements.* FROM elements, scenes WHERE elements.SCENE_ID=scenes.ID AND {$qry} ORDER BY PRIORITY DESC, TITLE");
$totale = count($elements);
$res2 = array();
for ($ie = 0; $ie < $totale; $ie++) {
$states = SQLSelect("SELECT elm_states.*,elements.TYPE FROM elm_states, elements WHERE elm_states.ELEMENT_ID=elements.ID AND ELEMENT_ID='" . $elements[$ie]['ID'] . "' ORDER BY elm_states.PRIORITY DESC, elm_states.TITLE");
if ($elements[$ie]['SMART_REPEAT'] && !$this->action == 'admin') {
$linked_object = '';
if ($states[0]['LINKED_OBJECT']) {
$linked_object = $states[0]['LINKED_OBJECT'];
} elseif ($states[0]['ACTION_OBJECT']) {
$linked_object = $states[0]['ACTION_OBJECT'];
}
if ($linked_object) {
$obj = getObject($linked_object);
$objects = getObjectsByClass($obj->class_id);
$total_o = count($objects);
for ($io = 0; $io < $total_o; $io++) {
$rec = $elements[$ie];
$rec['ID'] = $elements[$ie] . '_' . $objects[$io]['ID'];
$new_states = array();
$total_s = count($states);
for ($is = 0; $is < $total_s; $is++) {
$state_rec = $states[$is];
if ($state_rec['LINKED_OBJECT']) {
$state_rec['LINKED_OBJECT'] = $objects[$io]['TITLE'];
}
if ($state_rec['ACTION_OBJECT']) {
$state_rec['ACTION_OBJECT'] = $objects[$io]['TITLE'];
}
if ($state_rec['HTML']) {
$state_rec['HTML'] = str_replace('%' . $linked_object . '.', '%' . $objects[$io]['TITLE'] . '.', $state_rec['HTML']);
}
$state_rec['ID'] = $state_rec['ID'] . '_' . $objects[$io]['ID'];
$new_states[] = $state_rec;
}
$rec['STATES'] = $new_states;
$res2[] = $rec;
}
} else {
$elements[$ie]['STATES'] = $states;
$elements[$ie]['SMART_REPEAT'] = 0;
$res2[] = $elements[$ie];
}
} else {
$elements[$ie]['STATES'] = $states;
$res2[] = $elements[$ie];
}
}
return $res2;
}
开发者ID:AirKing555,项目名称:majordomo,代码行数:59,代码来源:scenes.class.php
示例11: mysql
include_once "./lib/loader.php";
include_once DIR_MODULES . "application.class.php";
$db = new mysql(DB_HOST, '', DB_USER, DB_PASSWORD, DB_NAME);
// connecting to database
include_once "./load_settings.php";
set_time_limit(30);
if (!$width) {
$w = 610;
} else {
$w = (int) $width;
}
// Dataset definition
//$DataSet = new pData;
if ($p != '') {
if (preg_match('/(.+)\\.(.+)/is', $p, $m)) {
$obj = getObject($m[1]);
$prop_id = $obj->getPropertyByName($m[2], $obj->class_id, $obj->id);
}
}
//$type='';
$pvalue = SQLSelectOne("SELECT * FROM pvalues WHERE PROPERTY_ID='" . $prop_id . "' AND OBJECT_ID='" . $obj->id . "'");
if (!$pvalue['ID']) {
echo "Incorrect property name";
exit;
}
if ($_GET['op'] == 'value') {
echo $pvalue['VALUE'];
exit;
}
$end_time = time();
if ($_GET['px']) {
开发者ID:cdkisa,项目名称:majordomo,代码行数:31,代码来源:index.php
示例12: processCommand
/**
* Title
*
* Description
*
* @access public
*/
function processCommand($command) {
getObject("ThisComputer")->callMethod("commandReceived", array("command"=>$command));
}
开发者ID:novozhenets,项目名称:majordomo,代码行数:10,代码来源:common.class.php
示例13: foreach
foreach ($bt_devices as $k => $v) {
if ($v != $last_scan) {
//device removed
echo date('Y/m/d H:i:s') . ' Device gone: ' . $k . '\\n';
$user = array();
$sqlQuery = "SELECT * \n FROM btdevices \n WHERE MAC LIKE '" . $k . "'";
$rec = SQLSelectOne($sqlQuery);
if ($rec['ID']) {
$rec['LOG'] = 'Device lost ' . date('Y/m/d H:i:s') . '\\n' . $rec['LOG'];
SQLUpdate('btdevices', $rec);
if ($rec['USER_ID']) {
$sqlQuery = "SELECT * \n FROM users \n WHERE ID = '" . $rec['USER_ID'] . "'";
$user = SQLSelectOne($sqlQuery);
}
}
$objectArray = array('mac' => $k, 'user' => $user['NAME']);
getObject('BlueDev')->raiseEvent("Lost", $objectArray);
unset($bt_devices[$k]);
}
}
}
}
$first_run = 0;
if (file_exists('./reboot') || $_GET['onetime']) {
$db->Disconnect();
exit;
}
sleep(1);
}
// closing database connection
$db->Disconnect();
开发者ID:Andrew-Shtein,项目名称:majordomo,代码行数:31,代码来源:cycle_bluetooth.php
示例14: getEobject
final function getEobject()
{
$class = "exx{$this->getClass()}";
return getObject($class);
}
开发者ID:hypervm-ng,项目名称:hypervm-ng,代码行数:5,代码来源:lxclass.php
示例15: checkAllVars
/**
* Title
*
* Description
*
* @access public
*/
function checkAllVars($force=0) {
// ping hosts
if ($force) {
$pings=SQLSelect("SELECT * FROM webvars WHERE 1");
} else {
$pings=SQLSelect("SELECT * FROM webvars WHERE CHECK_NEXT<=NOW()");
}
$total=count($pings);
for($i=0;$i<$total;$i++) {
$host=$pings[$i];
if (!$force) {
echo "Checking webvar: ".$host['HOSTNAME']."\n";
}
$online_interval=$host['ONLINE_INTERVAL'];
if (!$online_interval) {
$online_interval=60;
}
$host['CHECK_NEXT']=date('Y-m-d H:i:s', time()+$online_interval);
SQLUpdate('webvars', $host);
// checking
//web host
$old_status=$host['LATEST_VALUE'];
if ($host['AUTH'] && $host['USERNAME']) {
$content=getURL($host['HOSTNAME'], $host['ONLINE_INTERVAL'], $host['USERNAME'], $host['PASSWORD']);
} else {
$content=getURL($host['HOSTNAME'], $host['ONLINE_INTERVAL']);
}
if ($host['ENCODING']!='') {
$content=iconv($host['ENCODING'], "UTF-8", $content);
}
$ok=1;
$new_status='';
if ($host['SEARCH_PATTERN']) {
if (preg_match('/'.$host['SEARCH_PATTERN'].'/is', $content, $m)) {
$new_status=$m[1];
} else {
$ok=0; // result did not matched
}
} else {
$new_status=$content;
}
if ($host['CHECK_PATTERN'] && !preg_match('/'.$host['CHECK_PATTERN'].'/is', $new_status)) {
$ok=0; // result did not pass the check
}
if (!$ok) {
$host['LOG']=date('Y-m-d H:i:s').' incorrect value:'.$new_status."\n".$host['LOG'];
SQLUpdate('webvars', $host);
continue;
}
$host['CHECK_LATEST']=date('Y-m-d H:i:s');
$host['CHECK_NEXT']=date('Y-m-d H:i:s', time()+$online_interval);
if ($old_status!=$new_status) {
$host['LOG']=date('Y-m-d H:i:s').' new value:'.$new_status."\n".$host['LOG'];
}
$host['LATEST_VALUE']=$new_status;
SQLUpdate('webvars', $host);
if ($host['LINKED_OBJECT']!='' && $host['LINKED_PROPERTY']!='') {
getObject($host['LINKED_OBJECT'])->setProperty($host['LINKED_PROPERTY'], $new_status);
}
if ($old_status!=$new_status && $old_status!='') {
// do some status change actions
$run_script_id=0;
$run_code='';
// got online
if ($host['SCRIPT_ID']) {
$run_script_id=$host['SCRIPT_ID'];
} elseif ($host['CODE']) {
$run_code=$host['CODE'];
}
if ($run_script_id) {
//run script
runScript($run_script_id);
} elseif ($run_code) {
//run code
eval($run_code);
}
}
//.........这里部分代码省略.........
开发者ID:novozhenets,项目名称:majordomo,代码行数:101,代码来源:webvars.class.php
示例16: SQLSelect
$sqlQuery = "SELECT ID, TITLE\n FROM objects\n WHERE {$o_qry}";
$objects = SQLSelect($sqlQuery);
$total = count($objects);
for ($i = 0; $i < $total; $i++) {
echo $objects[$i]['TITLE'] . "->onNewMinute\n";
getObject($objects[$i]['TITLE'])->raiseEvent("onNewMinute");
getObject($objects[$i]['TITLE'])->setProperty("time", date('Y-m-d H:i:s'));
}
$old_minute = $m;
}
if ($h != $old_hour) {
$sqlQuery = "SELECT ID, TITLE\n FROM objects\n WHERE {$o_qry}";
echo "new hour\n";
$old_hour = $h;
$objects = SQLSelect($sqlQuery);
$total = count($objects);
for ($i = 0; $i < $total; $i++) {
getObject($objects[$i]['TITLE'])->raiseEvent("onNewHour");
}
}
if ($dt != $old_date) {
echo "new day\n";
$old_date = $dt;
}
if (file_exists('./reboot') || $_GET['onetime']) {
$db->Disconnect();
exit;
}
sleep(1);
}
DebMes("Unexpected close of cycle: " . basename(__FILE__));
开发者ID:NioFBI,项目名称:majordomo,代码行数:31,代码来源:cycle_main.php
示例17: array
$doesExist = $ossClient->doesObjectExist($bucket, "c.file.copy");
Common::println("file c.file.copy exist? " . ($doesExist ? "yes" : "no"));
// 批量删除object
$result = $ossClient->deleteObjects($bucket, array("b.file", "c.file"));
foreach ($result as $object) {
Common::println($object);
}
sleep(2);
unlink("c.file.localcopy");
//******************************* 完整用法参考下面函数 ****************************************************
listObjects($ossClient, $bucket);
listAllObjects($ossClient, $bucket);
createObjectDir($ossClient, $bucket);
putObject($ossClient, $bucket);
uploadFile($ossClient, $bucket);
getObject($ossClient, $bucket);
getObjectToLocalFile($ossClient, $bucket);
copyObject($ossClient, $bucket);
modifyMetaForObject($ossClient, $bucket);
getObjectMeta($ossClient, $bucket);
deleteObject($ossClient, $bucket);
deleteObjects($ossClient, $bucket);
doesObjectExist($ossClient, $bucket);
/**
* 创建虚拟目录
*
* @param OssClient $ossClient OssClient实例
* @param string $bucket 存储空间名称
* @return null
*/
function createObjectDir($ossClient, $bucket)
开发者ID:aliyun,项目名称:aliyun-oss-php-sdk,代码行数:31,代码来源:Object.php
示例18: processCommand
/**
* Title
*
* Description
*
* @access public
*/
function processCommand($command)
{
global $pattern_matched;
if (!$pattern_matched) {
getObject("ThisComputer")->callMethod("commandReceived", array("command" => $command));
}
}
开发者ID:Andrew-Shtein,项目名称:majordomo,代码行数:14,代码来源:common.class.php
示例19: MessageStatus
function MessageStatus( &$pMessage, $Status ) {
global $skype, $CurrentUser, $archivechats;
global $pt;
$myhandle = $CurrentUser->Handle;
$cmeUnknown = -1;
$cmeCreatedChatWith = 0;
$cmeAddedMembers = 2;
$cmeSetTopic = 3;
$cmeSaid = 4;
$cmeLeft = 5;
if ($pMessage->Type == $cmeSetTopic) {
//skype_SetTopic($pMessage);
} else if ($pMessage->Type == $cmeAddedMembers) {
//skype_add_member($pMessage);
} else if ($pMessage->Type == $cmeSaid || $pMessage->Type == $cmeUnknown) {
if ($Status == 0 || $Status == 2) {
// print "\n$pMessage->body $Status $pMessage->type";
if ($pMessage->FromHandle <> $CurrentUser->Handle ) {
echo $pMessage->FromHandle.": ".convert_cyr_string($pMessage->Body, 'w', 'd')."\n";
if ( substr(strtolower($pMessage->Body),0,4) == 'ping' ) {
$skype->Chat($pMessage->ChatName)->SendMessage("pong");
}
$user=SQLSelectOne("SELECT ID FROM users WHERE SKYPE LIKE '".$pMessage->FromHandle."'");
if (!$user['ID']) {
$user=SQLSelectOne("SELECT ID FROM users ORDER BY ID");
}
$user_id=$user['ID'];
$qrys=explode(' '.DEVIDER.' ', iconv('WINDOWS-1251', 'UTF-8', $pMessage->Body));
$total=count($qrys);
for($i=0;$i<$total;$i++) {
$room_id=0;
$rec=array();
$rec['ROOM_ID']=(int)$room_id;
$rec['MEMBER_ID']=$user_id;
$rec['MESSAGE']=htmlspecialchars($qrys[$i]);
$rec['ADDED']=date('Y-m-d H:i:s');
SQLInsert('shouts', $rec);
$pt->checkAllPatterns();
getObject("ThisComputer")->raiseEvent("commandReceived", array("command"=>$qrys[$i]));
}
}
}
}
}
开发者ID:novozhenets,项目名称:majordomo,代码行数:55,代码来源:skypebot.php
示例20: get_details
public static function get_details($message_id)
{
global $n;
global $pt;
//Получаем id чата, используется для ответа
$ch = $n->Invoke('GET CHATMESSAGE ' . $message_id . ' CHATNAME');
//Получаем текст сообщения
$mess = $n->Invoke('GET CHATMESSAGE ' . $message_id . ' BODY');
//Получаем автора сообщения
$aut = $n->Invoke('GET CHATMESSAGE ' . $message_id . ' FROM_DISPNAME');
/*
* Теперь мы получим из строк, которые мы только что получили, нужные нам данные.
* А именно: Автора сообщения, id чата и текст сообщения.
*/
$author = explode('FROM_DISPNAME ', $aut);
$chat = explode('CHATNAME ', $ch);
$message = explode('BODY ', $mess);
//Выводим в консоль автора и сообщение
#echo $author[1].': '.$message[1]."\n";
//на ping отвечаем pong - для тестирования приема сообщений скриптом. Если ответа нет - скорее всего скрипт остановлися.
if (substr(strtolower($message[1]), 0, 4) == 'ping') {
$n->Invoke('CHATMESSAGE ' . $chat[1] . ' pong');
return true;
}
//обработаем сообщения, начинающиеся с восклицательного знака !
//оставил возможность для примера - можно будет удалить
if ($message[1][0] == '!') {
self::reply($chat[1], $message[1], $message_id);
return true;
}
//на остальные сообщения - выполняем обычную обработку через модуль MajorDoMo
$user = SQLSelectOne("SELECT ID FROM users WHERE SKYPE LIKE '" . $author[1] . "'");
if (!$user['ID']) {
$user = SQLSelectOne("SELECT ID FROM users ORDER BY ID");
}
$user_id = $user['ID'];
$qrys = explode(' ' . DEVIDER . ' ', $message[1]);
$total = count($qrys);
for ($i = 0; $i < $total; $i++) {
$room_id = 0;
$rec = array();
$rec['ROOM_ID'] = (int) $room_id;
$rec['MEMBER_ID'] = $user_id;
$rec['MESSAGE'] = htmlspecialchars($qrys[$i]);
$rec['ADDED'] = date('Y-m-d H:i:s');
SQLInsert('shouts', $rec);
$pt->checkAllPatterns();
getObject("ThisComputer")->raiseEvent("commandReceived", array("command" => $qrys[$i]));
}
}
开发者ID:NioFBI,项目名称:majordomo,代码行数:50,代码来源:cycle_X101_skype.php
注:本文中的getObject函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论