Permalink
Browse files

Adding 'final' version

  • Loading branch information...
1 parent e21a967 commit dbf07581a91307fdd9492f75c8a09b331fb1135a @ccoenraets committed Jan 30, 2012
Showing with 4,887 additions and 0 deletions.
  1. +10 −0 final/api/.htaccess
  2. +45 −0 final/api/Slim/Exception/Pass.php
  3. +46 −0 final/api/Slim/Exception/RequestSlash.php
  4. +43 −0 final/api/Slim/Exception/Stop.php
  5. +222 −0 final/api/Slim/Http/Cookie.php
  6. +401 −0 final/api/Slim/Http/CookieJar.php
  7. +405 −0 final/api/Slim/Http/Request.php
  8. +321 −0 final/api/Slim/Http/Response.php
  9. +131 −0 final/api/Slim/Http/Uri.php
  10. +155 −0 final/api/Slim/Log.php
  11. +200 −0 final/api/Slim/Logger.php
  12. +398 −0 final/api/Slim/Route.php
  13. +203 −0 final/api/Slim/Router.php
  14. +192 −0 final/api/Slim/Session/Flash.php
  15. +125 −0 final/api/Slim/Session/Handler.php
  16. +71 −0 final/api/Slim/Session/Handler/Cookies.php
  17. +1,174 −0 final/api/Slim/Slim.php
  18. +167 −0 final/api/Slim/View.php
  19. +131 −0 final/api/index.php
  20. +80 −0 final/css/styles.css
  21. +32 −0 final/index.html
  22. +64 −0 final/js/main.js
  23. +18 −0 final/js/models/winemodel.js
  24. +35 −0 final/js/utils.js
  25. +21 −0 final/js/views/header.js
  26. +63 −0 final/js/views/winedetails.js
  27. +36 −0 final/js/views/winelist.js
  28. +33 −0 final/lib/backbone-min.js
  29. +4 −0 final/lib/jquery-1.7.1.min.js
  30. +31 −0 final/lib/underscore-min.js
  31. BIN final/pics/block_nine.jpg
  32. BIN final/pics/bodega_lurton.jpg
  33. BIN final/pics/bouscat.jpg
  34. BIN final/pics/domaine_serene.jpg
  35. BIN final/pics/ex_umbris.jpg
  36. BIN final/pics/generic.jpg
  37. BIN final/pics/lan_rioja.jpg
  38. BIN final/pics/le_doyenne.jpg
  39. BIN final/pics/lurton-pinot-gris.jpg
  40. BIN final/pics/margerum.jpg
  41. BIN final/pics/morizottes.jpg
  42. BIN final/pics/rex_hill.jpg
  43. BIN final/pics/saint_cosme.jpg
  44. BIN final/pics/viticcio.jpg
  45. +1 −0 final/tpl/header.html
  46. +28 −0 final/tpl/wine-details.html
  47. +1 −0 final/tpl/wine-list-item.html
