Overview

Namespaces

  • FlexiPeeHP
    • Bricks
    • ui
  • None
  • Orderer
  • PHP
  • SpojeNet
    • System
      • ui

Classes

  • DatePeriod
  • FlexiPeeHP\Bricks\Convertor
  • FlexiPeeHP\Bricks\Customer
  • FlexiPeeHP\Bricks\HookReciever
  • FlexiPeeHP\Bricks\ParovacFaktur
  • FlexiPeeHP\Bricks\PotvrzeniUhrady
  • FlexiPeeHP\Bricks\Upominac
  • FlexiPeeHP\Bricks\Upominka
  • FlexiPeeHP\Bricks\WebHookHandler
  • FlexiPeeHP\Bricks\XSLT
  • FlexiPeeHP\ui\AdresarForm
  • FlexiPeeHP\ui\CompanyLogo
  • FlexiPeeHP\ui\ConnectionForm
  • FlexiPeeHP\ui\DownloadInvoiceButton
  • FlexiPeeHP\ui\EmbedResponsive
  • FlexiPeeHP\ui\EmbedResponsiveHTML
  • FlexiPeeHP\ui\EmbedResponsivePDF
  • FlexiPeeHP\ui\KontaktForm
  • FlexiPeeHP\ui\OrderListingItem
  • FlexiPeeHP\ui\OrdersListing
  • FlexiPeeHP\ui\RecordTypeSelect
  • FlexiPeeHP\ui\SearchBox
  • FlexiPeeHP\ui\StatusInfoBox
  • SpojeNet\System\ui\VATSwitch

Interfaces

  • Traversable

Functions

  • apiUrlToLink
  • createYearsFrom
  • exchange
  • logOperationResult
  • Orderer\deleteAllBetween
  • parseCmdline
  • SpojeNet\System\operationsMenu
  • Overview
  • Namespace
  • Class
  • Tree
 1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 
<?php
/**
 * FlexiPeeHP Bricks - Commandline parameters parser
 *
 * @author     Vítězslav Dvořák <info@vitexsofware.cz>
 * @copyright  (G) 2018 Vitex Software
 */

    /**
     * Parse Commandline
     *
     * @return array
     */
    function parseCmdline()
    {
        $optionsParsed = [];
        $shortopts     = "";
        $shortopts     .= "s:";  // Server
        $shortopts     .= "u:";  // Username
        $shortopts     .= "p:";  // Password
        $shortopts     .= "c:";  // Company
        $shortopts     .= "f:";  // Config
        $shortopts     .= "d";  // Debug

        $longopts = array(
            "server:", // Server
            "username:", // Username
            "password:", // Password
            "company:", // Company
            "file:", // Config file
            "debug", // Debug
        );
        $options  = getopt($shortopts, $longopts);

        if (array_key_exists('s', $options)) {
            $optionsParsed['url'] = $options['s'];
        }
        if (array_key_exists('server', $options)) {
            $optionsParsed['url'] = $options['server'];
        }
        if (array_key_exists('c', $options)) {
            $optionsParsed['company'] = $options['c'];
        }
        if (array_key_exists('company', $options)) {
            $optionsParsed['company'] = $options['company'];
        }
        if (array_key_exists('u', $options)) {
            $optionsParsed['user'] = $options['u'];
        }
        if (array_key_exists('user', $options)) {
            $optionsParsed['user'] = $options['user'];
        }

        if (array_key_exists('p', $options)) {
            $optionsParsed['password'] = $options['p'];
        }
        if (array_key_exists('password', $options)) {
            $optionsParsed['password'] = $options['password'];
        }

        if (array_key_exists('f', $options)) {
            $optionsParsed['config'] = $options['f'] ? $options['f'] : '/etc/flexibee/client.json';
        }

        if (array_key_exists('file', $options)) {
            $optionsParsed['config'] = $options['file'] ? $options['file'] : '/etc/flexibee/client.json';
        }

        if (array_key_exists('config', $optionsParsed)) {
            \Ease\Shared::instanced()->loadConfig($optionsParsed['config'],true);
        }

        if (array_key_exists('d', $options)) {
            $optionsParsed['debug'] = true;
        }
        if (array_key_exists('debug', $options)) {
            $optionsParsed['debug'] = true;
        }

        if ((count($optionsParsed) < 4) && !array_key_exists('config',
                $optionsParsed)) {
            echo("Usage: ".basename($_SERVER['SCRIPT_NAME'])." -s  https://SERVER[:PORT] -u USERNAME -p PASSWORD -c COMPANY [-d debug]\n");
        }

        return $optionsParsed;
    }
    
FlexiPeeHP-Bricks API documentation generated by ApiGen