Frage

I recently downloaded a version of Laravel 4 and it was only 40kb. Laravel 3.2 was about 3.5mb, my questions are:

  • How can I use Laravel 4 completely offline?
  • I found out, Laravel 4 core codes was missing, Does it work cloud base or something like it!?
  • Which version do you recommend to use? Laravel 3.2 or Laravel 4? ( mostly for local developing )

thanks.

War es hilfreich?

Lösung

How did you installed Laravel? Using composer is as simple as:

composer create-project laravel/laravel your-project-name --prefer-dist

I use Laravel 4 for local development, and it works like a charm!

Andere Tipps

That's mainly because Laravel 4 uses composer to handle dependencies. What you downloaded wasn't exactly Laravel, but rather the structure for it. It's a preset project, with all default Laravel dependencies, so that all you have to do is run a command and download it all.

To use Laravel 4, you'll need to install composer. After you're done, open your command line, go to the folder where you saved the Laravel files you downloaded and, inside it, type: php composer install. This will download all the dependencies needed for the project; that means Laravel files and all of its own dependencies. It may take a while to install, and may seem to be stuck at Installing dependencies (including require-dev) for quite a long time, since there are lots of dependencies to be fetched, but that's normal. After it's done, you should see something like this:

Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing doctrine/lexer (dev-master bc0e1f0)
    Downloading: 100%

    ...

  - Installing laravel/framework (4.0.x-dev 733492c)
    Downloading: 100%

...
Writing lock file
Generating autoload files
Generating optimized class loader

Now all you have to do is point the root of your webserver to the /public folder and start programming. If you ever feel you want to update your dependencies, simply run composer update.

Note: Remember to enable PHP's openssl extension, so composer can download the projects from github, and Apache's mod_rewrite, so Laravel pretty URLs work. If you're using Apache, that is. Note²: Whenever you create a new command, controller, model, migration or seed, you'll have to type composer dump-autoload on your console, so composer knows how to autoload it.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top