Download the PHP package martinsik/php-doc-parser without Composer

On this page you can find all versions of the php package martinsik/php-doc-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-doc-parser

PHP Documentation Parser

Build Status

This package downloads gziped documentation from php.net, parses it and outputs all found functions as JSON with Markdown syntax. It comes with CLI interface for comfortable usage.

Installation

Add martinsik/php-doc-parser to your composer.json dependencies:

Then run composer.phar install.

Usage

As a CLI script

Composer adds doc-parser file to your directory with binaries (vendor/bin by default). Run it and follow the instructions on the screen.

$ vendor/bin/doc-parser

Results are saved into output directory by default. This creates following files (names are generated by selected language and mirror):

For full list of options run:

$ vendor/bin/doc-parser help parser:run

As a 3rd party package

Create an instance of DocParser\Package class to set language and mirror you want to parse and it'll download and unpack the documentation for you. Then give the DocParser\Parser directory with files you want to parse and it'll return a DocParser\ParserResult object with all data as arrays.

Sample output

This is what DateTime::setDate looks like deep inside en_php_net.json.

{
    "abs": { ... },
    "array_pop": { ... },
    ...
    "datetime::add": { ... },
    "datetime::setdate": {
        "desc": "Sets the date.",
        "long_desc": "Resets the current date of the DateTime object to a different date.",
        "ver": "PHP 5 >= 5.2.0",
        "ret_desc": "Returns the DateTime object for method chaining or FALSE on failure.",
        "seealso": [
            "DateTime::setISODate",
            "DateTime::setTime"
        ],
        "filename": "datetime.setdate",
        "params": [
            {
                "list": [
                    {
                        "type": "int",
                        "var": "$year",
                        "beh": "required",
                        "desc": "Year of the date."
                    },
                    {
                        "type": "int",
                        "var": "$month",
                        "beh": "required",
                        "desc": "Month of the date."
                    },
                    {
                        "type": "int",
                        "var": "$day",
                        "beh": "required",
                        "desc": "Day of the date."
                    }
                ],
                "name": "DateTime::setDate",
                "ret_type": "DateTime"
            },
            {
                "list": [
                    {
                        "type": "DateTime",
                        "var": "$object",
                        "beh": "required",
                        "desc": "Procedural style only: A DateTime object returned by date\\_create(). The function modifies this object."
                    },
                    {
                        "type": "int",
                        "var": "$year",
                        "beh": "required",
                        "desc": "Year of the date."
                    },
                    {
                        "type": "int",
                        "var": "$month",
                        "beh": "required",
                        "desc": "Month of the date."
                    },
                    {
                        "type": "int",
                        "var": "$day",
                        "beh": "required",
                        "desc": "Day of the date."
                    }
                ],
                "name": "date_date_set",
                "ret_type": "DateTime"
            }
        ],
        "examples": [
            {
                "title": "DateTime::setDate() example",
                "source": "$date = new DateTime();\n$date->setDate(2001, 2, 3);\necho $date->format('Y-m-d');",
                "output": "2001-02-03"
            },
            {
                "title": "Values exceeding ranges are added to their parent values",
                "source": "$date = new DateTime();\n\n$date->setDate(2001, 2, 28);\necho $date->format('Y-m-d') . \"\\n\";\n\n$date->setDate(2001, 2, 29);\necho $date->format('Y-m-d') . \"\\n\";\n\n$date->setDate(2001, 14, 3);\necho $date->format('Y-m-d') . \"\\n\";",
                "output": "2001-02-28\n2001-03-01\n2002-02-03"
            }
        ]
    },
    "date_date_set": "DateTime::setDate",
    "datedime::createfromformat": { ... },
    "date_create_from_format": "DateTime::createFromFormat",
    ...
    "strpos": { ... }
    "tempnam": { ... }
    ...
}

Note that this function has two different definitions, DateTime::setDate and date_date_set, where each takes different parameters. In order to be able to search both functions there are two keys for this function, where the second key, date_date_set, is just a reference to the first one. Also, all keys are lowercase.

Why?

I use this script to generate "database" for my Google Chrome Extension called PHP Ninja Manual.

By the way there's an official PHP Documentation generator for IDEs, but when I started developing my extension it didn't exist. I don't know what are its capabilities now but maybe it's worth a try.

Known limitations

Testing

This package uses Behat for testing. Run tests with:

$ bin/behat

License

PHP Documentation Parser (this package) is licensed under MIT license.

PHP Documentation pages (php.net/docs.php) are licensed under Creative Commons Attribution 3.0 License.


All versions of php-doc-parser with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
symfony/console Version ~2.6
symfony/filesystem Version ~2.6
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package martinsik/php-doc-parser contains the following files

Loading the files please wait ....