-
俺のDocker+PhpStorm 勉強用リンク【随時更新】
2020/12/15 -Docker
docker, phpstorm, docker-compose, xdebug仕事で一時的にDocker+PhpStormを触ることになったので、その勉強用リンクです。 Docker+PhpStorm+xdebug ・PhpStorm & Docker ( …
-
Laravel6のartisanコマンド一覧です。
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110$ php artisan listLaravel Framework 6.20.2Usage:command [options] [arguments]Options:-h, --help Display this help message-q, --quiet Do not output any message-V, --version Display this application version--ansi Force ANSI output--no-ansi Disable ANSI output-n, --no-interaction Do not ask any interactive question--env[=ENV] The environment the command should run under-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debugAvailable commands:clear-compiled Remove the compiled class filedown Put the application into maintenance modeenv Display the current framework environmenthelp Displays help for a commandlist Lists commandsmigrate Run the database migrationsoptimize Cache the framework bootstrap filespreset Swap the front-end scaffolding for the applicationserve Serve the application on the PHP development servertinker Interact with your applicationui Swap the front-end scaffolding for the applicationup Bring the application out of maintenance modeauthauth:clear-resets Flush expired password reset tokenscachecache:clear Flush the application cachecache:forget Remove an item from the cachecache:table Create a migration for the cache database tableconfigconfig:cache Create a cache file for faster configuration loadingconfig:clear Remove the configuration cache filedbdb:seed Seed the database with recordsdb:wipe Drop all tables, views, and typeseventevent:cache Discover and cache the application's events and listenersevent:clear Clear all cached events and listenersevent:generate Generate the missing events and listeners based on registrationevent:list List the application's events and listenerskeykey:generate Set the application keymakemake:channel Create a new channel classmake:command Create a new Artisan commandmake:controller Create a new controller classmake:event Create a new event classmake:exception Create a new custom exception classmake:factory Create a new model factorymake:job Create a new job classmake:listener Create a new event listener classmake:mail Create a new email classmake:middleware Create a new middleware classmake:migration Create a new migration filemake:model Create a new Eloquent model classmake:notification Create a new notification classmake:observer Create a new observer classmake:policy Create a new policy classmake:provider Create a new service provider classmake:request Create a new form request classmake:resource Create a new resourcemake:rule Create a new validation rulemake:seeder Create a new seeder classmake:test Create a new test classmigratemigrate:fresh Drop all tables and re-run all migrationsmigrate:install Create the migration repositorymigrate:refresh Reset and re-run all migrationsmigrate:reset Rollback all database migrationsmigrate:rollback Rollback the last database migrationmigrate:status Show the status of each migrationnotificationsnotifications:table Create a migration for the notifications tableoptimizeoptimize:clear Remove the cached bootstrap filespackagepackage:discover Rebuild the cached package manifestqueuequeue:failed List all of the failed queue jobsqueue:failed-table Create a migration for the failed queue jobs database tablequeue:flush Flush all of the failed queue jobsqueue:forget Delete a failed queue jobqueue:listen Listen to a given queuequeue:restart Restart queue worker daemons after their current jobqueue:retry Retry a failed queue jobqueue:table Create a migration for the queue jobs database tablequeue:work Start processing jobs on the queue as a daemonrouteroute:cache Create a route cache file for faster route registrationroute:clear Remove the route cache fileroute:list List all registered routesscheduleschedule:run Run the scheduled commandssessionsession:table Create a migration for the session database tablestoragestorage:link Create a symbolic link from "public/storage" to "storage/app/public"uiui:auth Scaffold basic login and registration views and routesvendorvendor:publish Publish any publishable assets from vendor packagesviewview:cache Compile all of the application's Blade templatesview:clear Clear all compiled view files
-
プログラミングでよく使う英単語のまとめです。 all change check disable display enable error exists find first last generate …
-
2019/09/25 -PHP7
Visual Studio Code個人的な設定メモです。 日本語化 メニューバー「表示」-「空白を表示」「制御文字を表示」をオン プラグイン「PHP Debug」インストール
-
仕事で一時的にRuby on Rails 5を触ることになったので、その勉強用リンクです。 DB検索 RubyonRails:Rails5で使えるデータ検索関連のメソッドをまとめてみた Rails M …
-
Nginx fastcgi_passを127.0.0.1からソケット通信に変更する方法
2018/11/18 -Nginx
fastcgi_pass, Socket, nginx, チューニング, ソケット通信, ループバックアドレスNginx(ver 1.13)のfastcgi_passを127.0.0.1:9000からソケット(Socket)通信に変更する方法です。 [crayon-5ffc3fdb014ce362867877 …
-
CakePHP3 Template用にsetした値を参照する方法
2018/11/13 -コントローラー(Controller)
set, Template, viewVarsCakePHP3 Template用にsetした値を参照する方法です。
123456<?php$aaa = 'test';$this->set('bbb', $aaa);var_dump($this->viewVars['bbb']);// 出力結果: test
-
CakePHP3 scriptタグ(HTMLヘルパー)のdefer・async属性設定方法
2018/11/09 -ビュー(Template)
defer, JavaScript, HtmlHelper, script, asyncCakePHP3 scriptタグ(HTMLヘルパー)のdefer・async属性オプションの設定方法です。
123456789101112131415// CakePHP3 HTMLヘルパー($this->Html->script - defer属性)<?= $this->Html->script(['jquery.min.js', 'bootstrap/bootstrap.min.js'], ['defer' => true])?>// 生成されるHTML<script src="/js/jquery.min.js" defer="defer"></script><script src="/js/bootstrap/bootstrap.min.js" defer="defer"></script>// CakePHP3 HTMLヘルパー($this->Html->script - async属性)<?= $this->Html->script(['jquery.min.js', 'bootstrap/bootstrap.min.js'], ['async' => true])?>// 生成されるHTML<script src="/js/jquery.min.js" async="async"></script><script src="/js/bootstrap/bootstrap.min.js" async="async"></script>
-
Chrome(クローム) すべてのCookieとサイトデータを表示する方法
Chrome(ver.70)で『すべての Cookie とサイトデータを表示』する方法のご紹介です。
123// アドレスバーに下記を入力chrome://settings/siteData
-
2018/10/29 -PHP7
コーディング規約, php-cs-fixer, コード整形ツール, PSR-2PHP用コード整形ツール(php-cs-fixer)のご紹介です。 「php-cs-fixer」は、コーディング規約(PSR-2)にそったコードに整形してくれるツールです。 [crayon-5ffc3 …
-
CakePHP3 composer管理パッケージの脆弱性チェックツール
2018/10/29 -CakePHP3
脆弱性チェックツール, composer, security-checkerCakePHP3 composer管理パッケージの脆弱性チェックツール(security-checker)のご紹介です。 「security-checker」は、既知の脆弱性を含んだパッケージを利用し …
-
ノーマルモード時(移動)
12345678910111213141516171819202122232425262728293031323334# 先頭行に移動gg# 7行目に移動7G# 最終行に移動G# 画面単位に進むctrl + f# 画面単位に戻るctrl + b# 単語単位に進むw# 単語単位に戻るb# 行頭に移動^# 行末に移動$# 対応するカッコ (){} にジャンプ%# 行内の指定文字に移動 ex) a// f + 文字fa※「;」で次の『a』に移動するノーマルモード時(コピー&ペースト)
1234567891011121314151617# カーソル位置の1文字カット(削除)x# 1行カット(削除)dd# 3行カット(削除)3dd# 1行コピーyy# 3行コピー3yy# 貼り付け(ペースト)pノー …
-
PHP7 配列データを整える(空要素削除・trim・添字連番化)
2018/08/30 -PHP7
array_filter, array_map, array_values, 空要素削除, 添字連番化, 配列, trimPHPにて配列データを整える(空要素削除・要素trim・添字連番化)方法です。
123456789101112131415161718192021222324252627282930313233343536373839<?php$data = ["aaa", " bbb ", "", "ccc"];// 配列の空要素削除$data = array_filter($data, 'strlen');// 上記$dataのvar_dumparray(3) {[0]=>string(3) "aaa"[1]=>string(9) " bbb "[3]=>string(3) "ccc"}// 配列の要素trim$data = array_map('trim', $data);// 上記$dataのvar_dumparray(3) {[0]=>string(3) "aaa"[1]=>string(3) "bbb"[3]=>string(3) "ccc"}// 配列の添字連番化$data = array_values($data);// 上記$dataのvar_dumparray(3) {[0]=>string(3) "aaa"[1]=>string(3) "bbb"[2]=>string(3) "ccc"}◯ 上記処理を1行にまとめた場合 [crayon-5f …
-
CakePHP3 Shell(シェルスクリプト)に引数を渡す方法
CakePHP3 Shell(シェルスクリプト)に引数を渡す方法です。
12345678910111213// 新規作成ファイル「src/Shell/sampleShell.php」<?phpnamespace App\Shell;use Cake\Console\Shell;class sampleShell extends Shell {public function main() {echo 'Shellテスト' . (isset($this->args[0]) ? $this->args[0] : '') . "\n";}}Shell(シェルスクリプト)をコマンドプロンプトから実行 [ …
-
CakePHP3 コントローラーにてURL生成(Router)する方法
◯ CakePHP3 コントローラーにてURL生成(Router)方法
123456789101112131415161718192021222324252627282930<?phpuse Cake\Routing\Router;//// アクセスURL例:https://test.com/contact?test// カレントパス(ドメイン含む)Router::url(NULL, true);-> https://test.com/contact// カレントパスのみ(ドメイン含まない)Router::url();-> /contact// クエリストリングを含むパス(ドメイン含む)Router::reverse($this->request, true);-> https://test.com/contact?test// クエリストリングを含むパス(ドメイン含まない)Router::reverse($this->request);-> /contact?test// 【その他】 サーバー変数($_SERVER)$_SERVER['REQUEST_URI'];-> /contact?test
-
2018/03/30 -コントローラー(Controller)
キャッシュ削除, delete, cache, clearCakePHP3 コントローラーからキャッシュ削除する方法です。 ◯ 「config/app.php」キャッシュ設定サンプル
123456789101112131415<?php'Cache' => ['default' => ['className' => 'File','path' => CACHE,'url' => env('CACHE_DEFAULT_URL', null),],'getShop' => ['className' => 'File','path' => CACHE . 'add/shop/','duration' => '+1 weeks','url' => env ('CACHE_DEFAULT_URL', null)],// ・・・],◯ キャ …
-
CakePHP3 サイトマップ(Sitemap)作成のサンプルコード
=簡易メモ= ・TOPページと店舗一覧の圧縮サイトマップ(sitemap.xml.gz)をwebroot直下に作成する。 ◯ 店舗用のテーブル定義 [crayon-5ffc3fdb03004 …