Laravel 5 installation on Ubuntu 14.04: Difference between revisions

→‎Post-installation updates: change <source to <syntaxhighlight
→‎References: add laravel category
→‎Post-installation updates: change <source to <syntaxhighlight
Line 106: Line 106:
Update <span class="package">app.url</span>, <span class="package">app.timezone</span><ref name="timezone">''PHP Manual''. Program documentation. ''PHP Manual''. N.p., n.d. Web. 26 Feb 2015. <http://php.net/manual/en/timezones.php>.</ref>.
Update <span class="package">app.url</span>, <span class="package">app.timezone</span><ref name="timezone">''PHP Manual''. Program documentation. ''PHP Manual''. N.p., n.d. Web. 26 Feb 2015. <http://php.net/manual/en/timezones.php>.</ref>.


<source lang="php">
<syntaxhighlight lang="php">
<?php
// config/app.php
// config/app.php
..
..
Line 114: Line 113:
'timezone' => 'America/Denver',
'timezone' => 'America/Denver',
..
..
</source>
</syntaxhighlight>


It may be just fine to leave the timezone to UTC if you are going to be accommodate for user's particular timezone through some means. If the application isn't going to be serving users from different time zones and you don't plan to scale it then set it to your local one.
It may be just fine to leave the timezone to UTC if you are going to be accommodate for user's particular timezone through some means. If the application isn't going to be serving users from different time zones and you don't plan to scale it then set it to your local one.
Line 123: Line 122:
<span style="color:#00ff00;">mhan</span><span style="color:#444444;">@</span><span style="color:#00cccc;">brahms</span><span style="color:#999999">:</span><span style="color:blue;">/srv/www/sanban</span><span style="color:#cccccc;">
<span style="color:#00ff00;">mhan</span><span style="color:#444444;">@</span><span style="color:#00cccc;">brahms</span><span style="color:#999999">:</span><span style="color:blue;">/srv/www/sanban</span><span style="color:#cccccc;">
$ <b class="color:white;">sudo chown -R www-data:mhan storage</b>
$ <b class="color:white;">sudo chown -R www-data:mhan storage</b>
</span>
<span style="color:#00ff00;">mhan</span><span style="color:#444444;">@</span><span style="color:#00cccc;">brahms</span><span style="color:#999999">:</span><span style="color:blue;">/srv/www/sanban</span><span style="color:#cccccc;">
$ <b class="color:white;">sudo chown -R 0664 storage</b>
</span>
<span style="color:#00ff00;">mhan</span><span style="color:#444444;">@</span><span style="color:#00cccc;">brahms</span><span style="color:#999999">:</span><span style="color:blue;">/srv/www/sanban</span><span style="color:#cccccc;">
$ <b class="color:white;">find storage -type d -exec chmod 2775 '{}' \;</b>
</span>
</span>
</div>
</div>
Line 151: Line 156:
If you use VIM like I do, you can insert this into your <span class="shell">~/.vimrc</span> file and just hit <code>,t</code> (comma and then t) key combination to run the unit test wherever you are under the project directory. This is a bit long because I have some repetitive bash commands to automatically detect the current application name and use that, i.d. "sanban" in this example.
If you use VIM like I do, you can insert this into your <span class="shell">~/.vimrc</span> file and just hit <code>,t</code> (comma and then t) key combination to run the unit test wherever you are under the project directory. This is a bit long because I have some repetitive bash commands to automatically detect the current application name and use that, i.d. "sanban" in this example.


<source lang="vim">
<syntaxhighlight lang="vim">
nmap ,t :!if [ -d .git ] \|\| git rev-parse --git-dir > /dev/null 2>&1; then phpunit.$(cat $(git rev-parse --show-toplevel)/phpspec.yml \| grep "namespace" \| awk '{print tolower(substr($0,20));exit}') -c $(git rev-parse --show-toplevel); else phpunit.$(cat $(git rev-parse --show-toplevel)/phpspec.yml \| grep "namespace" \| awk '{print tolower(substr($0,20));exit}'); fi<cr>
nmap ,t :!if [ -d .git ] \|\| git rev-parse --git-dir > /dev/null 2>&1; then phpunit.$(cat $(git rev-parse --show-toplevel)/phpspec.yml \| grep "namespace" \| awk '{print tolower(substr($0,20));exit}') -c $(git rev-parse --show-toplevel); else phpunit.$(cat $(git rev-parse --show-toplevel)/phpspec.yml \| grep "namespace" \| awk '{print tolower(substr($0,20));exit}'); fi<cr>
</source>
</syntaxhighlight>


In order for this to work properly your project directory has to be initialized as a git repository.
In order for this to work properly your project directory has to be initialized as a git repository.
Anonymous user