grant access to server resources

@param \AMQP\Wire\Reader $args

@return int
175278
protected function accessRequestOk(\AMQP\Wire\Reader $args)
    {
        $this->defaultTicket = $args->readShort();
        return $this->defaultTicket;
    }
1238629
private function cmdPublish($args)
    {
        $cmd = new PublishCommand($this->cwd);

        return $cmd->run(array_slice($args, 1));
    }
369658
public function route_useradd($args) {
		return $this->core->pj(
			$this->adm_add_user($args, false, true, true), 403);
	}
400998
protected function send(array $args = [])
    {
        $this->log->debug('send()ing command', $args);
        $response = RespUtils::deserialize($this->stream->write(RespUtils::serialize($args)));
        $this->log->debug('response', [$response]);
        return $response;
    }
274614
public function handleInstall(Args $args)
    {
        $moduleName = $args->getArgument('name');
        $installPath = Path::makeAbsolute($args->getArgument('path'), getcwd());
        $installer = $args->getOption('installer');
        $env = $args->isOptionSet('dev') ? Environment::DEV : Environment::PROD;

        $this->moduleManager->installModule($installPath, $moduleName, $installer, $env);

        return 0;
    }
922917
public function handlePagination($args)
    {
        $uri = $args['uri'];
        $current = $args['current'];
        $total = $args['total'];
        $limit = $args['limit'];

        $uri   = preg_replace('/offset=([0-9]+)/', '', $uri);
        $pages = ceil($total / $limit);
        $page  = $current;

        if ($pages < 2) {
            return;
        }

        $start = 1;

        if ($page >= 3) {
            $start = $page - 2;
        }

        $rtn = '<ul class="pagination">';

        $rtn .= $this->getPaginationPrevLink($page, $uri);

        for ($i = 0; $i < 5 && ($start + $i) <= $pages; $i++) {
            $num = $start + $i;
            $cls = ($page == $num ? 'active' : '');
            $rtn .= '<li class="' . $cls . '"><a href="' . $uri . 'p=' . $num . '">' . $num . '</a></li>';
        }

        $rtn .= $this->getPaginationNextLink($page, $uri, $pages);

        $rtn .= '</ul>';

        return $rtn;
    }
423239
public function total(array $args = []): int
    {
        // Establish args.

        $default_args = [
            // Also used by {@link all()}.
            'filters'  => [],
            'no_cache' => false,
        ];
        $args = array_merge($default_args, $args);
        $args = array_intersect_key($args, $default_args);

        $args['filters']  = (array) $args['filters'];
        $args['no_cache'] = (bool) $args['no_cache'];

        // Check cache; already did this query?

        $cache_keys = $args; // Keys to consider when checking the cache.
        unset($cache_keys['no_cache']); // Cache key exclusions.

        if (($total = &$this->cacheKey(__FUNCTION__, $cache_keys)) !== null && !$args['no_cache']) {
            return $total; // Already cached this.
        }
        // Establish total users in the query.

        $WP_User_Query = new \WP_User_Query(array_merge($args['filters'], [
            'fields' => 'ID', 'offset' => 0, 'paged' => 1, 'number' => 1, 'count_total' => true,
        ]));
        return $total = (int) $WP_User_Query->get_total();
    }
887906
public static function setInstance($args)
    {
        $name = array_shift($args);

        $name = self::getAccessor($name);

        $reflect = new \ReflectionClass($name);

        return $reflect->newInstanceArgs($args);
    }
175190
protected function connection_tune($args)
    {
        $v = $args->read_short();
        if ($v) {
            $this->channel_max = $v;
        }

        $v = $args->read_long();
        if ($v) {
            $this->frame_max = $v;
        }

        // use server proposed value if not set
        if ($this->heartbeat === null) {
            $this->heartbeat = $args->read_short();
        }

        $this->x_tune_ok($this->channel_max, $this->frame_max, $this->heartbeat);
    }
507044
public function command($args)
    {
        // Access items in container
        $settings = $this->container->get('settings');
        
        // Throw if no arguments provided
        if (empty($args)) {
            throw new RuntimeException("No arguments passed to command");
        }

        $firstArg = $args[0];

        // Output the first argument
        return $firstArg;
    }
