This file contains hidden or 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
worker_processes 1; | |
# pid of nginx master process | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
This file contains hidden or 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
cd /usr/local/etc/nginx/ | |
mkdir sites-available sites-enabled |
This file contains hidden or 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
brew install nginx |
This file contains hidden or 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 // this php tag is only included for gist to detect the file and do syntax coloring :) | |
// Call default or custom access callback | |
if (call_user_func_array($method['access callback'], $access_arguments) != TRUE) { | |
return services_error(t('Access denied'), 401); | |
} |
This file contains hidden or 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 | |
// let's turn on error reporting | |
ini_set("display_errors", 1); | |
// include the XMLRPC library | |
// I used the one by keithdevens.com/software/xmlrpc | |
// You are free to use any library, but then the call will be different | |
// | |
// Note: this library has one big downside, it throws a lot of warnings in PHP 5, since | |
// it has some deprecated calls. I just hide warnings on my production site, so that was not |
This file contains hidden or 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
<!DOCTYPE html> | |
<head> | |
<title>Drupalconnect frontend</title> | |
<style type="text/css"> | |
* { padding: 0; margin: 0; } | |
html { font-family: "Lucida grande", arial, sans-serif; color: #222;} | |
body { width: 800px; margin: 0 auto; } | |
h1 { margin: 80px 0; } | |
h3 { margin-bottom: 10px; } |
This file contains hidden or 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 | |
/* | |
* Implementation of hook_service() | |
* Required by all server modules | |
* Returns array defining all the methods available in the service | |
*/ | |
function drupalconnect_service() { | |
return array( | |
array( |
This file contains hidden or 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 | |
/* | |
* Implementation of hook_disable() | |
* Perform necessary actions before module is disabled. (like clear the drupalconnect:methods cache) | |
*/ | |
function drupalconnect_disable() { | |
cache_clear_all('drupalconnect:methods', 'cache'); | |
} | |
/* | |
* Implementation of hook_enable() |
This file contains hidden or 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
; $Id: drupalconnect.info, v 0.1 $ | |
name = Drupal Connect | |
description = Provide a service for an external site | |
package = Custom modules | |
core = 6.x |
This file contains hidden or 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
#!/bin/sh | |
set -o errexit | |
nopass=0 | |
if [ $# -eq 0 ]; then | |
echo "-----> No parameters passed, assuming username 'root' and empty password" | |
DBS=`mysql -uroot -e "show databases;"` | |
nopass=1 |