// Built-in types
$variable = null; // null type
// Scalar types
$boolVar = true; // bool type
$intVar = 42; // int type
$floatVar = 3.14; // float type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// prepare headers for API call | |
$request_headers = array(); | |
// prepare the url of the api I am calling | |
$api_url = "http://api.example.com?parameters=whatever"; | |
// append streamdata sandbox proxy | |
$url = 'https://streamdata.motwin.net/' . $api_url; |
Translations: Korean (by Yongwoo Lee)
Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.
I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param SymfonyStyle $io | |
* @param $remotePath | |
* | |
* @return string | |
*/ | |
public function download(SymfonyStyle $io, $remotePath) | |
{ | |
$io->section("Download " . $remotePath); | |
$parts = parse_url($remotePath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
# The Application | |
app: | |
build: | |
context: ./ | |
dockerfile: php-fpm.dockerfile | |
working_dir: /var/www | |
volumes: | |
- ./:/var/www |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(1); | |
$target = __DIR__ . '/../website.com'; // 生产环境web目录 | |
$token = '您在coding填写的hook令牌'; | |
$wwwUser = 'apache'; | |
$wwwGroup = 'apache'; | |
$json = json_decode(file_get_contents('php://input'), true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 设置方法: | |
# git config --global core.excludesfile ~/.gitignore_global | |
#compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"always_show_minimap_viewport": true, | |
"atomic_save": true, | |
"binary_file_patterns": | |
[ | |
"*.jpg", | |
"*.jpeg", | |
"*.png", | |
"*.gif", | |
"*.ttf", |