<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>nico-hacのブログ</title>
<link>https://ameblo.jp/nico-hac/</link>
<atom:link href="https://rssblog.ameba.jp/nico-hac/rss20.xml" rel="self" type="application/rss+xml" />
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
<description>ブログの説明を入力します。</description>
<language>ja</language>
<item>
<title>10/7 postgresお勉強</title>
<description>
<![CDATA[ brew reinstall php55 --with-postgresql<br>でエラーが出たので<br> brew untap josegonzalez/php<br>してから再度リインストールしたらdb表示でーきーまーしーたー<br>ところでExcelからのDBへの書き込み手順を復習します。<br><br>excelファイルをCSV形式で保存して書き込み<br>testdb=&gt; \encoding SJIS<br>testdb=&gt; \copy place from /ファイルの場所/ファイル名.csv with csv<br>testdb=&gt; \encoding UTF-8<br><br>DBからテキストファイルに書き込み<br>\copy place to /Users/SayakaNishide/nico/public/place.dat<br><br>テキストファイルからDBに書き込み<br>\copy place from /Users/SayakaNishide/nico/public/place.dat<br><br>すでにあるのも２重で書かれる<br>消すには :<br> DELETE FROM place WHERE place_no = 1;<br>とかで消せる<br>
]]>
</description>
<link>https://ameblo.jp/nico-hac/entry-12081617456.html</link>
<pubDate>Wed, 07 Oct 2015 18:45:47 +0900</pubDate>
</item>
<item>
<title>10/2</title>
<description>
<![CDATA[ 昨日はディズニーランドに行ってきまして今日から授業がスタートです。<br>localhostがつながらず外部サーバを借りたりしましたが、ポート8080で繋いだら難なくつながりました。なんでだろう。<br><br>そしてphp簡単にお勉強しながら、<br>http://www.phppro.jp/school/phpschool/vol5/3<br>ここみてます。<br><br>DB(postgresql)接続を試みる、、<br>wget<br>pare<br>インストールしました。<br><br>pareについて怖いからパスのメモ<br>:wget-1.15 SayakaNishide$ php -d detect_unicode=0 go-pear.phar<br><br>Below is a suggested file layout for your new PEAR installation.  To<br>change individual locations, type the number in front of the<br>directory.  Type 'all' to change all of them or simply press Enter to<br>accept these locations.<br><br> 1. Installation base ($prefix)                   : /Users/SayakaNishide/pear<br> 2. Temporary directory for processing            : /tmp/pear/install<br> 3. Temporary directory for downloads             : /tmp/pear/install<br> 4. Binaries directory                            : /Users/SayakaNishide/pear/bin<br> 5. PHP code directory ($php_dir)                 : /Users/SayakaNishide/pear/share/pear<br> 6. Documentation directory                       : /Users/SayakaNishide/pear/docs<br> 7. Data directory                                : /Users/SayakaNishide/pear/data<br> 8. User-modifiable configuration files directory : /Users/SayakaNishide/pear/cfg<br> 9. Public Web Files directory                    : /Users/SayakaNishide/pear/www<br>10. Tests directory                               : /Users/SayakaNishide/pear/tests<br>11. Name of configuration file                    : /Users/SayakaNishide/.pearrc<br><br><br><br>あと<br>http://b.pyar.bz/blog/2014/10/21/mac-postgresql-installation/<br>ここのこともやりました。<br>
]]>
</description>
<link>https://ameblo.jp/nico-hac/entry-12081606850.html</link>
<pubDate>Wed, 07 Oct 2015 18:45:27 +0900</pubDate>
</item>
<item>
<title>9/26-27 bootstrapインストール　未解決</title>
<description>
<![CDATA[ 未解決です<br><br>コマンドライン上での操作を諦めて、ブラウザからダウンロードしてきました<br><br><br><a href="http://stat.ameba.jp/user_images/20150928/09/nico-hac/d1/99/p/o0461032013437989627.png"><img src="https://stat.ameba.jp/user_images/20150928/09/nico-hac/d1/99/p/t02200153_0461032013437989627.png" alt="" width="220" height="152" border="0"></a><br><a href="http://stat.ameba.jp/user_images/20150928/09/nico-hac/a8/d1/p/o0536023813437989626.png"><img src="https://stat.ameba.jp/user_images/20150928/09/nico-hac/a8/d1/p/t02200098_0536023813437989626.png" alt="" width="220" height="97" border="0"></a><br><a href="http://stat.ameba.jp/user_images/20150928/09/nico-hac/f1/c5/p/o0552036213437989625.png"><img src="https://stat.ameba.jp/user_images/20150928/09/nico-hac/f1/c5/p/t02200144_0552036213437989625.png" alt="" width="220" height="144" border="0"></a><br><a href="http://stat.ameba.jp/user_images/20150928/09/nico-hac/31/51/p/o0545035813437989624.png"><img src="https://stat.ameba.jp/user_images/20150928/09/nico-hac/31/51/p/t02200145_0545035813437989624.png" alt="" width="220" height="144" border="0"></a><br><a href="http://stat.ameba.jp/user_images/20150928/09/nico-hac/2a/25/p/o0513023713437989623.png"><img src="https://stat.ameba.jp/user_images/20150928/09/nico-hac/2a/25/p/t02200102_0513023713437989623.png" alt="" width="220" height="101" border="0"></a><br>
]]>
</description>
<link>https://ameblo.jp/nico-hac/entry-12078093806.html</link>
<pubDate>Mon, 28 Sep 2015 09:20:36 +0900</pubDate>
</item>
<item>
<title>9/25 laravel DB</title>
<description>
<![CDATA[ .envファイル書き換え<br>DB_HOST=localhost<br>DB_DATABASE=testdb<br>DB_USERNAME=nico<br>DB_PASSWORD=password<br>DB_CONNECION=pgsql<br><br>.gitignoreからHomestead系の2行を消す<br><br>DBへの問い合わせ<br>:nicolara SayakaNishide$ php artisan migrate<br>Nothing to migrate.<br><br>:nicolara SayakaNishide$ php artisan tinker<br>Psy Shell v0.5.2 (PHP 5.5.29 — cli) by Justin Hileman<br>&gt;&gt;&gt; App\User::all()-&gt;toArray();<br>=&gt; []<br><br>DB作成<br>postgres testdbにアクセス<br>psql -d testdb<br><br>testdb=# create table members(member_no int,member_name text,member_song int,member_lesson int);<br>CREATE TABLE<br>testdb=# create table songs(song_no int,song_name text,song_members int,lesson int);<br>CREATE TABLE<br>testdb=# create table lessons(lesson_no int,lesson_name text,lesson_hist int,lesson_place text,lesson_members int);<br>CREATE TABLE<br><br>作ったデータベースの確認<br><br>testdb=# \d lessons<br>        Table "public.lessons"<br>     Column     |  Type   | Modifiers <br>----------------+---------+-----------<br> lesson_no      | integer | <br> lesson_name    | text    | <br> lesson_hist    | integer | <br> lesson_place   | text    | <br> lesson_members | integer | <br><br>testdb=# \d members<br>       Table "public.members"<br>    Column     |  Type   | Modifiers <br>---------------+---------+-----------<br> member_no     | integer | <br> member_name   | text    | <br> member_song   | integer | <br> member_lesson | integer | <br><br>testdb=# place<br>testdb-# \d place<br>       Table "public.place"<br>   Column   |  Type   | Modifiers <br>------------+---------+-----------<br> place_no   | integer | <br> place_name | text    | <br> place_able | integer | <br> place_ward | text    | <br> mirror     | integer | <br> piano      | integer | <br> cost       | integer | <br><br>testdb-# \d songs<br>        Table "public.songs"<br>    Column    |  Type   | Modifiers <br>--------------+---------+-----------<br> song_no      | integer | <br> song_name    | text    | <br> song_members | integer | <br> lesson       | integer |
]]>
</description>
<link>https://ameblo.jp/nico-hac/entry-12077530541.html</link>
<pubDate>Sat, 26 Sep 2015 20:33:36 +0900</pubDate>
</item>
<item>
<title>9/25 laravel コントローラからviewに値を渡す</title>
<description>
<![CDATA[ /app/Http/Controllers/PagesController.phpのaboutファンクションに追記<br>　　// 変数に値をセット<br>        $first_name = "Luke";<br>        $last_name = "Skywalker";<br> 　　 // view関数の第２引数に compact関数を使う<br>        return view('pages.about', compact('first_name', 'last_name')); <br><br>/resources/views/pages/about.blade.phpを書き換え<br>    <h1>About Me : {{ $first_name }} {{ $last_name }}</h1><br><br>/resources/views/layout.blade.phpを作成<br><br>&lt;えいちてぃえむえる lang="ja"&gt;<br>&lt;へっど&gt;<br>    &lt;めた ちゃーせっと="UTF-8"&gt;<br>    &lt;たいとる&gt;My Blog<!--たいとる--><br><!--へっど--><br>&lt;ぼでぃ&gt;<br>    @yield('content')　←ここに実際のコンテンツを流し込む<br> <!--ぼでぃ--><br><!--えいちてぃえむえる--><br><br> /resources/views/pages/about.blade.phpをbladeに書き換え<br>@extends('layout')　←layout.blade.phpを継承<br> @section('content')　←ここから<br>    <h1>About Me: {{ $first_name }} {{ $last_name }}</h1><br>@endsection　←ここまでをlayout ビューの @yield(‘content’) の箇所に流し込む<br><br>bladeのテンプレートはここにある<br>http://laravel.com/docs/5.1/blade<br><br>つぎ2/21のデータベースにはいる
]]>
</description>
<link>https://ameblo.jp/nico-hac/entry-12077035251.html</link>
<pubDate>Fri, 25 Sep 2015 12:31:22 +0900</pubDate>
</item>
<item>
<title>9/25 laravel コントローラ</title>
<description>
<![CDATA[ app/Http/routes.phpに追記<br>Route::get('about', 'PagesController@about');<br><br>コントローラの作成<br>nicolara SayakaNishide$ php artisan make:controller PagesController<br>Controller created successfully.<br><br>作成した/app/Http/Controllers/PagesController.phpの書き換え<br><!--?php<br /-->namespace App\Http\Controllers;<br>use Illuminate\Http\Request;<br>use App\Http\Requests;<br>use App\Http\Controllers\Controller;<br>class PagesController extends Controller<br>{<br>    public function about(){<br>        return view('pages.about'); //pagesフォルダ内のabout.blade.php<br>    }<br>    public function contact(){<br>        return view('contact');<br>    }<br>}<br><br>/resources/views/pages/about.blade.phpを作成<br>　<!-- about.blade.php --><br> 　<br>　&lt;えいちてぃーえむえる&gt;<br>　&lt;へっど&gt;<br>   　 <title>About</title><br>　<!--へっど--><br>　&lt;ぼでぃ&gt;<br>    <h1>About Me</h1><br>　<!--ぼでぃ--><br>　<!--えいちてぃーえむえる--><br><br>http://localhost:8000/contact<br>http://localhost:8000/about<br>で表示確認<br><br>https://laravel10.wordpress.com/2015/02/17まで終わった
]]>
</description>
<link>https://ameblo.jp/nico-hac/entry-12077015220.html</link>
<pubDate>Fri, 25 Sep 2015 11:25:41 +0900</pubDate>
</item>
<item>
<title>9/25 laravel view作成</title>
<description>
<![CDATA[ http://localhost:8000/contact を作成<br><br>app/Http/Requests/routes.phpに以下を追加<br>Route::get('/', 'WelcomeController@index'); <br>Route::get('contact', 'WelcomeController@contact');<br>下3行をコメントアウト<br><br>/app/Http/Controllers/WelcomeController.phpを作成<br><!--?php<br /-->namespace App\Http\Controllers;<br>use App\Http\Controllers\Controller;<br><br>class WelcomeController extends Controller {<br>    public function contact(){<br>        return "contact";<br>    }<br>}<br><br>http://localhost:8000/contact<br>に<br>contact<br>って出る<br><br>return "文字";<br>で直接文字表示<br>return view("viewの名前");<br>で/resources/views/viewの名前.blade.phpのview画面表示<br>
]]>
</description>
<link>https://ameblo.jp/nico-hac/entry-12077005730.html</link>
<pubDate>Fri, 25 Sep 2015 10:24:18 +0900</pubDate>
</item>
<item>
<title>9/25 laravel 初期設定</title>
<description>
<![CDATA[ nishide-ayaka-no-MacBook-Pro:nico SayakaNishide$ curl -sS https://getcomposer.org/installer | php<br>#!/usr/bin/env php<br>All settings correct for using Composer<br>Downloading...<br><br>Composer successfully installed to: /Users/SayakaNishide/nico/composer.phar<br>Use it: php composer.phar<br>nishide-ayaka-no-MacBook-Pro:nico SayakaNishide$ mv composer.phar /usr/local/bin/composer<br>nishide-ayaka-no-MacBook-Pro:nico SayakaNishide$ composer create-project laravel/laravel --prefer-dist nicolara<br>Installing laravel/laravel (v5.1.11)<br>  - Installing laravel/laravel (v5.1.11)<br>    Loading from cache<br><br>Created project in nicolara<br>&gt; php -r "copy('.env.example', '.env');"<br>Loading composer repositories with package information<br>Installing dependencies (including require-dev)<br>  - Installing vlucas/phpdotenv (v1.1.1)<br>    Loading from cache<br><br>  - Installing symfony/var-dumper (v2.7.4)<br>    Loading from cache<br><br>  - Installing symfony/translation (v2.7.4)<br>    Loading from cache<br><br>  - Installing symfony/routing (v2.7.4)<br>    Loading from cache<br><br>  - Installing symfony/process (v2.7.4)<br>    Loading from cache<br><br>  - Installing psr/log (1.0.0)<br>    Loading from cache<br><br>  - Installing symfony/debug (v2.7.4)<br>    Loading from cache<br><br>  - Installing symfony/http-foundation (v2.7.4)<br>    Loading from cache<br><br>  - Installing symfony/event-dispatcher (v2.7.4)<br>    Loading from cache<br><br>  - Installing symfony/http-kernel (v2.7.4)<br>    Loading from cache<br><br>  - Installing symfony/finder (v2.7.4)<br>    Loading from cache<br><br>  - Installing symfony/dom-crawler (v2.7.4)<br>    Loading from cache<br><br>  - Installing symfony/css-selector (v2.7.4)<br>    Loading from cache<br><br>  - Installing symfony/console (v2.7.4)<br>    Loading from cache<br><br>  - Installing swiftmailer/swiftmailer (v5.4.1)<br>    Loading from cache<br><br>  - Installing jakub-onderka/php-console-color (0.1)<br>    Loading from cache<br><br>  - Installing jakub-onderka/php-console-highlighter (v0.3.2)<br>    Loading from cache<br><br>  - Installing dnoegel/php-xdg-base-dir (0.1)<br>    Loading from cache<br><br>  - Installing nikic/php-parser (v1.4.1)<br>    Downloading: 100%         <br><br>  - Installing psy/psysh (v0.5.2)<br>    Loading from cache<br><br>  - Installing nesbot/carbon (1.20.0)<br>    Loading from cache<br><br>  - Installing mtdowling/cron-expression (v1.0.4)<br>    Loading from cache<br><br>  - Installing monolog/monolog (1.17.1)<br>    Loading from cache<br><br>  - Installing league/flysystem (1.0.14)<br>    Downloading: 100%         <br><br>  - Installing jeremeamia/superclosure (2.1.0)<br>    Loading from cache<br><br>  - Installing doctrine/inflector (v1.0.1)<br>    Loading from cache<br><br>  - Installing danielstjules/stringy (1.10.0)<br>    Loading from cache<br><br>  - Installing classpreloader/classpreloader (2.0.0)<br>    Loading from cache<br><br>  - Installing laravel/framework (v5.1.17)<br>    Downloading: 100%         <br><br>  - Installing fzaninotto/faker (v1.5.0)<br>    Loading from cache<br><br>  - Installing hamcrest/hamcrest-php (v1.2.2)<br>    Loading from cache<br><br>  - Installing mockery/mockery (0.9.4)<br>    Loading from cache<br><br>  - Installing sebastian/version (1.0.6)<br>    Loading from cache<br><br>  - Installing sebastian/global-state (1.0.0)<br>    Loading from cache<br><br>  - Installing sebastian/recursion-context (1.0.1)<br>    Loading from cache<br><br>  - Installing sebastian/exporter (1.2.1)<br>    Loading from cache<br><br>  - Installing sebastian/environment (1.3.2)<br>    Loading from cache<br><br>  - Installing sebastian/diff (1.3.0)<br>    Loading from cache<br><br>  - Installing sebastian/comparator (1.2.0)<br>    Loading from cache<br><br>  - Installing symfony/yaml (v2.7.4)<br>    Loading from cache<br><br>  - Installing doctrine/instantiator (1.0.5)<br>    Loading from cache<br><br>  - Installing phpdocumentor/reflection-docblock (2.0.4)<br>    Loading from cache<br><br>  - Installing phpspec/prophecy (v1.5.0)<br>    Loading from cache<br><br>  - Installing phpunit/php-text-template (1.2.1)<br>    Loading from cache<br><br>  - Installing phpunit/phpunit-mock-objects (2.3.7)<br>    Loading from cache<br><br>  - Installing phpunit/php-timer (1.0.7)<br>    Loading from cache<br><br>  - Installing phpunit/php-token-stream (1.4.8)<br>    Loading from cache<br><br>  - Installing phpunit/php-file-iterator (1.4.1)<br>    Loading from cache<br><br>  - Installing phpunit/php-code-coverage (2.2.3)<br>    Loading from cache<br><br>  - Installing phpunit/phpunit (4.8.9)<br>    Downloading: 100%         <br><br>  - Installing phpspec/php-diff (v1.0.2)<br>    Loading from cache<br><br>  - Installing phpspec/phpspec (2.3.0)<br>    Loading from cache<br><br>symfony/var-dumper suggests installing ext-symfony_debug ()<br>symfony/translation suggests installing symfony/config ()<br>symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)<br>symfony/routing suggests installing symfony/expression-language (For using expression matching)<br>symfony/routing suggests installing doctrine/annotations (For using the annotation loader)<br>symfony/event-dispatcher suggests installing symfony/dependency-injection ()<br>symfony/http-kernel suggests installing symfony/browser-kit ()<br>symfony/http-kernel suggests installing symfony/class-loader ()<br>symfony/http-kernel suggests installing symfony/config ()<br>symfony/http-kernel suggests installing symfony/dependency-injection ()<br>psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)<br>monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)<br>monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)<br>monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)<br>monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)<br>monolog/monolog suggests installing videlalvaro/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)<br>monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))<br>monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)<br>monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)<br>monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)<br>monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)<br>league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)<br>league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)<br>league/flysystem suggests installing league/flysystem-copy (Allows you to use Copy.com storage)<br>league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)<br>league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)<br>league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)<br>league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)<br>league/flysystem suggests installing league/flysystem-dropbox (Allows you to use Dropbox storage)<br>league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)<br>league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)<br>league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)<br>laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (~3.0).)<br>laravel/framework suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (~2.4).)<br>laravel/framework suggests installing guzzlehttp/guzzle (Required to use the Mailgun and Mandrill mail drivers (~5.3|~6.0).)<br>laravel/framework suggests installing iron-io/iron_mq (Required to use the iron queue driver (~2.0).)<br>laravel/framework suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (~1.0).)<br>laravel/framework suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)<br>laravel/framework suggests installing pda/pheanstalk (Required to use the beanstalk queue driver (~3.0).)<br>laravel/framework suggests installing predis/predis (Required to use the redis cache and queue drivers (~1.0).)<br>laravel/framework suggests installing pusher/pusher-php-server (Required to use the Pusher broadcast driver (~2.0).)<br>fzaninotto/faker suggests installing ext-intl (*)<br>sebastian/global-state suggests installing ext-uopz (*)<br>phpdocumentor/reflection-docblock suggests installing dflydev/markdown (~1.0)<br>phpdocumentor/reflection-docblock suggests installing erusev/parsedown (~1.0)<br>phpunit/php-code-coverage suggests installing ext-xdebug (&gt;=2.2.1)<br>phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)<br>phpspec/phpspec suggests installing phpspec/nyan-formatters (~1.0 – Adds Nyan formatters)<br>Writing lock file<br>Generating autoload files<br>&gt; php artisan clear-compiled<br>&gt; php artisan optimize<br>Generating optimized class loader<br>&gt; php artisan key:generate<br>Application key [uZhrJHg4TNrbZU7kgB51gBQHRYAFcbM5] set successfully.<br>nishide-ayaka-no-MacBook-Pro:nico SayakaNishide$ cd nicolara<br>nishide-ayaka-no-MacBook-Pro:nicolara SayakaNishide$ ls<br>appbootstrapcomposer.lockdatabasepackage.jsonphpunit.xmlreadme.mdserver.phptests<br>artisancomposer.jsonconfiggulpfile.jsphpspec.ymlpublicresourcesstoragevendor<br>nishide-ayaka-no-MacBook-Pro:nicolara SayakaNishide$ cp .env.example .env<br>nishide-ayaka-no-MacBook-Pro:nicolara SayakaNishide$ php artisan key:generate<br>Application key [pHqnXcst0wBly8nfeWvPVFf2Tby910uh] set successfully.<br><br><br><br>config/app.phpを変更<br>return [<br>    // ...<br> <br>    'timezone' =&gt; 'Asia/Tokyo',<br>    'locale' =&gt; 'ja',<br> <br>    // ...<br>];<br><br>.envに追記<br>DB_CONNECTION = pgsql<br>config/database.phpのsqlデフォルトを変更<br>'default' =&gt; env('DB_CONNECTION', 'pgsql'),<br><br>bootstrapディレクトリとstorageのgroupとothersに書き込み権限も追加<br>:nicolara SayakaNishide$ chmod g+w bootstrap<br>:nicolara SayakaNishide$ chmod o+w bootstrap<br>:nicolara SayakaNishide$ chmod o+w storage<br>:nicolara SayakaNishide$ chmod g+w storage<br><br>laravelアプリの実行<br>:nicolara SayakaNishide$ php -S localhost:8000 -t public<br>→localhost:8000にアクセス<br>
]]>
</description>
<link>https://ameblo.jp/nico-hac/entry-12076995880.html</link>
<pubDate>Fri, 25 Sep 2015 10:00:25 +0900</pubDate>
</item>
<item>
<title>9/25 git</title>
<description>
<![CDATA[ :~ SayakaNishide$ mkdir nico<br>:~ SayakaNishide$ cd nico<br>:nico SayakaNishide$ echo "# nico" &gt;&gt; README.md<br>:nico SayakaNishide$ git init<br>Initialized empty Git repository in /Users/SayakaNishide/nico/.git/<br>:nico SayakaNishide$ git add README.md<br>:nico SayakaNishide$ git commit -m "first commit"<br>[master (root-commit) 54447e8] first commit<br> 1 file changed, 1 insertion(+)<br> create mode 100644 README.md<br>:nico SayakaNishide$ git remote add origin https://github.com/SayakaNishide/nico.git<br>:nico SayakaNishide$ git push -u origin master<br>Counting objects: 3, done.<br>Writing objects: 100% (3/3), 239 bytes | 0 bytes/s, done.<br>Total 3 (delta 0), reused 0 (delta 0)<br>To https://github.com/SayakaNishide/nico.git<br> * [new branch]      master -&gt; master<br>Branch master set up to track remote branch master from origin.<br><br>
]]>
</description>
<link>https://ameblo.jp/nico-hac/entry-12076974486.html</link>
<pubDate>Fri, 25 Sep 2015 08:56:37 +0900</pubDate>
</item>
<item>
<title>9/25 heroku</title>
<description>
<![CDATA[ vagrant使うと話がややこしそうなので、herokuで挑戦してみる<br><br>①ログイン<br>~ SayakaNishide$ heroku login<br>Enter your Heroku credentials.<br>Email: g1120531@is.ocha.ac.jp<br>Password (typing will be hidden): <br>Authentication successful.<br>updating Heroku CLI...done. Updated to 3.42.3<br><br>②アプリをデプロイ<br>~ SayakaNishide$ cd php-getting-started<br>php-getting-started SayakaNishide$ heroku create<br>Installing Heroku Toolbelt v4... done.<br>For more information on Toolbelt v4: https://github.com/heroku/heroku-cli<br>Setting up node-v4.1.0... done<br>Installing core plugins heroku-apps, heroku-fork, heroku-git, heroku-local, heroku-run, heroku-status... done<br>Creating agile-journey-6419... done, stack is cedar-14<br>https://agile-journey-6419.herokuapp.com/ | https://git.heroku.com/agile-journey-6419.git<br>Git remote heroku added<br><br>③Gitにプッシュ<br>:php-getting-started SayakaNishide$ git push heroku master<br>Counting objects: 133, done.<br>Delta compression using up to 4 threads.<br>Compressing objects: 100% (69/69), done.<br>Writing objects: 100% (133/133), 27.07 KiB | 0 bytes/s, done.<br>Total 133 (delta 50), reused 133 (delta 50)<br>remote: Compressing source files... done.<br>remote: Building source:<br>remote: <br>remote: -----&gt; PHP app detected<br>remote: -----&gt; No runtime required in 'composer.json', defaulting to PHP 5.6.13.<br>remote: -----&gt; Installing system packages...<br>remote:        - PHP 5.6.13<br>remote:        - Apache 2.4.10<br>remote:        - Nginx 1.6.0<br>remote: -----&gt; Installing PHP extensions...<br>remote:        - zend-opcache (automatic; bundled)<br>remote: -----&gt; Installing dependencies...<br>remote:        Composer version 1.0.0-alpha10 2015-04-14 21:18:51<br>remote:        Loading composer repositories with package information<br>remote:        Installing dependencies from lock file<br>remote:          - Installing psr/log (1.0.0)<br>remote:            Downloading: 100%<br>remote:        <br>remote:          - Installing monolog/monolog (1.16.0)<br>remote:            Downloading: 100%<br>remote:        <br>remote:          - Installing symfony/routing (v2.7.3)<br>remote:            Downloading: 100%<br>remote:        <br>remote:          - Installing symfony/http-foundation (v2.7.3)<br>remote:            Downloading: 100%<br>remote:        <br>remote:          - Installing symfony/event-dispatcher (v2.7.3)<br>remote:            Downloading: 100%<br>remote:        <br>remote:          - Installing symfony/debug (v2.7.3)<br>remote:            Downloading: 100%<br>remote:        <br>remote:          - Installing symfony/http-kernel (v2.7.3)<br>remote:            Downloading: 100%<br>remote:        <br>remote:          - Installing pimple/pimple (v1.1.1)<br>remote:            Downloading: 100%<br>remote:        <br>remote:          - Installing silex/silex (v1.3.1)<br>remote:            Downloading: 100%<br>remote:        <br>remote:          - Installing twig/twig (v1.19.0)<br>remote:            Downloading: 100%<br>remote:        <br>remote:          - Installing symfony/twig-bridge (v2.7.3)<br>remote:            Downloading: 100%<br>remote:        <br>remote:        Generating optimized autoload files<br>remote: -----&gt; Preparing runtime environment...<br>remote: -----&gt; Discovering process types<br>remote:        Procfile declares types -&gt; web<br>remote: <br>remote: -----&gt; Compressing... done, 73.4MB<br>remote: -----&gt; Launching... done, v3<br>remote:        https://agile-journey-6419.herokuapp.com/ deployed to Heroku<br>remote: <br>remote: Verifying deploy.... done.<br>To https://git.heroku.com/agile-journey-6419.git<br> * [new branch]      master -&gt; master<br><br>④インスタンス起動？<br>php-getting-started SayakaNishide$ heroku ps:scale web=1<br>Scaling dynos... done, now running web at 1:Free.<br><br>⑤Webページ立ち上げ<br>HerokuのGettingStartedのページにとんだ<br><br>⑥見れるdyno(Appサーバの1プロセス)の数<br>php-getting-started SayakaNishide$ heroku ps<br>=== web (Free): `vendor/bin/heroku-php-apache2 web/`<br>web.1: up 2015/09/25 01:11:36 (~ 6m ago)<br><br>⑦コンポーザアップデート<br>php-getting-started SayakaNishide$ composer update<br><br>⑧ローカルチェンジをプッシュ<br>php-getting-started SayakaNishide$ composer require alrik11es/cowsayphp<br>php-getting-started SayakaNishide$ composer update<br><br>/php-getting-started/web/views/index.phpに以下の文を追加<br><br>$app-&gt;get('/cowsay', function() use($app) {<br>  $app['monolog']-&gt;addDebug('cowsay');<br>  return "<pre>".\League\Cowsayphp\Cow::say("Cool beans")."</pre>";<br>});<br><br>⑨デプロイ<br>php-getting-started SayakaNishide$ git add .<br>php-getting-started SayakaNishide$ git commit -m "Demo"<br>php-getting-started SayakaNishide$ git push heroku master<br>php-getting-started SayakaNishide$ heroku open<br>同じページが開く<br><br>10　クラウド監視の有料サービスはとばす<br><br>11　<br>test-git-0925 SayakaNishide$ heroku run "php -a"<br>Running php -a on test-git-0925... up, run.5026<br>Interactive shell<br><br>php &gt; echo PHP_VERSION;<br>5.6.13<br><br>12　<br>test-git-0925 SayakaNishide$ heroku run "php -a"<br>Running php -a on test-git-0925... up, run.5026<br>Interactive shell<br><br>php &gt; echo PHP_VERSION;<br>5.6.13<br>test-git-0925 SayakaNishide$ heroku run bash<br>Running bash on test-git-0925... up, run.2392<br>~ $ ls<br>Procfile  README.md  composer.json  composer.lock  vendor  web<br><br>viewがないのが気になる<br><br>/php-getting-started/web/views/index.phpの以下のファンクションをこのように書き換え<br><br>$app-&gt;get('/', function() use($app) {<br>  $app['monolog']-&gt;addDebug('logging output.');<br>  //return $app['twig']-&gt;render('index.twig');<br>  return str_repeat('Hello', getenv('TIMES'));<br>});<br><br>12　セット<br>test-git-0925 SayakaNishide$ heroku config:set TIMES=20<br>Setting config vars and restarting test-git-0925... done, v5<br>TIMES: 20<br>test-git-0925 SayakaNishide$ heroku config<br>=== test-git-0925 Config Vars<br>TIMES: 20<br><br>13　DBの設定<br>/php-getting-started/web/views/index.phpに追記<br><br>$dbopts = parse_url(getenv('DATABASE_URL'));<br>$app-&gt;register(new Herrera\Pdo\PdoServiceProvider(),<br>  array(<br>    'pdo.dsn' =&gt; 'pgsql:dbname='.ltrim($dbopts["path"],'/').';host='.$dbopts["host"],<br>    'pdo.port' =&gt; $dbopts["port"],<br>    'pdo.username' =&gt; $dbopts["user"],<br>    'pdo.password' =&gt; $dbopts["pass"]<br>  )<br>);<br>$app-&gt;get('/db/', function() use($app) {<br>  $st = $app['pdo']-&gt;prepare('SELECT name FROM test_table');<br>  $st-&gt;execute();<br><br>  $names = array();<br>  while ($row = $st-&gt;fetch(PDO::FETCH_ASSOC)) {<br>    $app['monolog']-&gt;addDebug('Row ' . $row['name']);<br>    $names[] = $row;<br>  }<br><br>  return $app['twig']-&gt;render('database.twig', array(<br>    'names' =&gt; $names<br>  ));<br>});<br><br>14　/php-getting-started/web/views/　database.twigを作成<br><br>{% extends "layout.html" %}<br><br>{% block content %}<br><p>Got these rows from the database:</p><br><br><ul><br>{% for n in names %}<br>  <li> {{ n.name }} </li><br>{% else %}<br>  <li>Nameless!</li><br>{% endfor %}<br></ul><br><br>{% endblock %}<br><br>反映<br>$ git add .<br>$ git commit -m 'added database access'<br>$ git push heroku master<br><br>15　ぽすぐれ触る<br>test-git-0925 SayakaNishide$ heroku pg:psql<br>---&gt; Connecting to DATABASE_URL<br>psql (9.4.4)<br>SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)<br>Type "help" for help.<br><br>test-git-0925::DATABASE=&gt; create table test_table (id integer, name text);<br>CREATE TABLE<br>test-git-0925::DATABASE=&gt; insert into test_table values (1, 'hello database');<br>INSERT 0 1<br>test-git-0925::DATABASE=&gt; \q<br><br>
]]>
</description>
<link>https://ameblo.jp/nico-hac/entry-12076972548.html</link>
<pubDate>Fri, 25 Sep 2015 01:05:10 +0900</pubDate>
</item>
</channel>
</rss>
