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

PHP parseArgs函数代码示例

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

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



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

示例1: genCast

function genCast($func, $indent)
{
    global $current_server;
    $funcname = $func->name;
    $async = @$func->async;
    $args_set = parseArgs(@$func->args);
    // decode args
    $arg_count = count($args_set);
    if ($arg_count) {
        $argsType = getArgsType($funcname);
        echo "{$indent}{$argsType} _args;\n";
        echo "{$indent}const bool _fOk = cerl::getMailBody(_ar, _args);\n\n";
        echo "{$indent}CERL_ASSERT(_fOk && \"{$current_server}::_handle_cast - {$funcname}\");\n";
        echo "{$indent}if (_fOk)\n";
    } else {
        echo "{$indent}NS_CERL_IO::check_vt_null(_ar);\n";
    }
    $indent2 = $arg_count ? $indent . "\t" : $indent;
    echo "{$indent2}{$funcname}(caller";
    if ($arg_count == 1) {
        echo ", _args";
    } else {
        foreach ($args_set as $var => $tp) {
            echo ", _args.{$var}";
        }
    }
    echo ");\n";
}
开发者ID:greatbody,项目名称:cerl,代码行数:28,代码来源:gen_stub.php


示例2: main

/**
 * Main function
 *
 * @param string[] $argv Program parameters
 *
 * @return void
 * @throws Exception
 */
function main($argv)
{
    $params = parseArgs($argv);
    applyConfigOverrides($params);
    if (empty($params['source']) || !is_string($params['source'])) {
        echo <<<EOT
Usage: {$argv['0']} --source=... [...]

Parameters:

--source            Repository id ('*' for all, separate multiple sources
                    with commas)
--exclude           Repository id's to exclude when using '*' for source
                    (separate multiple sources with commas)
--from              Override harvesting start date
--until             Override harvesting end date
--all               Harvest from beginning (overrides --from)
--verbose           Enable verbose output
--override          Override initial resumption token
                    (e.g. to resume failed connection)
--reharvest[=date]  This is a full reharvest, delete all records that were not
                    received during the harvesting (or were modified before [date]).
                    Implies --all.
--config.section.name=value
                    Set configuration directive to given value overriding any
                    setting in recordmanager.ini
--lockfile=file     Use a lock file to avoid executing the command multiple times in
                    parallel (useful when running from crontab)


EOT;
        exit(1);
    }
    $lockfile = isset($params['lockfile']) ? $params['lockfile'] : '';
    $lockhandle = false;
    try {
        if (($lockhandle = acquireLock($lockfile)) === false) {
            die;
        }
        $manager = new RecordManager(true, isset($params['verbose']) ? $params['verbose'] : false);
        $from = isset($params['from']) ? $params['from'] : null;
        if (isset($params['all']) || isset($params['reharvest'])) {
            $from = '-';
        }
        foreach (explode(',', $params['source']) as $source) {
            $manager->harvest($source, $from, isset($params['until']) ? $params['until'] : null, isset($params['override']) ? urldecode($params['override']) : '', isset($params['exclude']) ? $params['exclude'] : null, isset($params['reharvest']) ? $params['reharvest'] : '');
        }
    } catch (Exception $e) {
        releaseLock($lockhandle);
        throw $e;
    }
    releaseLock($lockhandle);
}
开发者ID:grharry,项目名称:RecordManager,代码行数:61,代码来源:harvest.php


示例3: main

/**
 * Main function 
 * 
 * @param string[] $argv Program parameters
 * 
 * @return void
 */
