diff --git a/README.md b/README.md index 679a154b0..a378ee9c0 100644 --- a/README.md +++ b/README.md @@ -39,5 +39,6 @@ What it sets up * phpsh (for Drush) * phpsh * Vagrant (for managing VirtualBox virtual machines) +* PHP_CodeSniffer (and set to drupal code standards) It should take about 40 minutes for everything to install, depending on your machine. diff --git a/conf_files/ext-imagick.ini b/conf_files/ext-imagick.ini new file mode 100644 index 000000000..db295b743 --- /dev/null +++ b/conf_files/ext-imagick.ini @@ -0,0 +1,2 @@ +[imagick] +extension="/usr/local/Cellar/php53-imagick/3.1.0RC2/imagick.so" diff --git a/conf_files/ext-memcached.ini b/conf_files/ext-memcached.ini new file mode 100644 index 000000000..9cca2d043 --- /dev/null +++ b/conf_files/ext-memcached.ini @@ -0,0 +1,2 @@ +[memcached] +extension="/usr/local/Cellar/php53-memcached/2.1.0/memcached.so" diff --git a/conf_files/ext-pcntl.ini b/conf_files/ext-pcntl.ini new file mode 100644 index 000000000..7af209db4 --- /dev/null +++ b/conf_files/ext-pcntl.ini @@ -0,0 +1,2 @@ +[pcntl] +; extension="/usr/local/Cellar/php53-pcntl/5.3.27/pcntl.so" diff --git a/conf_files/ext-redis.ini b/conf_files/ext-redis.ini new file mode 100644 index 000000000..a54a61a0f --- /dev/null +++ b/conf_files/ext-redis.ini @@ -0,0 +1,2 @@ +[redis] +extension="/usr/local/Cellar/php53-redis/2.2.4/redis.so" diff --git a/conf_files/ext-xdebug.ini b/conf_files/ext-xdebug.ini new file mode 100644 index 000000000..b9aebb47f --- /dev/null +++ b/conf_files/ext-xdebug.ini @@ -0,0 +1,4 @@ +[xdebug] +zend_extension="/usr/local/Cellar/php53-xdebug/2.2.3/xdebug.so" +cli_color=2 +collect_assignments=1 diff --git a/conf_files/ext-xhprof.ini b/conf_files/ext-xhprof.ini new file mode 100644 index 000000000..83ff868ee --- /dev/null +++ b/conf_files/ext-xhprof.ini @@ -0,0 +1,2 @@ +[xhprof] +extension="/usr/local/Cellar/php53-xhprof/254eb24/xhprof.so" diff --git a/conf_files/httpd.conf b/conf_files/httpd.conf index 0b8f32318..5c8336c1d 100644 --- a/conf_files/httpd.conf +++ b/conf_files/httpd.conf @@ -48,9 +48,7 @@ ServerRoot "/usr" # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 - Listen 80 - # # Dynamic Shared Object (DSO) Support @@ -109,12 +107,11 @@ LoadModule speling_module libexec/apache2/mod_speling.so LoadModule alias_module libexec/apache2/mod_alias.so LoadModule rewrite_module libexec/apache2/mod_rewrite.so #LoadModule php5_module libexec/apache2/libphp5.so -LoadModule php5_module /usr/local/Cellar/php/5.3.10/libexec/apache2/libphp5.so +LoadModule php5_module /usr/local/Cellar/php53/5.3.27/libexec/apache2/libphp5.so #Apple specific modules -LoadModule apple_userdir_module libexec/apache2/mod_userdir_apple.so -LoadModule bonjour_module libexec/apache2/mod_bonjour.so +#LoadModule apple_userdir_module libexec/apache2/mod_userdir_apple.so +#LoadModule bonjour_module libexec/apache2/mod_bonjour.so - LoadModule authn_dbm_module libexec/apache2/mod_authn_dbm.so LoadModule authn_anon_module libexec/apache2/mod_authn_anon.so LoadModule authn_dbd_module libexec/apache2/mod_authn_dbd.so @@ -132,20 +129,6 @@ LoadModule proxy_connect_module libexec/apache2/mod_proxy_connect.so LoadModule proxy_ftp_module libexec/apache2/mod_proxy_ftp.so LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so LoadModule status_module libexec/apache2/mod_status.so - - - -LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so -#LoadModule auth_digest_apple_module libexec/apache2/mod_auth_digest_apple.so -#LoadModule encoding_module libexec/apache2/mod_encoding.so -#LoadModule jk_module libexec/apache2/mod_jk.so -LoadModule apple_auth_module libexec/apache2/mod_auth_apple.so -LoadModule spnego_auth_module libexec/apache2/mod_spnego_apple.so -LoadModule apple_digest_module libexec/apache2/mod_digest_apple.so -#LoadModule python_module libexec/apache2/mod_python.so -#LoadModule xsendfile_module libexec/apache2/mod_xsendfile.so -LoadModule apple_status_module libexec/apache2/mod_status_apple.so - # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. @@ -187,51 +170,7 @@ ServerAdmin you@example.com # #ServerName www.example.com:80 - -DocumentRoot /var/empty - - BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On - - - Header add MS-Author-Via "DAV" - RequestHeader set X_FORWARDED_PROTO 'https' env=https - RequestHeader set X_FORWARDED_PROTO 'http' env=!https - - - EncodingEngine on - NormalizeUsername on - DefaultClientEncoding UTF-8 -# Windows XP? - AddClientEncoding "Microsoft-WebDAV-MiniRedir/" MSUTF-8 -# Windows 2K SP2 with .NET - AddClientEncoding "(Microsoft .* DAV\$)" MSUTF-8 -# Windows 2K SP2/Windows XP - AddClientEncoding "(Microsoft .* DAV 1.1)" CP932 -# Windows XP? - AddClientEncoding "Microsoft-WebDAV*" CP932 -# RealPlayer - AddClientEncoding "RMA/*" CP932 -# MacOS X webdavfs - AddClientEncoding "WebDAVFS" UTF-8 -# cadaver - AddClientEncoding "cadaver/" EUC-JP - - - AllowOverride None - Options MultiViews FollowSymlinks - Order allow,deny - Allow from all - Header Set Cache-Control no-cache - -Alias /webmail /usr/share/web/webmail.html -Alias /changepassword /usr/share/web/changepassword.html -Alias /profilemanager /usr/share/web/profilemanager.html -Alias /webcal /usr/share/web/webcal.html - - - - # # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but @@ -303,8 +242,7 @@ DocumentRoot "/Users/@@USER@@/htdocs" DirectoryIndex index.html - - + # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. @@ -610,7 +548,6 @@ LockFile "/private/var/log/apache2/accept.lock" # Language settings Include /private/etc/apache2/extra/httpd-languages.conf - # Multi -language error messages #Include /private/etc/apache2/extra/httpd-multilang-errordoc.conf @@ -618,7 +555,7 @@ Include /private/etc/apache2/extra/httpd-languages.conf Include /private/etc/apache2/extra/httpd-autoindex.conf # User home directories -Include /private/etc/apache2/extra/httpd-userdir.conf +# Include /private/etc/apache2/extra/httpd-userdir.conf # Real-time info on requests and configuration #Include /private/etc/apache2/extra/httpd-info.conf @@ -635,25 +572,8 @@ Include /private/etc/apache2/extra/httpd-manual.conf # Custom config. Include /private/etc/apache2/extra/httpd-extra-config.conf - - # Secure (SSL/TLS) connections - #Include /private/etc/apache2/extra/httpd-ssl.conf - - - - SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown - SSLPassPhraseDialog exec:/etc/apache2/getsslpassphrase - SSLSessionCache shmcb:/var/run/ssl_scache(512000) - SSLSessionCacheTimeout 300 - SSLMutex file:/var/run/ssl_mutex - SSLRandomSeed startup builtin - SSLRandomSeed connect builtin - AddType application/x-x509-ca-cert crt - AddType application/x-pkcs7-crl crl - - JKWorkersFile /etc/apache2/workers.properties @@ -668,17 +588,5 @@ Include /private/etc/apache2/extra/httpd-extra-config.conf DirectoryIndex index.html index.php - - Include /etc/apache2/other/*.conf - - - - Include /etc/apache2/sites/*.conf - - - Include /etc/apache2/sites/virtual_host_global.conf - Include /etc/apache2/sites/*_.conf - Include /etc/apache2/sites/*__shadow.conf - - +Include /etc/apache2/other/*.conf diff --git a/conf_files/my.cnf b/conf_files/my.cnf index f6520b948..145d1ba64 100644 --- a/conf_files/my.cnf +++ b/conf_files/my.cnf @@ -24,7 +24,7 @@ slow_query_log=OFF max_connections=400 # Don't run out of file descriptors! -open_files_limit=32768 +open_files_limit=16384 # If you set the query cache too high, your server risks severly slowing down and taking tens of seconds after an INSERT due to query cache mutex contention. query_cache_limit=1M diff --git a/conf_files/php.ini b/conf_files/php.ini index ef7de3eb7..85434b78f 100644 --- a/conf_files/php.ini +++ b/conf_files/php.ini @@ -19,7 +19,7 @@ ; See the PHP docs for more specific information. ; http://php.net/configuration.file -; The syntax of the file is extremely simple. Whitespace and Lines +; The syntax of the file is extremely simple. Whitespace and lines ; beginning with a semicolon are silently ignored (as you probably guessed). ; Section headers (e.g. [Foo]) are also silently ignored, even though ; they might mean something in the future. @@ -419,6 +419,10 @@ disable_classes = ; http://php.net/realpath-cache-ttl ;realpath_cache_ttl = 120 +; Enables or disables the circular reference collector. +; http://php.net/zend.enable-gc +zend.enable_gc = On + ;;;;;;;;;;;;;;;;; ; Miscellaneous ; ;;;;;;;;;;;;;;;;; @@ -437,7 +441,7 @@ expose_php = On ; Maximum execution time of each script, in seconds ; http://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI -max_execution_time = 30 +max_execution_time = 180 ; Maximum amount of time each script may spend parsing request data. It's a good ; idea to limit this time on productions servers in order to eliminate unexpectedly @@ -447,15 +451,18 @@ max_execution_time = 30 ; Development Value: 60 (60 seconds) ; Production Value: 60 (60 seconds) ; http://php.net/max-input-time -max_input_time = 60 +max_input_time = 180 ; Maximum input variable nesting level ; http://php.net/max-input-nesting-level ;max_input_nesting_level = 64 +; How many GET/POST/COOKIE input variables may be accepted +; max_input_vars = 1000 + ; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit -memory_limit = 128M +memory_limit = 512M ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Error handling and logging ; @@ -477,7 +484,7 @@ memory_limit = 128M ; development and early testing. ; ; Error Level Constants: -; E_ALL - All errors and warnings (includes E_STRICT as of PHP 6.0.0) +; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) ; E_ERROR - fatal run-time errors ; E_RECOVERABLE_ERROR - almost fatal run-time errors ; E_WARNING - run-time warnings (non-fatal errors) @@ -529,7 +536,7 @@ error_reporting = E_ALL | E_STRICT ; Development Value: On ; Production Value: Off ; http://php.net/display-errors -display_errors = Off +display_errors = On ; The display of errors which occur during PHP's startup sequence are handled ; separately from display_errors. PHP's default behavior is to suppress those @@ -540,7 +547,7 @@ display_errors = Off ; Development Value: On ; Production Value: Off ; http://php.net/display-startup-errors -display_startup_errors = Off +display_startup_errors = On ; Besides displaying errors, PHP can also log errors to locations such as a ; server-specific log, STDERR, or a location specified by the error_log @@ -1235,7 +1242,7 @@ mysql.default_password = ; Maximum time (in seconds) for connect timeout. -1 means no limit ; http://php.net/mysql.connect-timeout -mysql.connect_timeout = 60 +mysql.connect_timeout = 180 ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and ; SQL-Errors will be displayed. @@ -1296,12 +1303,12 @@ mysqli.default_pw = mysqli.reconnect = Off [mysqlnd] -; Enable / Disable collection of general statstics by mysqlnd which can be +; Enable / Disable collection of general statistics by mysqlnd which can be ; used to tune and monitor MySQL operations. ; http://php.net/mysqlnd.collect_statistics mysqlnd.collect_statistics = On -; Enable / Disable collection of memory usage statstics by mysqlnd which can be +; Enable / Disable collection of memory usage statistics by mysqlnd which can be ; used to tune and monitor MySQL operations. ; http://php.net/mysqlnd.collect_memory_statistics mysqlnd.collect_memory_statistics = Off @@ -1703,7 +1710,7 @@ mssql.secure_connection = Off ;mssql.max_procs = -1 ; Specify client character set. -; If empty or not set the client charset from freetds.comf is used +; If empty or not set the client charset from freetds.conf is used ; This is only used when compiled with FreeTDS ;mssql.charset = "ISO-8859-1" @@ -1896,35 +1903,6 @@ ldap.max_links = -1 [dba] ;dba.default_handler= -[xdebug] -;zend_extension="/usr/local/Cellar/php/5.3.6/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so" -;extension="xdebug.so" -extension="xdebug.so" -xdebug.remote_enable=on -xdebug.remote_handler=dbgp -xdebug.remote_host=127.0.0.1 -xdebug.remote_port=9000 -xdebug.idekey="netbeans-xdebug" - -[apc] -extension="apc.so" -apc.shm_size=64M - -[memcached] -extension="memcached.so" - -[xhprof] -extension="xhprof.so" - -[imagemagick] -extension="imagemagick.so" - -[redis] -extension="redis.so" - -[pcntl] -extension="pcntl.so" - ; Local Variables: ; tab-width: 4 ; End: diff --git a/mac b/mac old mode 100644 new mode 100755 index e426a2897..c08b882a2 --- a/mac +++ b/mac @@ -23,7 +23,7 @@ type -p gcc > /dev/null || { echo "Installing Homebrew, a good OS X package manager." need_sudo - /usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)" + ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)" brew update echo "Installing GNU userland tools." @@ -36,7 +36,7 @@ echo "Installing a recent version of curl and wget for HTTP requests." brew install curl wget echo "Installing MySQL, our standard database server." - curl -fsSL https://raw.github.com/phase2/laptop/master/conf_files/my.cnf > /tmp/my.cnf + curl -fsSL https://raw.github.com/srjosh/laptop/master/conf_files/my.cnf > /tmp/my.cnf need_sudo sudo mv /tmp/my.cnf /etc/my.cnf brew install mysql @@ -51,29 +51,36 @@ echo "Installing a test phpinfo.php in the new DocumentRoot." } echo "Installing Homebrew's PHP, MSSQL, MySQL and internationalization support." - brew install https://raw.github.com/josegonzalez/homebrew-php/f09dc1288d839c8d7118a431360d80cd7e9419d2/Formula/php.rb --with-mysql --with-intl - curl -fsSL https://raw.github.com/phase2/laptop/master/conf_files/httpd.conf | sed -e "s/@@USER@@/$USER/" > /tmp/httpd.conf - curl -fsSL https://raw.github.com/phase2/laptop/master/conf_files/httpd-extra-config.conf > /tmp/httpd-extra-config.conf - curl -fsSL https://raw.github.com/phase2/laptop/master/conf_files/httpd-vhosts.conf | sed -e "s/@@USER@@/$USER/" > /tmp/httpd-vhosts.conf + brew tap josegonzalez/php + brew install php53 --with-mysql --with-intl + curl -fsSL https://raw.github.com/srjosh/laptop/master/conf_files/httpd.conf | sed -e "s/@@USER@@/$USER/" > /tmp/httpd.conf + curl -fsSL https://raw.github.com/srjosh/laptop/master/conf_files/httpd-extra-config.conf > /tmp/httpd-extra-config.conf + curl -fsSL https://raw.github.com/srjosh/laptop/master/conf_files/httpd-vhosts.conf | sed -e "s/@@USER@@/$USER/" > /tmp/httpd-vhosts.conf need_sudo sudo mv /tmp/httpd.conf /etc/apache2/httpd.conf sudo mv /tmp/httpd-extra-config.conf /etc/apache2/extra/httpd-extra-config.conf sudo mv /tmp/httpd-vhosts.conf /etc/apache2/extra/httpd-vhosts.conf - chmod -R ug+w /usr/local/Cellar/php/5.3.10/lib/php + chmod -R ug+w /usr/local/Cellar/php/5.3.27/lib/php pear config-set php_ini /usr/local/etc/php.ini echo "Installing PHP extensions and a default configuration." - brew install https://raw.github.com/josegonzalez/homebrew-php/master/Formula/apc-php.rb - brew install https://raw.github.com/josegonzalez/homebrew-php/master/Formula/memcached-php.rb - brew install https://raw.github.com/josegonzalez/homebrew-php/master/Formula/imagick-php.rb - brew install https://raw.github.com/josegonzalez/homebrew-php/master/Formula/pcntl-php.rb - brew install https://raw.github.com/josegonzalez/homebrew-php/master/Formula/xdebug-php.rb - brew install https://raw.github.com/josegonzalez/homebrew-php/master/Formula/xhprof-php.rb - brew install https://raw.github.com/josegonzalez/homebrew-php/master/Formula/redis-php.rb - brew install https://raw.github.com/josegonzalez/homebrew-php/master/Formula/phpsh.rb - curl -fsSL https://raw.github.com/phase2/laptop/master/conf_files/php.ini > /tmp/php.ini + brew install php53-memcached php53-imagick php53-pcntl php53-xdebug php53-xhprof php53-redis phpsh + curl -fsSL https://raw.github.com/srjosh/laptop/master/conf_files/php.ini > /tmp/php.ini mv /tmp/php.ini /usr/local/etc/php.ini + curl -fsSL https://raw.github.com/srjosh/laptop/master/conf_files/ext-imagick.ini > /tmp/ext-imagick.ini + mv /tmp/ext-imagick.ini /usr/local/etc/php/5.3/conf.d + curl -fsSL https://raw.github.com/srjosh/laptop/master/conf_files/ext-memcached.ini > /tmp/ext-memcached.ini + mv /tmp/ext-memcached.ini /usr/local/etc/php/5.3/conf.d + curl -fsSL https://raw.github.com/srjosh/laptop/master/conf_files/ext-pcntl.ini > /tmp/ext-pcntl.ini + mv /tmp/ext-pcntl.ini /usr/local/etc/php/5.3/conf.d + curl -fsSL https://raw.github.com/srjosh/laptop/master/conf_files/ext-redis.ini > /tmp/ext-redis.ini + mv /tmp/ext-redis.ini /usr/local/etc/php/5.3/conf.d + curl -fsSL https://raw.github.com/srjosh/laptop/master/conf_files/ext-xdebug.ini > /tmp/ext-xdebug.ini + mv /tmp/ext-xdebug.ini /usr/local/etc/php/5.3/conf.d + curl -fsSL https://raw.github.com/srjosh/laptop/master/conf_files/ext-xhprof.ini > /tmp/ext-xhprof.ini + mv /tmp/ext-xhprof.ini /usr/local/etc/php/5.3/conf.d + open /System/Library/PreferencePanes/SharingPref.prefPane osascript -e 'tell app "System Events" to activate' osascript -e 'tell app "System Events" to display dialog "To prevent issues with Apache, please turn on Web Sharing now.\n\nClick \"OK\" once it has started to view the phpinfo() page." buttons {"Cancel", "OK"} default button 2' @@ -92,13 +99,21 @@ if [ -f $brew_prefix/etc/bash_completion ]; then fi # Put homebrew PHP ahead in $PATH a la http://justinhileman.info/article/reinstalling-php-53-on-mac-os-x/ -export PATH=$brew_prefix/sbin:$brew_prefix/bin:$PATH' > $HOME/.bashrc +export PATH=$brew_prefix/sbin:$brew_prefix/bin:$PATH + +# If PEAR is installed, put its bin dir ahead of $PATH. +type -P pear > /dev/null && export PATH=$(pear config-get bin_dir):$PATH + +# Always set up $HOME/bin in the front of $PATH. +export PATH=$HOME/bin:$PATH' > $HOME/.bashrc echo ' if [ -f ~/.bashrc ]; then source ~/.bashrc fi' > $HOME/.bash_profile +source ~/.bashrc + echo "Installing Drush, because we <3 Drupal and the shell." pear channel-discover pear.drush.org pear install drush/drush @@ -118,12 +133,19 @@ echo "Installing lots of Drush coolness." drush dl drush-vagrant echo "Downloading VirtualBox for virtualization." - curl -fsSL http://download.virtualbox.org/virtualbox/4.1.12/VirtualBox-4.1.12-77245-OSX.dmg > $HOME/Downloads/VirtualBox-4.1.12-77245-OSX.dmg - open $HOME/Downloads/VirtualBox-4.1.12-77245-OSX.dmg + curl -fsSL http://download.virtualbox.org/virtualbox/4.3.0/VirtualBox-4.3.0-89960-OSX.dmg > $HOME/Downloads/VirtualBox-4.3.0-89960-OSX.dmg + open $HOME/Downloads/VirtualBox-4.3.0-89960-OSX.dmg echo "Downloading Vagrant for virtualized dev environments." - curl -fsSL http://files.vagrantup.com/packages/41445466ee4d376601fd8d0c6a5e3af61d32f131/Vagrant-1.0.2.dmg > $HOME/Downloads/Vagrant-1.0.2.dmg - open $HOME/Downloads/Vagrant-1.0.2.dmg + curl -fsSL http://files.vagrantup.com/packages/a40522f5fabccb9ddabad03d836e120ff5d14093/Vagrant-1.3.5.dmg > $HOME/Downloads/Vagrant-1.3.5.dmg + open $HOME/Downloads/Vagrant-1.3.5.dmg + +echo "Installing PHP_CodeSniffer, and setting to drupal code standards." + pear install PHP_CodeSniffer + curl -fsSl http://ftp.drupal.org/files/projects/coder-7.x-2.x-dev.tar.gz > /tmp/coder-7.x-2.x-dev.tar.gz + open /tmp/coder-7.x-2.x-dev.tar.gz + cp -R /tmp/coder/coder_sniffer/Drupal $(brew --prefix)/Cellar/php53/5.3.27/lib/php/PHP/CodeSniffer/Standards/Drupal + phpcs --config-set default_standard Drupal osascript -e 'tell app "System Events" to activate' osascript -e 'tell app "System Events" to display dialog "Please install Vagrant, install VirtualBox and then restart.\n\nWelcome to Phase2!" buttons {"OK"}'