\n";
+ }
+ return $string;
+}
+
+
+/**
+ * Write to the application log file using error_log
+ *
+ * @param string $message to save
+ * @return bool
+ */
+function log_message($message)
+{
+ $path = SP . 'Storage/Log/' . date('Y-m-d') . '.log';
+
+ // Append date and IP to log message
+ return error_log(date('H:i:s ') . getenv('REMOTE_ADDR') . " $message\n", 3, $path);
+}
+
+
+/**
+ * Send a HTTP header redirect using "location" or "refresh".
+ *
+ * @param string $url the URL string
+ * @param int $c the HTTP status code
+ * @param string $method either location or redirect
+ */
+function redirect($url = NULL, $code = 302, $method = 'location')
+{
+ if(strpos($url, '://') === FALSE)
+ {
+ $url = site_url($url);
+ }
+
+ header($method == 'refresh' ? "Refresh:0;url = $url" : "Location: $url", TRUE, $code);
+}
+
+
+/**
+ * Return the full URL to a location on this site
+ *
+ * @param string $path to use or FALSE for current path
+ * @param array $params to append to URL
+ * @return string
+ */
+function site_url($path = NULL, array $params = NULL)
+{
+ // In PHP 5.4, http_build_query will support RFC 3986
+ return DOMAIN . ($path ? '/'. trim($path, '/') : PATH)
+ . ($params ? '?'. str_replace('+', '%20', http_build_query($params, TRUE, '&')) : '');
+}
+
+
+/**
+ * Return a SQLite/MySQL/PostgreSQL datetime string
+ *
+ * @param int $timestamp
+ */
+function sql_date($timestamp = NULL)
+{
+ return date('Y-m-d H:i:s', $timestamp ?: time());
+}
+
+
+/**
+ * Color output text for the CLI
+ *
+ * @param string $text to color
+ * @param string $color of text
+ * @param string $background color
+ */
+function colorize($text, $color, $bold = FALSE)
+{
+ // Standard CLI colors
+ $colors = array_flip(array(30 => 'gray', 'red', 'green', 'yellow', 'blue', 'purple', 'cyan', 'white', 'black'));
+
+ // Escape string with color information
+ return"\033[" . ($bold ? '1' : '0') . ';' . $colors[$color] . "m$text\033[0m";
+}
+
+
+/**
+ * Make a request to the given URL using cURL.
+ *
+ * @param string $url to request
+ * @param array $options for cURL object
+ * @return object
+ */
+function curl_request($url, array $options = NULL)
+{
+ $ch = curl_init($url);
+
+ $defaults = array(
+ CURLOPT_HEADER => 0,
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_TIMEOUT => 5,
+ );
+
+ // Connection options override defaults if given
+ curl_setopt_array($ch, (array) $options + $defaults);
+
+ // Create a response object
+ $object = new stdClass;
+
+ // Get additional request info
+ $object->response = curl_exec($ch);
+ $object->error_code = curl_errno($ch);
+ $object->error = curl_error($ch);
+ $object->info = curl_getinfo($ch);
+
+ curl_close($ch);
+
+ return $object;
+}
+
+
+/**
+ * Create a RecursiveDirectoryIterator object
+ *
+ * @param string $dir the directory to load
+ * @param boolean $recursive to include subfolders
+ * @return object
+ */
+function directory($dir, $recursive = TRUE)
+{
+ $i = new \RecursiveDirectoryIterator($dir);
+
+ if( ! $recursive) return $i;
+
+ return new \RecursiveIteratorIterator($i, \RecursiveIteratorIterator::SELF_FIRST);
+}
+
+
+/**
+ * Make sure that a directory exists and is writable by the current PHP process.
+ *
+ * @param string $dir the directory to load
+ * @param string $chmod value as octal
+ * @return boolean
+ */
+function directory_is_writable($dir, $chmod = 0755)
+{
+ // If it doesn't exist, and can't be made
+ if(! is_dir($dir) AND ! mkdir($dir, $chmod, TRUE)) return FALSE;
+
+ // If it isn't writable, and can't be made writable
+ if(! is_writable($dir) AND !chmod($dir, $chmod)) return FALSE;
+
+ return TRUE;
+}
+
diff --git a/Public/Admin/CSS/admin.css b/Public/Admin/CSS/admin.css
deleted file mode 100755
index deaa2c1..0000000
--- a/Public/Admin/CSS/admin.css
+++ /dev/null
@@ -1,212 +0,0 @@
-/* Typography - Choose your font and size (base.css default is 16px) */
-body
-{
- font-size:80%;
- line-height:1.5em;
- font-family:Helvetica,Arial,sans-serif;
- background: #202020;
-}
-/*IE*/
-html>body{font-size:13px}
-pre,code
-{
- font-family:"DejaVu Sans Mono","Bitstream Vera Sans Mono",Monaco,"Courier New",monospace;
-}
-
-a img, img { border: none; }
-a {color: #2A90BF;text-decoration: none;}
-
-a:hover {
-color: #BE4925;
-text-decoration: underline;
-text-decoration: none;
-}
-
-
-#main {
-margin: 0 0 0 150px;
-background: #ddd;
-}
-
-#content {
-background: #fff;
-padding: 2em;
-margin: 1em 1em 2em 1em;
-margin: 0;
-}
-
-#sidebar { width: 150px; float: left; }
-
-#sidebar h2 {
-color: #777;
-border: none;
-font-size: 20px;
-line-height: 50px;
-text-align: center;
-}
-
-#sidebar ul {
-margin: 2em 0;
-padding: 0;
-list-style: none;
-}
-
-#sidebar ul li {margin: 0;padding: 0;}
-
-#sidebar ul li a {
-display: block;
-line-height: 2.5em;
-padding: 0 1em;
-border-bottom: 1px solid #333;
-color: #fff;
-font-size: 14px;
-font-weight: bold;
-text-shadow:0 1px 2px #000000;
-}
-
-/*
-#sidebar ul li a.selected,
-#sidebar ul li a:hover {
-background: #ddd;
-color: #000;
-text-shadow:0 1px 2px #eee;
-}
-*/
-
-#sidebar ul li a.selected,
-#sidebar ul li a:hover {
-background: #111;
-text-shadow:0 1px 1px #777;
-}
-
-/* Sub levels */
-#sidebar ul li ul { padding: 0; margin: 0; }
-#sidebar ul li li a { color: #ccc; padding: 0 1em 0 3em; }
-
-
-table thead a { color: #333;white-space:nowrap;}
-table tbody tr:hover {background: #f1f1f1;}
-
-
-/*
- * Header
- */
-#header {
-background: #eee;
-height: 30px;
-line-height: 30px;
-margin: 0;
-border-bottom: 0px solid #ddd;
-}
-
-/*
- * Footer
- */
-
-#footer {
-background: #eee;
-height: 30px;
-line-height: 30px;
-margin: 0;
-border-top: 1px solid #ddd;
-color: #777;
-}
-
-
-/*
- * Horizontal menu UL
- */
-ul.horizontal_menu,
-ul.horizontal_menu li {
-margin: 0;
-padding: 0;
-list-style: none;
-}
-ul.horizontal_menu li { float: left; padding: 0 1em; }
-ul.horizontal_menu li.right {float: right;}
-
-
-.box {
- padding: 1em;
- margin: 1em 0;
- background: #eee;
-
- border: 1px solid #fff;
- -moz-box-shadow: 0px 1px 4px #bbb;
- -webkit-box-shadow: 0px 1px 4px #bbb;
- box-shadow: 0px 1px 4px #bbb;
-
- background: #F7F7F7; /* old browsers */
- background: -moz-linear-gradient(top, #F7F7F7 0%, #EAEAEA 100%); /* firefox */
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F7F7F7), color-stop(100%,#EAEAEA)); /* webkit */
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F7F7F7', endColorstr='#EAEAEA',GradientType=0 ); /* ie */
-}
-
-
-/* Create New link */
-.create_new { float: right; }
-
-.create_new a.button {
- border-top: 1px solid #6ee653;
- background: #57c246;
- background: -webkit-gradient(linear, left top, left bottom, from(#57c246), to(#0c9427));
- background: -moz-linear-gradient(top, #57c246,#0c9427);
- padding: 7px 15px;
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
- -webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
- -moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
- box-shadow: rgba(0,0,0,1) 0 1px 0;
- text-shadow: rgba(0,0,0,.4) 0 1px 0;
- color: white;
- text-decoration: none;
- vertical-align: middle;
- font-weight: bold;
-}
-.create_new a.button:hover {
- background: #57c246;
- background: -webkit-gradient(linear, left top, left bottom, from(#0c9427), to(#57c246));
- background: -moz-linear-gradient(top, #0c9427, #57c246);
- color: #ffffff;
-}
-.create_new a.button:active {
- border-top-color: #1b435e;
- background: #264d07;
-}
-
-
-/* Pagination links */
-.pagination a { padding: 5px 10px; border: 1px solid #ddd; background: #f8f8f8; border-radius: 4px; }
-.pagination a.current { color: #aaa; }
-
-
-
-/* Messages Boxes use the great Silk icons from http://famfamfam.com/ */
-.message, .warning, .error, .success
-{
- margin: 1em auto;
- display: block;
- padding: .8em 50px;
- border: 1px solid #fff;
-}
-.message
-{
- background: #F8FAFC url(../images/message.png) 20px center no-repeat;
- border-color: #B5D4FE;
-}
-.warning
-{
- background: #fff6bf url(../images/warning.png) 20px center no-repeat;
- border-color: #ffd324;
-}
-.error
-{
- background: #fde6e9 url(../images/error.png) 20px center no-repeat;
- border-color: #fb939f;
-}
-.success
-{
- background: #EBFCE1 url(../images/success.png) 20px center no-repeat;
- border-color: #B9DAA6;
-}
diff --git a/Public/Admin/CSS/base.css b/Public/Admin/CSS/base.css
deleted file mode 100755
index 115b73a..0000000
--- a/Public/Admin/CSS/base.css
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-A CSS framework by David Pennington
-Copyright 2011, MIT License
-http://xeoncross.com
-*/
-
-/* Master Reset */
-*{vertical-align:baseline}
-html,body,div,form,fieldset,input,textarea,th,td,h1,h2,h3,h4,h5,h6{margin:0;padding:0}
-article,aside,figure,figcaption,hgroup,footer,header,nav,section,video,object{display:block}
-th,td{text-align:left;vertical-align:top;padding:.5em;border:1px solid}
-table{border-collapse:collapse;border-spacing:0;width:100%}
-abbr,acronym{cursor:help;border-bottom:1px dotted}
-fieldset,img{border:0}
-pre{width:100%;white-space:pre;overflow:auto}
-.reset,.reset *{font-weight:inherit;font-family:inherit;font-style:inherit;font-size:1em;border:0;outline:0;padding:0;margin:0}
-
-/* Form Reset (IE7+) */
-input[type=text],input[type=email],input[type=password],input[type=url],input[type=tel],html>body textarea
-{
- width:100%;
- padding:.5em;
- margin:0 0 1.5em 0;
- -webkit-box-sizing:border-box; /* Safari/Chrome, other WebKit */
- -moz-box-sizing:border-box; /* Firefox, other Gecko */
- box-sizing:border-box; /* Opera/IE 8+ */
-}
-
-/* 12 Column Grid System */
-
-/* 1024px, 1152px, & 1280 screens */
-.grid_1{width:50px}
-.grid_2{width:130px}
-.grid_3{width:210px}
-.grid_4{width:290px}
-.grid_5{width:370px}
-.grid_6{width:450px}
-.grid_7{width:530px}
-.grid_8{width:610px}
-.grid_9{width:690px}
-.grid_10{width:770px}
-.grid_11{width:850px}
-.grid_12{width:930px}
-.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12
-{margin-left:30px;float:left;display:inline;/*overflow:hidden;*/}
-.container{width:930px;margin:0 auto;/*overflow:hidden;*/}
-.container .first, .container .grid_12{margin-left:0;clear:left}
-
-/* +1400px screens */
-@media only screen and (min-width:1400px){
-.grid_1{width:70px}
-.grid_2{width:170px}
-.grid_3{width:270px}
-.grid_4{width:370px}
-.grid_5{width:470px}
-.grid_6{width:570px}
-.grid_7{width:670px}
-.grid_8{width:770px}
-.grid_9{width:870px}
-.grid_10{width:970px}
-.grid_11{width:1070px}
-.grid_12{width:1170px}
-.container{width:1170px}
-}
-
-/* Mobile Devices */
-@media only screen and (max-width:700px){
-.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12
-{width:100%;margin-left:0px}
-.container{width:auto;margin:0 2em}
-}
-
-/* Vertical Rhythm - Auto-ajusting Font/Line-Height Ratio */
-body{font-size:100%;line-height:1.5em;font-family:Georgia,serif;}/*IE*/
-html>body{font-size:1em}
-p{margin:0 0 1.5em 0;padding:0}
-h1,h2,h3,h4{font-weight:normal;line-height:1.5em}
-h1{font-size:4em}
-h2{font-size:3em}
-h3{font-size:1.5em;line-height:2em}
-h4{font-size:1em;font-weight:bold}
-table{margin:1em 0}
-th,td{border:1px solid;padding:.5em}
-blockquote{margin:1.5em;font-style:italic}
-ul,ol,dl{margin:1.5em;padding:0}
-ul ul,ol ol{margin:0 2em}
-pre{margin:1.5em 0;line-height:1.5em}
-input,select{font-family:inherit;font-size:1em;/*line-height:1.5em;height:1.5em;*/}
-textarea{margin:0 0 1.5em 0;height:9em;font-family:inherit;font-size:1em;}
-
diff --git a/Public/Admin/CSS/style.css b/Public/Admin/CSS/style.css
deleted file mode 100755
index 2ea5e95..0000000
--- a/Public/Admin/CSS/style.css
+++ /dev/null
@@ -1,37 +0,0 @@
-table thead tr
-{
- border-bottom: 1px solid #fff;
- -moz-box-shadow: 0px 1px 2px #ddd;
- -webkit-box-shadow: 0px 1px 2px #ddd;
- box-shadow: 0px 1px 2px #ddd;
-}
-
-table th
-{
- background: #F7F7F7; /* old browsers */
- background: -moz-linear-gradient(top, #F7F7F7 0%, #EAEAEA 100%); /* firefox */
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F7F7F7), color-stop(100%,#EAEAEA)); /* webkit */
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F7F7F7', endColorstr='#EAEAEA',GradientType=0 ); /* ie */
-}
-
-table tr { border: 1px solid #eee;}
-table td, table th { border: 0; }
-tr:nth-of-type(odd) { background-color:#f8f8f8; }
-
-table tr.header { border-bottom: 1px solid #ddd; }
-table tr.header td { background: #eee; }
-
-/* Column Sorting Table Headers */
-table th a.sort_by {padding-right: 20px;}
-table th a.down {background: url(../images/bullet_arrow_down.png) right no-repeat;}
-table th a.up {background: url(../images/bullet_arrow_up.png) right no-repeat;}
-
-/* Special Links */
-a.delete, a.edit {margin: 0 .5em;}
-
-/* Form Reset (IE7+) */
-input[type=text],input[type=email],input[type=password],input[type=url],input[type=tel],html>body textarea
-{
- border: 1px solid;
- border-color: #888 #bbb #e2e2e2;
-}
diff --git a/Public/Admin/Images/bullet_arrow_down.png b/Public/Admin/Images/bullet_arrow_down.png
deleted file mode 100755
index 9b23c06d7b4f4689dc8c9fd4e9d4d1f199fe376f..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 201
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg
z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-%M_H=O!(Kw&{<9vg>5sxM-`@i?U
z_W%6<>VNmY^FQu?=k0EK8(;qS{{MRQfQxhfe|^4DBSLrMi_=~IrT?G*6aRH>fZ%Fr
xHSdzT`JeW`iC!n;=N{%MvhUm!=_W-^hCUIl<$=usRzPbQJYD@<);T3K0RSKzPZ9tC
diff --git a/Public/Admin/Images/bullet_arrow_up.png b/Public/Admin/Images/bullet_arrow_up.png
deleted file mode 100755
index 24df0f42129c291ddb3dd50c8ba2884dc23a2c43..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 201
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg
z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-%M_H=O!(Kw&{<9vg>5sxM7Y}K&+
zaVqV>2dg?$?}z`N|7UG5-|D8TLf!k;{Mi5T|C#@x_qjwjYRvdu`ttwR|Kb1QzwCco
x|Ef}l>({^Sf7bts|6%{R{?h*$`OZ2jjF;IsFRaMi76-J3!PC{xWt~$(698OLQAz*+
diff --git a/Public/Admin/Images/error.png b/Public/Admin/Images/error.png
deleted file mode 100755
index 08f249365afd29594b51210c6e21ba253897505d..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 715
zcmV;+0yO=JP)C4}Mrzlg<+1Y8PEBfUp0jJpx4B>@E+cy3`^(Gw`Mf+2&yxZm<$to~Vpgvg&QKNR
z_f#1(r6svZt%iF?s+n<8X?B&!h3g9Dbb8_=MX}!;HiQSAh`bp^WMl~Z-44teO7W_Y
zV4thSL{h;rJY7!l3%5J4H1!tIzB`Dv+YxO(haWeausGZYkI8^hWj6mzo=L0{%;yxzh{5!Htr?51
zvG|W62MzC8BZ76hRpCyO2zOn<%e)K>NHge!-~)Ap33OdWw6hsLYbCxGNt0%wk_2z7
zfyYvXheSG)5HRK1VB~%mq7Dmurw#bi@hEcOr3&G1ZiF*$M=&9nB#VNf&Q^r$4G5kp
zTURh&s)E0%5&hyVD}sp<72~zmAY`Y(9aqO6CXF%=zFHGzO-A&I(pE}v70YQxCPJ{Y
z4L+?5-crdLn3ZRPEs!A4ehEY3ZRpL~w9>@aMN+{F4dI@v&>(QDHQum!mG~E^$OS8l
z!7?%Uwib*ROP67Hw`ika)gX-(8Ia`-u_IEhxG7U<13kSsMW+$lbb2dUMm5p6pa}cjgA+U$^mJ^AjD?&bdi)8~y+Q002ovPDHLkV1g8IMc@Dc
diff --git a/Public/Admin/Images/famfamfam.com b/Public/Admin/Images/famfamfam.com
deleted file mode 100755
index 9ed36ef..0000000
--- a/Public/Admin/Images/famfamfam.com
+++ /dev/null
@@ -1 +0,0 @@
-Images from: http://famfamfam.com
diff --git a/Public/Admin/Images/message.png b/Public/Admin/Images/message.png
deleted file mode 100755
index 12cd1aef900803abba99b26920337ec01ad5c267..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 778
zcmV+l1NHogP)BVme|mWaqy4$_pJm?y9KM{-*hp?1+Ey3e-CEDooTa!B;e(Q>TSF?bj>5At13y1p
zriN3w3x~5SfZj{@J4M{kp{?=M_Lh2bV+5LH)Q)5W!-ePA$RgE1@5f1cyHki0Y}JyVEYZF(LD$xXlt$7A5CgE@
zpV-&l%vf;=5kZ2-2gi@Y6J&=cuwt>!vJ^#(&n|LcZyUzi6Duj$$hJ1s*HD-#;k-w@
zpdrwAuoDG_N2bvb07G$Zk*?Hc)JLtW4yqOnic_$zO7NZ#l>Fm){;fE?b$IbOaX2fe
z0la4g0Dfw2xk7Wi7NapVD8YMPCZu?A1QCK*67dgsvRKBLFtrM>?$%&_lD1882mzdO
zWPdw5KWw6IT`m1b_8=lS5jt8D3=RDa=&jWzR-)S@56WMslZ~mKu1)-wpXB>rNBQ>N
zU#K`#1B&v|_AQK;7I~B}OdGiUT9LX>f0xm6<;LeP!=vFjPsUQF*wCJ*dO)4YBypgdiuF!=i@6Zyi7F|q#K
zz?tlSZULa@t1D?$e;f@b36&N!V2mjOHw|*WdP)4-QibtN)VXQDpczE`xXAkUjh%RI>;okxb7K@0kpyQ1k_Y(|Oe7$m(^
zNYX>mI||sUbmn+c3<&FnE=4u#()KBS^SH8e)Qs5i!#lY=$-1gbH6VluzU=m=EP78&5vQ
z-?+fFP-G2l&l_QzYealK$;1Rl?FkzXR&Jv@fBPNjCr#AYRyJ7UJQ0v#?)7Ott=>3`#-pV!7>9}>Q1jL)H6h&gkP@3nI=+F3nA~M>u#(n*
z8T!#8oEw&-mED4!h4s!N@Jo3S7N&Q6%6l3}nlcd~X@>;uelvPsSkXIgg~e+^T1zSf
z3SNj(5%jK~i8@b;CeOSYYtbpBV}~vsBnU!_?2tr-P=|^T
zED%wc9ezHgW@NMb!^uT_|SvCpFLJylbx
zY%bpaTGI8IYXMN$9w<3j9VkA~NYOKEQXsj?6a9_hcwfU$acAhJhB)zb_w@MVUEy@S
zX&I>K-R!bhu3?(6bHWIg$HEl7{9g>>&l_qdd+UYb(1~BCo9LptNq&8>!yoJ3Ui(i5
zRJ|XnYBklL!{@$-7=3mJ>P@1c=7Oc79e-V7yf+%lD2!I;Y&nXBZ>=B!5?CB>LvEx6
znI%n)qqi$#X#wKB(U7XP2P=+4{b@j#r%9-K(8UqtSDk>0UKzf*HM9yqMZ1D!$2MdZ
zR=`U>0zhOH1XqN?nY@AQqB7)Fp4{v&dKXvb43hZKvnN8;Po;+jY*}~*Z|W9Q0W%{D
z^T}Cc<|r(Su=1K=P5>Z4
zg`et&Va}tdzBS-G-ZcO)zCWpJvGQwrHZ`@wpM420ac@bI5~KkTFfGEM3sPWO8co4^fI6lPnA)Y{ef%@{+SnoUk0+dW+*{8WvF8}}l07*qoM6N<$g7cXs
A&j0`b
diff --git a/Public/CSS/base.css b/Public/CSS/base.css
deleted file mode 100755
index 6b99ce6..0000000
--- a/Public/CSS/base.css
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-A CSS framework by David Pennington
-Copyright 2011, MIT License
-http://xeoncross.com
-*/
-
-/* Master Reset */
-*{vertical-align:baseline}
-html,body,div,form,fieldset,input,textarea,th,td,h1,h2,h3,h4,h5,h6{margin:0;padding:0}
-article,aside,figure,figcaption,hgroup,footer,header,nav,section,video,object{display:block}
-th,td{text-align:left;vertical-align:top;padding:.5em;border:1px solid}
-table{border-collapse:collapse;border-spacing:0;width:100%}
-abbr,acronym{cursor:help;border-bottom:1px dotted}
-fieldset,img{border:0}
-pre{width:100%;white-space:pre;overflow:auto}
-.reset,.reset *{font-weight:inherit;font-family:inherit;font-style:inherit;font-size:1em;border:0;outline:0;padding:0;margin:0}
-
-/* Form Reset (IE7+) */
-input[type=text],input[type=email],input[type=password],input[type=url],input[type=tel],html>body textarea
-{
- width:100%;
- padding:.5em;
- -webkit-box-sizing:border-box; /* Safari/Chrome, other WebKit */
- -moz-box-sizing:border-box; /* Firefox, other Gecko */
- box-sizing:border-box; /* Opera/IE 8+ */
-}
-
-/* 12 Column Grid System */
-
-/* 1024px, 1152px, & 1280 screens */
-.grid_1{width:50px}
-.grid_2{width:130px}
-.grid_3{width:210px}
-.grid_4{width:290px}
-.grid_5{width:370px}
-.grid_6{width:450px}
-.grid_7{width:530px}
-.grid_8{width:610px}
-.grid_9{width:690px}
-.grid_10{width:770px}
-.grid_11{width:850px}
-.grid_12{width:930px}
-.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12
-{margin-left:30px;float:left;display:inline;/*overflow:hidden;*/}
-.container{width:930px;margin:0 auto;/*overflow:hidden;*/}
-.container .first, .container .grid_12{margin-left:0;clear:left}
-
-/* +1400px screens */
-@media only screen and (min-width:1400px){
-.grid_1{width:70px}
-.grid_2{width:170px}
-.grid_3{width:270px}
-.grid_4{width:370px}
-.grid_5{width:470px}
-.grid_6{width:570px}
-.grid_7{width:670px}
-.grid_8{width:770px}
-.grid_9{width:870px}
-.grid_10{width:970px}
-.grid_11{width:1070px}
-.grid_12{width:1170px}
-.container{width:1170px}
-}
-
-/* Mobile Devices */
-@media only screen and (max-width:700px){
-.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12
-{width:100%;margin-left:0px}
-.container{width:auto;margin:0 2em}
-}
-
-/* Vertical Rhythm - Auto-ajusting Font/Line-Height Ratio */
-body{font-size:100%;line-height:1.5em;font-family:Georgia,serif;}/*IE*/
-html>body{font-size:1em}
-p{margin:0 0 1.5em 0;padding:0}
-h1,h2,h3,h4{font-weight:normal;line-height:1.5em}
-h1{font-size:4em}
-h2{font-size:3em}
-h3{font-size:1.5em;line-height:2em}
-h4{font-size:1em;font-weight:bold}
-table{margin:1em 0}
-th,td{border:1px solid;padding:.5em}
-blockquote{margin:1.5em;font-style:italic}
-ul,ol,dl{margin:1.5em;padding:0}
-ul ul,ol ol{margin:0 2em}
-pre{margin:1.5em 0;line-height:1.5em}
-input,select{margin:0 0 1.5em 0;font-family:inherit;font-size:1em;/*line-height:1.5em;height:1.5em;*/}
-textarea{margin:0 0 1.5em 0;height:9em;font-family:inherit;font-size:1em;}
-
diff --git a/Public/CSS/style.css b/Public/CSS/style.css
deleted file mode 100755
index 3f01b95..0000000
--- a/Public/CSS/style.css
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Typography - Choose your font and size (base.css default is 16px) */
-body
-{
- font-size:80%;
- line-height:1.5em;
- font-family:Helvetica,"Helvetica Neue",Arial,sans-serif;
-} /*IE*/
-html>body{font-size:13px}
-pre,code
-{
- font-family:"DejaVu Sans Mono","Bitstream Vera Sans Mono",Monaco,"Courier New",monospace;
-}
-
-header, #main, footer { float: left; width: 100%; }
-#main { margin: 2em 0; }
-a { text-decoration: none; color: #4B6E89;font-weight: bold; }
-a:hover { color: #000; }
-
-header { border-bottom: 1px solid #ddd; }
-header h1 { color: #ddd; margin: 0;line-height: 100px; }
-
-nav ul{ list-style: none;margin: 0;padding: 0;}
-nav ul li { float: right;margin: 0 2em 0 0;line-height: 100px; }
-
-#sidebar h3 { margin-bottom: 5px; }
-#sidebar ul { margin: 0; }
-#sidebar ul li {list-style: none;border-bottom: 1px solid #eee;line-height: 2.4em;}
-#sidebar ul li:hover { background: #f8f8f8; }
-
-footer { border-top: 1px solid #ddd; padding: 1em 0;color: #999;font-size: 12px; }
-footer .stats { text-align:right; }
-
-/* Form element label */
-form.formstyle label
-{
- margin: 0px;
- display: inline;
- line-height: 2em;
- float: left;
- width: 100%;
-}
-form.formstyle label b { float: left; }
-form.formstyle label span
-{
- color: #999;
- display: block;
- font-size: 12px;
- float: right;
- text-align: right;
-}
-form.formstyle .form_error
-{
- color: #E83D1B;
- font-weight: bold;
- margin: -1.5em 0 1.5em 0;
-}
-
-/* Messages Boxes use the great Silk icons from http://famfamfam.com/ */
-.message, .warning, .error, .success
-{
- margin: 1em auto;
- display: block;
- clear: both;
- padding: .8em 50px;
- border: 1px solid #fff;
-}
-.message
-{
- background: #F8FAFC url(../Images/message.png) 20px center no-repeat;
- border-color: #B5D4FE;
-}
-.warning
-{
- background: #fff6bf url(../Images/warning.png) 20px center no-repeat;
- border-color: #ffd324;
-}
-.error
-{
- background: #fde6e9 url(../Images/error.png) 20px center no-repeat;
- border-color: #fb939f;
-}
-.success
-{
- background: #EBFCE1 url(../Images/success.png) 20px center no-repeat;
- border-color: #B9DAA6;
-}
diff --git a/Public/Images/error.png b/Public/Images/error.png
deleted file mode 100755
index 08f249365afd29594b51210c6e21ba253897505d..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 715
zcmV;+0yO=JP)C4}Mrzlg<+1Y8PEBfUp0jJpx4B>@E+cy3`^(Gw`Mf+2&yxZm<$to~Vpgvg&QKNR
z_f#1(r6svZt%iF?s+n<8X?B&!h3g9Dbb8_=MX}!;HiQSAh`bp^WMl~Z-44teO7W_Y
zV4thSL{h;rJY7!l3%5J4H1!tIzB`Dv+YxO(haWeausGZYkI8^hWj6mzo=L0{%;yxzh{5!Htr?51
zvG|W62MzC8BZ76hRpCyO2zOn<%e)K>NHge!-~)Ap33OdWw6hsLYbCxGNt0%wk_2z7
zfyYvXheSG)5HRK1VB~%mq7Dmurw#bi@hEcOr3&G1ZiF*$M=&9nB#VNf&Q^r$4G5kp
zTURh&s)E0%5&hyVD}sp<72~zmAY`Y(9aqO6CXF%=zFHGzO-A&I(pE}v70YQxCPJ{Y
z4L+?5-crdLn3ZRPEs!A4ehEY3ZRpL~w9>@aMN+{F4dI@v&>(QDHQum!mG~E^$OS8l
z!7?%Uwib*ROP67Hw`ika)gX-(8Ia`-u_IEhxG7U<13kSsMW+$lbb2dUMm5p6pa}cjgA+U$^mJ^AjD?&bdi)8~y+Q002ovPDHLkV1g8IMc@Dc
diff --git a/Public/Images/famfamfam.com.txt b/Public/Images/famfamfam.com.txt
deleted file mode 100755
index fd3f4df..0000000
--- a/Public/Images/famfamfam.com.txt
+++ /dev/null
@@ -1 +0,0 @@
-http://famfamfam.com
\ No newline at end of file
diff --git a/Public/Images/message.png b/Public/Images/message.png
deleted file mode 100755
index 12cd1aef900803abba99b26920337ec01ad5c267..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 778
zcmV+l1NHogP)BVme|mWaqy4$_pJm?y9KM{-*hp?1+Ey3e-CEDooTa!B;e(Q>TSF?bj>5At13y1p
zriN3w3x~5SfZj{@J4M{kp{?=M_Lh2bV+5LH)Q)5W!-ePA$RgE1@5f1cyHki0Y}JyVEYZF(LD$xXlt$7A5CgE@
zpV-&l%vf;=5kZ2-2gi@Y6J&=cuwt>!vJ^#(&n|LcZyUzi6Duj$$hJ1s*HD-#;k-w@
zpdrwAuoDG_N2bvb07G$Zk*?Hc)JLtW4yqOnic_$zO7NZ#l>Fm){;fE?b$IbOaX2fe
z0la4g0Dfw2xk7Wi7NapVD8YMPCZu?A1QCK*67dgsvRKBLFtrM>?$%&_lD1882mzdO
zWPdw5KWw6IT`m1b_8=lS5jt8D3=RDa=&jWzR-)S@56WMslZ~mKu1)-wpXB>rNBQ>N
zU#K`#1B&v|_AQK;7I~B}OdGiUT9LX>f0xm6<;LeP!=vFjPsUQF*wCJ*dO)4YBypgdiuF!=i@6Zyi7F|q#K
zz?tlSZULa@t1D?$e;f@b36&N!V2mjOHw|*WdP)4-QibtN)VXQDpczE`xXAkUjh%RI>;okxb7K@0kpyQ1k_Y(|Oe7$m(^
zNYX>mI||sUbmn+c3<&FnE=4u#()KBS^SH8e)Qs5i!#lY=$-1gbH6VluzU=m=EP78&5vQ
z-?+fFP-G2l&l_QzYealK$;1Rl?FkzXR&Jv@fBPNjCr#AYRyJ7UJQ0v#?)7Ott=>3`#-pV!7>9}>Q1jL)H6h&gkP@3nI=+F3nA~M>u#(n*
z8T!#8oEw&-mED4!h4s!N@Jo3S7N&Q6%6l3}nlcd~X@>;uelvPsSkXIgg~e+^T1zSf
z3SNj(5%jK~i8@b;CeOSYYtbpBV}~vsBnU!_?2tr-P=|^T
zED%wc9ezHgW@NMb!^uT_|SvCpFLJylbx
zY%bpaTGI8IYXMN$9w<3j9VkA~NYOKEQXsj?6a9_hcwfU$acAhJhB)zb_w@MVUEy@S
zX&I>K-R!bhu3?(6bHWIg$HEl7{9g>>&l_qdd+UYb(1~BCo9LptNq&8>!yoJ3Ui(i5
zRJ|XnYBklL!{@$-7=3mJ>P@1c=7Oc79e-V7yf+%lD2!I;Y&nXBZ>=B!5?CB>LvEx6
znI%n)qqi$#X#wKB(U7XP2P=+4{b@j#r%9-K(8UqtSDk>0UKzf*HM9yqMZ1D!$2MdZ
zR=`U>0zhOH1XqN?nY@AQqB7)Fp4{v&dKXvb43hZKvnN8;Po;+jY*}~*Z|W9Q0W%{D
z^T}Cc<|r(Su=1K=P5>Z4
zg`et&Va}tdzBS-G-ZcO)zCWpJvGQwrHZ`@wpM420ac@bI5~KkTFfGEM3sPWO8co4^fI6lPnA)Y{ef%@{+SnoUk0+dW+*{8WvF8}}l07*qoM6N<$g7cXs
A&j0`b
diff --git a/Public/index.php b/Public/index.php
old mode 100755
new mode 100644
index c77170e..7373c18
--- a/Public/index.php
+++ b/Public/index.php
@@ -1,38 +1,110 @@
routes;
+
+// Default homepage route
+if(PATH === '')
+{
+ $controller = $routes[''];
+}
+// If this is not a valid, safe path (more complex params belong in GET/POST)
+else
+{
+ foreach($routes as $route => $resource)
+ {
+ if( ! $route) continue; // Skip homepage route
+
+ // Is this a regex?
+ if($route{0} === '/')
+ {
+ if(preg_match($route, $path, $matches))
+ {
+ $complete = array_shift($matches);
+
+ // The following code tries to solve:
+ // (Regex) "/^path/(\w+)/" + (Path) "path/word/other" = (Params) array(word, other)
+
+ // Skip the regex match and continue from there
+ $params = explode('/', trim(mb_substr($path, mb_strlen($complete)), '/'));
+
+ if($params[0])
+ {
+ // Add captured group back into params
+ foreach($matches as $match)
+ {
+ array_unshift($params, $match);
+ }
+ }
+ else
+ {
+ $params = $matches;
+ }
+
+ $controller = $resource;
+ }
+ }
+ else
+ {
+ if(mb_substr($path, 0, mb_strlen($route)) === $route)
+ {
+ $params = explode('/', trim(mb_substr($path, mb_strlen($route)), '/'));
+ $controller = $resource;
+ }
+ }
+
+ if($controller) break;
+ }
+
+ // Controller not found
+ if( ! $controller)
+ {
+ $controller = $routes['404'];
+ }
+}
+
+// Remove to free memory
+unset($routes);
+config('Route', TRUE);
+
try
{
- // Anything else before we start?
- event('system.startup');
+ // Get the controller method
+ list($controller, $method) = explode('::', $controller) + array('', 'index');
- // Load controller dispatch passing URL routes
- $dispatch = new \Core\Dispatch(config('Route')->routes);
+ // Load the controller
+ $controller = new $controller;
- // Run controller based on URL path and HTTP request method
- $controller = $dispatch->controller(PATH, getenv('REQUEST_METHOD'));
+ // Allow REST-specific methods (is it safe to use REQUEST_METHOD like this?)
+ if(method_exists($controller, getenv('REQUEST_METHOD') . $method))
+ {
+ $method = getenv('REQUEST_METHOD') . $method;
+ }
- // Send the controller response
- $controller->send();
+ // Run before
+ $controller->before($method);
- // One last chance to do something
- event('system.shutdown', $controller);
+ // Let the controller take it from here!
+ $result = call_user_func_array(array($controller, $method), $params);
+
+ // Run after
+ $controller->after($method, $result);
}
catch (Exception $e)
{
- \Core\Error::exception($e);
+ \Micro\Error::exception($e);
}
-
+// κόψη/bar/ዕንቁላል/Зарегистрируйте4сь
+//var_dump(get_defined_vars());
diff --git a/README.markdown b/README.markdown
index 804c8f0..b695910 100755
--- a/README.markdown
+++ b/README.markdown
@@ -10,21 +10,42 @@ MicroMVC is also fully PSR-0 compliant which means you can start using Symfony,
All class methods are fully documented. Average class size is only 4kb which makes reading the codebase very easy and quick. IDE's such as eclipse or netbeans can pickup on the phpDoc comments to add instant auto-completion to your projects. In addition, full multi-byte string support is built into the system.
-## Requirements
+## Submodules
+
+This system is built to be used with *other PSR-0 compliant libraries*. These can be used easily by adding submodules to the `Class` directory and adding the correct "namespace" path to the `Config/Config.php` file. For example, to use [Zend Framework 2](https://github.com/zendframework/zf2) run the following commands.
+
+ $ git submodule add git://github.com/zendframework/zf2.git Class/Zend
+
+Then add the following configuration path to the `Config/Config.php` file so the system knows where to load the classes from.
+
+ $config['namespaces'] = array(
+ 'Zend' => 'Zend/library/Zend/'
+ );
+
+
+This system relies on the [Xeoncross/Micro](https://github.com/Xeoncross/Micro) submodule. After checking out a copy of the system, please run the following commands to pull the submodules.
+
+ $ git submodule init
+ $ git submodule update
+
+You can add additional libraries as shown above.
+
+## Requirements
* PHP 5.3+
* Nginx 0.7.x (legacy support for Apache with mod_rewrite)
* PDO if using the Database
-* mb_string, [gettext](http://php.net/gettext), [iconv](http://www.php.net/manual/en/book.iconv.php), [ICU INTL](http://php.net/manual/en/book.intl.php) & SPL classes
+* mb_string, gettext, iconv, & SPL classes
+
+
+## License (MIT License)
-## Where is the Locale Class?
+Copyright (c) 2011 [David Pennington](http://xeoncross.com)
-If you have errors about missing classes make sure you have the required PHP extensions installed.
+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:
-Ubuntu/Debian: `$ sudo apt-get install php5-intl php5-mycrypt php-gettext`
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-## License
+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.
-[MicroMVC](http://micromvc.com) is licensed under the Open Source MIT license, so you can use it for any personal or corporate projects totally free!
-Built by [David Pennington](http://xeoncross.com) of [Code2Design](http://code2design.com)
diff --git a/README/install.txt b/README/install.txt
index 2e84558..156b919 100755
--- a/README/install.txt
+++ b/README/install.txt
@@ -11,3 +11,15 @@ A CLI console is provided for using the migrations
$ php CLI create
The code is very well commented, please read it.
+
+--- Submodules ---
+
+This system relies on the https://github.com/Xeoncross/Micro submodule. After checking out a copy of the system, please run the following commands to pull the submodules.
+
+$ git submodule init
+$ git submodule update
+
+You can add additional libraries to the classes folder like so
+
+$ git submodule add git://github.com/[User]/[project].git Class/[project]
+
diff --git a/View/404.php b/View/Example/404.php
similarity index 100%
rename from View/404.php
rename to View/Example/404.php
diff --git a/View/Index/Index.php b/View/Example/Index.php
similarity index 100%
rename from View/Index/Index.php
rename to View/Example/Index.php
diff --git a/View/Layout.php b/View/Example/Layout.php
similarity index 100%
rename from View/Layout.php
rename to View/Example/Layout.php
diff --git a/View/School/Index.php b/View/Example/School.php
similarity index 100%
rename from View/School/Index.php
rename to View/Example/School.php
diff --git a/View/Sidebar.php b/View/Example/Sidebar.php
similarity index 100%
rename from View/Sidebar.php
rename to View/Example/Sidebar.php
diff --git a/View/System/Debug.php b/View/System/Debug.php
index fb8f974..09930a5 100755
--- a/View/System/Debug.php
+++ b/View/System/Debug.php
@@ -20,14 +20,14 @@
', TRUE),36));
};
- foreach(\Core\Database::$queries as $type => $queries)
+ foreach(\Micro\Database::$queries as $type => $queries)
{
print ''.$type.' ('. count($queries). ' queries)';
foreach($queries as $data)
@@ -36,10 +36,10 @@
}
}
- if(\Core\Error::$found)
+ if(\Micro\Error::$found)
{
print 'Last Query Run';
- print '