function main($argv)
{
    $params = parseArgs($argv);
    if (!isset($params['input']) || !isset($params['output'])) {
        echo "Usage: splitlog --input=... --output=...\n\n";
        echo "Parameters:\n\n";
        echo "--input             A harvest debug log file\n";
        echo "--output            A file mask for output (e.g. output%d.xml)\n";
        echo "--verbose           Enable verbose output\n\n";
        exit(1);
    }
    $fh = fopen($params['input'], 'r');
    $out = null;
    $count = 0;
    $inResponse = false;
    $emptyLines = 2;
    while ($line = fgets($fh)) {
        $line = chop($line);
        if (!$line) {
            ++$emptyLines;
            continue;
        }
        //echo "Empty: $emptyLines, $inResponse, line: '$line'\n";
        if ($emptyLines >= 2 && $line == 'Request:') {
            fgets($fh);
            fgets($fh);
            $inResponse = true;
            $emptyLines = 0;
            ++$count;
            $filename = sprintf($params['output'], $count);
            echo "Creating file '{$filename}'\n";
            if ($out) {
                fclose($out);
            }
            $out = fopen($filename, 'w');
            if ($out === false) {
                die("Could not open output file\n");
            }
            continue;
        }
        $emptyLines = 0;
        if ($inResponse) {
            fputs($out, $line . "\n");
        }
    }
    if ($out) {
        fclose($out);
    }
    echo "Done.\n";
}
开发者ID:grharry,项目名称:RecordManager,代码行数:57,代码来源:splitlog.php


示例4: main

/**
 * Main function
 *
 * @param string[] $argv Program parameters
 *
 * @return void
 */
function main($argv)
{
    $params = parseArgs($argv);
    applyConfigOverrides($params);
    if (empty($params['search'])) {
        echo <<<EOT
Usage: {$argv['0']} --search=...

Parameters:

--search=[regexp]   Search for a string in data sources and list the data source id's


EOT;
        exit(1);
    }
    $manager = new RecordManager(true, isset($params['verbose']) ? $params['verbose'] : false);
    if (!empty($params['search'])) {
        $manager->searchDataSources($params['search']);
    }
}
开发者ID:grharry,项目名称:RecordManager,代码行数:28,代码来源:datasources.php


示例5: main

/**
 * Main function
 *
 * @param string[] $argv Program parameters
 *
 * @return void
 * @throws Exception
 */
function main($argv)
{
    $params = parseArgs($argv);
    applyConfigOverrides($params);
    if (empty($params['file']) || empty($params['source'])) {
        echo <<<EOT
Usage: {$argv['0']} --file=... --source=... [...]

Parameters:

--file              The file or wildcard pattern of files of records
--source            Source ID
--verbose           Enable verbose output
--config.section.name=value
                   Set configuration directive to given value overriding any
                   setting in recordmanager.ini
--lockfile=file    Use a lock file to avoid executing the command multiple times in
                   parallel (useful when running from crontab)


EOT;
        exit(1);
    }
    $lockfile = isset($params['lockfile']) ? $params['lockfile'] : '';
    $lockhandle = false;
    try {
        if (($lockhandle = acquireLock($lockfile)) === false) {
            die;
        }
        $manager = new RecordManager(true, isset($params['verbose']) ? $params['verbose'] : false);
        $manager->loadFromFile($params['source'], $params['file']);
    } catch (Exception $e) {
        releaseLock($lockhandle);
        throw $e;
    }
    releaseLock($lockhandle);
}
开发者ID:grharry,项目名称:RecordManager,代码行数:45,代码来源:import.php


示例6: main

/**
 * Main function
 *
 * @param string[] $argv Program parameters
 *
 * @return void
 */
