Open a new terminal and install Composer:
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
Once that has finished installing and moved, install the PHP-CS-Fixer Composer package globally:
| /** | |
| * pr | |
| * 比較寬的console.log, | |
| * 若代入兩個個參數則第二個參數會變成title並換行顯示第一個參數 | |
| * @param desc | |
| * @param title | |
| * @return boolean | |
| */ | |
| function pr(desc, title) { | |
| if (!debug) return false; |
| <?php | |
| $url = 'http://scare.senao.com.tw/api/post/list/?category=latest'; | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
| curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Accept: application/json']); | |
| $output = curl_exec($ch); | |
| curl_close($ch); | |
| $json = json_decode($output, true); |
Open a new terminal and install Composer:
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
Once that has finished installing and moved, install the PHP-CS-Fixer Composer package globally: