1

I downloaded the Text-Statistics ZIP master from Github and extracted and renamed the folder to stats on /Library/WebServer/Documents/stats. Then I used cd /Library/WebServer/Documents/stats and composer update and all dependencies built on /Library/WebServer/Documents/stats as well. When I go to http://localhost/stats/ in my browser, it shows as follows:

composer, php, github project installation

This is my first time to install a project on my localhost directory which uses composer. Shall I create an index.php to see how the codes work? Below you can also see the composer.json file:

{
    "name": "textstatistics",
    "description": "PHP package to measure the readability of text according to various algorithms.",
    "require": {
        "php": ">=5.3.0"
    },
    "require-dev": {
        "phpunit/phpunit": "4.2.*"
    },
    "autoload": {
        "psr-0" : {
            "DaveChild\\TextStatistics" : "src"
        }
    },
    "extra": {
        "branch-alias": {
            "dev-master": "1.0.x-dev"
        }
    },
    "suggest": {
        "ext-bcmath": "More accurate floating point calculations.",
        "ext-mbstring": "Handle multi-byte text properly."
    }
}

2 Answers 2

2

The package you 'installed' is a toolbox and meant to be used inside your project. It has no index.php since that would be useless, what would it have to show?

You should add it to an existing project by running composer require davechild/textstatistics from your project's root directory.

Composer exists so you do not have to download the package, and it's dependencies, yourself (like you did with the zip). It will also generate your autoload file so you do not have to bother about requiring or loading those classes. And it is especially useful when you want to update your dependencies (just run composer update)

Sign up to request clarification or add additional context in comments.

Comments

2

This is completely unrelated to github or composer. It looks like this project is not a web application, because I don't see a bootstrap file (something like index.php). This means there is nothing which makes sense to call from a webserver context.

I took a short look at the projects github page. PHP Text Statistics is a library that will be used in other projects, but it's not a standalone tool, or application.

1 Comment

Thank you KingCrunch, your answer is also correct, I wish there was an option to select your answer as a correct answer as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.