function main($argv)
{
    $params = parseArgs($argv);
    applyConfigOverrides($params);
    if (empty($params['file'])) {
        echo <<<EOT
Usage: {$argv['0']} --file=... [...]

Parameters:

--file=...          The file for records
--deleted=...       The file for deleted record IDs
--from=...          From date where to start the export
--verbose           Enable verbose output
--quiet             Quiet, no output apart from the data
--skip=...          Skip x records to export only a "representative" subset
--source=...        Export only the given source(s)
                    (separate multiple sources with commas)
--single=...        Export single record with the given id
--xpath=...         Export only records matching the XPath expression
--config.section.name=...
                    Set configuration directive to given value overriding
                    any setting in recordmanager.ini
--sortdedup         Sort export file by dedup id
--dedupid=...       deduped = Add dedup id's to records that have duplicates
                    always  = Always add dedup id's to the records
                    Otherwise dedup id's are not added to the records


EOT;
        exit(1);
    }
    $manager = new RecordManager(true, isset($params['verbose']) ? $params['verbose'] : false);
    $manager->quiet = isset($params['quiet']) ? $params['quiet'] : false;
    $manager->exportRecords($params['file'], isset($params['deleted']) ? $params['deleted'] : '', isset($params['from']) ? $params['from'] : '', isset($params['skip']) ? $params['skip'] : 0, isset($params['source']) ? $params['source'] : '', isset($params['single']) ? $params['single'] : '', isset($params['xpath']) ? $params['xpath'] : '', isset($params['sortdedup']) ? $params['sortdedup'] : false, isset($params['dedupid']) ? $params['dedupid'] : '');
}
开发者ID:grharry,项目名称:RecordManager,代码行数:43,代码来源:export.php


示例7: processArgType

function processArgType($func, $indent)
{
    $name = $func->name;
    $args_set = parseArgs(@$func->args);
    $i = count($args_set);
    if ($i == 0) {
        return;
    } else {
        if ($i == 1) {
            foreach ($args_set as $var => $type) {
                $typename = mapType($type, "");
                $argsTyName = getArgsType($name);
                echo "\n{$indent}typedef {$typename} {$argsTyName};\n";
            }
        } else {
            echo "\n{$indent}typedef struct {\n";
            foreach ($args_set as $var => $type) {
                $typename = mapType($type, "");
                echo "{$indent}\t{$typename} {$var};\n";
            }
            $argsTyName = getArgsType($name);
            echo "{$indent}} {$argsTyName};\n";
        }
    }
}
开发者ID:greatbody,项目名称:cerl,代码行数:25,代码来源:functions.php


