Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* 简单自动部署
* bitbucket POST hook http://horsley:anypassword@your_host/autodeploy.php
*/
if (php_sapi_name() != 'cli') {
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
die('Restricted Area!');
<?php
/**
* 简单自动部署
* bitbucket POST hook http://horsley:anypassword@your_host/autodeploy.php
*/
if (php_sapi_name() != 'cli') {
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
die('Restricted Area!');