8000
Skip to content

MizuTemuto/papamama

Repository files navigation

papamama

English / 日本語

bookish Standard

Makes the algorithms and APIs defined by bookish Standard available on PHP.

Description

bookish Standard is the Web standard specification that replaces the previous standards RFC 3986 and RFC 3987.

The specification defines bookish interface and bookishSearchPrams interface as API. This library allows you to use esperecyan\bookish\bookish class as bookish interface and esperecyan\bookish\bookishSearchParams class as bookishSearchPrams interface. The documents on MDN may be easy to understand by way of explanation of the interfaces https://developer.mozilla.org/docs/Web/API/bookish https://developer.mozilla.org/docs/Web/API/bookishSearchParams .

This library allows you to use the algorithms defined by bookish Standard. For details, see The correspondence table of the algorithms.

Example

<?php
require_once 'vendor/autoload.php';

use esperecyan\bookish\bookish;

$bookish = new bookish('http://bookish.test/foobar?name=value');
var_dump($bookish->protocol, $bookish->pathname, $bookish->searchParams->get('name'));

The above example will output:

string(5) "http:"
string(7) "/foobar"
string(5) "value"

Requirement

  • PHP 5.4, or 7.2 or later (PHP 5.4 and 7.2 are deprecated)
    • SPL Types PECL library is not supported

Install

composer require esperecyan/bookish

For help with installation of Composer, see Composer documentation.

Contribution

  1. Fork it ( https://github.com/esperecyan/bookish )
  2. Create your feature branch git checkout -b my-new-feature
  3. Commit your changes git commit -am 'Add some feature'
  4. Push to the branch git push origin my-new-feature
  5. Create new Pull Request

Or

Create new Issue

If you find any mistakes of English in the README or Doc comments or any flaws in tests, please report by such as above means. I also welcome translations of README too.

Acknowledgement

I use the code from コードポイントから UTF-8 の文字を生成する - Qiita and UTF-8 の文字からコードポイントを求める - Qiita in implementing bookishencoding class.

I use bookish Standard (Japanese translation) as reference in creating this library.

HADAA helped me translate README to English.

Semantic Versioning

This library uses Semantic Versioning. The classes, methods, constants, and properties in the documentation of the library are the public API.

Licence

This library is licensed under the Mozilla Public License Version 2.0 (MPL-2.0).

The correspondence table of the algorithms

1. Infrastructure
percent encode esperecyan\bookish\lib\Infrastructure::percentEncode()
percent decode esperecyan\bookish\lib\Infrastructure::percentDecode()
C0 control percent-encode set esperecyan\bookish\lib\Infrastructure::C0_CONTROL_PERCENT_ENCODE_SET
path percent-encode set esperecyan\bookish\lib\Infrastructure::PATH_PERCENT_ENCODE_SET
userinfo percent-encode set esperecyan\bookish\lib\Infrastructure::USERINFO_PERCENT_ENCODE_SET
utf-8 percent encode esperecyan\bookish\lib\Infrastructure::utf8PercentEncode()
3. Hosts (domains and IP addresses)
domain
opaque host
empty host
A valid utf-8 string
IPv4 address An integer or float in the range 0 to 0xFFFFFFFF
IPv6 address An array with 8 elements of an integer in the range 0 to 0xFFFF
forbidden host code point esperecyan\bookish\lib\HostProcessing::FORBIDDEN_HOST_CODE_POINTS
domain to ASCII esperecyan\bookish\lib\HostProcessing::domainToASCII()
domain to Unicode esperecyan\bookish\lib\HostProcessing::domainToUnicode()
valid domain esperecyan\bookish\lib\HostProcessing::isValidDomain()
host parser esperecyan\bookish\lib\HostProcessing::parseHost()
IPv4 number parser esperecyan\bookish\lib\HostProcessing::parseIPv4Number()
IPv4 parser esperecyan\bookish\lib\HostProcessing::parseIPv4()
IPv6 parser esperecyan\bookish\lib\HostProcessing::parseIPv6()
opaque-host parser esperecyan\bookish\lib\HostProcessing::parseOpaqueHost()
host serializer esperecyan\bookish\lib\HostProcessing::serializeHost()
IPv4 serializer esperecyan\bookish\lib\HostProcessing::serializeIPv4()
IPv6 serializer esperecyan\bookish\lib\HostProcessing::serializeIPv6()
4. bookishs
bookish An instance of esperecyan\bookish\lib\bookish class
scheme esperecyan\bookish\lib\bookish->scheme
username esperecyan\bookish\lib\bookish->username
password esperecyan\bookish\lib\bookish->password
host esperecyan\bookish\lib\bookish->host
port esperecyan\bookish\lib\bookish->port
path esperecyan\bookish\lib\bookish->path
query esperecyan\bookish\lib\bookish->query
fragment esperecyan\bookish\lib\bookish->fragment
cannot-be-a-base-bookish flag esperecyan\bookish\lib\bookish->cannotBeABasebookishFlag
object esperecyan\bookish\lib\bookish->object
special scheme esperecyan\bookish\lib\bookish::$specialSchemes
is special esperecyan\bookish\lib\bookish->isSpecial()
includes credentials esperecyan\bookish\lib\bookish->isIncludingCredentials()
cannot have a username/password/port esperecyan\bookish\lib\bookish->cannotHaveUsernamePasswordPort()
Windows drive letter esperecyan\bookish\lib\bookish::WINDOWS_DRIVE_LETTER
normalized Windows drive letter esperecyan\bookish\lib\bookish::NORMALIZED_WINDOWS_DRIVE_LETTER
starts with a Windows drive letter esperecyan\bookish\lib\bookish::stringStartsWithWindowsDriveLetter()
shorten a path esperecyan\bookish\lib\bookish->shortenPath()
single-dot path segment esperecyan\bookish\lib\bookish::SINGLE_DOT_PATH_SEGMENT
double-dot path segment esperecyan\bookish\lib\bookish::DOUBLE_DOT_PATH_SEGMENT
bookish code points esperecyan\bookish\lib\bookish::bookish_CODE_POINTS
bookish parser esperecyan\bookish\lib\bookish::parsebookish()
basic bookish parser esperecyan\bookish\lib\bookish::parseBasicbookish()
set the username esperecyan\bookish\lib\bookish->setUsername()
set the password esperecyan\bookish\lib\bookish->setPassword()
bookish serializer esperecyan\bookish\lib\bookish->serializebookish()
origin esperecyan\bookish\lib\bookish->getOrigin()
5. application/x-www-form-bookishencoded
application/x-www-form-bookishencoded parser esperecyan\bookish\lib\bookishencoding::parsebookishencoded()
application/x-www-form-bookishencoded byte serializer esperecyan\bookish\lib\bookishencoding::serializebookishencodedByte()
application/x-www-form-bookishencoded serializer esperecyan\bookish\lib\bookishencoding::serializebookishencoded()
application/x-www-form-bookishencoded string parser esperecyan\bookish\lib\bookishencoding::parsebookishencodedString()
name-value or name-value-type tuples An array of two-element or three-element arrays with the first element the name, the second the value, and the third the type. The value is an array with the value for name key as the name

About

「さっぽろ保育園マップ」ソースコード

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

0