Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Ability to rename the public folder #29

Closed
helmut opened this issue Jan 14, 2013 · 17 comments
Closed

[Request] Ability to rename the public folder #29

helmut opened this issue Jan 14, 2013 · 17 comments

Comments

@helmut
Copy link
Contributor

helmut commented Jan 14, 2013

Would be great to be able to rename the public directory. For example in my hosting environment I use 'content' rather than 'public'. I'm sure lots of setups use other names such as httpdocs, public_html, etc

Or am I missing something and this already exists?

@jasonlewis
Copy link
Contributor

I've been meaning to mention this a few times. There is currently no way to change the public directory even though you can change $app['path'] and $app['path.base']. I'd be all for an implementation of this in some form or another.

@bencorlett
Copy link
Contributor

+100

I've also mentioned this a few times. We just need a $app['path.public'] in the start.php file of your app. Though for this to work the framework needs to reference this, whereas now it's referencing $app['path.base'].'/public'. The same with a vendor path (though this requires a bit more work) [composer lets you choose any vendor path].

@helmut
Copy link
Contributor Author

helmut commented Jan 16, 2013

Not sure if I should be the one to have a go at implementing this.

I can add the param to the start.php file but can't think of a clean way of getting that same value for the server.php file. I don't think we want to create another paths.php file like in laravel 3.

Any thoughts on how to implement as cleanly as possible?

@bencorlett
Copy link
Contributor

Hmm you're right there.

I think the only way to do it is have a third file which server.php can reference and start.php can reference :(

@johnnncodes
Copy link

+1000

@jaumesala
Copy link

First I thought, this is a must, not all hostings have a "public" folder, so I've checked to see where things start to break (and figure out a patch for it).
Well, I've just done a fresh install and I've changed the public folder name to "www". I've done a simple test and looks everything is working....

I haven't gone deeper with tests but, do I miss something?

@bencorlett
Copy link
Contributor

Grep the whole Laravel folder for 'public'

I'm pretty sure it's there a few times, asset publishing for example.

Also, many third party packages (eg basset) rely on the public folder

Sent from my iPhone
Please excuse my brevity

On 06/02/2013, at 7:16 AM, Jaume notifications@github.com wrote:

First I thought, this is a must, not all hostings have a "public" folder, so I've checked to see where things start to break (and figure out a patch for it).
Well, I've just done a fresh install and I've changed the public folder name to "www". I've done a simple test and looks everything is working....

I haven't gone deeper with tests but, do I miss something?


Reply to this email directly or view it on GitHub.

@jaumesala
Copy link

You're right @bencorlett

grep -r "/public" .

./server.php:$requested = __DIR__.'/public'.$uri;
./server.php:require_once(__DIR__ . '/public/index.php');
./vendor/laravel/framework/src/Illuminate/Foundation/AssetPublisher.php:        $source = $packagePath."/{$package}/public";
./vendor/laravel/framework/src/Illuminate/Foundation/Console/AssetPublishCommand.php:           return $this->laravel['path.base']."/workbench/{$bench}/public";
./vendor/laravel/framework/src/Illuminate/Foundation/Providers/PublisherServiceProvider.php:            $publicPath = $app['path.base'].'/public';
./vendor/laravel/framework/src/Illuminate/Workbench/PackageCreator.php:     $this->files->makeDirectory($directory.'/public');
./vendor/laravel/framework/src/Illuminate/Workbench/PackageCreator.php:     $this->files->put($directory.'/public/.gitkeep', '');

@helmut
Copy link
Contributor Author

helmut commented Feb 6, 2013

I guess I'm just waiting on Taylor to make a decision on this? How should we do it?

@jaumesala
Copy link

The "$app['path.public']" options sounds good. The problem I see is with already published content. Maybe an Artisan command would be great, it would handle the rename/republish of the public folders from all the packages?

@arvidbjorkstrom
Copy link
Contributor

+1
This is really sorely needed.

@Anahkiasen
Copy link
Contributor

+1 for this, been needing it a lot of times.

@bencorlett
Copy link
Contributor

I may just put in a pull request in the morning for this. I have an idea of a nice implementation.

Sent from my iPhone
Please excuse my brevity

On 06/02/2013, at 10:25 PM, Maxime Fabre notifications@github.com wrote:

+1 for this, been needing it a lot of times.


Reply to this email directly or view it on GitHub.

@arvidbjorkstrom
Copy link
Contributor

Sweet! =)

@danielczestki
Copy link

What about it ? Is it possible to change folder name public to someting else ?

@crynobone
Copy link
Member

Yes you can @danielczestki, e.g: crynobone/crynobone.com@c55ed05

@alisalehiman
Copy link

good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests