Skip to content

Shahrzad-Rafatnia/MySmartHome

Repository files navigation

SmartHome

Smart Home Sensor Visualization Project

Setup

NEW: Try first-time-setup.sh. The following explains what that script does.

PHP

We're using the Composer dependency manager to automatically track PHP library dependencies (for example, PHPUnit, Twig, plus any other PHP libraries we may want). The link given should give you enough information for how to setup Composer on your machine. Essentially, it's just:

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

Then in www/ simply:

composer install --dev

To install all dependencies.

JavaScript

JavaScript modules are cloned into www/js/ using git-submodules.

The first time you pull, you must use:

git submodule init
git submodule update

...to get the latest versions of all submodules. When somebody changes the submodule version (you can check this using git submodule status), you can update again using:

git submodule update

PHP Tests

For now, I'm just dumping them all in the test/ directory. Check out DummyTest.php to give you the template for all of your unit tests. Essentially, just include define a subclass of PHPUnit_Framework_TestCase. To run it, you need the phpunit exeucturable somewhere in your path. Then, you can simply run the test in the command line (e.g., phpunit tests/DummyTest.php).

EXPERIMENTAL: r.js

We can use r.js to optimize the ENTIRE web site -- basically, it merges and minifies a bunch of JavaScript and CSS.

This would recreate the www/ directory into a build/ directory.

It's kind of crazy, and I wouldn't recommend trying it right now, but it's all set up and pretty nifty.

Simply do this in the root repository directory:

r.js -o www/js/app.build.js

And a clone of the www/ directory will be made called build/ that will contain all of the uglified JavaScript and CSS sources.

Credits

Using the EvalMath PHP class by Miles Kaufmann.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 11