914242
public function send($args)
    {
      $data = Ensure::Input($args);
      $url = URIResource::Make($this->path);

      if ($data->has("media")) {
         $data->add("media", (string) new MediaURL($data->val("media", $this)));   
      }
          
      $message_id = Locator::Find($this->client->post($url, $data->get()));
      $data->add("id", $message_id);

      return Constructor::Make($this, $data->get(), array("messageId" => "id"));
    }
899087
public function authorize($args)
  {
      $numArgs = func_num_args();

      if ($numArgs === 0) {
          throw new \InvalidArgumentException('Wrapper->authorize expects atleast 1 argument!');

          return;
      }

      if ($numArgs === 1) {
          $arg1 = func_get_arg(0);
          if ($arg1 instanceof OAuthResponse) {
              $this->accessToken = $arg1->getAccessToken();
              $this->registeredScopes = $arg1->getScope();
          } elseif (is_string($arg1)) {
              $this->accessToken = $arg1;
          } else {
              throw new \InvalidArgumentException("Passed argument must be an access token OR an instance of Raideer\TwitchApi\OAuthResponse");

              return;
          }
      } elseif ($numArgs === 2) {
          list($arg1, $arg2) = func_get_args();

          if (is_string($arg1) && is_array($arg2)) {
              $this->accessToken = $arg1;
              $this->registeredScopes = $arg2;
          } else {
              throw new \InvalidArgumentException('First argument must be an accessToken and the second must be an array of registered scopes');

              return;
          }
      } else {
          throw new \InvalidArgumentException('Wrapper->authorize expects 1 or 2 arguments');

          return;
      }

      $this->authorized = true;
  }
1196254
final public function run(int $argc, array $argv)
    {
        $ar = new ArgsManager();
        $ar->getArgs($argc, $argv);
    }
285135
public function count($meta, ...$args)
    {
        $query = $args && $args[0] instanceof Query\Select ? $args[0] : Query\Select::fromParamArgs($args);
        $meta = !$meta instanceof Meta ? $this->mapper->getMeta($meta) : $meta;
        
        $table = $query->table ?: $meta->table;
        
        list ($where, $params, $props) = $query->buildClause($meta);
        if ($props) {
            $params = $this->mapper->formatParams($meta, $props, $params);
        }

        $t = ($meta->schema ? "`{$meta->schema}`." : null)."`{$table}`";
        $query = "SELECT COUNT(1) FROM $t "
            .($where  ? "WHERE $where" : '');

        $stmt = $this->getConnector()->prepare($query)->execute($params);
        return (int)$stmt->fetchColumn();
    }
1082098
public function set($args) {
		$data['args']				= func_get_args();
		$caller						= debug_backtrace();
		$data['caller']				= $caller[0];
		$data['formated_time']		= strftime('%Y-%m-%d %H:%M:%S', time());
		$data['formated_microtime']	= sprintf("%'03d", microtime()*1000);

		return $this->_getOutputPlain($data);
	}
1216577
function getRequestToken($args = array()) {/*{{{*/
    $r = $this->oAuthRequest($this->requestTokenURL(), $args);
    $token = $this->oAuthParseResponse($r);
    $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
    return $token;
  }
719228
public function run($args)
    {
        foreach ($this->permissions as $dir => $config) {
            $path = $this->basePath . '/' . $dir;
            if (file_exists($path)) {
                try {
                    if (isset($config['user'])) {
                        $this->changeOwner($path, $config['user']);
                    }
                    if (isset($config['group'])) {
                        $this->changeGroup($path, $config['group']);
                    }
                    if (isset($config['mode'])) {
                        $this->changeMode($path, $config['mode']);
                    }
                } catch(CException $e) {
                    echo $this->formatError($e->getMessage())."\n";
                }
            } else {
                echo sprintf("Failed to change permissions for %s. File does not exist!\n", $path);
            }
        }
        echo "Permissions successfully changed.\n";
        return 0;
    }