View
@@ -0,0 +1,10 @@
+RewriteEngine On
+
+# Some hosts may require you to use the `RewriteBase` directive.
+# If you need to use the `RewriteBase` directive, it should be the
+# absolute physical path to the directory that contains this htaccess file.
+#
+# RewriteBase /
+
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^(.*)$ index.php [QSA,L]
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Slim - a micro PHP 5 framework
+ *
+ * @author Josh Lockhart <info@joshlockhart.com>
+ * @copyright 2011 Josh Lockhart
+ * @link http://www.slimframework.com
+ * @license http://www.slimframework.com/license
+ * @version 1.5.0
+ *
+ * MIT LICENSE
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * Pass Exception
+ *
+ * This Exception will cause the Router::dispatch method
+ * to skip the current matching route and continue to the next
+ * matching route. If no subsequent routes are found, a
+ * HTTP 404 Not Found response will be sent to the client.
+ *
+ * @package Slim
+ * @author Josh Lockhart <info@joshlockhart.com>
+ * @since Version 1.0
+ */
+class Slim_Exception_Pass extends Exception {}
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Slim - a micro PHP 5 framework
+ *
+ * @author Josh Lockhart <info@joshlockhart.com>
+ * @copyright 2011 Josh Lockhart
+ * @link http://www.slimframework.com
+ * @license http://www.slimframework.com/license
+ * @version 1.5.0
+ *
+ * MIT LICENSE
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * Request Slash Exception
+ *
+ * This Exception is thrown when Slim detects a matching route
+ * (defined with a trailing slash) and the HTTP request
+ * matches the route but does not have a trailing slash. This
+ * exception will be caught in `Slim::run` and trigger a 301 redirect
+ * to the same resource URI with a trailing slash.
+ *
+ * @package Slim
+ * @author Josh Lockhart <info@joshlockhart.com>
+ * @since Version 1.0
+ */
+class Slim_Exception_RequestSlash extends Exception {}
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Slim - a micro PHP 5 framework
+ *
+ * @author Josh Lockhart <info@joshlockhart.com>
+ * @copyright 2011 Josh Lockhart
+ * @link http://www.slimframework.com
+ * @license http://www.slimframework.com/license
+ * @version 1.5.0
+ *
+ * MIT LICENSE
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * Stop Exception
+ *
+ * This Exception is thrown when the Slim application needs to abort
+ * processing and return control flow to the outer PHP script.
+ *
+ * @package Slim
+ * @author Josh Lockhart <info@joshlockhart.com>
+ * @since Version 1.0
+ */
+class Slim_Exception_Stop extends Exception {}
@@ -0,0 +1,222 @@
+<?php
+/**
+ * Slim - a micro PHP 5 framework
+ *
+ * @author Josh Lockhart <info@joshlockhart.com>
+ * @copyright 2011 Josh Lockhart
+ * @link http://www.slimframework.com
+ * @license http://www.slimframework.com/license
+ * @version 1.5.0
+ *
+ * MIT LICENSE
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * Cookie
+ *
+ * Object-oriented representation of a Cookie to be sent in an HTTP response
+ *
+ * @package Slim
+ * @author Josh Lockhart <info@joshlockhart.com>
+ * @since Version 1.0
+ */
+class Slim_Http_Cookie {
+
+ /**
+ * @var string
+ */
+ protected $name;
+
+ /**
+ * @var string
+ */
+ protected $value;
+
+ /**
+ * @var int UNIX timestamp
+ */
+ protected $expires;
+
+ /**
+ * @var string
+ */
+ protected $path;
+
+ /**
+ * @var string
+ */
+ protected $domain;
+
+ /**
+ * @var bool
+ */
+ protected $secure;
+
+ /**
+ * @var bool
+ */
+ protected $httponly;
+
+ /**
+ * Constructor
+ * @param string $name The cookie name
+ * @param string $value The cookie value
+ * @param mixed $time The duration of the cookie;
+ * If integer, should be a UNIX timestamp;
+ * If string, converted to UNIX timestamp with `strtotime`;
+ * @param string $path The path on the server in which the cookie will be available on
+ * @param string $domain The domain that the cookie is available to
+ * @param bool $secure Indicates that the cookie should only be transmitted over a secure
+ * HTTPS connection from the client
+ * @param bool $httponly When TRUE the cookie will be made accessible only through the HTTP protocol
+ * @return void
+ */
+ public function __construct( $name, $value = null, $expires = 0, $path = null, $domain = null, $secure = false, $httponly = false ) {
+ $this->setName($name);
+ $this->setValue($value);
+ $this->setExpires($expires);
+ $this->setPath($path);
+ $this->setDomain($domain);
+ $this->setSecure($secure);
+ $this->setHttpOnly($httponly);
+ }
+
+ /**
+ * Get cookie name
+ * @return string
+ */
+ public function getName() {
+ return $this->name;
+ }
+
+ /**
+ * Set cookie name
+ * @param string $name
+ * @return void
+ */
+ public function setName( $name ) {
+ $this->name = (string)$name;
+ }
+
+ /**
+ * Get cookie value
+ * @return string
+ */
+ public function getValue() {
+ return $this->value;
+ }
+
+ /**
+ * Set cookie value
+ * @param string $value
+ * @return void
+ */
+ public function setValue( $value ) {
+ $this->value = (string)$value;
+ }
+
+ /**
+ * Get cookie expiration time
+ * @return int UNIX timestamp
+ */
+ public function getExpires() {
+ return $this->expires;
+ }
+
+ /**
+ * Set cookie expiration time
+ * @param string|int Cookie expiration time
+ * @return void
+ */
+ public function setExpires( $time ) {
+ $this->expires = is_string($time) ? strtotime($time) : (int)$time;
+ }
+
+ /**
+ * Get cookie path
+ * @return string
+ */
+ public function getPath() {
+ return $this->path;
+ }
+
+ /**
+ * Set cookie path
+ * @param string $path
+ * @return void
+ */
+ public function setPath( $path ) {
+ $this->path = (string)$path;
+ }
+
+ /**
+ * Get cookie domain
+ * @return string
+ */
+ public function getDomain() {
+ return $this->domain;
+ }
+
+ /**
+ * Set cookie domain
+ * @param string $domain
+ * @return void
+ */
+ public function setDomain( $domain ) {
+ $this->domain = (string)$domain;
+ }
+
+ /**
+ * Is cookie sent only if SSL/HTTPS is used?
+ * @return bool
+ */
+ public function getSecure() {
+ return $this->secure;
+ }
+
+ /**
+ * Set whether cookie is sent only if SSL/HTTPS is used
+ * @param bool $secure
+ * @return void
+ */
+ public function setSecure( $secure ) {
+ $this->secure = (bool)$secure;
+ }
+
+ /**
+ * Is cookie sent with HTTP protocol only?
+ * @return bool
+ */
+ public function getHttpOnly() {
+ return $this->httponly;
+ }
+
+ /**
+ * Set whether cookie is sent with HTTP protocol only
+ * @param bool $httponly
+ * @return void
+ */
+ public function setHttpOnly( $httponly ) {
+ $this->httponly = (bool)$httponly;
+ }
+
+}
Oops, something went wrong.

0 comments on commit dbf0758

Please sign in to comment.