Giter Site home page Giter Site logo

amphp.github.io's People

Contributors

bwoebi avatar daniel15 avatar daverandom avatar joshdifabio avatar kelunik avatar krakjoe avatar luiz-brandao avatar pomaxa avatar ralt avatar staabm avatar strayobject avatar trowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amphp.github.io's Issues

Aerys Docs TODO

SIMPLE

START

  • Intro [php bin/aerys -d -c demo.php]
  • Very simple setup of Host + static Root

HTTP

  • Sample http function [mention Router, Response, Request]
  • Response [headers, end()]
  • Request [headers, query array]
  • parseBody function + ParsedBody class
  • Router [methodname('/route', $callable), mention dynamic routes]
  • Dynamic routes [having route info as last arg, explain route info]
  • Cookies [refer to Session, Request::getCookie(), Response::setCookie()]

WEBSOCKET

  • websocket(instanceof Websocket) [explain clientId, onOpen, onClose, onData, yield $message]
  • Websocket\Endpoint [send(), close(), Websocket::onStart()]
  • Websocket::onHandshake [second parameter of onOpen]

HOST

  • expose(), name()
  • encrypt() [HTTPS ... per port! HTTP2 needs openssl 1.0.2 !!!]
  • use() [explain exactly]
  • redirect() [is the last action, e.g. combine with router, redirect in case of not found]

I/O

  • Typical Amp promises usable in Websocket methods and HTTP callable [refer to Amp docs]
  • Big fat warning about blocking I/O

HELPERS (only intros)

  • Overview (Reverse proxy, Session) (link to docs / github repo)

LOGGING

  • PSR3 Logger
  • Bootable imports Logger

OPTIONS

  • AERYS_OPTIONS, Server::get/setOption, Request::getOption
  • "simple" options [user, sendServerToken, allowedMethods]

ADVANCED

HTTP

  • Response::stream()
  • Response::push()
  • Managing routes

PERFORMANCE

  • Aerys is not the bottleneck. Your App is. [explain (careful about memory_limit), tips?]
  • Perf critical options [balance against DOS etc.]
  • Response::stream() and Websocket\Endpoint::send() return Promises!
  • explain Body = Websocket\Message PromiseStream [only increase accepted data limit for these] + ClientException may be thrown in while waiting. No need to catch.
  • BodyParser (incremental API)

MIDDLEWARES

  • Intro [powerful, use with care, ...]
  • Middleware::do() [no I/O, "protocol" of string, array, null and false]
  • InternalRequest [headers, locals, Request::get/setLocalVar()]

END

  • Sum it up [mention CommandClient, HttpDriver]

CLASSES

  • All APIs documented per class

Reference

We need to generate a PHPDoc reference for every project. We need our own template for it, because the existing ones are really ugly.

Tables need to be responsive

Currently, we have overflow-x: hidden to prevent too large elements from creating a horizontal scrollbar. Those elements must shrink so we can remove the overflow-x: hidden.

The samples provided in the Getting Started section don't work

This section needs to be updated. None of the provided examples seem to be working.

The code sample provided here https://amphp.org/getting-started/tcp-chat/basic-echo-server throws this error:

PHP Fatal error: Uncaught TypeError: Argument 1 passed to {closure}() must be an instance of Amp\Socket\ServerSocket, instance of Amp\Socket\ResourceSocket given, called in [REDACTED]vendor/amphp/amp/lib/functions.php on line 60 and defined in [REDACTED]/test.php:13

Same thing here: https://amphp.org/getting-started/tcp-chat/broadcasting - i only tried running the first code sample

PHP Fatal error: Uncaught TypeError: Argument 1 passed to class@anonymous::handleClient() must be an instance of Amp\Socket\ServerSocket, instance of Amp\Socket\ResourceSocket given, called in [REDACTED]/index.php on line 20 and defined in [REDACTED]/index.php:25

Steps to reproduce:

  1. Create a new test directory:
    mkdir test; cd test
  2. Within that test directory download amphp/socket:
    composer require amphp/socket
  3. Create a test.php file, copy and paste one of the samples then execute the file with this command:
    php test.php
    This will start the script and wait for connections
  4. From another terminal try to connect with "nc":
    nc localhost 1337

As soon as nc attempts to connect the script will throw the errors mentioned above.

Tested on:

  • Ubuntu 18.04 with PHP 7.2.19 (installed from the distro's official repositories)
  • MacOS 10.14.6 with PHP 7.3.4 (installed with homebrew)

Search Input on Mozilla Firefox overlaps side nav

In Firefox the search input breaks out of the top menu and overlaps the side navigation. This prevents access from the side nav's top most link and suggest edit action within the package documentation.

Here is a screenshot with the broken element.

Screenshot from 2019-08-25 09-03-46

Here is a screenshot with the element working as intended in Chromium (https://www.chromium.org/).

Screenshot from 2019-08-25 09-03-58


OS: Ubuntu 18.10
Mozilla Firefox: 68.0
Chromium: 75.0.3770.90

Sphynx Docs?

Has the project considered Sphynx for docs? I found it super useful. It does have some learning curve but really makes fantastic docs. Fabien created a plugin for PHP code highlighting that works quite well. The Symfony docs are written using Sphynx as are the docs I wrote for LaunchKey: https://docs.launchkey.com. Not being critical or anything, just wondering. If the idea is intriguing, I could build a proof of concept.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.