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: | |
apache: | |
image: php:7.1.3-apache | |
ports: | |
- "80:80" |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/html | |
ServerName html.com | |
ServerAlias www.html.com | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> |
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
# docker-compose.yml | |
version: '2' | |
services: | |
apache: | |
image: php:7.1.3-apache | |
volumes: | |
- content:/var/www/html/ | |
apache-lb: | |
image: rancher/lb-service-haproxy:v0.6.4 |
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 | |
echo "Hello, world!"; |
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
#rancher-compose.yml | |
version: '2' | |
services: | |
apache: | |
scale: 1 | |
apache-lb: | |
scale: 1 | |
lb_config: |
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
# docker-compose.yml | |
version: '2' | |
services: | |
apache: | |
image: php:7.1.3-apache | |
volumes: | |
- content:/var/www/html/ | |
apache-lb: | |
image: rancher/lb-service-haproxy:v0.6.4 | |
ports: |
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: | |
php: | |
image: php:7.1.3 | |
volumes: | |
- /var/run/docker.sock:/tmp/docker.sock:ro |
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
// creates a New Session | |
// returns Session ID | |
func createNewSession() ->String { | |
let urlString = "http://" + self.host + ":" + self.port + "/session" | |
guard let url = URL(string: urlString) else { | |
print("Error: cannot create URL") | |
return "" | |
} | |
var request = URLRequest(url: url) |
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
/* 1 */ | |
So I'm reading the documentation for database/sql for rows.Close(): | |
"Close closes the Rows, preventing further enumeration. If Next returns false, the Rows are closed automatically | |
and it will suffice to check the result of Err. Close is idempotent and does not affect the result of Err."" | |
I still don't get what closing a row does. I get closing in the context of closing for like DB.close() since its a DB | |
connection. But what does closing a row mean. "Close closes the Rows". Its using the same word to describe itself. | |
Answer: DB Connection Pooling | |
Open is essentially only there to store credentials & never makes a connection. | |
Queries / Insert / etc. each create separate connections in the DB Connection Pool as they are independent of |
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
// project/app/Application.php | |
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class Application extends Model | |
{ |