File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Potential folders that might show up here as accidental script output.
2+ composer.lock
23backups
34tmp
5+ bin
6+ /vendor /
47
58# OS generated files
69.DS_Store
1114Icon ?
1215ehthumbs.db
1316Thumbs.db
14-
15- /vendor /
Original file line number Diff line number Diff line change @@ -15,28 +15,31 @@ This collection of scripts is intended to provide consistency and shortcuts for
1515The following dependencies are assumed to be available on the target system and available in the default ` PATH ` .
1616
1717* ` bash `
18- * ` php `
1918* ` composer `
20- * ` phpcs `
21- * ` phpunit `
22- * ` mysqldump `
2319* ` git `
24- * ` zip `
2520* ` mail `
26- * ` bin/phpdoc.php ` (composer installed)
27- * ` bin/cake ` (composer installed)
28-
21+ * ` mysqldump `
22+ * ` pear `
23+ * ` php `
2924* ` realpath ` (not available by default on OS X)
3025* ` readlink `
26+ * ` zip `
3127
28+ Additionally, some scripts expect additional tools that should be automatically installed as composer dependencies to _ this_ package:
29+
30+ * ` bin/phpcs `
31+ * ` bin/phpunit `
32+ * ` bin/phpdoc.php `
33+ * ` bin/cake ` (composer installed ** by target project** )
3234
3335If these items are not available, some scripts may not function as expected.
3436
37+
3538## Installation ##
3639
3740** WARNING!** These scripts are currently only compatible with Cake 2.x. Don't try to use them on a 1.x project.
3841
39- ## composer ##
42+ ### composer # ##
4043
4144Your project's own ` composer.json ` file should look something like this:
4245
@@ -54,7 +57,7 @@ Then run `composer install` to pull this repo into your project. A `bin/` folder
5457
5558** Note** : The ` bin-dir ` is non-standard and may cause conflicts with other composer packages that install "binaries". These scripts are all expect to live in ` PROJECT_ROOT/bin ` though so don't expect anything to work if you forgo the ` bin-dir ` setting in your project.
5659
57- ## git submodule ##
60+ ### git submodule # ##
5861
5962(This is the old method and will eventually be retired.)
6063
Original file line number Diff line number Diff line change 99 }
1010 ],
1111 "require" : {
12- "php" : " >=5.3.0"
12+ "php" : " >=5.3.0" ,
13+ "phpunit/phpunit" : " 3.7.*" ,
14+ "phpdocumentor/phpdocumentor" : " 2.*@beta" ,
15+ "squizlabs/php_codesniffer" : " 1.*" ,
16+ "loadsys/loadsys_codesniffer" : " 0.*"
1317 },
1418 "config" : {
1519 "bin-dir" : " bin"
4549 " pear-package-installed-dumb" ,
4650 " rename-empty" ,
4751 " run-codesniffer" ,
52+ " run-in-vagrant" ,
4853 " run-tests" ,
4954 " set-configs" ,
5055 " set-owner" ,
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ if [ -e "$COMPOSER_CONFIG_FILE" ]; then
6060 else
6161 echo " ## Found composer at: ${COMPOSER} "
6262 " $COMPOSER " install --no-interaction
63+ " $COMPOSER " dumpautoload --optimize
6364 fi
6465fi
6566
Original file line number Diff line number Diff line change @@ -66,4 +66,10 @@ $PHPCS -p --extensions=php --standard=CakePHP ${COVERAGE} ${SNIFF_FOLDERS[@]}
6666if [ $SAVE_REPORTS ] && [ $? -eq 0 ]; then
6767 echo " ## Full report created at: ${FULL_REPORT_FILE} "
6868 echo " ## Summary report created at: ${SUMMARY_REPORT_FILE} "
69- fi
69+ fi
70+
71+
72+ # @TODO: Make use of new Loadsys code standard.
73+ # Ref: https://github.com/loadsys/loadsys_codesniffer
74+ # Example usage:
75+ # bin/phpcs --standard=Vendor/loadsys/loadsys_codesniffer/Loadsys --report-summary -p --extensions=php Controller/ Model/ View/ Lib/
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # ---------------------------------------------------------------------
4+ usage ()
5+ {
6+ cat << EOT
7+
8+ ${0##*/ }
9+ Executes the provided arguments inside the current vagrant VM,
10+ if present. Otherwise just executes the arguments. The entire
11+ command string MUST be quoted. All paths used must be relative
12+ to the root project folder shared between the host and VM.
13+
14+ Usage:
15+ bin/${0##*/ } "Command [--with args]"
16+
17+ EOT
18+
19+ exit 0
20+ }
21+ if [ " $1 " = ' -h' ]; then
22+ usage
23+ fi
24+
25+ echo " @TODO: WIP"
26+ exit 1
27+
28+
29+ if mount | grep -q ' ^/vagrant' ; then
30+ vagrant ssh -c " cd /vagrant; $@ "
31+ else
32+ eval " $@ "
33+ fi
Original file line number Diff line number Diff line change 3939fi
4040
4141bin/clear-cache
42- if [ -e ' .vagrant' ]; then
43- vagrant ssh -c " cd /var/www; Console/cake test app $TESTCASE --configuration=" ${PHPUNIT_CONFIG} " " $@ " "
44- else
42+ if mount | grep -q ' ^/vagrant' ; then
4543 Console/cake test app $TESTCASE --configuration=" ${PHPUNIT_CONFIG} " " $@ "
44+ else
45+ vagrant ssh -c " cd /var/www; Console/cake test app $TESTCASE --configuration=" ${PHPUNIT_CONFIG} " " $@ " "
4646fi
You can’t perform that action at this time.
0 commit comments