<?php

ini_set("include_path", ini_get("include_path") . ":../lib/");
require_once "Args.class.php";
$a = new Args();
$file = $a->flag("file");
if ($file === FALSE) {
    printHelp();
}
$document = new DomDocument();
if (!is_readable($file)) {
    print "{$file} can not be read.\n";
    exit(1);
}
if ($document->load($file) === FALSE) {
    print "Failed to load service definition\n";
    exit(1);
}
$typeNodes = $document->getElementsByTagName("type");
$methodNodes = $document->getElementsByTagName("method");
$serviceNode = $document->documentElement;
$serviceName = $serviceNode->attributes->getNamedItem("name")->value;
$serviceUrl = $serviceNode->attributes->getNamedItem("url")->value;
$serviceNS = str_replace(".", "\\", $serviceNode->attributes->getNamedItem("ns")->value);
//print "/*\n";
//print "Service name: " . $serviceName . "\n";
//print "Service URL: " . $serviceUrl . "\n";
//print "Service NS: " . $serviceNS . "\n";
//print "Found " . $typeNodes->length . " type definitions\n";
//print "Found " . $methodNodes->length . " method definitions\n";
//print "*/\n\n";
Exemple #2
0
     {
         return isset($this->flags[$name]) ? $this->flags[$name] : false;
     }
 }
 function usage()
 {
     echo "commands: -s {stop} | -p file {photo} | -d {desktop (mac only)}\n";
     echo "php " . $GLOBALS['argv'][0] . " -h hostname[:port] command\n";
 }
 function waitforuser()
 {
     echo 'Press return to quit';
     fgets(STDIN);
 }
 $args = new Args();
 $host = $args->flag('h');
 if ($host == null || $host == '' || $host === false) {
     usage();
     exit(1);
 } else {
     $host = split(':', $host);
     if (count($host) > 1) {
         $airplay = new AirPlay($host[0], $host[1]);
     } else {
         $airplay = new AirPlay($host[0]);
     }
     if ($args->flag('s')) {
         $airplay->stop();
     } elseif ($file = $args->flag('p')) {
         $airplay->photoFile($file);
         waitforuser();
Exemple #3
0
    echo "  -t        Append timestamp to uploaded filename for versioning.\n";
    echo "  -x        Set far future expiry headers on uploaded file.\n";
    echo "  -z        Upload a gzipped version in addition to the main file.\n";
    echo "\n";
    echo "  --version Appends a timestamp (string) of your choosing to each file.\n";
    echo "\n";
    echo "  --key     Amazon S3 key\n";
    echo "  --secret  Amazon S3 private key\n";
    echo "\n";
    echo "            If --key and --secret are not specified,\n";
    echo "            s3up will read values from the AMZ_KEY\n";
    echo "            and AMZ_SECRET environment variables.\n\n";
    exit;
}
// Get our Amazon credentials...
$AMZ_KEY = $args->flag('key') ? $args->flag('key') : @$_ENV['AMZ_KEY'];
$AMZ_SECRET = $args->flag('secret') ? $args->flag('secret') : @$_ENV['AMZ_SECRET'];
if (strlen($AMZ_KEY) == 0 || strlen($AMZ_SECRET) == 0) {
    trigger_error("Amazon key and private key must both be defined.\n", E_USER_ERROR);
}
// Gather our arguments...
$s3_bucket = $args->args[0];
$s3_filename = $args->args[1];
// Accept file to upload via stdin...
if (count($args->args) == 2) {
    $filename = tempnam('/tmp', 's3up');
    $src = fopen('php://stdin', 'r');
    $dest = fopen($filename, 'w');
    stream_copy_to_stream($src, $dest);
    upload_static_file($s3_bucket, $s3_filename, $filename, $args);
    // Assume $s3_filename is actually a directory, so upload files "into" it instead
Exemple #4
0
<?php

ini_set("include_path", ini_get("include_path") . ":../lib/");
require_once "XRDLGenerator.class.php";
require_once "Args.class.php";
require_once "exports.php";
$a = new Args();
$ns = $a->flag("ns");
$name = $a->flag("name");
$url = $a->flag("url");
if ($ns == FALSE || $name == FALSE || $url == FALSE) {
    printHelp();
}
$generator = new XRDLGenerator($url, $ns, $name);
foreach ($exports as $class => $methods) {
    foreach ($methods as $method) {
        $generator->addMethod($class, $method);
    }
}
print $generator->generate();
function printHelp()
{
    die("Usage: php ./xrdl-generator.php --url <service URL> --ns <service namespace> --name <service name>\n");
}
?>

Exemple #5
0
        die;
    }
    $l = $languages[$extension];
    // The dividing token we feed into Pygments, to delimit the boundaries between
    // sections.
    $l["divider_text"] = "\n" . $l["symbols"][0] . "DIVIDER\n";
    // The mirror of `divider_text` that we expect Pygments to return. We can split
    // on this to recover the original sections.
    $l["divider_html"] = '/\\n*?<span class="c[1]?">' . $l["symbols"][0] . 'DIVIDER<\\/span>\\n*?/s';
    return $l;
}
global $options;
global $sources;
$sources = array();
$args = new Args();
//Default options
$options = array("outputdir" => "docs");
if ($outputdir = $args->flag("o")) {
    $options["outputdir"] = $outputdir;
}
if (count($args->args) == 0) {
    print "You must supply a filename to continue.\n";
}
foreach ($args->args as $filename) {
    $e = explode(".", $filename);
    $basename = $e[0];
    $sources[] = $basename;
}
foreach ($args->args as $filename) {
    generate_documentation($filename);
}
<?php

/*
 * TODO:
 * - Use statically typed method results, instead of QVariant based ones
 */
ini_set("include_path", ini_get("include_path") . ":../lib/");
require_once "Args.class.php";
$a = new Args();
$file = $a->flag("file");
$outputDir = $a->flag("dir");
$prefix = $a->flag("prefix");
if ($file === FALSE) {
    printHelp();
}
if ($outputDir === FALSE) {
    printHelp();
}
if ($prefix === FALSE) {
    printHelp();
}
$document = new DomDocument();
if (!is_readable($file)) {
    print "{$file} can not be read\n";
    exit(1);
}
if ($document->load($file) === FALSE) {
    print "Failed to load service definition\n";
    exit(1);
}
$typeNodes = $document->getElementsByTagName("type");