示例8: trim

             case 1:
                 /* cut off function as second part of input string and keep rest for further parsing */
                 $function = trim(substr($input_string, 0, $pos));
                 $input_string = trim(strchr($input_string, ' ')) . ' ';
                 break;
             case 2:
                 /* take the rest as parameter(s) to the function stripped off previously */
                 $parameters = trim($input_string);
                 break 2;
         }
     } else {
         break;
     }
     $i++;
 }
 if (!parseArgs($parameters, $parameter_array)) {
     cacti_log("WARNING: Script Server count not parse '{$parameters}' for {$function}", false, 'PHPSVR');
     fputs(STDOUT, "U\n");
     continue;
 }
 if (read_config_option('log_verbosity') >= POLLER_VERBOSITY_DEBUG) {
     cacti_log("DEBUG: PID[{$pid}] CTR[{$ctr}] INC: '" . basename($include_file) . "' FUNC: '" . $function . "' PARMS: '" . $parameters . "'", false, 'PHPSVR');
 }
 /* validate the existance of the function, and include if applicable */
 if (!function_exists($function)) {
     if (file_exists($include_file)) {
         /* quirk in php on Windows, believe it or not.... */
         /* path must be lower case */
         if ($config['cacti_server_os'] == 'win32') {
             $include_file = strtolower($include_file);
         }
开发者ID:andrei1489,项目名称:cacti,代码行数:31,代码来源:script_server.php


示例9: genCtor

function genCtor($class_name, $ctor, $indent)
{
    echo "\n";
    echo "{$indent}";
    if (!count($ctor) || !@$ctor->args) {
        echo "explicit ";
    }
    //echo "${class_name}(cerl::Fiber self";
    echo "{$class_name}(";
    if (count($ctor)) {
        $args = parseArgs(@$ctor->args);
        $i = 0;
        foreach ($args as $var => $tp) {
            if ($i == 0) {
                $typename = mapType($tp, "&");
                echo "const {$typename} {$var}";
            } else {
                $typename = mapType($tp, "&");
                echo ", const {$typename} {$var}";
            }
            $i = $i + 1;
        }
    }
    //echo ")\n${indent}\t: self(_me)\n";
    echo ")\n";
    echo "{$indent}{\n{$indent}}\n";
}
开发者ID:greatbody,项目名称:cerl,代码行数:27,代码来源:gen_impl.php


示例10: structureAddon

 /**
  * add extra's, buttons, drop downs, etc. 
  *
  * @author Paul Whitehead
  * @return object
  */
 private function structureAddon($type = 'prepend')
 {
     if (!is_array($this->input[$type]) or empty($this->input[$type])) {
         return $this;
     }
     //combine our arugments
     $addon = parseArgs($this->input[$type], $this->addon_defaults);
     //check if we want a drop down box
     //if options have not been provided
     if (!is_array($this->input[$type]['options']) or empty($this->input[$type]['options'])) {
         //check for the need to do anything
         if (is_array($this->input[$type]) and !empty($this->input[$type])) {
             $this->form_build[] = '<' . $addon['type'] . ' class="add-on">' . $addon['value'] . '</' . $addon['type'] . '>';
         }
         //if we have options
     } else {
         $this->form_build[] = '<div class="btn-group">';
         $this->form_build[] = '<button class="btn dropdown-toggle" data-toggle="dropdown">' . $addon['value'];
         $this->form_build[] = '<span class="caret"></span></button>';
         $this->form_build[] = '<ul class="dropdown-menu">';
         foreach ($this->input[$type]['options'] as $key => $value) {
             //check if a divider is requested
             if ($key == 'divider' and $value === true) {
                 $this->form_build[] = '<li class="divider"></li>';
                 continue;
             }
             //check is we just have a simple string or value
             if (!is_array($value)) {
                 $this->form_build[] = $key;
                 continue;
             }
             $this->form_build[] = '<li><a ' . $this->attrKeyValue($value, array('icon')) . '>' . $value['title'] . '</a></li>';
             continue;
         }
         $this->form_build[] = '</ul>';
         $this->form_build[] = '</div>';
     }
     return $this;
 }
开发者ID:prwhitehead,项目名称:meagr,代码行数:45,代码来源:form.php


示例11: ini_set

#!/usr/bin/env php
<?php 
require __DIR__ . '/../lib/bootstrap.php';
ini_set('xdebug.max_nesting_level', 3000);
// Disable XDebug var_dump() output truncation
ini_set('xdebug.var_display_max_children', -1);
ini_set('xdebug.var_display_max_data', -1);
ini_set('xdebug.var_display_max_depth', -1);
list($operations, $files, $attributes) = parseArgs($argv);
/* Dump nodes by default */
if (empty($operations)) {
    $operations[] = 'dump';
}
if (empty($files)) {
    showHelp("Must specify at least one file.");
}
$lexer = new PhpParser\Lexer\Emulative(array('usedAttributes' => array('startLine', 'endLine', 'startFilePos', 'endFilePos')));
$parser = new PhpParser\Parser($lexer);
$dumper = new PhpParser\NodeDumper();
$prettyPrinter = new PhpParser\PrettyPrinter\Standard();
$serializer = new PhpParser\Serializer\XML();
$traverser = new PhpParser\NodeTraverser();
$traverser->addVisitor(new PhpParser\NodeVisitor\NameResolver());
foreach ($files as $file) {
    if (strpos($file, '<?php') === 0) {
        $code = $file;
        echo "====> Code {$code}\n";
    } else {
        if (!file_exists($file)) {
            die("File {$file} does not exist.\n");
        }
开发者ID:a53ali,项目名称:CakePhP,代码行数:31,代码来源:php-parse.php


示例12: list

#!/usr/bin/env php
<?php 
require_once __DIR__ . '/helper.php';
use Dropbox as dbx;
/* @var dbx\Client $client */
/* @var string $sourcePath */
/* @var string $dropboxPath */
list($client, $sourcePath, $dropboxPath) = parseArgs("upload-file", $argv, array(array("source-path", "A path to a local file or a URL of a resource."), array("dropbox-path", "The path (on Dropbox) to save the file to.")));
$pathError = dbx\Path::findErrorNonRoot($dropboxPath);
if ($pathError !== null) {
    fwrite(STDERR, "Invalid <dropbox-path>: {$pathError}\n");
    die;
}
$size = null;
if (\stream_is_local($sourcePath)) {
    $size = \filesize($sourcePath);
}
$fp = fopen($sourcePath, "rb");
$metadata = $client->uploadFile($dropboxPath, dbx\WriteMode::add(), $fp, $size);
fclose($fp);
print_r($metadata);
开发者ID:andrefedalto,项目名称:htv,代码行数:21,代码来源:upload-file.php


示例13: define

//define("DBF_HOST", "localhost");
//define("DBF_USER", "ipplan");
//define("DBF_NAME", "ipplan");
//define("DBF_PASSWORD", "ipplan99");
// define the nmap command for normal scan
define("NMAP_CMD", "-sP -PE -q -n -oG");
// define the nmap command for scan with dns lookup
define("NMAP_CMDH", "-sP -PE -q -R -v -oG");
require_once "../adodb/adodb.inc.php";
require_once "../config.php";
$timestamp = FALSE;
$hostnames = FALSE;
$audit = FALSE;
// Set Defaults
// $options["h"]=TRUE;
parseArgs($argv, $options);
// options will be $options["FLAG"] (if not argument is given like -h the
// $options["h"] will be set to bolean true
if (isset($options["a"]) && $options["a"] == TRUE) {
    $audit = TRUE;
}
if (isset($options["time"]) && $options["time"] == TRUE) {
    $timestamp = TRUE;
}
if (isset($options["hostnames"]) && $options["hostnames"] == TRUE) {
    $hostnames = TRUE;
}
if (!isset($options["q"])) {
    if (!empty($_REQUEST)) {
        echo "<br>Mmm, this is a command line utility not to be executed via a web browser! Try the -q option\n";
        exit(1);
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:ipplan-poller.php


示例14: main

/**
 * Main function
 *
 * @param string[] $argv Program parameters
 *
 * @return void
 * @throws Exception
 */
function main($argv)
{
    $params = parseArgs($argv);
    applyConfigOverrides($params);
    if (empty($params['func']) || !is_string($params['func'])) {
        echo <<<EOT
Usage: {$argv['0']} --func=... [...]

Parameters:

--func             renormalize|deduplicate|updatesolr|dump|dumpsolr|markdeleted
                   |deletesource|deletesolr|optimizesolr|count|checkdedup|comparesolr
                   |purgedeleted|markdedup
--source           Source ID to process (separate multiple sources with commas)
--all              Process all records regardless of their state (deduplicate,
                   markdedup)
                   or date (updatesolr)
--from             Override the date from which to run the update (updatesolr)
--single           Process only the given record id (deduplicate, updatesolr, dump)
--nocommit         Don't ask Solr to commit the changes (updatesolr)
--field            Field to analyze (count)
--force            Force deletesource to proceed even if deduplication is enabled for
                   the source
--verbose          Enable verbose output for debugging
--config.section.name=value
                   Set configuration directive to given value overriding any setting
                   in recordmanager.ini
--lockfile=file    Use a lock file to avoid executing the command multiple times in
                   parallel (useful when running from crontab)
--comparelog       Record comparison output file. N.B. The file will be overwritten
                   (comparesolr)
--dumpprefix       File name prefix to use when dumping records (dumpsolr). Default
                   is "dumpsolr".
--mapped           If set, use values only after any mapping files are processed when
                   counting records (count)
--daystokeep=days  How many last days to keep when purging deleted records
                   (purgedeleted)


EOT;
        exit(1);
    }
    $lockfile = isset($params['lockfile']) ? $params['lockfile'] : '';
    $lockhandle = false;
    try {
        if (($lockhandle = acquireLock($lockfile)) === false) {
            die;
        }
        $manager = new RecordManager(true, isset($params['verbose']) ? $params['verbose'] : false);
        $sources = isset($params['source']) ? $params['source'] : '';
        $single = isset($params['single']) ? $params['single'] : '';
        $noCommit = isset($params['nocommit']) ? $params['nocommit'] : false;
        // Solr update, compare and dump can handle multiple sources at once
        if ($params['func'] == 'updatesolr' || $params['func'] == 'dumpsolr') {
            $date = isset($params['all']) ? '' : (isset($params['from']) ? $params['from'] : null);
            $dumpPrefix = $params['func'] == 'dumpsolr' ? isset($params['dumpprefix']) ? $params['dumpprefix'] : 'dumpsolr' : '';
            $manager->updateSolrIndex($date, $sources, $single, $noCommit, '', $dumpPrefix);
        } elseif ($params['func'] == 'comparesolr') {
            $date = isset($params['all']) ? '' : (isset($params['from']) ? $params['from'] : null);
            $manager->updateSolrIndex($date, $sources, $single, $noCommit, isset($params['comparelog']) ? $params['comparelog'] : '-');
        } else {
            foreach (explode(',', $sources) as $source) {
                switch ($params['func']) {
                    case 'renormalize':
                        $manager->renormalize($source, $single);
                        break;
                    case 'deduplicate':
                    case 'markdedup':
                        $manager->deduplicate($source, isset($params['all']) ? true : false, $single, $params['func'] == 'markdedup');
                        break;
                    case 'dump':
                        $manager->dumpRecord($single);
                        break;
                    case 'deletesource':
                        $manager->deleteRecords($source, isset($params['force']) ? $params['force'] : false);
                        break;
                    case 'markdeleted':
                        $manager->markDeleted($source);
                        break;
                    case 'deletesolr':
                        $manager->deleteSolrRecords($source);
                        break;
                    case 'optimizesolr':
                        $manager->optimizeSolr();
                        break;
                    case 'count':
                        $manager->countValues($source, isset($params['field']) ? $params['field'] : null, isset($params['mapped']) ? $params['mapped'] : false);
                        break;
                    case 'checkdedup':
                        $manager->checkDedupRecords();
                        break;
                    case 'purgedeleted':
//.........这里部分代码省略.........
开发者ID:grharry,项目名称:RecordManager,代码行数:101,代码来源:manage.php


示例15: list

#!/usr/bin/env php
<?php 
require_once __DIR__ . '/helper.php';
use Dropbox as dbx;
/* @var dbx\Client $client */
/* @var string $dropboxPath */
list($client, $dropboxPath) = parseArgs("link", $argv, array(array("dropbox-path", "The path (on Dropbox) to create a link for.")));
$pathError = dbx\Path::findError($dropboxPath);
if ($pathError !== null) {
    fwrite(STDERR, "Invalid <dropbox-path>: {$pathError}\n");
    die;
}
$link = $client->createShareableLink($dropboxPath);
print $link . "\n";
开发者ID:andrefedalto,项目名称:htv,代码行数:14,代码来源:link.php


示例16: str_split

                } else {
                    $chars = str_split(substr($arg, 1));
                    foreach ($chars as $char) {
                        $key = $char;
                        $out[$key] = isset($out[$key]) ? $out[$key] : true;
                    }
                }
            } else {
                $out[] = $arg;
            }
        }
    }
    return $out;
}
// Get the passed args.
$options = parseArgs($argv);
// Specify --env= in the cron, otherwise it will be set to production by default.
// Then unset the value so it doesn't get in the way of building the li3 command.
$env = isset($options['env']) ? $options['env'] : 'production';
if (isset($options['env'])) {
    unset($options['env']);
}
// This script is meant to be in the root of the application.
// If it is not, then --path= must be passed with the full path to the app.
$li3_app_path = isset($options['path']) ? $options['path'] : __DIR__;
if (isset($options['path'])) {
    unset($options['path']);
}
// This can be helpful if you want to test the call before putting it in crontab.
// Just call the same command you'd set in cron with --verbose passed and you'll see output.
$verbose = isset($options['verbose']) ? true : false;
开发者ID:aniston,项目名称:Platypus,代码行数:31,代码来源:cron.php


示例17: array

    $assid = $incident[0]['assignment_group'];
    $callid = $incident[0]['caller_id'];
    $location = $incident[0]['location'];
    //EDIT KA SCS Assignment Group, SCS Category and SCS Subcagetory
    $params = array('sys_id' => "{$sysid}", 'comments' => "{$message}", 'description' => 'Aspera API Creation Site', 'location' => "{$location}", 'category' => "Support", 'u_scs_category' => 'Data Transfer', 'u_scs_subcategory' => 'Run Service', 'assignment_group' => "{$assid}", 'caller_id' => "{$callid}");
    try {
        $result = $inc->update($params);
    } catch (Exception $e) {
        echo 'Exception: ' . $e->getMessage() . "\n";
        exit(4);
    }
}
/*
*      MAIN
*/
$cmdinput = parseArgs($argv);
if (isset($cmdinput['create'])) {
    $create = $cmdinput['create'];
    // no email sent with create argument default to scs
    if ($create == 1) {
        $create = '[email protected]';
    }
    $sysid = newIncident($create);
    print "{$sysid}\n";
} elseif (isset($cmdinput['update']) && isset($cmdinput['attach'])) {
    $update = $cmdinput['update'];
    $payload = $cmdinput['attach'];
    Attachment($update, $payload);
} elseif (isset($cmdinput['update']) && !isset($cmdinput['attach']) && isset($cmdinput['message'])) {
    $update = $cmdinput['update'];
    $message = $cmdinput['message'];
开发者ID:only1dallas,项目名称:ServiceNow-2,代码行数:31,代码来源:servicenow_1.php


示例18: list

#!/usr/bin/env php
<?php 
require_once __DIR__ . '/helper.php';
use Dropbox as dbx;
list($client, $cursor) = parseArgs("delta", $argv, array(), array(array("cursor", "The cursor returned by the previous delta call (optional).")));
$deltaPage = $client->getDelta($cursor);
$numAdds = 0;
$numRemoves = 0;
foreach ($deltaPage["entries"] as $entry) {
    list($lcPath, $metadata) = $entry;
    if ($metadata === null) {
        echo "- {$lcPath}\n";
        $numRemoves++;
    } else {
        echo "+ {$lcPath}\n";
        $numAdds++;
    }
}
echo "Num Adds: {$numAdds}\n";
echo "Num Removes: {$numRemoves}\n";
echo "Has More: " . $deltaPage["has_more"] . "\n";
echo "Cursor: " . $deltaPage["cursor"] . "\n";
开发者ID:hisapi,项目名称:multistorage,代码行数:22,代码来源:delta.php


示例19: serializeArgsType

function serializeArgsType($namespace, $func, $indent)
{
    global $cpp_keywords, $derived_types, $typeset, $current_server;
    $args = @$func->args;
    //there is not args anymore
    if (!$args) {
        return;
    }
    $args_set = parseArgs(@$func->args);
    $argsTyName = getArgsType($func->name);
    if (count($args_set) == 1) {
        return;
    }
    $tp_name = "{$current_server}::{$argsTyName}";
    if (@$derived_types[$current_server][$argsTyName]) {
        return;
    }
    //there are args here
    //put
    echo "{$indent}\nCERL_IO_BEGIN_PUTTER({$namespace}::{$argsTyName})\n";
    $indent2 = $indent . "\t";
    foreach ($args as $arg) {
        $var_member = "val.{$arg->name}";
        echo "{$indent2}NS_CERL_IO::put(os, {$var_member});\n";
    }
    echo "{$indent}CERL_IO_END_PUTTER()\n";
    //get
    echo "\n";
    echo "{$indent}CERL_IO_BEGIN_GETTER({$namespace}::{$argsTyName})\n";
    $indent2 = $indent . "\t";
    $indent3 = $indent2 . "\t";
    echo "{$indent2}return ";
    $i = 0;
    foreach ($args as $arg) {
        $var_member = "val.{$arg->name}";
        if ($i++ == 0) {
            echo "NS_CERL_IO::get(is, {$var_member})";
        } else {
            echo "\n{$indent3}&& NS_CERL_IO::get(is, {$var_member})";
        }
    }
    echo ";\n";
    echo "{$indent}CERL_IO_END_GETTER()\n";
    //copy
    //printPODTYPE($args);
    $podTrue = true;
    echo "\n{$indent}template <class AllocT>\n";
    echo "{$indent}inline void copy(AllocT& alloc, {$namespace}::{$argsTyName}& dest, const {$namespace}::{$argsTyName}& src)\n";
    echo "{$indent}{\n";
    echo "{$indent2}dest = src;\n";
    foreach ($args as $arg) {
        if (!isPOD($arg->type)) {
            echo "{$indent2}NS_CERL_IO::copy(alloc, dest.{$arg->name}, src.{$arg->name});\n";
            $podTrue = false;
        }
    }
    echo "{$indent}}\n";
    if ($podTrue) {
        echo "{$indent}CERL_PODTYPE({$namespace}::{$argsTyName}, true);\n";
    } else {
        echo "{$indent}CERL_PODTYPE({$namespace}::{$argsTyName}, false);\n";
    }
    //dump
    echo "\ntemplate<class LogT>\n";
    echo "inline void dump(LogT& log, const {$namespace}::{$argsTyName}& args)\n";
    echo "{\n";
    echo "\tNS_CERL_IO::dump(log, '{');\n";
    $i = 0;
    foreach ($args as $var) {
        if ($i++ == 0) {
            echo "\tNS_CERL_IO::dump(log, args.{$var->name});\n";
        } else {
            echo "\tNS_CERL_IO::dump(log, \", \");\n";
            echo "\tNS_CERL_IO::dump(log, args.{$var->name});\n";
        }
    }
    echo "\tNS_CERL_IO::dump(log, '}');\n";
    echo "}\n";
}
开发者ID:greatbody,项目名称:cerl,代码行数:79,代码来源:gen_base.php


示例20: list

#!/usr/bin/env php
<?php 
require_once __DIR__ . '/helper.php';
use Dropbox as dbx;
list($client, $dropboxPath, $localPath) = parseArgs("download-file", $argv, array(array("dropbox-path", "The path of the file (on Dropbox) to download."), array("local-path", "The local path to save the downloaded file contents to.")));
$pathError = dbx\Path::findErrorNonRoot($dropboxPath);
if ($pathError !== null) {
    fwrite(STDERR, "Invalid <dropbox-path>: {$pathError}\n");
    die;
}
$metadata = $client->getFile($dropboxPath, fopen($localPath, "wb"));
if ($metadata === null) {
    fwrite(STDERR, "File not found on Dropbox.\n");
    die;
}
print_r($metadata);
echo "File contents written to \"{$localPath}\"\n";
开发者ID:hisapi,项目名称:multistorage,代码行数:17,代码来源:download-file.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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