Categories
Laravel

Laravel on Shared Hosting

AntJanus gave the basic approach here. It did work for my Hello World test, not sure if there are potential issues waiting, such as with maintenance or framework updates.

Basically install locally (on Composer so far), zip it all up and upload the framework directory to a private folder above public_html.

The public entry point can be directly in public_html if the site is for the domain root, or in a sub-folder. Edit both public/index.php and laravel/bootstrap/paths.php to be able to find each other.

Paths.php looked a bit like this

[29]  'public' => __DIR__.'/../public_html/laravel',
//laravel is sub-directory
Categories
Laravel

Laravel Installation

The intro docs have you using Composer to pull in all its dependencies, which come to about 100mb. Apparently it should be possible to turn off development bundles, but not sure I’ve done it yet.

This composer.json:

{
	"require": {
		"laravel/framework": "4.0.*"
	},
	"autoload": {
		"classmap": [
			"app/commands",
			"app/controllers",
			"app/models",
			"app/database/migrations",
			"app/database/seeds",
			"app/tests/TestCase.php"
		]
	},
	"scripts": {
		"pre-update-cmd": [
			"php artisan clear-compiled"
		],
		"post-install-cmd": [
			"php artisan optimize"
		],
		"post-update-cmd": [
			"php artisan vendor-cleanup",
			"php artisan optimize"
		]
	},
	"config": {
		"preferred-install": "dist"
	},
	"minimum-stability": "dev"
}

Should cut file size down with the vendor-cleanup, but I’m wondering if the artisan command does nothing on my local system. When did it get into Windows?

Code Bright takes a different approach, pulling from GitHub. Haven’t tried it yet though.

Categories
JavaScript

Require.JS

It seems to be a popular way of managing JS dependencies. From what I gather it expects files to be self contained anonymous functions that stay out of the global scope. jQuery can be hacked to fit Require.JS’ approach, but the jQuery file won’t by default.

don’t think it’s about LazyLoading so much as getting all the scripts you need for a given page without having to call them explicitly in the markup.