├── .ebignore ├── Dockerfile ├── LICENSE ├── NOTICE.txt ├── README.md ├── appspec.yml ├── circle.yml ├── composer.json ├── config.php ├── index.php ├── phpunit.xml ├── phpunit ├── indexTest.php └── loadGenTest.php ├── scripts ├── solano-docker-ecr-build-push.sh └── solano-docker-ecs-deploy.sh ├── solano-docker.yml ├── solano-test.sh ├── solano.yml ├── task-skeleton.json ├── test.php └── www ├── Chart.js ├── Chart.min.js ├── css ├── bootstrap.min.css └── templatemo_style.css ├── images ├── body-bg.png ├── header-bg.png ├── round-rectangle.png └── underline.png ├── index.php ├── jquery.min.js ├── js ├── jquery-1.11.1.min.js └── templatemo_script.js ├── lib.php ├── loadAuto.php ├── loadCreate.php ├── loadFunctions.php ├── loadGen.php └── loadTest └── index.php /.ebignore: -------------------------------------------------------------------------------- 1 | composer.json 2 | composer.lock 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:6 2 | 3 | MAINTAINER "fontesj" 4 | 5 | RUN yum -y install httpd php php-cli mod_security jq 6 | RUN /sbin/chkconfig httpd on 7 | 8 | ADD index.php /var/www/html/index.php 9 | ADD test.php /var/www/html/test.php 10 | ADD www /var/www/html/www 11 | 12 | EXPOSE 80 13 | 14 | # Start the service 15 | CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"] 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | 204 | The MIT License (MIT) 205 | 206 | Copyright (c) 2011-2015 Twitter, Inc 207 | 208 | Permission is hereby granted, free of charge, to any person obtaining a copy 209 | of this software and associated documentation files (the "Software"), to deal 210 | in the Software without restriction, including without limitation the rights 211 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 212 | copies of the Software, and to permit persons to whom the Software is 213 | furnished to do so, subject to the following conditions: 214 | 215 | The above copyright notice and this permission notice shall be included in 216 | all copies or substantial portions of the Software. 217 | 218 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 219 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 220 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 221 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 222 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 223 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 224 | THE SOFTWARE. 225 | 226 | 227 | 228 | Copyright (c) 2013-2015 Nick Downie 229 | 230 | 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: 231 | 232 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 233 | 234 | 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. 235 | 236 | 237 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. 238 | 239 | License 240 | 241 | THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. 242 | 243 | BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. 244 | 245 | 1. Definitions 246 | 247 | "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. 248 | "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. 249 | "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership. 250 | "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. 251 | "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. 252 | "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. 253 | "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. 254 | "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. 255 | "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. 256 | 257 | 2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. 258 | 259 | 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: 260 | 261 | to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; 262 | to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified."; 263 | to Distribute and Publicly Perform the Work including as incorporated in Collections; and, 264 | to Distribute and Publicly Perform Adaptations. 265 | 266 | For the avoidance of doubt: 267 | Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; 268 | Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and, 269 | Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License. 270 | 271 | The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved. 272 | 273 | 4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: 274 | 275 | You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested. 276 | If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. 277 | Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise. 278 | 279 | 5. Representations, Warranties and Disclaimer 280 | 281 | UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. 282 | 283 | 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 284 | 285 | 7. Termination 286 | 287 | This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. 288 | Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. 289 | 290 | 8. Miscellaneous 291 | 292 | Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. 293 | Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. 294 | If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. 295 | No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. 296 | This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. 297 | The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. 298 | 299 | Creative Commons Notice 300 | 301 | Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor. 302 | 303 | Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of this License. 304 | 305 | Creative Commons may be contacted at https://creativecommons.org/. 306 | 307 | 308 | 3-Clause BSD License 309 | 310 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 311 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 312 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 313 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOLANO LABS BE LIABLE FOR 314 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 315 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 316 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 317 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 318 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 319 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 320 | POSSIBILITY OF SUCH DAMAGE. 321 | 322 | Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 Solano Labs All Rights Reserved 323 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | aws-demo-php-simple-app 2 | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | 4 | 5 | 6 | ********************** 7 | THIRD PARTY COMPONENTS 8 | ********************** 9 | This software includes third party software subject to the following copyrights: 10 | 11 | - Bootstrap - Copyright 2011-2014 Twitter, Inc. MIT License 12 | - Chart.js - Copyright 2015 Nick Downie, MIT License 13 | - Brownie Template - Creative Commons 3.0 US 14 | - PHPUnit - Copyright (c) 2001-2015, Sebastian Bergmann 15 | - CI_Memes-Docker - Copyright 2015, Solao Labs, 3-clause BSD License 16 | 17 | The licenses for these third party components are included in LICENSE.txt 18 | 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aws-demo-php-simple-app 2 | Application was created for use with an AWS Partner blog post and will be used for demonstration purposes for other web applications. 3 | 4 | This web application utilizes the PHP scripting language to gather information system information and display that information using HTML/CSS/Chart.js. 5 | 6 | Information gathered is a read-only file handler that reads information from /proc/. Information gathered is, CPU load, memory use, network packet types, and disk use. 7 | 8 | Features: 9 | - Simple PHP application tested on PHP 5.3 - 5.6 10 | - Load generation utility included 11 | 12 | Other Items: 13 | - Currently no database test capabilities 14 | -------------------------------------------------------------------------------- /appspec.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at 3 | # 4 | # http://aws.amazon.com/apache2.0/ 5 | # 6 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7 | # See the License for the specific language governing permissions and limitations under the License. 8 | 9 | version: 0.0 10 | os: linux 11 | files: 12 | - source: /www 13 | destination: /var/www/html/www 14 | - source: /index.php 15 | destination: /var/www/html/index.php 16 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at 3 | # 4 | # http://aws.amazon.com/apache2.0/ 5 | # 6 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 7 | # See the License for the specific language governing permissions and limitations under the License. 8 | 9 | test: 10 | override: 11 | - php ./test.php 12 | deployment: 13 | staging: 14 | branch: master 15 | codedeploy: 16 | circleci-demo-app: 17 | application_root: / 18 | region: us-east-1 19 | revision_location: 20 | revision_type: S3 21 | s3_location: 22 | bucket: glob-bucket-east-1 23 | key_pattern: circleci-demo-app-{BRANCH}-{SHORT_COMMIT} 24 | deployment_group: circleci-demo-dg 25 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require-dev": 3 | { 4 | "phpunit/phpunit": "4.*", 5 | "solano/solano-phpunit": "*" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | 24 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 1) 15 | $outBound = "http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])."/www/"; 16 | else 17 | $outBound = "http://".$_SERVER['SERVER_NAME']."/www/"; 18 | 19 | header("Location: $outBound"); 20 | 21 | ?> 22 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | phpunit 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /phpunit/indexTest.php: -------------------------------------------------------------------------------- 1 | assertContains("Overview of major system components", $output); 12 | } 13 | } 14 | 15 | ?> 16 | -------------------------------------------------------------------------------- /phpunit/loadGenTest.php: -------------------------------------------------------------------------------- 1 | assertContains("Hash Valid", $output); 15 | } 16 | public function testLoadGenHash14() 17 | { 18 | $_GET['string'] = 'goFMEPBiI4Yd67'; 19 | $_GET['hash'] = 'JDJ5JDE0JGZNeU41OVhvMUNyMjc3bTdab0NVZU9BOWJ6RFpUeGNrSXRvdmg3THh3ZGt3QUNDN2dJTE5p'; 20 | $_GET['cost'] = 14; 21 | $GLOBALS['LOAD_OVERRIDE'] = 1; 22 | ob_start(); 23 | include('www/loadGen.php'); 24 | $output = ob_get_flush(); 25 | $this->assertContains("Hash Valid", $output); 26 | } 27 | public function testLoadGenHash16() 28 | { 29 | $_GET['string'] = 'Zo6DWkeC8a7IFX'; 30 | $_GET['hash'] = 'JDJ5JDE2JHdGclBQME13SU52RjMyaWJzcjhQcS5ja3AyaG5qQmxudU9CTWUvZXFjdXAvblQvRG8zbmtx'; 31 | $_GET['cost'] = 16; 32 | $GLOBALS['LOAD_OVERRIDE'] = 1; 33 | ob_start(); 34 | include('www/loadGen.php'); 35 | $output = ob_get_flush(); 36 | $this->assertContains("Hash Valid", $output); 37 | } 38 | public function testLoadGenHash17() 39 | { 40 | $_GET['string'] = 'ih5YEnHsjeOX3f'; 41 | $_GET['hash'] = 'JDJ5JDE3JGtFTmRkUWJBYUN4VUZqV05pRjkwSC5GWnd0VnJheUdSUlM3MUl4b1hPQW1LY25GUkRtem5t'; 42 | $_GET['cost'] = 17; 43 | $GLOBALS['LOAD_OVERRIDE'] = 1; 44 | ob_start(); 45 | include('www/loadGen.php'); 46 | $output = ob_get_flush(); 47 | $this->assertContains("Hash Valid", $output); 48 | } 49 | public function testLoadGenHashCreate() 50 | { 51 | $_GET['cost'] = 14; 52 | $GLOBALS['LOAD_OVERRIDE'] = 1; 53 | ob_start(); 54 | include('www/loadCreate.php'); 55 | $output = ob_get_flush(); 56 | $outputA = explode("~",$output); 57 | $_GET['string'] = trim($outputA[1]); 58 | $_GET['hash'] = trim($outputA[0]); 59 | ob_start(); 60 | include('www/loadGen.php'); 61 | $outputN = ob_get_flush(); 62 | $this->assertContains("Hash Valid", $outputN); 63 | } 64 | } 65 | 66 | ?> 67 | -------------------------------------------------------------------------------- /scripts/solano-docker-ecr-build-push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at 5 | # 6 | # http://aws.amazon.com/apache2.0/ 7 | # 8 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and limitations under the License. 10 | # 11 | # 12 | # Description: Build, test and store docker container image in AWS ECR 13 | 14 | #initial version provided by Solano Labs: 15 | # https://github.com/solanolabs/ci_memes-docker/ 16 | 17 | set -o errexit -o pipefail # Exit on error 18 | 19 | SOLANO_LOGFILE="$HOME/results/$TDDIUM_SESSION_ID/session/solano-docker-ecr-build-push-${TDDIUM_SESSION_ID}.txt" 20 | 21 | echo "Starting solano-docker-ecr-build-push.sh" > $SOLANO_LOGFILE 22 | date >> $SOLANO_LOGFILE 23 | 24 | # Ensure aws-cli is installed and configured 25 | if [ ! -f $HOME/bin/aws ]; then 26 | curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" 27 | unzip awscli-bundle.zip 28 | ./awscli-bundle/install -b $HOME/bin/aws 29 | echo "Installed AWS CLI" >> $SOLANO_LOGFILE 30 | which aws >> $SOLANO_LOGFILE 31 | fi 32 | if [ -d $HOME/lib/python2.7/site-packages ]; then 33 | export PYTHONPATH=$HOME/lib/python2.7/site-packages 34 | fi 35 | 36 | # Ensure AWS Variables are available 37 | if [[ -z "$AWS_ACCOUNT_ID" || -z "$AWS_DEFAULT_REGION " ]]; then 38 | echo "AWS Variables Not Set. Either AWS_ACCOUNT_ID or AWS_DEFAULT_REGION" 39 | exit 1 40 | fi 41 | 42 | which aws 43 | if [ $? -ne 0 ]; then 44 | echo "Cannot find aws command." 45 | exit 1 46 | fi 47 | 48 | #Credentials provided by Solano from AssumeRole dashboard Org configuration 49 | export AWS_ACCESS_KEY_ID=$AWS_ASSUME_ROLE_ACCESS_KEY_ID 50 | export AWS_SECRET_ACCESS_KEY=$AWS_ASSUME_ROLE_SECRET_ACCESS_KEY 51 | export AWS_SESSION_TOKEN=$AWS_ASSUME_ROLE_SESSION_TOKEN 52 | #uncomment below for the Solano output of credentials used 53 | #aws configure list 54 | 55 | #Log in to AWS ECR Docker Repository 56 | echo "Requesting AWS ECR credentials." 57 | DOCKER_LOGIN=`aws ecr get-login --region $AWS_DEFAULT_REGION` 58 | 59 | #Uncomment to show docker creds in logs 60 | #NOT RECOMMENDED 61 | #echo $DOCKER_LOGIN 62 | 63 | echo "Performing docker login." 64 | sudo $DOCKER_LOGIN 65 | echo "Login Complete" 66 | 67 | # Build docker image 68 | echo "Performing docker build." 69 | sudo docker build -t $AWS_ECR_REPO:$TDDIUM_SESSION_ID . 70 | echo "Completed docker build." 71 | 72 | #tag image and push to AWS ECR 73 | sudo docker tag ${AWS_ECR_REPO}:${TDDIUM_SESSION_ID} ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${AWS_ECR_REPO}:${TDDIUM_SESSION_ID} 74 | 75 | # Pushing docker image to repository 76 | sudo docker push ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${AWS_ECR_REPO}:${TDDIUM_SESSION_ID} 77 | echo "Image uploaded to repository." 78 | 79 | echo "Push to AWS ECR Complete" >> $SOLANO_LOGFILE 80 | date >> $SOLANO_LOGFILE 81 | -------------------------------------------------------------------------------- /scripts/solano-docker-ecs-deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at 5 | # 6 | # http://aws.amazon.com/apache2.0/ 7 | # 8 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 9 | # See the License for the specific language governing permissions and limitations under the License. 10 | # 11 | # 12 | # Description: Update AWS ECS task definition with new version using AWS ECR version just created 13 | # Call for the update of the AWS ECS environment to new task definitiion version 14 | # 15 | #initial version provided by Solano Labs: 16 | # https://github.com/solanolabs/ci_memes-docker/ 17 | 18 | # Exit on script errors 19 | set -o errexit -o pipefail 20 | 21 | # Only deploy if all tests have passed 22 | if [[ "passed" != "$TDDIUM_BUILD_STATUS" ]]; then 23 | echo "\$TDDIUM_BUILD_STATUS = $TDDIUM_BUILD_STATUS" 24 | echo "Will only deploy on passed builds" 25 | exit 26 | fi 27 | 28 | # Only the master branch should trigger deploys 29 | if [[ "master" != "$TDDIUM_CURRENT_BRANCH" ]]; then 30 | echo "\$TDDIUM_CURRENT_BRANCH = $TDDIUM_CURRENT_BRANCH" 31 | echo "Will only depoloy on master branch" 32 | exit 33 | fi 34 | 35 | # Deploy to AWS EC2 Container Service? 36 | if [ -n "$DEPLOY_AWS_ECS" ] && [[ "true" == "$DEPLOY_AWS_ECS" ]]; then 37 | 38 | echo "Using AssumeRole $ROLE" 39 | export AWS_ACCESS_KEY_ID=$AWS_ASSUME_ROLE_ACCESS_KEY_ID 40 | export AWS_SECRET_ACCESS_KEY=$AWS_ASSUME_ROLE_SECRET_ACCESS_KEY 41 | export AWS_SESSION_TOKEN=$AWS_ASSUME_ROLE_SESSION_TOKEN 42 | #Uncomment below to have session token value available in logs 43 | #echo "Token: $AWS_SESSION_TOKEN" 44 | 45 | # Ensure required environment variables are set 46 | if [ -z "$AWS_ACCESS_KEY_ID" ] || [ -z "$AWS_SECRET_ACCESS_KEY" ] || [ -z "$AWS_DEFAULT_REGION" ]; then 47 | echo "AWS ECS deploy requires setting \$AWS_ACCESS_KEY_ID, \$AWS_SECRET_ACCESS_KEY, and \$AWS_DEFAULT_REGION" 48 | echo 'These variables are provided by either the Solano cross-account role feature or the Solano CLI' 49 | exit 1 50 | fi 51 | 52 | # Create new task definition from template file 53 | AWS_ECR_IMAGE_LOC="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${AWS_ECR_REPO}:${TDDIUM_SESSION_ID}" 54 | sed -e "s;%AWS_ECS_TASK_DEFINITION%;${AWS_ECS_TASK_DEFINITION};g" task-skeleton.json | sed -e "s;%AWS_ECS_TASK_NAME%;${AWS_ECS_TASK_NAME};g" | sed -e "s;%AWS_DOCKER_FULL_IMAGE%;${AWS_ECR_IMAGE_LOC};g" > task-${TDDIUM_SESSION_ID}.json 55 | aws ecs register-task-definition --family $AWS_ECS_TASK_DEFINITION --cli-input-json file://task-${TDDIUM_SESSION_ID}.json 56 | 57 | # Get revision number of newly created definition 58 | REV=`aws ecs describe-task-definition --task-definition $AWS_ECS_TASK_DEFINITION | egrep "revision" | tr "/" " " | awk '{print $2}' | sed 's/"$//'` 59 | 60 | # Update AWS ECS Service with new task definition revision 61 | echo "aws ecs update-service --cluster $AWS_ECS_CLUSTER --service $AWS_ECS_SERVICE --task-definition ${AWS_ECS_TASK_DEFINITION}:${REV} --region $AWS_DEFAULT_REGION" 62 | aws ecs update-service --cluster $AWS_ECS_CLUSTER --service $AWS_ECS_SERVICE --task-definition ${AWS_ECS_TASK_DEFINITION}:${REV} --region $AWS_DEFAULT_REGION 63 | 64 | fi 65 | -------------------------------------------------------------------------------- /solano-docker.yml: -------------------------------------------------------------------------------- 1 | system: 2 | docker: true 3 | 4 | environment: 5 | 'DOCKER_APP': 'solano' 6 | 'DEPLOY_AWS_ECS': 'true' 7 | 'AWS_ECS_CLUSTER': 'solano-ecs-cluster' 8 | 'AWS_ECS_SERVICE': 'solano-ecs-service' 9 | 'AWS_ECS_TASK_DEFINITION': 'solano-family' 10 | 'AWS_ECS_TASK_NAME': 'solano-task-definition' 11 | 'AWS_ELB_NAME': 'solano-elb' 12 | # For sensitive values, use `solano config:add repo ` from the cli 13 | # See: http://docs.solanolabs.com/Setup/setting-environment-variables/#via-config-variables 14 | # 'DOCKER_USER': '' 15 | # 'DOCKER_EMAIL': '' 16 | # 'DOCKER_PASSWORD': '' 17 | 18 | timeout_hook: 900 19 | 20 | hooks: 21 | pre_setup: chmod -R 755 ./scripts 22 | post_setup: ./scripts/solano-docker-ecr-build-push.sh 23 | post_build: ./scripts/solano-docker-ecs-deploy.sh 24 | 25 | php: 26 | php_version: "5.6" 27 | 28 | tests: 29 | - './solano-test.sh' 30 | - 'echo "Done with Image Test"' 31 | -------------------------------------------------------------------------------- /solano-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at 4 | # 5 | # http://aws.amazon.com/apache2.0/ 6 | # 7 | # or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 8 | # See the License for the specific language governing permissions and limitations under the License. 9 | # 10 | # Description: Single bash script to run Solano CI tests. Can add more tests below as necessary. 11 | 12 | sudo docker run ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${DOCKER_APP}:${TDDIUM_SESSION_ID} /usr/bin/php /var/www/html/www/index.php 13 | EXIT_CODE=$? 14 | echo "Test complete with Status: $EXIT_CODE" 15 | -------------------------------------------------------------------------------- /solano.yml: -------------------------------------------------------------------------------- 1 | 2 | php: 3 | version: '5.6' 4 | hooks: 5 | pre_setup: composer.phar install 6 | cache: 7 | key_paths: 8 | - composer.json 9 | - composer.lock 10 | save_paths: 11 | - vendor 12 | tests: 13 | - type: phpunit 14 | mode: parallel 15 | output: exit-status 16 | command: vendor/bin/solano-phpunit 17 | config: phpunit.xml 18 | files: 19 | - phpunit/**Test.php 20 | -------------------------------------------------------------------------------- /task-skeleton.json: -------------------------------------------------------------------------------- 1 | { 2 | "family": "%AWS_ECS_TASK_DEFINITION%", 3 | "containerDefinitions": [ 4 | { 5 | "name": "%AWS_ECS_TASK_NAME%", 6 | "image": "%AWS_DOCKER_FULL_IMAGE%", 7 | "cpu": 100, 8 | "memory": 128, 9 | "environment": [], 10 | "command": [], 11 | "portMappings": [ 12 | { 13 | "hostPort": 80, 14 | "containerPort": 80, 15 | "protocol": "tcp" 16 | } 17 | ], 18 | "volumesFrom": [], 19 | "links": [], 20 | "mountPoints": [], 21 | "essential": true 22 | } 23 | ], 24 | "volumes": [] 25 | } 26 | -------------------------------------------------------------------------------- /test.php: -------------------------------------------------------------------------------- 1 | \n"; 25 | exit(1); 26 | } 27 | else 28 | { 29 | print "Buffer Size: ".strlen($buff)."\n
"; 30 | } 31 | 32 | ?> 33 | -------------------------------------------------------------------------------- /www/Chart.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Chart.js 3 | * http://chartjs.org/ 4 | * Version: 1.0.2 5 | * 6 | * Copyright 2015 Nick Downie 7 | * Released under the MIT license 8 | * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md 9 | */ 10 | (function(){"use strict";var t=this,i=t.Chart,e=function(t){this.canvas=t.canvas,this.ctx=t;var i=function(t,i){return t["offset"+i]?t["offset"+i]:document.defaultView.getComputedStyle(t).getPropertyValue(i)},e=this.width=i(t.canvas,"Width"),n=this.height=i(t.canvas,"Height");t.canvas.width=e,t.canvas.height=n;var e=this.width=t.canvas.width,n=this.height=t.canvas.height;return this.aspectRatio=this.width/this.height,s.retinaScale(this),this};e.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}},e.types={};var s=e.helpers={},n=s.each=function(t,i,e){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var n;for(n=0;n=0;s--){var n=t[s];if(i(n))return n}},s.inherits=function(t){var i=this,e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return i.apply(this,arguments)},s=function(){this.constructor=e};return s.prototype=i.prototype,e.prototype=new s,e.extend=r,t&&a(e.prototype,t),e.__super__=i.prototype,e}),c=s.noop=function(){},u=s.uid=function(){var t=0;return function(){return"chart-"+t++}}(),d=s.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},p=s.amd="function"==typeof define&&define.amd,f=s.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=s.max=function(t){return Math.max.apply(Math,t)},m=s.min=function(t){return Math.min.apply(Math,t)},v=(s.cap=function(t,i,e){if(f(i)){if(t>i)return i}else if(f(e)&&e>t)return e;return t},s.getDecimalPlaces=function(t){return t%1!==0&&f(t)?t.toString().split(".")[1].length:0}),S=s.radians=function(t){return t*(Math.PI/180)},x=(s.getAngleFromPoint=function(t,i){var e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s),o=2*Math.PI+Math.atan2(s,e);return 0>e&&0>s&&(o+=2*Math.PI),{angle:o,distance:n}},s.aliasPixel=function(t){return t%2===0?0:.5}),y=(s.splineCurve=function(t,i,e,s){var n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),a=s*n/(n+o),h=s*o/(n+o);return{inner:{x:i.x-a*(e.x-t.x),y:i.y-a*(e.y-t.y)},outer:{x:i.x+h*(e.x-t.x),y:i.y+h*(e.y-t.y)}}},s.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),C=(s.calculateScaleRange=function(t,i,e,s,n){var o=2,a=Math.floor(i/(1.5*e)),h=o>=a,l=g(t),r=m(t);l===r&&(l+=.5,r>=.5&&!s?r-=.5:l+=.5);for(var c=Math.abs(l-r),u=y(c),d=Math.ceil(l/(1*Math.pow(10,u)))*Math.pow(10,u),p=s?0:Math.floor(r/(1*Math.pow(10,u)))*Math.pow(10,u),f=d-p,v=Math.pow(10,u),S=Math.round(f/v);(S>a||a>2*S)&&!h;)if(S>a)v*=2,S=Math.round(f/v),S%1!==0&&(h=!0);else if(n&&u>=0){if(v/2%1!==0)break;v/=2,S=Math.round(f/v)}else v/=2,S=Math.round(f/v);return h&&(S=o,v=f/S),{steps:S,stepValue:v,min:p,max:p+S*v}},s.template=function(t,i){function e(t,i){var e=/\W/.test(t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):s[t]=s[t];return i?e(i):e}if(t instanceof Function)return t(i);var s={};return e(t,i)}),w=(s.generateLabels=function(t,i,e,s){var o=new Array(i);return labelTemplateString&&n(o,function(i,n){o[n]=C(t,{value:e+s*(n+1)})}),o},s.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),st?-.5*s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e):s*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)*.5+1)},easeInBack:function(t){var i=1.70158;return 1*(t/=1)*t*((i+1)*t-i)},easeOutBack:function(t){var i=1.70158;return 1*((t=t/1-1)*t*((i+1)*t+i)+1)},easeInOutBack:function(t){var i=1.70158;return(t/=.5)<1?.5*t*t*(((i*=1.525)+1)*t-i):.5*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)},easeInBounce:function(t){return 1-w.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*w.easeInBounce(2*t):.5*w.easeOutBounce(2*t-1)+.5}}),b=s.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),P=s.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),L=(s.animationLoop=function(t,i,e,s,n,o){var a=0,h=w[e]||w.linear,l=function(){a++;var e=a/i,r=h(e);t.call(o,r,e,a),s.call(o,r,e),i>a?o.animationFrame=b(l):n.apply(o)};b(l)},s.getRelativePosition=function(t){var i,e,s=t.originalEvent||t,n=t.currentTarget||t.srcElement,o=n.getBoundingClientRect();return s.touches?(i=s.touches[0].clientX-o.left,e=s.touches[0].clientY-o.top):(i=s.clientX-o.left,e=s.clientY-o.top),{x:i,y:e}},s.addEvent=function(t,i,e){t.addEventListener?t.addEventListener(i,e):t.attachEvent?t.attachEvent("on"+i,e):t["on"+i]=e}),k=s.removeEvent=function(t,i,e){t.removeEventListener?t.removeEventListener(i,e,!1):t.detachEvent?t.detachEvent("on"+i,e):t["on"+i]=c},F=(s.bindEvents=function(t,i,e){t.events||(t.events={}),n(i,function(i){t.events[i]=function(){e.apply(t,arguments)},L(t.chart.canvas,i,t.events[i])})},s.unbindEvents=function(t,i){n(i,function(i,e){k(t.chart.canvas,e,i)})}),R=s.getMaximumWidth=function(t){var i=t.parentNode;return i.clientWidth},T=s.getMaximumHeight=function(t){var i=t.parentNode;return i.clientHeight},A=(s.getMaximumSize=s.getMaximumWidth,s.retinaScale=function(t){var i=t.ctx,e=t.canvas.width,s=t.canvas.height;window.devicePixelRatio&&(i.canvas.style.width=e+"px",i.canvas.style.height=s+"px",i.canvas.height=s*window.devicePixelRatio,i.canvas.width=e*window.devicePixelRatio,i.scale(window.devicePixelRatio,window.devicePixelRatio))}),M=s.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},W=s.fontString=function(t,i,e){return i+" "+t+"px "+e},z=s.longestText=function(t,i,e){t.font=i;var s=0;return n(e,function(i){var e=t.measureText(i).width;s=e>s?e:s}),s},B=s.drawRoundedRectangle=function(t,i,e,s,n,o){t.beginPath(),t.moveTo(i+o,e),t.lineTo(i+s-o,e),t.quadraticCurveTo(i+s,e,i+s,e+o),t.lineTo(i+s,e+n-o),t.quadraticCurveTo(i+s,e+n,i+s-o,e+n),t.lineTo(i+o,e+n),t.quadraticCurveTo(i,e+n,i,e+n-o),t.lineTo(i,e+o),t.quadraticCurveTo(i,e,i+o,e),t.closePath()};e.instances={},e.Type=function(t,i,s){this.options=i,this.chart=s,this.id=u(),e.instances[this.id]=this,i.responsive&&this.resize(),this.initialize.call(this,t)},a(e.Type.prototype,{initialize:function(){return this},clear:function(){return M(this.chart),this},stop:function(){return P(this.animationFrame),this},resize:function(t){this.stop();var i=this.chart.canvas,e=R(this.chart.canvas),s=this.options.maintainAspectRatio?e/this.chart.aspectRatio:T(this.chart.canvas);return i.width=this.chart.width=e,i.height=this.chart.height=s,A(this.chart),"function"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:c,render:function(t){return t&&this.reflow(),this.options.animation&&!t?s.animationLoop(this.draw,this.options.animationSteps,this.options.animationEasing,this.options.onAnimationProgress,this.options.onAnimationComplete,this):(this.draw(),this.options.onAnimationComplete.call(this)),this},generateLegend:function(){return C(this.options.legendTemplate,this)},destroy:function(){this.clear(),F(this,this.events);var t=this.chart.canvas;t.width=this.chart.width,t.height=this.chart.height,t.style.removeProperty?(t.style.removeProperty("width"),t.style.removeProperty("height")):(t.style.removeAttribute("width"),t.style.removeAttribute("height")),delete e.instances[this.id]},showTooltip:function(t,i){"undefined"==typeof this.activeElements&&(this.activeElements=[]);var o=function(t){var i=!1;return t.length!==this.activeElements.length?i=!0:(n(t,function(t,e){t!==this.activeElements[e]&&(i=!0)},this),i)}.call(this,t);if(o||i){if(this.activeElements=t,this.draw(),this.options.customTooltips&&this.options.customTooltips(!1),t.length>0)if(this.datasets&&this.datasets.length>1){for(var a,h,r=this.datasets.length-1;r>=0&&(a=this.datasets[r].points||this.datasets[r].bars||this.datasets[r].segments,h=l(a,t[0]),-1===h);r--);var c=[],u=[],d=function(){var t,i,e,n,o,a=[],l=[],r=[];return s.each(this.datasets,function(i){t=i.points||i.bars||i.segments,t[h]&&t[h].hasValue()&&a.push(t[h])}),s.each(a,function(t){l.push(t.x),r.push(t.y),c.push(s.template(this.options.multiTooltipTemplate,t)),u.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})},this),o=m(r),e=g(r),n=m(l),i=g(l),{x:n>this.chart.width/2?n:i,y:(o+e)/2}}.call(this,h);new e.MultiTooltip({x:d.x,y:d.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:c,legendColors:u,legendColorBackground:this.options.multiTooltipKeyBackground,title:t[0].label,chart:this.chart,ctx:this.chart.ctx,custom:this.options.customTooltips}).draw()}else n(t,function(t){var i=t.tooltipPosition();new e.Tooltip({x:Math.round(i.x),y:Math.round(i.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:C(this.options.tooltipTemplate,t),chart:this.chart,custom:this.options.customTooltips}).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),e.Type.extend=function(t){var i=this,s=function(){return i.apply(this,arguments)};if(s.prototype=o(i.prototype),a(s.prototype,t),s.extend=e.Type.extend,t.name||i.prototype.name){var n=t.name||i.prototype.name,l=e.defaults[i.prototype.name]?o(e.defaults[i.prototype.name]):{};e.defaults[n]=a(l,t.defaults),e.types[n]=s,e.prototype[n]=function(t,i){var o=h(e.defaults.global,e.defaults[n],i||{});return new s(t,o,this)}}else d("Name not provided for this chart, so it hasn't been registered");return i},e.Element=function(t){a(this,t),this.initialize.apply(this,arguments),this.save()},a(e.Element.prototype,{initialize:function(){},restore:function(t){return t?n(t,function(t){this[t]=this._saved[t]},this):a(this,this._saved),this},save:function(){return this._saved=o(this),delete this._saved._saved,this},update:function(t){return n(t,function(t,i){this._saved[i]=this[i],this[i]=t},this),this},transition:function(t,i){return n(t,function(t,e){this[e]=(t-this._saved[e])*i+this._saved[e]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return f(this.value)}}),e.Element.extend=r,e.Point=e.Element.extend({display:!0,inRange:function(t,i){var e=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(i-this.y,2)=this.startAngle&&e.angle<=this.endAngle,o=e.distance>=this.innerRadius&&e.distance<=this.outerRadius;return n&&o},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,i=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*i,y:this.y+Math.sin(t)*i}},draw:function(t){var i=this.ctx;i.beginPath(),i.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle),i.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0),i.closePath(),i.strokeStyle=this.strokeColor,i.lineWidth=this.strokeWidth,i.fillStyle=this.fillColor,i.fill(),i.lineJoin="bevel",this.showStroke&&i.stroke()}}),e.Rectangle=e.Element.extend({draw:function(){var t=this.ctx,i=this.width/2,e=this.x-i,s=this.x+i,n=this.base-(this.base-this.y),o=this.strokeWidth/2;this.showStroke&&(e+=o,s-=o,n+=o),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(e,this.base),t.lineTo(e,n),t.lineTo(s,n),t.lineTo(s,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,i){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&i>=this.y&&i<=this.base}}),e.Tooltip=e.Element.extend({draw:function(){var t=this.chart.ctx;t.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var i=this.caretPadding=2,e=t.measureText(this.text).width+2*this.xPadding,s=this.fontSize+2*this.yPadding,n=s+this.caretHeight+i;this.x+e/2>this.chart.width?this.xAlign="left":this.x-e/2<0&&(this.xAlign="right"),this.y-n<0&&(this.yAlign="below");var o=this.x-e/2,a=this.y-n;if(t.fillStyle=this.fillColor,this.custom)this.custom(this);else{switch(this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-i),t.lineTo(this.x+this.caretHeight,this.y-(i+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(i+this.caretHeight)),t.closePath(),t.fill();break;case"below":a=this.y+i+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+i),t.lineTo(this.x+this.caretHeight,this.y+i+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+i+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":o=this.x-e+(this.cornerRadius+this.caretHeight);break;case"right":o=this.x-(this.cornerRadius+this.caretHeight)}B(t,o,a,e,s,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,o+e/2,a+s/2)}}}),e.MultiTooltip=e.Element.extend({initialize:function(){this.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=W(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,i=z(this.ctx,this.font,this.labels)+this.fontSize+3,e=g([i,t]);this.width=e+2*this.xPadding;var s=this.height/2;this.y-s<0?this.y=s:this.y+s>this.chart.height&&(this.y=this.chart.height-s),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var i=this.y-this.height/2+this.yPadding,e=t-1;return 0===t?i+this.titleFontSize/2:i+(1.5*this.fontSize*e+this.fontSize/2)+1.5*this.titleFontSize},draw:function(){if(this.custom)this.custom(this);else{B(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,s.each(this.labels,function(i,e){t.fillStyle=this.textColor,t.fillText(i,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(e+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[e].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}}),e.Scale=e.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?z(this.ctx,this.font,this.yLabels):0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var t,i=this.endPoint-this.startPoint;for(this.calculateYRange(i),this.buildYLabels(),this.calculateXLabelRotation();i>this.endPoint-this.startPoint;)i=this.endPoint-this.startPoint,t=this.yLabelWidth,this.calculateYRange(i),this.buildYLabels(),tthis.yLabelWidth+10?e/2:this.yLabelWidth+10,this.xLabelRotation=0,this.display){var n,o=z(this.ctx,this.font,this.xLabels);this.xLabelWidth=o;for(var a=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>a&&0===this.xLabelRotation||this.xLabelWidth>a&&this.xLabelRotation<=90&&this.xLabelRotation>0;)n=Math.cos(S(this.xLabelRotation)),t=n*e,i=n*s,t+this.fontSize/2>this.yLabelWidth+8&&(this.xScalePaddingLeft=t+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=n*o;this.xLabelRotation>0&&(this.endPoint-=Math.sin(S(this.xLabelRotation))*o+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:c,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var i=this.drawingArea()/(this.min-this.max);return this.endPoint-i*(t-this.min)},calculateX:function(t){var i=(this.xLabelRotation>0,this.width-(this.xScalePaddingLeft+this.xScalePaddingRight)),e=i/Math.max(this.valuesCount-(this.offsetGridLines?0:1),1),s=e*t+this.xScalePaddingLeft;return this.offsetGridLines&&(s+=e/2),Math.round(s)},update:function(t){s.extend(this,t),this.fit()},draw:function(){var t=this.ctx,i=(this.endPoint-this.startPoint)/this.steps,e=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,n(this.yLabels,function(n,o){var a=this.endPoint-i*o,h=Math.round(a),l=this.showHorizontalLines;t.textAlign="right",t.textBaseline="middle",this.showLabels&&t.fillText(n,e-10,a),0!==o||l||(l=!0),l&&t.beginPath(),o>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),h+=s.aliasPixel(t.lineWidth),l&&(t.moveTo(e,h),t.lineTo(this.width,h),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(e-5,h),t.lineTo(e,h),t.stroke(),t.closePath()},this),n(this.xLabels,function(i,e){var s=this.calculateX(e)+x(this.lineWidth),n=this.calculateX(e-(this.offsetGridLines?.5:0))+x(this.lineWidth),o=this.xLabelRotation>0,a=this.showVerticalLines;0!==e||a||(a=!0),a&&t.beginPath(),e>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),a&&(t.moveTo(n,this.endPoint),t.lineTo(n,this.startPoint-3),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(n,this.endPoint),t.lineTo(n,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(s,o?this.endPoint+12:this.endPoint+8),t.rotate(-1*S(this.xLabelRotation)),t.font=this.font,t.textAlign=o?"right":"center",t.textBaseline=o?"middle":"top",t.fillText(i,0,0),t.restore()},this))}}),e.RadialScale=e.Element.extend({initialize:function(){this.size=m([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var i=this.drawingArea/(this.max-this.min);return(t-this.min)*i},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var t,i,e,s,n,o,a,h,l,r,c,u,d=m([this.height/2-this.pointLabelFontSize-5,this.width/2]),p=this.width,g=0;for(this.ctx.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),i=0;ip&&(p=t.x+s,n=i),t.x-sp&&(p=t.x+e,n=i):i>this.valuesCount/2&&t.x-e0){var s,n=e*(this.drawingArea/this.steps),o=this.yCenter-n;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,n,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var a=0;a=0;i--){if(this.angleLineWidth>0){var e=this.getPointPosition(i,this.calculateCenterOffset(this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(e.x,e.y),t.stroke(),t.closePath()}var s=this.getPointPosition(i,this.calculateCenterOffset(this.max)+5);t.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var o=this.labels.length,a=this.labels.length/2,h=a/2,l=h>i||i>o-h,r=i===h||i===o-h;t.textAlign=0===i?"center":i===a?"center":a>i?"left":"right",t.textBaseline=r?"middle":l?"bottom":"top",t.fillText(this.labels[i],s.x,s.y)}}}}}),s.addEvent(window,"resize",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){n(e.instances,function(t){t.options.responsive&&t.resize(t.render,!0)})},50)}}()),p?define(function(){return e}):"object"==typeof module&&module.exports&&(module.exports=e),t.Chart=e,e.noConflict=function(){return t.Chart=i,e}}).call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'
    <% for (var i=0; i
  • <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
'};i.Type.extend({name:"Bar",defaults:s,initialize:function(t){var s=this.options;this.ScaleClass=i.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,i,e){var n=this.calculateBaseWidth(),o=this.calculateX(e)-n/2,a=this.calculateBarWidth(t);return o+a*i+i*s.barDatasetSpacing+a/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*s.barValueSpacing},calculateBarWidth:function(t){var i=this.calculateBaseWidth()-(t-1)*s.barDatasetSpacing;return i/t}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getBarsAtEvent(t):[];this.eachBars(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),this.BarClass=i.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,bars:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.bars.push(new this.BarClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.strokeColor,fillColor:i.fillColor,highlightFill:i.highlightFill||i.fillColor,highlightStroke:i.highlightStroke||i.strokeColor}))},this)},this),this.buildScale(t.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars(function(t,i,s){e.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,s,i),y:this.scale.endPoint}),t.save()},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachBars(function(t){t.save()}),this.render()},eachBars:function(t){e.each(this.datasets,function(i,s){e.each(i.bars,t,this,s)},this)},getBarsAtEvent:function(t){for(var i,s=[],n=e.getRelativePosition(t),o=function(t){s.push(t.bars[i])},a=0;a<% for (var i=0; i
  • <%if(segments[i].label){%><%=segments[i].label%><%}%>
  • <%}%>'};i.Type.extend({name:"Doughnut",defaults:s,initialize:function(t){this.segments=[],this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=i.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.calculateTotal(t),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({value:t.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:t.color,highlightColor:t.highlight||t.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(t.value),label:t.label})),e||(this.reflow(),this.update())},calculateCircumference:function(t){return 2*Math.PI*(Math.abs(t)/this.total)},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=Math.abs(t.value)},this)},update:function(){this.calculateTotal(this.segments),e.each(this.activeElements,function(t){t.restore(["fillColor"])}),e.each(this.segments,function(t){t.save()}),this.render()},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,e.each(this.segments,function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},draw:function(t){var i=t?t:1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},i),t.endAngle=t.startAngle+t.circumference,t.draw(),0===e&&(t.startAngle=1.5*Math.PI),e<% for (var i=0; i
  • <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>'};i.Type.extend({name:"Line",defaults:s,initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)0&&ithis.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.ythis.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y0&&(s.lineTo(h[h.length-1].x,this.scale.endPoint),s.lineTo(h[0].x,this.scale.endPoint),s.fillStyle=t.fillColor,s.closePath(),s.fill()),e.each(h,function(t){t.draw()})},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'
      <% for (var i=0; i
    • <%if(segments[i].label){%><%=segments[i].label%><%}%>
    • <%}%>
    '};i.Type.extend({name:"PolarArea",defaults:s,initialize:function(t){this.segments=[],this.SegmentArc=i.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:t.length}),this.updateScaleRange(t),this.scale.update(),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),e||(this.reflow(),this.update())},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=t.value},this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var i=[];e.each(t,function(t){i.push(t.value)});var s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s,{size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),e.each(this.segments,function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),e.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),e.each(this.segments,function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})},this)},draw:function(t){var i=t||1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},i),t.endAngle=t.startAngle+t.circumference,0===e&&(t.startAngle=1.5*Math.PI),e<% for (var i=0; i
  • <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>'},initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){var o;this.scale.animation||(o=this.scale.getPointPosition(n,this.scale.calculateCenterOffset(e))),s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,x:this.options.animation?this.scale.xCenter:o.x,y:this.options.animation?this.scale.yCenter:o.y,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=e.getRelativePosition(t),s=e.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},i),n=2*Math.PI/this.scale.valuesCount,o=Math.round((s.angle-1.5*Math.PI)/n),a=[];return(o>=this.scale.valuesCount||0>o)&&(o=0),s.distance<=this.scale.drawingArea&&e.each(this.datasets,function(t){a.push(t.points[o])}),a},buildScale:function(t){this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var i=function(){var i=[];return e.each(t,function(t){t.data?i=i.concat(t.data):e.each(t.points,function(t){i.push(t.value)})}),i}(),s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s)},addData:function(t,i){this.scale.valuesCount++,e.each(t,function(t,e){var s=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:s.x,y:s.y,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.labels.push(i),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),e.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var i=t||1,s=this.chart.ctx;this.clear(),this.scale.draw(),e.each(this.datasets,function(t){e.each(t.points,function(t,e){t.hasValue()&&t.transition(this.scale.getPointPosition(e,this.scale.calculateCenterOffset(t.value)),i)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(t.points,function(t,i){0===i?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)},this),s.closePath(),s.stroke(),s.fillStyle=t.fillColor,s.fill(),e.each(t.points,function(t){t.hasValue()&&t.draw()})},this)}})}.call(this); -------------------------------------------------------------------------------- /www/css/templatemo_style.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Brownie Template 4 | 5 | http://www.templatemo.com/preview/templatemo_440_brownie 6 | 7 | COLOR CODES 8 | Black #1f1d1a 9 | Light Gray #929292 10 | Dark Gray #2a2a2a 11 | Brown #865701, rgb(134,87,1) 12 | Gold #b28601, rgb(178,134,1) 13 | 14 | TABLE OF CONTENT 15 | 1. Universal Styles 16 | 2. Header & Menu Styles 17 | 3. Home Styles 18 | 4. About & Services Styles 19 | 5. Contact & Footer Styles 20 | 7. Media Queries 21 | --------------------------------------*/ 22 | 23 | /* 1. Universal Styles 24 | --------------------------------------*/ 25 | * { font-family: 'Open Sans', sans-serif; } 26 | body { background: url('../images/body-bg.png') repeat; } 27 | h1, h2, h3 { text-transform: uppercase; } 28 | h2 { 29 | margin-top: 0; 30 | width: 100%; 31 | } 32 | h3 { 33 | font-size: 18px; 34 | font-weight: 600; 35 | margin-top: 0; 36 | } 37 | a:hover, a:focus { 38 | color: #b28601; 39 | text-decoration: none; 40 | } 41 | p { color: #929292; } 42 | ul { margin: 0; } 43 | 44 | .blue { 45 | color: #6BE; 46 | } 47 | 48 | .green { 49 | color: #6E6; 50 | } 51 | 52 | .col-md-6, 53 | .col-lg-6 { 54 | padding-left: 0; 55 | padding-right: 0; 56 | } 57 | .margin-top-15 { margin-top: 15px; } 58 | .margin-top-30 { margin-top: 30px; } 59 | .padding-30 { padding: 30px; } 60 | .templatemo-section-title { display: block; } 61 | .templatemo-home-image, 62 | .templatemo-image-overlay, 63 | .templatemo-black-bg { 64 | border-radius: 30px; 65 | width: 100%; 66 | } 67 | .templatemo-black-bg, 68 | .templatemo-content-box { 69 | width: 523px; 70 | height: 523px; 71 | } 72 | .templatemo-content-box { 73 | display: -webkit-box; 74 | display: -webkit-flex; 75 | display: -ms-flexbox; 76 | display: flex; 77 | -webkit-box-orient:vertical; 78 | -webkit-box-direction:normal; 79 | -webkit-flex-direction:column; 80 | -ms-flex-direction:column; 81 | flex-direction:column; 82 | -webkit-box-align: start; 83 | -webkit-align-items: flex-start; 84 | -ms-flex-align: start; 85 | align-items: flex-start; 86 | -webkit-box-pack: center; 87 | -webkit-justify-content: center; 88 | -ms-flex-pack: center; 89 | justify-content: center; 90 | padding: 50px; 91 | } 92 | /* IE fix */ 93 | .templatemo-flex-item-ie-fix, 94 | .templatemo-content-box > * { 95 | width: 100%; 96 | } 97 | .templatemo-flex-center { 98 | display: -webkit-box; 99 | display: -webkit-flex; 100 | display: -ms-flexbox; 101 | display: flex; 102 | -webkit-box-align: center; 103 | -webkit-align-items: center; 104 | -ms-flex-align: center; 105 | align-items: center; 106 | -webkit-box-pack: center; 107 | -webkit-justify-content: center; 108 | -ms-flex-pack: center; 109 | justify-content: center; 110 | } 111 | .templatemo-black-bg { 112 | background: url('../images/round-rectangle.png') no-repeat; 113 | background-position: center; 114 | background-size: contain; 115 | } 116 | .templatemo-brown-rectangle-bg { 117 | border: 1px solid #865701; 118 | border-radius: 30px; 119 | width: 80%; 120 | height: 80%; 121 | } 122 | .templatemo-brown { color: #865701; } 123 | .templatemo-gold { color: #b28601; } 124 | .templatemo-btn { 125 | background: #865701; 126 | color: white; 127 | -webkit-transition: all 0.3s ease; 128 | transition: all 0.3s ease; 129 | } 130 | .templatemo-btn:hover, .templatemo-btn:focus { 131 | background: #b28601; 132 | color: white; 133 | } 134 | .templatemo-position-relative { position: relative; } 135 | 136 | /* 2. Header & Menu Styles 137 | --------------------------------------*/ 138 | .templatemo-site-header { 139 | background: url('../images/header-bg.png') repeat-x; 140 | border-bottom: 1px solid #865701; 141 | height: 82px; 142 | position: fixed; 143 | top: 0; 144 | width: 100%; 145 | z-index: 2000; 146 | -webkit-transition: all 0.3s ease; 147 | transition: all 0.3s ease; 148 | } 149 | .templatemo-site-header.sticky { height: 47px; } 150 | .templatemo-site-header h1 { 151 | font-size: 60px; 152 | -webkit-transition: all 0.3s ease; 153 | transition: all 0.3s ease; 154 | } 155 | .templatemo-site-header.sticky h1 { font-size: 34px; } 156 | .templatemo-site-name { 157 | font-family: Georgia, Times, serif; 158 | margin-top: 0; 159 | margin-bottom: 0; 160 | padding-left: 30px; 161 | } 162 | .templatemo-site-name span { 163 | display: inline-block; 164 | vertical-align: middle; 165 | line-height: normal; 166 | } 167 | .templatemo-site-name span:first-child { font-size: 20px; } 168 | .templatemo-site-header .templatemo-nav { 169 | position: absolute; 170 | bottom: 14px; 171 | right: 0; 172 | -webkit-transition: all 0.3s ease; 173 | transition: all 0.3s ease; 174 | } 175 | .templatemo-site-header.sticky .templatemo-nav { bottom: 6px; } 176 | .ie11 .templatemo-site-header.sticky .templatemo-nav, 177 | .ie10 .templatemo-site-header.sticky .templatemo-nav { 178 | bottom: 7px; 179 | } 180 | 181 | /* 182 | https://stackoverflow.com/questions/952861/targeting-only-firefox-with-css/953491#953491 183 | */ 184 | @-moz-document url-prefix() { 185 | .templatemo-site-header .templatemo-nav { 186 | bottom: 16px; 187 | -webkit-transition: all 0.3s ease; 188 | transition: all 0.3s ease; 189 | } 190 | .templatemo-site-header.sticky .templatemo-nav { bottom: 8px; } 191 | } 192 | .templatemo-nav ul li { 193 | float: left; 194 | list-style: none; 195 | } 196 | .templatemo-nav ul li a { 197 | padding: 15px 20px; 198 | -webkit-transition: all 0.3s ease; 199 | transition: all 0.3s ease; 200 | } 201 | .templatemo-site-header.sticky .templatemo-nav ul li a { 202 | padding-top: 8px; 203 | padding-bottom: 8px; 204 | } 205 | .templatemo-nav ul li.active a { 206 | background: url('../images/body-bg.png'); 207 | border-left: 1px solid #865701; 208 | border-top: 1px solid #865701; 209 | border-right: 1px solid #865701; 210 | border-top-left-radius: 15px; 211 | border-top-right-radius: 15px; 212 | } 213 | .templatemo-nav ul li a { color: #865701; } 214 | #responsive-menu ul li:hover a, 215 | #responsive-menu ul li.active a, 216 | .templatemo-nav li:hover a, 217 | .templatemo-nav li.active a { 218 | color: #b28601; 219 | } 220 | .templatemo-nav li:hover a, 221 | .templatemo-nav li.active a, 222 | a:focus { 223 | text-decoration: none; 224 | } 225 | #responsive-menu { 226 | top: 0; 227 | width: 250px; 228 | height: 100%; 229 | background: rgba(116, 106, 64, 0.4); 230 | position: fixed; 231 | z-index: 5500; 232 | right: -1500px; 233 | display: none; 234 | overflow: auto; 235 | } 236 | #responsive-menu ul { 237 | padding: 0; 238 | margin: 0; 239 | list-style: none; 240 | } 241 | #responsive-menu ul li { 242 | display: block; 243 | margin-bottom: 2px; 244 | } 245 | #responsive-menu ul li a { 246 | padding: 12px 18px; 247 | background-color: #1f1d1a; 248 | color: #865701; 249 | display: block; 250 | -webkit-border-radius: 4px; 251 | -webkit-background-clip: padding-box; 252 | -moz-border-radius: 4px; 253 | -moz-background-clip: padding; 254 | border-radius: 4px; 255 | background-clip: padding-box; 256 | text-transform: uppercase; 257 | } 258 | #responsive-menu ul li a i { margin-right: 15px; } 259 | a#mobile_menu { 260 | font-size: 24px; 261 | background-color: rgba(178,134,1, 0.8); 262 | border-radius: 10px; 263 | color: #1f1d1a; 264 | width: 50px; 265 | height: 50px; 266 | display: block; 267 | text-align: center; 268 | line-height: 50px; 269 | position: fixed; 270 | top: 15px; 271 | right: 15px; 272 | z-index: 5500; 273 | } 274 | #responsive-menu ul li a:hover, 275 | #responsive-menu ul li.active a { 276 | background: #333; 277 | text-decoration: none; 278 | } 279 | 280 | /* 3. Home Styles 281 | --------------------------------------*/ 282 | #home { padding-top: 197px; } 283 | .templatemo-home-image-container { 284 | display: inline-block; 285 | position: relative; 286 | } 287 | .templatemo-image-overlay { 288 | background: rgba(51,51,51,0.9); /* OLD - iOS 6-, Safari 3.1-6 */ 289 | cursor: pointer; 290 | display: -webkit-flex; 291 | display: -ms-flexbox; 292 | display: -webkit-box; 293 | display: flex; 294 | -webkit-flex-direction: column; 295 | -ms-flex-direction: column; 296 | flex-direction: column; 297 | 298 | -webkit-justify-content: center; 299 | -ms-flex-pack: center; 300 | -webkit-box-pack: center; 301 | justify-content: center; 302 | 303 | -webkit-align-items: center; 304 | -webkit-box-align: center; 305 | -ms-flex-align: center; 306 | -webkit-box-align: center; 307 | align-items: center; 308 | 309 | -webkit-box-orient: vertical; 310 | -webkit-box-pack: center; 311 | -ms-flex-pack: center; 312 | 313 | opacity: 0; 314 | position: absolute; 315 | top: 0; 316 | left: 0; 317 | width: 100%; 318 | height: 100%; 319 | } 320 | .templatemo-image-overlay:hover { 321 | opacity: 1; 322 | -webkit-transition: all 0.3s ease; 323 | transition: all 0.3s ease; 324 | } 325 | .templatemo-search-icon { 326 | background: #865701; 327 | border-radius: 50%; 328 | font-size: 30px; 329 | padding: 30px; 330 | margin-bottom: 15px; 331 | } 332 | .templatemo-info-btn { 333 | margin-top: 30px; 334 | padding-left: 15px; 335 | padding-right: 15px; 336 | max-width: 150px; 337 | } 338 | 339 | /* 4. About & Services Styles 340 | --------------------------------------*/ 341 | .templatemo-team-member-container { 342 | max-width: 250px; 343 | margin: 0 auto; 344 | } 345 | .tm-team-member-title { 346 | font-size: 18px; 347 | font-weight: 400; 348 | margin-bottom: 0; 349 | } 350 | .templatemo-member-img-container { 351 | display: inline-block; 352 | position: relative; 353 | } 354 | .templatemo-img-frame { position: absolute; } 355 | 356 | .templatemo-service-image { 357 | display: block; 358 | float: left; 359 | } 360 | .templatemo-service-container { margin-top: 15px; } 361 | .templatemo-service-content { margin-left: 90px; } 362 | h3.templatemo-service-title { 363 | font-size: 14px; 364 | margin-bottom: 5px; 365 | margin-top: 0; 366 | } 367 | 368 | /* 5. Contact & Footer Styles 369 | -------------------------------------*/ 370 | form { width: 430px; } 371 | .form-control { 372 | background: #1f1d1a; 373 | border: 1px solid #865701; 374 | border-radius: 10px; 375 | color: #b28601; 376 | } 377 | .form-control:focus { border: 1px solid #b28601; } 378 | .templatemo-send-btn { 379 | background: #774d01; 380 | color: #C5A554; 381 | } 382 | /* http://css-tricks.com/snippets/css/style-placeholder-text/ */ 383 | .form-control::-webkit-input-placeholder { color: #b28601; } 384 | .form-control:-moz-placeholder { color: #b28601; } /* Firefox 18- */ 385 | .form-control::-moz-placeholder { color: #b28601; } /* Firefox 19+ */ 386 | .form-control:-ms-input-placeholder { color: #b28601; } 387 | 388 | .templatemo-social-icons-img { display: none; } 389 | .templatemo-social-icon { 390 | display: inline-block; 391 | width: 52px; 392 | height: 44px; 393 | } 394 | #facebook { background: url('../images/social-icons.png') -5px 0; } 395 | #twitter { background: url('../images/social-icons.png') -59px 0; } 396 | #google { background: url('../images/social-icons.png') -113px 0; } 397 | #vimeo { background: url('../images/social-icons.png') -167px 0; } 398 | #flickr { background: url('../images/social-icons.png') -220px 0; } 399 | footer { padding-bottom: 50px; } 400 | .templatemo-copyright-container { padding-left: 30px; } 401 | 402 | /* 7. Media Queries 403 | --------------------------------------*/ 404 | @media screen and (max-width: 1199px) { 405 | .templatemo-black-bg, 406 | .templatemo-content-box { 407 | width: 480px; 408 | height: 523px; 409 | } 410 | } 411 | 412 | @media screen and (max-width: 991px) { 413 | .templatemo-site-header { height: 48px; } 414 | .templatemo-site-header h1 { font-size: 35px; } 415 | .templatemo-site-header .templatemo-nav { 416 | right: 10px; 417 | bottom: 8px; 418 | } 419 | /*https://stackoverflow.com/questions/952861/targeting-only-firefox-with-css/953491#953491*/ 420 | @-moz-document url-prefix() { 421 | .templatemo-site-header .templatemo-nav { 422 | bottom: 11px; 423 | } 424 | } 425 | .ie11 .templatemo-site-header .templatemo-nav, 426 | .ie10 .templatemo-site-header .templatemo-nav { 427 | bottom: 9px; 428 | } 429 | .ie11 .templatemo-site-header.sticky .templatemo-nav { 430 | bottom: 7px; 431 | } 432 | 433 | .templatemo-nav ul li a { 434 | padding-top: 10px; 435 | padding-bottom: 10px; 436 | } 437 | #home { padding-top: 100px; } 438 | .templatemo-black-bg, 439 | .templatemo-content-box { 440 | margin-left: auto; 441 | margin-right: auto; 442 | } 443 | .templatemo-content-box { 444 | height: auto; 445 | padding: 15px; 446 | } 447 | .templatemo-section { margin-top: 50px; } 448 | } 449 | 450 | @media screen and (max-width: 767px) { 451 | .templatemo-site-header { position: static; } 452 | .templatemo-nav { bottom: -6px; } 453 | #home { padding-top: 30px; } 454 | .templatemo-black-bg, 455 | .templatemo-content-box { 456 | width: 98%; 457 | height: auto; 458 | } 459 | .templatemo-black-bg { 460 | background: #1B1B1B; 461 | border: 1px solid #865701; 462 | border-radius: 30px; 463 | padding: 30px; 464 | } 465 | .templatemo-brown-rectangle-bg { 466 | width: 100%; 467 | padding: 30px; 468 | } 469 | .templatemo-second-box { margin-top: 50px; } 470 | .templatemo-service-container > * { text-align: center; } 471 | .templatemo-service-image { 472 | float: none; 473 | margin: 20px auto 10px auto; 474 | } 475 | .templatemo-service-content { 476 | margin-left: auto; 477 | margin-right: auto; 478 | } 479 | .templatemo-copyright-container { padding-left: 0; } 480 | } 481 | 482 | @media screen and (max-width: 400px) { 483 | .templatemo-black-bg { padding: 15px; } 484 | .templatemo-brown-rectangle-bg { padding: 5px; } 485 | .templatemo-product-container { 486 | padding-top: 8px; 487 | padding-bottom: 8px; 488 | } 489 | .templatemo-product-img { 490 | margin-top: 20px; 491 | width: 75%; 492 | } 493 | } 494 | -------------------------------------------------------------------------------- /www/images/body-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-demo-php-simple-app/f1c74a7176d635c3c137f1d5febf5c280abcb133/www/images/body-bg.png -------------------------------------------------------------------------------- /www/images/header-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-demo-php-simple-app/f1c74a7176d635c3c137f1d5febf5c280abcb133/www/images/header-bg.png -------------------------------------------------------------------------------- /www/images/round-rectangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-demo-php-simple-app/f1c74a7176d635c3c137f1d5febf5c280abcb133/www/images/round-rectangle.png -------------------------------------------------------------------------------- /www/images/underline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-demo-php-simple-app/f1c74a7176d635c3c137f1d5febf5c280abcb133/www/images/underline.png -------------------------------------------------------------------------------- /www/index.php: -------------------------------------------------------------------------------- 1 | 22 | 23 | 24 | 32 | AWS Demo Web Application 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 52 |
    53 |
    54 |
    55 | 64 |

    65 | AWS 66 | 67 |

    68 |
    69 | 70 |
    71 |
    72 |
    73 |
    74 |
    75 |
    76 |
    77 |
    78 | 79 |
    80 |
    81 |
    82 |

    System Overview

    83 |

    Overview of major system components.

    84 |

    System overview information for top processes and resources used.

    85 |
    86 |
    87 |
    88 |
    89 |
    90 |
    91 |
    92 |
    93 |
    94 |
    95 |

    96 | CPU 97 | Information Graph 98 |

    99 |

    CPU use information in graph presentation.

    100 |
    101 |
    102 |
    103 | 104 |
    105 |
    106 |
    107 |
    108 |
    109 |
    110 |
    111 |
    112 | 113 |
    114 |
    115 |
    116 |

    117 | RAM 118 | System Memory 119 |

    120 |

    System memory.

    121 |
    122 |
    123 |
    124 |
    125 |
    126 |
    127 |
    128 |
    129 |
    130 |
    131 |

    132 | Current Network 133 | Use DATA 134 |

    135 |

    Current Error, Drop, Tx, and Rx data values.

    136 |
    137 |
    138 |
    139 | 140 |
    141 |
    142 |
    143 |
    144 |
    145 |
    146 |
    147 |
    148 | 149 |
    150 |
    151 |
    152 |

    Disk Usage STORAGE

    153 |

    Current storage utilization. Hard disk space on system.

    154 |
    155 |
    156 |
    157 |
    158 |
    159 | 169 | 170 | 171 | 195 | 226 | 231 | 254 | 300 | 329 | 330 | 331 | -------------------------------------------------------------------------------- /www/js/templatemo_script.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | 3 | "use strict"; 4 | 5 | // Cache selectors 6 | var lastId, 7 | topMenu = $(".menu-holder"), 8 | topMenuHeight = 55, 9 | // All list items 10 | menuItems = topMenu.find("a"), 11 | // Anchors corresponding to menu items 12 | scrollItems = menuItems.map(function(){ 13 | var item = $($(this).attr("href")); 14 | 15 | if (item.length) { 16 | return item; 17 | } 18 | }); 19 | 20 | if($(window).width()<=767){ 21 | topMenuHeight = 0; 22 | } 23 | 24 | // Bind click handler to menu items 25 | // so we can get a fancy scroll animation 26 | menuItems.click(function(e){ 27 | var href = $(this).attr("href"); 28 | var offsetTop = href === "#" ? 0 : $(href).offset().top - topMenuHeight + 1; 29 | 30 | $('html, body').stop().animate({ 31 | scrollTop: offsetTop 32 | }, 300); 33 | 34 | e.preventDefault(); 35 | }); 36 | 37 | // Bind to scroll 38 | $(window).scroll(function(){ 39 | // Get container scroll position 40 | var fromTop = $(this).scrollTop()+topMenuHeight; 41 | 42 | // Get id of current scroll item 43 | var cur = scrollItems.map(function(){ 44 | if ($(this).offset().top < fromTop) 45 | return this; 46 | }); 47 | 48 | // Get the id of the current element 49 | cur = cur[cur.length-1]; 50 | var id = cur && cur.length ? cur[0].id : ""; 51 | 52 | if (lastId !== id && id != "") { 53 | lastId = id; 54 | // Set/remove active class 55 | menuItems 56 | .parent().removeClass("active") 57 | .end().filter("[href=#"+id+"]").parent().addClass("active"); 58 | } 59 | 60 | changeNavMenu(); 61 | }); 62 | 63 | //mobile menu and desktop menu 64 | $("#responsive-menu").css({"right":-1500}); 65 | $("#mobile_menu").click(function(){ 66 | $("#responsive-menu").show(); 67 | 68 | if($("#responsive-menu").css("right") == "-1500px") 69 | { 70 | $("#responsive-menu").animate({ "right":0 }, 400); 71 | } 72 | else 73 | { 74 | $("#responsive-menu").animate({ "right":-1500 }, 400); 75 | } 76 | 77 | return false; 78 | }); 79 | $(window).on("load resize", function(){ 80 | changeNavMenu(); 81 | }); 82 | 83 | $("#responsive-menu a").click(function(){ 84 | $("#responsive-menu").animate({ "right":-1500 }, 400); 85 | }); 86 | 87 | })(jQuery); 88 | 89 | function changeNavMenu(){ 90 | if($(window).width()>767) 91 | { 92 | $("#responsive-menu").css({"right":-1500}); 93 | 94 | if ($(window).scrollTop() > 1) 95 | { 96 | $('.templatemo-site-header').addClass("sticky"); 97 | } 98 | else 99 | { 100 | $('.templatemo-site-header').removeClass("sticky"); 101 | } 102 | } 103 | else { 104 | $('.templatemo-site-header').removeClass("sticky"); 105 | } 106 | } 107 | 108 | /* http://marxo.me/target-ie-in-css/ 109 | -----------------------------------------*/ 110 | function detectIE(){ 111 | // Detect IE and append class to element 112 | var UA = navigator.userAgent; 113 | var html = document.documentElement; 114 | if (UA.indexOf("IEMobile") === -1) { 115 | if ((UA.indexOf("rv:11.") !== -1) && (!html.classList.contains('ie11')) && window.navigator.msPointerEnabled) { 116 | html.classList.add("ie11"); 117 | } else if ((UA.indexOf("MSIE 10.") !== -1) && (!html.classList.contains('ie10')) && window.navigator.msPointerEnabled) { 118 | html.classList.add("ie10"); 119 | } 120 | } 121 | } 122 | 123 | /* HTML document is loaded. DOM is ready. 124 | -----------------------------------------*/ 125 | $(document).ready(function() 126 | { 127 | detectIE(); 128 | }); 129 | -------------------------------------------------------------------------------- /www/lib.php: -------------------------------------------------------------------------------- 1 | "); 27 | $fht = fopen('/sys/class/net/eth0/statistics/tx_bytes','r') or die("Could not read DX interface information
    "); 28 | $fhe = fopen('/sys/class/net/eth0/statistics/rx_errors','r') or die("Could not read DX interface information
    "); 29 | $fhd = fopen('/sys/class/net/eth0/statistics/rx_dropped','r') or die("Could not read DX interface information
    "); 30 | 31 | $net_info = array(); 32 | 33 | $net_info['rx'] = trim(fgets($fhr)); 34 | $net_info['tx'] = trim(fgets($fht)); 35 | $net_info['ex'] = trim(fgets($fhe)); 36 | $net_info['dx'] = trim(fgets($fhd)); 37 | 38 | fclose($fhr); 39 | fclose($fht); 40 | fclose($fhe); 41 | fclose($fhd); 42 | 43 | return $net_info; 44 | } 45 | 46 | function get_cpu() 47 | { 48 | $cpu_info = sys_getloadavg(); 49 | 50 | return $cpu_info; 51 | } 52 | 53 | function get_disk() 54 | { 55 | $disk_info = array(); 56 | 57 | $disk_info['total'] = disk_total_space("/"); 58 | $disk_info['free'] = disk_free_space("/"); 59 | $disk_info['used'] = $disk_info['total'] - $disk_info['free']; 60 | 61 | return $disk_info; 62 | } 63 | 64 | function get_mem() 65 | { 66 | $fh = fopen('/proc/meminfo','r') or die("Could not read memory information
    "); 67 | 68 | $mem_info = array(); 69 | 70 | while ($line = fgets($fh)) 71 | { 72 | if(preg_match('/^MemTotal:/', $line)) 73 | { 74 | $stor = str_replace("kB","",str_replace("MemTotal:", "", str_replace(' ','',trim($line)))); 75 | $mem_info['total'] = $stor; 76 | } 77 | if(preg_match('/^MemFree:/', $line)) 78 | { 79 | $stor = str_replace("kB","",str_replace("MemFree:", "", str_replace(' ','',trim($line)))); 80 | $mem_info['free'] = $stor; 81 | } 82 | if(preg_match('/^MemAvailable:/', $line)) 83 | { 84 | $stor = str_replace("kB","",str_replace("MemAvailable:", "", str_replace(' ','',trim($line)))); 85 | $mem_info['avail'] = $stor; 86 | } 87 | if(preg_match('/^Cached:/', $line)) 88 | { 89 | $stor = str_replace("kB","",str_replace("Cached:", "", str_replace(' ','',trim($line)))); 90 | $mem_info['cach'] = $stor; 91 | } 92 | } 93 | 94 | fclose($fh); 95 | 96 | return $mem_info; 97 | } 98 | 99 | 100 | -------------------------------------------------------------------------------- /www/loadAuto.php: -------------------------------------------------------------------------------- 1 | 9 | // 10 | //Integer should be a numeric value representing the level 11 | //of load to be used. This value is used with the password 12 | //hasing algorithm which is the source of the load. 13 | // 14 | //Prior to use, enable the use of load generation from 15 | //within the config.php file. 16 | 17 | $configLoad = 0; 18 | 19 | if(file_exists('../config.php')) 20 | { 21 | include '../config.php'; 22 | $configLoad = 1; 23 | } 24 | if(file_exists('config.php')) 25 | { 26 | include 'config.php'; 27 | $configLoad = 1; 28 | } 29 | if($configLoad != 1) 30 | { 31 | print "Could not load config...\n"; 32 | exit(1); 33 | } 34 | 35 | if($configLoad != 1) 36 | { 37 | print "Could not load config...\n"; 38 | exit(1); 39 | } 40 | 41 | if($loadGenUse != 1) 42 | { 43 | if(!isset($GLOBALS['LOAD_OVERRIDE'])) 44 | { 45 | print "Load Generator not configured for use.\n"; 46 | exit(1); 47 | } 48 | if($GLOBALS['LOAD_OVERRIDE'] != 1) 49 | { 50 | print "Load Generator not configured for use.\n"; 51 | exit(1); 52 | } 53 | } 54 | 55 | include 'loadFunctions.php'; 56 | 57 | if(!isset($_GET['cost'])) 58 | { 59 | print "Missing Cost Variable\n"; 60 | exit(1); 61 | } 62 | 63 | $strLen = 14; 64 | $cost = $_GET['cost']; 65 | $count = 1; 66 | 67 | $options = array('cost' => $cost); 68 | 69 | for($i = 0; $i < $count; $i++) 70 | { 71 | $string = generateRandomString($strLen); 72 | $hash = password_hash($string,PASSWORD_DEFAULT,$options); 73 | if($configLoad == 1) 74 | { 75 | print base64_encode($hash)."~".$string."~".$cost."\n"; 76 | } 77 | 78 | if(password_verify($string,$hash)) 79 | { 80 | print "Hash Valid"; 81 | } 82 | else 83 | { 84 | print "Hash Invalid"; 85 | } 86 | 87 | } 88 | print "

    "; 89 | print ""; 90 | 91 | $cpuLoad = sys_getloadavg(); 92 | if(!isset($cpuLoad[0])) 93 | { 94 | print "Error returning CPU Load\n
    "; 95 | exit(1); 96 | } 97 | print ""; 98 | print ""; 99 | print ""; 100 | print "
    Current CPU Use:
    1 Min Avg - ".$cpuLoad[0]."
    5 Min Avg - ".$cpuLoad[1]."
    15 Min Avg - ".$cpuLoad[2]."
    "; 101 | 102 | ?> 103 | 104 | 105 | -------------------------------------------------------------------------------- /www/loadCreate.php: -------------------------------------------------------------------------------- 1 | $cost); 54 | 55 | for($i = 0; $i < $count; $i++) 56 | { 57 | $string = generateRandomString($strLen); 58 | $hash = password_hash($string,PASSWORD_DEFAULT,$options); 59 | if($configLoad == 1) 60 | { 61 | print base64_encode($hash)."~".$string."~".$cost."\n"; 62 | } 63 | } 64 | ?> 65 | -------------------------------------------------------------------------------- /www/loadFunctions.php: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /www/loadGen.php: -------------------------------------------------------------------------------- 1 | 50)) 48 | { 49 | print "Valid values for cost are: 1 - 50.\n"; 50 | exit(1); 51 | } 52 | 53 | $options = array('cost' => $cost); 54 | 55 | if(password_verify($string,$hash)) 56 | { 57 | print "Hash Valid"; 58 | } 59 | else 60 | { 61 | print "Hash Invalid"; 62 | } 63 | ?> 64 | -------------------------------------------------------------------------------- /www/loadTest/index.php: -------------------------------------------------------------------------------- 1 | 9 | // 10 | //Integer should be a numeric value representing the level 11 | //of load to be used. This value is used with the password 12 | //hasing algorithm which is the source of the load. 13 | // 14 | //Prior to use, enable the use of load generation from 15 | //within the config.php file. 16 | 17 | $configLoad = 0; 18 | 19 | if(file_exists('../config.php')) 20 | { 21 | include '../config.php'; 22 | $configLoad = 1; 23 | } 24 | if(file_exists('../../config.php')) 25 | { 26 | include '../../config.php'; 27 | $configLoad = 1; 28 | } 29 | if(file_exists('config.php')) 30 | { 31 | include 'config.php'; 32 | $configLoad = 1; 33 | } 34 | if($configLoad != 1) 35 | { 36 | print "Could not load config...\n"; 37 | exit(1); 38 | } 39 | 40 | if($configLoad != 1) 41 | { 42 | print "Could not load config...\n"; 43 | exit(1); 44 | } 45 | 46 | if($loadGenUse != 1) 47 | { 48 | if(!isset($GLOBALS['LOAD_OVERRIDE'])) 49 | { 50 | print "Load Generator not configured for use.\n"; 51 | exit(1); 52 | } 53 | if($GLOBALS['LOAD_OVERRIDE'] != 1) 54 | { 55 | print "Load Generator not configured for use.\n"; 56 | exit(1); 57 | } 58 | } 59 | 60 | include '../loadFunctions.php'; 61 | 62 | if(!isset($_GET['cost'])) 63 | { 64 | $cost = 10; 65 | } 66 | else 67 | { 68 | $cost = $_GET['cost']; 69 | } 70 | 71 | $strLen = 14; 72 | $count = 1; 73 | 74 | $options = array('cost' => $cost); 75 | 76 | for($i = 0; $i < $count; $i++) 77 | { 78 | $string = generateRandomString($strLen); 79 | $hash = password_hash($string,PASSWORD_DEFAULT,$options); 80 | if($configLoad == 1) 81 | { 82 | print base64_encode($hash)."~".$string."~".$cost."\n"; 83 | } 84 | 85 | if(password_verify($string,$hash)) 86 | { 87 | print "Hash Valid"; 88 | } 89 | else 90 | { 91 | print "Hash Invalid"; 92 | } 93 | 94 | } 95 | print "

    "; 96 | print ""; 97 | 98 | $cpuLoad = sys_getloadavg(); 99 | if(!isset($cpuLoad[0])) 100 | { 101 | print "Error returning CPU Load\n
    "; 102 | exit(1); 103 | } 104 | print ""; 105 | print ""; 106 | print ""; 107 | print "
    Current CPU Use:
    1 Min Avg - ".$cpuLoad[0]."
    5 Min Avg - ".$cpuLoad[1]."
    15 Min Avg - ".$cpuLoad[2]."
    "; 108 | 109 | ?> 110 | --------------------------------------------------------------------------------