diff --git a/week-04/README.md b/week-04/README.md new file mode 100644 index 0000000..a40afa0 --- /dev/null +++ b/week-04/README.md @@ -0,0 +1,39 @@ +# Homework: PDO and CRUD + +Create a database named "sportstars". Inside that database, create a table also named "sportstars". Inside that table, the following column names would be required to complete the assignment: + +| id | int(11) | primary key, not null, auto increment | +| --- | --- | --- | +| name | varchar(100) | not null | +| age | int(3) | not null | +| sport | varchar(100) | not null | + +Create a PHP Web Application using the lesson plans taught during this week regarding PHP Data Objects (PDO), as well as the skills being used in the CMS project regarding CRUD (Create, Read, Update, and Delete) to create a fully-functional, dynamic, database-driven web application that will allow the user to enter the name, age, and sport of the sport star. The following criteria would be required when completing this: + +- The Homepage (first page to access) MUST include a blank table. This table will display column headings "Name", "Age", "Sport", and "Update". There should be a link to allow the user to add a new sport star above or below the table. The last column in the table should be two separate links, one of which states "Edit" and another that states "Delete". +- When a user adds a new sport star, it'll take them to a form where the user will fill out the proper fields. Proper error handling must be displayed for a form with invalid characters, as well as empty form fields. When the user submits the newly created sport star, they should be told that the star has been added successfully with a link to go back to the Homepage to view the newly created star. +- When a user edits an existing sport star, it'll take them to an auto-filled form that has the information currently existing for the sport star in the form field. The user can change the information. Upon updating the existing sport star, the user should be redirected to the Homepage and be able to view their changes. The previously existing information should now display the updated information. +- When a user deletes an existing sport star, it should first give them a warning (either a new page or an alert box) asking the user to confirm the deletion or cancel it. Once confirmed, the sport star should be removed from both the database and the table on the Homepage. + +Keep in mind that this is being done in PDO. The use of mysqli in PHP is FORBIDDEN and will result in a loss of points. Make sure upon completion to zip up your project files (with all pages created for this assignment) and then submit in this assignment. + +Include a dump of your test database using the mysqldump program or phpmyAdmin and upload the exported file with your submission. Here are some sites with tutorials that show you how to use mysqldump and phpMyAdmin: + +[How to export a database with mysqldump](http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html) +[How to export a database using phpMyAdmin](http://fragments.turtlemeat.com/mysql-database-backup-restore-phpmyadmin.php) + +> See [homework](https://git.vdm.dev/champlain/WEBD-325-45/src/branch/master/week-04/homework)... + +# Project: Content Management of Subjects + +Complete the scripts to manage content for multiple subjects on the public site for your CMS projects. Your functionality should include all necessary CRUD (Create, Read, Update, Delete) tasks required to maintain subject categories on the public site. Remember that a logged in administrator (that was created in week 3) should have the ability to create, update, and delete the subjects appropriately. When an admin is updating a subject, the form field should be auto-filled with the information that is currently displaying for the subject. The admin and all users should have the ability to read the subjects. After you complete this part of your project, zip up your entire project and submit in this assignment. + +There will be 2 points of extra credit awarded if PDO is used to complete the database programming with MySQL and PHP. There will be an additional 3 points extra credit awarded if you incorporate the Composer Library into your project. Make sure to send me a submission comment about your use of PDO and/or the Composer Library and what exactly you did with Composer so the extra credit can be awarded appropriately. + +Also, make sure to include a dump of your test database using the mysqldump program or phpMyAdmin and upload the exported file with your submission. Here are some sites with tutorials that show how to use mysqldump and phpMyAdmin: + +[How to export a database with mysqldump](http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html) +[How to export a database using phpMyAdmin](http://fragments.turtlemeat.com/mysql-database-backup-restore-phpmyadmin.php) + +> See [project proposal](https://git.vdm.dev/champlain/WEBD-325-45/src/branch/master/week-04/project)... + diff --git a/week-04/project/.gitignore b/week-04/project/.gitignore new file mode 100644 index 0000000..91d907b --- /dev/null +++ b/week-04/project/.gitignore @@ -0,0 +1,28 @@ +# IDE & System Related Files +.buildpath +.project +.settings +.DS_Store +.idea +.vscode +.docker +/docker-compose.yml +/nbproject + +# Local System File +/octoconfig.php +/.htaccess +/web.config +/php.ini + +# Vendor directory handling +/libraries/vendor + +# OSX +._* +.Spotlight-V100 +.Trashes + +# Windows +Thumbs.db +Desktop.ini \ No newline at end of file diff --git a/week-04/project/LICENSE b/week-04/project/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/week-04/project/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/week-04/project/README.md b/week-04/project/README.md new file mode 100644 index 0000000..73c3ae1 --- /dev/null +++ b/week-04/project/README.md @@ -0,0 +1,28 @@ +# Login To Admin Area or Create an Account + +This is the basic basic dependency injection CMS + +## To install this CMS + +1. Import the SQL tables into your database found in /sql/install.sql +2. Copy the /octoconfig.php.example file to /octoconfig.php +3. Update the /octoconfig.php to reflect your CMS details +4. Remove the installation folder from you root directory + +## To install all composer libraries + +0. Make sure you have [composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos) installed on your system. +1. In your terminal go to the root folder of your Octoleo website where you will find the composer.json file. +2. Run the following command composer install to install all PHP packages. + +## To create an Account + +1. Open [hostname:]/administrator +2. Click on link that says create Account +3. Fill in your details [done] + +## To login to admin/staff area + +1. Open [hostname:]/administrator +2. Add you username and password +3. Click login [done] diff --git a/week-04/project/administrator/includes/app.php b/week-04/project/administrator/includes/app.php new file mode 100644 index 0000000..0f10dc1 --- /dev/null +++ b/week-04/project/administrator/includes/app.php @@ -0,0 +1,97 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +defined('_LEXEC') or die; + +// Option to override defines from root folder +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/app.php#L15 +if (file_exists(dirname(__DIR__) . '/defines.php')) +{ + include_once dirname(__DIR__) . '/defines.php'; +} + +// Load the default defines +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/app.php#L20 +if (!defined('_LDEFINES')) +{ + define('LPATH_BASE', dirname(__DIR__)); + require_once LPATH_BASE . '/includes/defines.php'; +} + +// Check for presence of vendor dependencies not included in the git repository +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/app.php#L26 +if (!file_exists(LPATH_LIBRARIES . '/vendor/autoload.php')) +{ + echo file_get_contents(LPATH_ROOT . '/templates/system/build_incomplete.html'); + + exit; +} + +// Load configuration (or install) +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/app.php#L34 +require_once LPATH_BASE . '/includes/framework.php'; + +// Wrap in a try/catch so we can display an error if need be +try +{ + $container = (new Joomla\DI\Container) + ->registerServiceProvider(new Octoleo\CMS\Service\ConfigurationProvider(LPATH_CONFIGURATION . '/octoconfig.php')) + ->registerServiceProvider(new Octoleo\CMS\Service\SessionProvider) + ->registerServiceProvider(new Octoleo\CMS\Service\UserProvider) + ->registerServiceProvider(new Octoleo\CMS\Service\AdminApplicationProvider) + ->registerServiceProvider(new Joomla\Database\Service\DatabaseProvider) + ->registerServiceProvider(new Octoleo\CMS\Service\EventProvider) + ->registerServiceProvider(new Octoleo\CMS\Service\HttpProvider) + ->registerServiceProvider(new Octoleo\CMS\Service\LoggingProvider) + ->registerServiceProvider(new Joomla\Preload\Service\PreloadProvider) + ->registerServiceProvider(new Octoleo\CMS\Service\TemplatingProvider); + + // Alias the web application to Octoleo's base application class as this is the primary application for the environment + $container->alias(Joomla\Application\AbstractApplication::class, Joomla\Application\AbstractWebApplication::class); + + // Alias the web logger to the PSR-3 interface as this is the primary logger for the environment + $container->alias(Monolog\Logger::class, 'monolog.logger.application.web') + ->alias(Psr\Log\LoggerInterface::class, 'monolog.logger.application.web'); +} +catch (\Throwable $e) +{ + error_log($e); + + header('HTTP/1.1 500 Internal Server Error', null, 500); + echo 'Container Initialization Error

Container Initialization Error

An error occurred while creating the DI container: ' . $e->getMessage() . '

'; + + exit(1); +} + +// Execute the application +// source: https://github.com/joomla/framework.joomla.org/blob/master/www/index.php#L85 +try +{ + $app = $container->get(Joomla\Application\AbstractApplication::class); + // Set the application as global app + \Octoleo\CMS\Factory::$application = $app; + // Execute the application. + $app->execute(); +} +catch (\Throwable $e) +{ + error_log($e); + + if (!headers_sent()) + { + header('HTTP/1.1 500 Internal Server Error', null, 500); + header('Content-Type: text/html; charset=utf-8'); + } + + echo 'Application Error

Application Error

An error occurred while executing the application: ' . $e->getMessage() . '

'; + + exit(1); +} +// I am just playing around... ((ewɘ))yn purring \ No newline at end of file diff --git a/week-04/project/administrator/includes/defines.php b/week-04/project/administrator/includes/defines.php new file mode 100644 index 0000000..ed34049 --- /dev/null +++ b/week-04/project/administrator/includes/defines.php @@ -0,0 +1,24 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +defined('_LEXEC') or die; + +// Global definitions +$parts = explode(DIRECTORY_SEPARATOR, LPATH_BASE); +array_pop($parts); + +// Defines. +define('LPATH_ROOT', implode(DIRECTORY_SEPARATOR, $parts)); +define('LPATH_SITE', LPATH_ROOT); +define('LPATH_CONFIGURATION', LPATH_ROOT); +define('LPATH_ADMINISTRATOR', LPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator'); +define('LPATH_LIBRARIES', LPATH_ROOT . DIRECTORY_SEPARATOR . 'libraries'); +define('LPATH_INSTALLATION', LPATH_ROOT . DIRECTORY_SEPARATOR . 'installation'); +define('LPATH_TEMPLATES', LPATH_ROOT . DIRECTORY_SEPARATOR . 'templates/admin'); diff --git a/week-04/project/administrator/includes/framework.php b/week-04/project/administrator/includes/framework.php new file mode 100644 index 0000000..649f4b4 --- /dev/null +++ b/week-04/project/administrator/includes/framework.php @@ -0,0 +1,35 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +defined('_LEXEC') or die; + +// System includes +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/framework.php#L14 +require_once LPATH_LIBRARIES . '/bootstrap.php'; + +// Installation check, and check on removal of the installation directory. +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/framework.php#L17 +if (!file_exists(LPATH_CONFIGURATION . '/octoconfig.php') + || (filesize(LPATH_CONFIGURATION . '/octoconfig.php') < 10) + || (file_exists(LPATH_INSTALLATION . '/index.php'))) +{ + if (file_exists(LPATH_INSTALLATION . '/index.php')) + { + header('Location: ../installation/index.php'); + + exit; + } + else + { + echo 'No configuration file found and no installation code available. Exiting...'; + + exit; + } +} diff --git a/week-04/project/administrator/includes/index.html b/week-04/project/administrator/includes/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/week-04/project/administrator/includes/index.html @@ -0,0 +1 @@ + diff --git a/week-04/project/administrator/index.php b/week-04/project/administrator/index.php new file mode 100644 index 0000000..5c9f04b --- /dev/null +++ b/week-04/project/administrator/index.php @@ -0,0 +1,35 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// NOTE: This file should remain compatible with PHP 5.2 to allow us to run our PHP minimum check and show a friendly error message +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/index.php#L9 + +// Define the application's minimum supported PHP version as a constant, so it can be referenced within the application. +define('OCTOLEO_MINIMUM_PHP', '7.2.5'); + +if (version_compare(PHP_VERSION, OCTOLEO_MINIMUM_PHP, '<')) +{ + die( + str_replace( + '{{phpversion}}', + OCTOLEO_MINIMUM_PHP, + file_get_contents(dirname(__FILE__) . '/../templates/system/incompatible.html') + ) + ); +} + +/** + * Constant that is checked in included files to prevent direct access. + */ +define('_LEXEC', 1); + +// We must setup some house rules, since we can't have all +// this code just doing what it wants can we.... <>yn growling +require_once dirname(__FILE__) . '/includes/app.php'; diff --git a/week-04/project/composer.json b/week-04/project/composer.json new file mode 100644 index 0000000..7f3b12b --- /dev/null +++ b/week-04/project/composer.json @@ -0,0 +1,71 @@ +{ + "name": "octoleo/cms", + "type": "project", + "description": "Octoleo CMS", + "keywords": [ + "octoleo", + "cms" + ], + "homepage": "https://github.com/mychamplain", + "license": "GPL-2.0-or-later", + "config": { + "optimize-autoloader": true, + "platform": { + "php": "7.2.5" + }, + "vendor-dir": "libraries/vendor", + "github-protocols": ["https"], + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + }, + "autoload": { + "psr-4": { + "Octoleo\\CMS\\": "libraries/src/" + } + }, + "require": { + "php": "^7.2.5", + "joomla/application": "~2.0", + "joomla/archive": "~2.0", + "joomla/authentication": "~2.0", + "joomla/console": "~2.0", + "joomla/controller": "~2.0", + "joomla/crypt": "~2.0", + "joomla/data": "~2.0", + "joomla/database": "~2.0", + "joomla/di": "~2.0", + "joomla/event": "~2.0", + "joomla/filter": "~2.0", + "joomla/filesystem": "~2.0", + "joomla/http": "~2.0", + "joomla/input": "~2.0", + "joomla/model": "~2.0", + "joomla/preload": "~2.0", + "joomla/ldap": "~2.0", + "joomla/oauth1": "~2.0", + "joomla/oauth2": "~2.0", + "joomla/registry": "~2.0", + "joomla/renderer": "~2.0", + "joomla/router": "~2.0", + "joomla/session": "~2.0", + "joomla/string": "~2.0", + "joomla/uri": "~2.0", + "joomla/utilities": "~2.0", + "algo26-matthias/idna-convert": "~3.0", + "joomla/view": "~2.0", + "laminas/laminas-diactoros": "^2.3", + "monolog/monolog": "^2.1", + "psr/link": "^1.0", + "ramsey/uuid": "^4.0.1", + "robmorgan/phinx": "^0.12.3", + "defuse/php-encryption": "^2.0", + "symfony/asset": "^5.1.2", + "symfony/process": "^5.1.2", + "symfony/web-link": "^5.1.2", + "symfony/yaml": "^5.1.2", + "theiconic/php-ga-measurement-protocol": "^2.7.2", + "twig/twig": "^2.13", + "phpmailer/phpmailer": "~6.0" + } +} \ No newline at end of file diff --git a/week-04/project/composer.lock b/week-04/project/composer.lock new file mode 100644 index 0000000..ed50632 --- /dev/null +++ b/week-04/project/composer.lock @@ -0,0 +1,5392 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "3442722df6289914de45ee254d28bada", + "packages": [ + { + "name": "algo26-matthias/idna-convert", + "version": "v3.0.5", + "source": { + "type": "git", + "url": "https://github.com/algo26-matthias/idna-convert.git", + "reference": "9cbcfa17ecfed54387ca2ed29acb2773f1870a5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/algo26-matthias/idna-convert/zipball/9cbcfa17ecfed54387ca2ed29acb2773f1870a5e", + "reference": "9cbcfa17ecfed54387ca2ed29acb2773f1870a5e", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "jakeasmith/http_build_url": "^1", + "php": ">=7.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "suggest": { + "ext-iconv": "Install ext/iconv for using input / output other than UTF-8 or ISO-8859-1", + "ext-mbstring": "Install ext/mbstring for using input / output other than UTF-8 or ISO-8859-1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Algo26\\IdnaConvert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1+" + ], + "authors": [ + { + "name": "Matthias Sommerfeld", + "email": "matthias.sommerfeld@algo26.de", + "role": "Developer" + } + ], + "description": "A library for encoding and decoding internationalized domain names", + "homepage": "http://idnaconv.net/", + "keywords": [ + "idn", + "idna", + "php" + ], + "support": { + "issues": "https://github.com/algo26-matthias/idna-convert/issues", + "source": "https://github.com/algo26-matthias/idna-convert/tree/v3.0.5" + }, + "time": "2020-10-05T05:49:30+00:00" + }, + { + "name": "brick/math", + "version": "0.9.3", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/ca57d18f028f84f777b2168cd1911b0dee2343ae", + "reference": "ca57d18f028f84f777b2168cd1911b0dee2343ae", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.0", + "vimeo/psalm": "4.9.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "brick", + "math" + ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.9.3" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/brick/math", + "type": "tidelift" + } + ], + "time": "2021-08-15T20:50:18+00:00" + }, + { + "name": "cakephp/core", + "version": "4.3.7", + "source": { + "type": "git", + "url": "https://github.com/cakephp/core.git", + "reference": "499f17738d40560ec077d7d2039c9af4969c6b17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/core/zipball/499f17738d40560ec077d7d2039c9af4969c6b17", + "reference": "499f17738d40560ec077d7d2039c9af4969c6b17", + "shasum": "" + }, + "require": { + "cakephp/utility": "^4.0", + "php": ">=7.2.0" + }, + "suggest": { + "cakephp/cache": "To use Configure::store() and restore().", + "cakephp/event": "To use PluginApplicationInterface or plugin applications.", + "league/container": "To use Container and ServiceProvider classes" + }, + "type": "library", + "autoload": { + "files": [ + "functions.php" + ], + "psr-4": { + "Cake\\Core\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/core/graphs/contributors" + } + ], + "description": "CakePHP Framework Core classes", + "homepage": "https://cakephp.org", + "keywords": [ + "cakephp", + "core", + "framework" + ], + "support": { + "forum": "https://stackoverflow.com/tags/cakephp", + "irc": "irc://irc.freenode.org/cakephp", + "issues": "https://github.com/cakephp/cakephp/issues", + "source": "https://github.com/cakephp/core" + }, + "time": "2022-03-10T13:13:51+00:00" + }, + { + "name": "cakephp/database", + "version": "4.3.7", + "source": { + "type": "git", + "url": "https://github.com/cakephp/database.git", + "reference": "0a32584763af097eaaba96cf062e2d5d31e6ea3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/database/zipball/0a32584763af097eaaba96cf062e2d5d31e6ea3b", + "reference": "0a32584763af097eaaba96cf062e2d5d31e6ea3b", + "shasum": "" + }, + "require": { + "cakephp/core": "^4.0", + "cakephp/datasource": "^4.0", + "php": ">=7.2.0" + }, + "suggest": { + "cakephp/i18n": "If you are using locale-aware datetime formats or Chronos types." + }, + "type": "library", + "autoload": { + "psr-4": { + "Cake\\Database\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/database/graphs/contributors" + } + ], + "description": "Flexible and powerful Database abstraction library with a familiar PDO-like API", + "homepage": "https://cakephp.org", + "keywords": [ + "abstraction", + "cakephp", + "database", + "database abstraction", + "pdo" + ], + "support": { + "forum": "https://stackoverflow.com/tags/cakephp", + "irc": "irc://irc.freenode.org/cakephp", + "issues": "https://github.com/cakephp/cakephp/issues", + "source": "https://github.com/cakephp/database" + }, + "time": "2022-03-12T14:25:33+00:00" + }, + { + "name": "cakephp/datasource", + "version": "4.3.7", + "source": { + "type": "git", + "url": "https://github.com/cakephp/datasource.git", + "reference": "d9e88333a8c6832fddfc38d092f30efcab8cd34d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/datasource/zipball/d9e88333a8c6832fddfc38d092f30efcab8cd34d", + "reference": "d9e88333a8c6832fddfc38d092f30efcab8cd34d", + "shasum": "" + }, + "require": { + "cakephp/core": "^4.0", + "php": ">=7.2.0", + "psr/log": "^1.0 || ^2.0", + "psr/simple-cache": "^1.0 || ^2.0" + }, + "suggest": { + "cakephp/cache": "If you decide to use Query caching.", + "cakephp/collection": "If you decide to use ResultSetInterface.", + "cakephp/utility": "If you decide to use EntityTrait." + }, + "type": "library", + "autoload": { + "psr-4": { + "Cake\\Datasource\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/datasource/graphs/contributors" + } + ], + "description": "Provides connection managing and traits for Entities and Queries that can be reused for different datastores", + "homepage": "https://cakephp.org", + "keywords": [ + "cakephp", + "connection management", + "datasource", + "entity", + "query" + ], + "support": { + "forum": "https://stackoverflow.com/tags/cakephp", + "irc": "irc://irc.freenode.org/cakephp", + "issues": "https://github.com/cakephp/cakephp/issues", + "source": "https://github.com/cakephp/datasource" + }, + "time": "2022-03-04T04:39:56+00:00" + }, + { + "name": "cakephp/utility", + "version": "4.3.7", + "source": { + "type": "git", + "url": "https://github.com/cakephp/utility.git", + "reference": "3d352060ca3e49c81c3fd2bdb092ee345d8f4e38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/utility/zipball/3d352060ca3e49c81c3fd2bdb092ee345d8f4e38", + "reference": "3d352060ca3e49c81c3fd2bdb092ee345d8f4e38", + "shasum": "" + }, + "require": { + "cakephp/core": "^4.0", + "php": ">=7.2.0" + }, + "suggest": { + "ext-intl": "To use Text::transliterate() or Text::slug()", + "lib-ICU": "To use Text::transliterate() or Text::slug()" + }, + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Cake\\Utility\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/utility/graphs/contributors" + } + ], + "description": "CakePHP Utility classes such as Inflector, String, Hash, and Security", + "homepage": "https://cakephp.org", + "keywords": [ + "cakephp", + "hash", + "inflector", + "security", + "string", + "utility" + ], + "support": { + "forum": "https://stackoverflow.com/tags/cakephp", + "irc": "irc://irc.freenode.org/cakephp", + "issues": "https://github.com/cakephp/cakephp/issues", + "source": "https://github.com/cakephp/utility" + }, + "time": "2022-01-28T18:02:00+00:00" + }, + { + "name": "composer/ca-bundle", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", + "reference": "4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.3.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-10-28T20:44:15+00:00" + }, + { + "name": "defuse/php-encryption", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/defuse/php-encryption.git", + "reference": "77880488b9954b7884c25555c2a0ea9e7053f9d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/defuse/php-encryption/zipball/77880488b9954b7884c25555c2a0ea9e7053f9d2", + "reference": "77880488b9954b7884c25555c2a0ea9e7053f9d2", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "paragonie/random_compat": ">= 2", + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "^4|^5|^6|^7|^8|^9" + }, + "bin": [ + "bin/generate-defuse-key" + ], + "type": "library", + "autoload": { + "psr-4": { + "Defuse\\Crypto\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Hornby", + "email": "taylor@defuse.ca", + "homepage": "https://defuse.ca/" + }, + { + "name": "Scott Arciszewski", + "email": "info@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "Secure PHP Encryption Library", + "keywords": [ + "aes", + "authenticated encryption", + "cipher", + "crypto", + "cryptography", + "encrypt", + "encryption", + "openssl", + "security", + "symmetric key cryptography" + ], + "support": { + "issues": "https://github.com/defuse/php-encryption/issues", + "source": "https://github.com/defuse/php-encryption/tree/v2.3.1" + }, + "time": "2021-04-09T23:57:26+00:00" + }, + { + "name": "fig/link-util", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/link-util.git", + "reference": "5d7b8d04ed3393b4b59968ca1e906fb7186d81e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/link-util/zipball/5d7b8d04ed3393b4b59968ca1e906fb7186d81e8", + "reference": "5d7b8d04ed3393b4b59968ca1e906fb7186d81e8", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "psr/link": "~1.0@dev" + }, + "provide": { + "psr/link-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.1", + "squizlabs/php_codesniffer": "^2.3.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Fig\\Link\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common utility implementations for HTTP links", + "keywords": [ + "http", + "http-link", + "link", + "psr", + "psr-13", + "rest" + ], + "support": { + "issues": "https://github.com/php-fig/link-util/issues", + "source": "https://github.com/php-fig/link-util/tree/1.1.2" + }, + "time": "2021-02-03T23:36:04+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "ac1ec1cd9b5624694c3a40be801d94137afb12b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ac1ec1cd9b5624694c3a40be801d94137afb12b4", + "reference": "ac1ec1cd9b5624694c3a40be801d94137afb12b4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-curl": "*", + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.4-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.4.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2022-03-20T14:16:28+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.2.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c94a94f120803a18554c1805ef2e539f8285f9a2", + "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.2.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2022-03-20T21:55:58+00:00" + }, + { + "name": "jakeasmith/http_build_url", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/jakeasmith/http_build_url.git", + "reference": "93c273e77cb1edead0cf8bcf8cd2003428e74e37" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jakeasmith/http_build_url/zipball/93c273e77cb1edead0cf8bcf8cd2003428e74e37", + "reference": "93c273e77cb1edead0cf8bcf8cd2003428e74e37", + "shasum": "" + }, + "type": "library", + "autoload": { + "files": [ + "src/http_build_url.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jake A. Smith", + "email": "theman@jakeasmith.com" + } + ], + "description": "Provides functionality for http_build_url() to environments without pecl_http.", + "support": { + "issues": "https://github.com/jakeasmith/http_build_url/issues", + "source": "https://github.com/jakeasmith/http_build_url" + }, + "time": "2017-05-01T15:36:40+00:00" + }, + { + "name": "joomla/application", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/application.git", + "reference": "e7b950d2d1358c0baac95a8633a60de20a1e82ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/application/zipball/e7b950d2d1358c0baac95a8633a60de20a1e82ab", + "reference": "e7b950d2d1358c0baac95a8633a60de20a1e82ab", + "shasum": "" + }, + "require": { + "joomla/event": "^2.0", + "joomla/registry": "^1.4.5|^2.0", + "laminas/laminas-diactoros": "^2.2.2", + "php": "^7.2.5", + "psr/http-message": "^1.0", + "psr/log": "^1.0", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "joomla/di": "<1.5", + "joomla/input": "<1.2", + "joomla/router": "<2.0", + "joomla/session": "<2.0", + "joomla/uri": "<1.1" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "joomla/controller": "^1.0|^2.0", + "joomla/di": "^1.5|^2.0", + "joomla/input": "^1.2|^2.0", + "joomla/router": "^2.0", + "joomla/session": "^2.0", + "joomla/test": "^2.0", + "joomla/uri": "^1.1|^2.0", + "phpunit/phpunit": "^8.5|^9.0", + "symfony/phpunit-bridge": "^3.4.26|^4.1.12|^4.2.7|^5.0" + }, + "suggest": { + "joomla/controller": "^1.0|^2.0 To support resolving ControllerInterface objects in ControllerResolverInterface, install joomla/controller", + "joomla/input": "^1.2|^2.0 To use WebApplicationInterface, install joomla/input", + "joomla/router": "^2.0 To use WebApplication or ControllerResolverInterface implementations, install joomla/router", + "joomla/session": "^2.0 To use SessionAwareWebApplicationInterface, install joomla/session", + "joomla/uri": "^1.1|^2.0 To use AbstractWebApplication, install joomla/uri", + "psr/container": "^1.0 To use the ContainerControllerResolver, install any PSR-11 compatible container" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Application\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Application Package", + "homepage": "https://github.com/joomla-framework/application", + "keywords": [ + "application", + "framework", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/application/issues", + "source": "https://github.com/joomla-framework/application/tree/2.0.1" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-12-10T12:11:13+00:00" + }, + { + "name": "joomla/archive", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/archive.git", + "reference": "cedda2cf21c388c590b8a110df25db6197765b8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/archive/zipball/cedda2cf21c388c590b8a110df25db6197765b8c", + "reference": "cedda2cf21c388c590b8a110df25db6197765b8c", + "shasum": "" + }, + "require": { + "joomla/filesystem": "^2.0", + "php": "^7.2.5|^8.0" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "joomla/test": "^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "suggest": { + "ext-bz2": "To extract bzip2 compressed packages", + "ext-zip": "To extract zip compressed packages", + "ext-zlib": "To extract gzip or zip compressed packages" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Archive\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Archive Package", + "homepage": "https://github.com/joomla-framework/archive", + "keywords": [ + "archive", + "framework", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/archive/issues", + "source": "https://github.com/joomla-framework/archive/tree/2.0.1" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2022-03-29T13:03:06+00:00" + }, + { + "name": "joomla/authentication", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/authentication.git", + "reference": "73d77db3b5d31300ffc0f147936cb420d4dffd96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/authentication/zipball/73d77db3b5d31300ffc0f147936cb420d4dffd96", + "reference": "73d77db3b5d31300ffc0f147936cb420d4dffd96", + "shasum": "" + }, + "require": { + "php": "^7.2.5|^8.0" + }, + "conflict": { + "joomla/database": "<2.0" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "joomla/database": "^2.0", + "joomla/input": "^1.0|^2.0", + "phpunit/phpunit": "^8.5|^9.0", + "symfony/phpunit-bridge": "^3.4|^4.4|^5.0" + }, + "suggest": { + "joomla/database": "Required if you want to use Joomla\\Authentication\\Strategies\\DatabaseStrategy", + "joomla/input": "Required if you want to use classes in the Joomla\\Authentication\\Strategies namespace" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Authentication\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Authentication Package", + "homepage": "https://github.com/joomla-framework/authentication", + "keywords": [ + "Authentication", + "framework", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/authentication/issues", + "source": "https://github.com/joomla-framework/authentication/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-10T18:44:21+00:00" + }, + { + "name": "joomla/console", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/console.git", + "reference": "9db90c5b99e84a48cbaaf14c4c0d881b4d92480d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/console/zipball/9db90c5b99e84a48cbaaf14c4c0d881b4d92480d", + "reference": "9db90c5b99e84a48cbaaf14c4c0d881b4d92480d", + "shasum": "" + }, + "require": { + "joomla/application": "^2.0", + "joomla/event": "^2.0", + "joomla/string": "^2.0", + "php": "^7.2.5", + "symfony/console": "^3.4|^4.4|^5.0" + }, + "require-dev": { + "joomla/coding-standards": "^2.0@alpha", + "joomla/test": "^2.0", + "phpunit/phpunit": "^8.5|^9.0", + "psr/container": "^1.0" + }, + "suggest": { + "psr/container-implementation": "To use the ContainerLoader" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Console\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Console Package", + "homepage": "https://github.com/joomla-framework/console", + "keywords": [ + "console", + "framework", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/console/issues", + "source": "https://github.com/joomla-framework/console/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-10T20:31:15+00:00" + }, + { + "name": "joomla/controller", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/controller.git", + "reference": "85b26e4b4521bceb346783bd342cb8c7a3f8c1be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/controller/zipball/85b26e4b4521bceb346783bd342cb8c7a3f8c1be", + "reference": "85b26e4b4521bceb346783bd342cb8c7a3f8c1be", + "shasum": "" + }, + "require": { + "php": "^7.2.5|^8.0" + }, + "require-dev": { + "joomla/application": "^1.0|^2.0", + "joomla/coding-standards": "^2.0@alpha", + "joomla/input": "^1.0|^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "suggest": { + "joomla/application": "The joomla/application package is required to use Joomla\\Controller\\AbstractController", + "joomla/input": "The joomla/input package is required to use Joomla\\Controller\\AbstractController" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Controller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Controller Package", + "homepage": "https://github.com/joomla-framework/controller", + "keywords": [ + "controller", + "framework", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/controller/issues", + "source": "https://github.com/joomla-framework/controller/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-16T20:21:42+00:00" + }, + { + "name": "joomla/crypt", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/crypt.git", + "reference": "db9e5c4f8b42df5dee0a3698404affe631fdaba4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/crypt/zipball/db9e5c4f8b42df5dee0a3698404affe631fdaba4", + "reference": "db9e5c4f8b42df5dee0a3698404affe631fdaba4", + "shasum": "" + }, + "require": { + "php": "^7.2.5|^8.0" + }, + "conflict": { + "defuse/php-encryption": "<2.0" + }, + "require-dev": { + "defuse/php-encryption": "^2.0", + "joomla/coding-standards": "^2.0@alpha", + "paragonie/sodium_compat": "^1.0", + "phpunit/phpunit": "^8.5|^9.0", + "symfony/phpunit-bridge": "^4.4|^5.0", + "symfony/polyfill-util": "^1.0" + }, + "suggest": { + "defuse/php-encryption": "To use Crypto cipher", + "ext-openssl": "To use the OpenSSL cipher", + "ext-sodium": "To use the Sodium cipher", + "paragonie/sodium_compat": "To use Sodium cipher if neither ext/sodium or ext/libsodium are available" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Crypt\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Crypt Package", + "homepage": "https://github.com/joomla-framework/crypt", + "keywords": [ + "crypt", + "framework", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/crypt/issues", + "source": "https://github.com/joomla-framework/crypt/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-10T18:46:07+00:00" + }, + { + "name": "joomla/data", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/data.git", + "reference": "6327825f48ba517d8f35179ac8f7868522d3a23f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/data/zipball/6327825f48ba517d8f35179ac8f7868522d3a23f", + "reference": "6327825f48ba517d8f35179ac8f7868522d3a23f", + "shasum": "" + }, + "require": { + "joomla/registry": "^1.4.5|^2.0", + "php": "^7.2.5" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "joomla/test": "^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Data\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Data Package", + "homepage": "https://github.com/joomla-framework/data", + "keywords": [ + "data", + "framework", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/data/issues", + "source": "https://github.com/joomla-framework/data/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-10T18:47:10+00:00" + }, + { + "name": "joomla/database", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/database.git", + "reference": "194415339358b3ded43d5f68446b4fa93e18c3d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/database/zipball/194415339358b3ded43d5f68446b4fa93e18c3d3", + "reference": "194415339358b3ded43d5f68446b4fa93e18c3d3", + "shasum": "" + }, + "require": { + "joomla/event": "^2.0", + "php": "^7.2.5|^8.0", + "symfony/deprecation-contracts": "^2.1" + }, + "require-dev": { + "joomla/archive": "^1.0|^2.0", + "joomla/coding-standards": "^2.0@alpha", + "joomla/console": "^2.0", + "joomla/di": "^1.0|^2.0", + "joomla/filesystem": "^1.3|^2.0", + "joomla/registry": "^1.4.5|^2.0", + "joomla/test": "^2.0", + "phpunit/phpunit": "^8.5|^9.0", + "psr/log": "^1.1", + "symfony/phpunit-bridge": "^4.4|^5.0" + }, + "suggest": { + "ext-mysqli": "To connect to a MySQL database via MySQLi", + "ext-pdo": "To connect to a MySQL, PostgreSQL, or SQLite database via PDO", + "ext-sqlsrv": "To connect to a SQL Server database", + "joomla/archive": "To use the ExportCommand class, install joomla/archive", + "joomla/console": "To use the ExportCommand and ImportCommand classes, install joomla/console", + "joomla/di": "To use the Database ServiceProviderInterface objects, install joomla/di.", + "joomla/filesystem": "To use the ExportCommand and ImportCommand classes, install joomla/filesystem", + "joomla/registry": "To use the Database ServiceProviderInterface objects, install joomla/registry.", + "psr/log": "To use the LoggingMonitor, install psr/log." + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Database\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Database Package", + "homepage": "https://github.com/joomla-framework/database", + "keywords": [ + "database", + "framework", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/database/issues", + "source": "https://github.com/joomla-framework/database/tree/2.1.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2022-03-02T16:36:31+00:00" + }, + { + "name": "joomla/di", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/di.git", + "reference": "22ef18207e8945c8247aa2372bddbe76383bd0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/di/zipball/22ef18207e8945c8247aa2372bddbe76383bd0bc", + "reference": "22ef18207e8945c8247aa2372bddbe76383bd0bc", + "shasum": "" + }, + "require": { + "php": "^7.2.5|~8", + "psr/container": "^1.0", + "symfony/deprecation-contracts": "^2.1" + }, + "provide": { + "psr/container-implementation": "~1.0" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "joomla/test": "^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\DI\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla DI Package", + "homepage": "https://github.com/joomla-framework/di", + "keywords": [ + "container", + "dependency injection", + "di", + "framework", + "ioc", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/di/issues", + "source": "https://github.com/joomla-framework/di/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-04-06T22:33:15+00:00" + }, + { + "name": "joomla/event", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/event.git", + "reference": "dc19eae9a6cbffb608d4719f4eeb986e785692bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/event/zipball/dc19eae9a6cbffb608d4719f4eeb986e785692bd", + "reference": "dc19eae9a6cbffb608d4719f4eeb986e785692bd", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/deprecation-contracts": "^2.1" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "joomla/console": "^2.0", + "phpunit/phpunit": "^8.5|^9.0", + "psr/container": "^1.0" + }, + "suggest": { + "joomla/console": "If you want to use the DebugEventDispatcherCommand class, please install joomla/console", + "psr/container-implementation": "If you want to use the LazyServiceEventListener class, please install a PSR-11 container" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Event\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Event Package", + "homepage": "https://github.com/joomla-framework/event", + "keywords": [ + "event", + "framework", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/event/issues", + "source": "https://github.com/joomla-framework/event/tree/2.0.1" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-12-10T11:50:27+00:00" + }, + { + "name": "joomla/filesystem", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/filesystem.git", + "reference": "d991e618da69e557a84ea97e6a601afec28ae8cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/filesystem/zipball/d991e618da69e557a84ea97e6a601afec28ae8cf", + "reference": "d991e618da69e557a84ea97e6a601afec28ae8cf", + "shasum": "" + }, + "require": { + "php": "^7.2.5|^8.0" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "joomla/test": "^2.0", + "mikey179/vfsstream": "^1.1", + "phpunit/phpunit": "^8.5|^9.0" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Filesystem\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Filesystem Package", + "homepage": "https://github.com/joomla/joomla-framework-filesystem", + "keywords": [ + "filesystem", + "framework", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/filesystem/issues", + "source": "https://github.com/joomla-framework/filesystem/tree/2.0.1" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2022-03-29T12:43:57+00:00" + }, + { + "name": "joomla/filter", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/filter.git", + "reference": "137ca3f8925c4529a113735404b873fad0a1305f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/filter/zipball/137ca3f8925c4529a113735404b873fad0a1305f", + "reference": "137ca3f8925c4529a113735404b873fad0a1305f", + "shasum": "" + }, + "require": { + "joomla/string": "^1.3|^2.0", + "php": "^7.2.5" + }, + "conflict": { + "joomla/language": "<2.0" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "joomla/language": "^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "suggest": { + "joomla/language": "Required only if you want to use `OutputFilter::stringURLSafe`." + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Filter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Filter Package", + "homepage": "https://github.com/joomla-framework/filter", + "keywords": [ + "filter", + "framework", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/filter/issues", + "source": "https://github.com/joomla-framework/filter/tree/2.0.1" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2022-02-15T21:33:06+00:00" + }, + { + "name": "joomla/http", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/http.git", + "reference": "95f46a39dec738f73839e61c035be4fa597e822a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/http/zipball/95f46a39dec738f73839e61c035be4fa597e822a", + "reference": "95f46a39dec738f73839e61c035be4fa597e822a", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "joomla/uri": "^1.0|^2.0", + "laminas/laminas-diactoros": "^2.2.2", + "php": "^7.2.5", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "joomla/coding-standards": "^2.0@alpha", + "joomla/test": "^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "suggest": { + "ext-curl": "To use cURL for HTTP connections" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Http\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla HTTP Package", + "homepage": "https://github.com/joomla-framework/http", + "keywords": [ + "framework", + "http", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/http/issues", + "source": "https://github.com/joomla-framework/http/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-16T19:52:50+00:00" + }, + { + "name": "joomla/input", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/input.git", + "reference": "147229d2e0c5ac7db6f972d19c9faa922575e5c2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/input/zipball/147229d2e0c5ac7db6f972d19c9faa922575e5c2", + "reference": "147229d2e0c5ac7db6f972d19c9faa922575e5c2", + "shasum": "" + }, + "require": { + "joomla/filter": "^1.0|^2.0", + "php": "^7.2.5", + "symfony/deprecation-contracts": "^2.1" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "joomla/test": "^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Input\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Input Package", + "homepage": "https://github.com/joomla-framework/input", + "keywords": [ + "framework", + "input", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/input/issues", + "source": "https://github.com/joomla-framework/input/tree/2.0.3" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2022-04-06T20:02:40+00:00" + }, + { + "name": "joomla/ldap", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/ldap.git", + "reference": "b02ec8a59297b517b0b843b07971aa2e7bbe91d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/ldap/zipball/b02ec8a59297b517b0b843b07971aa2e7bbe91d2", + "reference": "b02ec8a59297b517b0b843b07971aa2e7bbe91d2", + "shasum": "" + }, + "require": { + "ext-ldap": "*", + "php": "~7.0" + }, + "require-dev": { + "joomla/coding-standards": "~2.0@alpha", + "joomla/registry": "^1.4.5|~2.0", + "phpunit/phpunit": "~6.3" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Ldap\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla LDAP Package", + "homepage": "https://github.com/joomla-framework/ldap", + "keywords": [ + "framework", + "joomla", + "ldap" + ], + "support": { + "issues": "https://github.com/joomla-framework/ldap/issues", + "source": "https://github.com/joomla-framework/ldap/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-16T20:01:23+00:00" + }, + { + "name": "joomla/model", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/model.git", + "reference": "e874ca6ea7f463d28f7620dc242973747dc8f0f0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/model/zipball/e874ca6ea7f463d28f7620dc242973747dc8f0f0", + "reference": "e874ca6ea7f463d28f7620dc242973747dc8f0f0", + "shasum": "" + }, + "require": { + "php": "^7.2.5" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "joomla/database": "^1.0|^2.0", + "joomla/registry": "^1.4.5|^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "suggest": { + "joomla/database": "^1.0|^2.0 Allows using database models", + "joomla/registry": "^1.4.5|^2.0 Allows using stateful models" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Model\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Model Package", + "homepage": "https://github.com/joomla-framework/model", + "keywords": [ + "framework", + "joomla", + "model" + ], + "support": { + "issues": "https://github.com/joomla-framework/model/issues", + "source": "https://github.com/joomla-framework/model/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-16T20:22:12+00:00" + }, + { + "name": "joomla/oauth1", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/oauth1.git", + "reference": "89559f79ff0c3fef73f806fd66814ae8bb1cb655" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/oauth1/zipball/89559f79ff0c3fef73f806fd66814ae8bb1cb655", + "reference": "89559f79ff0c3fef73f806fd66814ae8bb1cb655", + "shasum": "" + }, + "require": { + "joomla/application": "^2.0", + "joomla/http": "^1.2.2|^2.0", + "joomla/input": "^1.2|^2.0", + "joomla/registry": "^1.4.5|^2.0", + "joomla/session": "^2.0", + "joomla/uri": "^1.1|^2.0", + "php": "^7.2.5" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "joomla/event": "^2.0", + "joomla/test": "^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\OAuth1\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla OAuth1 Package", + "homepage": "https://github.com/joomla-framework/oauth1", + "keywords": [ + "framework", + "joomla", + "oauth1" + ], + "support": { + "issues": "https://github.com/joomla-framework/oauth1/issues", + "source": "https://github.com/joomla-framework/oauth1/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-16T19:58:37+00:00" + }, + { + "name": "joomla/oauth2", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/oauth2.git", + "reference": "1e6fd0affea9f96376e580ec050145e874b399cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/oauth2/zipball/1e6fd0affea9f96376e580ec050145e874b399cb", + "reference": "1e6fd0affea9f96376e580ec050145e874b399cb", + "shasum": "" + }, + "require": { + "joomla/application": "^2.0", + "joomla/http": "^1.2.2|^2.0", + "joomla/input": "^1.2|^2.0", + "joomla/session": "^1.0|^2.0", + "joomla/uri": "^1.0|^2.0", + "php": "^7.2.5" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "phpunit/phpunit": "^8.5|^9.0" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\OAuth2\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla OAuth2 Package", + "homepage": "https://github.com/joomla-framework/oauth2", + "keywords": [ + "framework", + "joomla", + "oauth2" + ], + "support": { + "issues": "https://github.com/joomla-framework/oauth2/issues", + "source": "https://github.com/joomla-framework/oauth2/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-16T19:59:30+00:00" + }, + { + "name": "joomla/preload", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/preload.git", + "reference": "dcd6f3424e3d02e2b47761464e33826b2b6ae7e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/preload/zipball/dcd6f3424e3d02e2b47761464e33826b2b6ae7e0", + "reference": "dcd6f3424e3d02e2b47761464e33826b2b6ae7e0", + "shasum": "" + }, + "require": { + "fig/link-util": "^1.0", + "php": "^7.2.5", + "psr/link": "^1.0" + }, + "conflict": { + "joomla/application": "<2.0", + "joomla/event": "<2.0" + }, + "require-dev": { + "joomla/application": "^2.0", + "joomla/coding-standards": "^2.0@alpha", + "joomla/di": "^1.5|^2.0", + "joomla/event": "^2.0", + "joomla/uri": "^2.0", + "phpunit/phpunit": "^8.2", + "symfony/web-link": "^3.4|^4.4|^5.0" + }, + "suggest": { + "joomla/application": "To use the PreloadSubscriber event listener, install `^2.0`", + "joomla/di": "To use the PreloadProvider service provider, install `^1.5|^2.0`", + "joomla/event": "To use the PreloadSubscriber event listener, install `^2.0`", + "symfony/web-link": "To use the PreloadSubscriber event listener, install `^3.4|^4.4|^5.0`" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Preload\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Preload Package", + "homepage": "https://github.com/joomla-framework/preload", + "keywords": [ + "console", + "framework", + "joomla" + ], + "support": { + "issues": "https://github.com/joomla-framework/preload/issues", + "source": "https://github.com/joomla-framework/preload/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-16T20:23:39+00:00" + }, + { + "name": "joomla/registry", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/registry.git", + "reference": "4fcfa060f1ec101ec8311770a1d1c166eba6e367" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/registry/zipball/4fcfa060f1ec101ec8311770a1d1c166eba6e367", + "reference": "4fcfa060f1ec101ec8311770a1d1c166eba6e367", + "shasum": "" + }, + "require": { + "joomla/utilities": "^1.4.1|^2.0", + "php": "^7.2.5" + }, + "conflict": { + "symfony/yaml": "<3.4" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "phpunit/phpunit": "^8.5|^9.0", + "symfony/yaml": "^3.4|^4.4|^5.0" + }, + "suggest": { + "symfony/yaml": "Install symfony/yaml if you require YAML support." + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Registry\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Registry Package", + "homepage": "https://github.com/joomla-framework/registry", + "keywords": [ + "framework", + "joomla", + "registry" + ], + "support": { + "issues": "https://github.com/joomla-framework/registry/issues", + "source": "https://github.com/joomla-framework/registry/tree/2.0.1" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-12-10T11:52:55+00:00" + }, + { + "name": "joomla/renderer", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/renderer.git", + "reference": "482896d9b10a3a17bf87cbb531d2ebfb463a3df7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/renderer/zipball/482896d9b10a3a17bf87cbb531d2ebfb463a3df7", + "reference": "482896d9b10a3a17bf87cbb531d2ebfb463a3df7", + "shasum": "" + }, + "require": { + "php": "^7.2.5" + }, + "conflict": { + "illuminate/view": "<6.0", + "league/plates": "<3.0", + "mustache/mustache": "<2.3", + "symfony/templating": "<3.4", + "twig/twig": "<1.34 || >=2.0,<2.4" + }, + "require-dev": { + "illuminate/events": "^6.0|^7.0", + "illuminate/filesystem": "^6.0|^7.0", + "illuminate/view": "^6.0|^7.0", + "joomla/coding-standards": "^2.0@alpha", + "joomla/test": "^2.0", + "league/plates": "^3.0", + "mustache/mustache": "^2.3", + "phpunit/phpunit": "^8.5|^9.0", + "symfony/templating": "^3.4|^4.4|^5.0", + "twig/twig": "^1.34|^2.4|^3.0" + }, + "suggest": { + "illuminate/view": "Install ^6.0|^7.0 if you are using Laravel's Blade template engine.", + "league/plates": "Install ^3.0 if you are using the Plates template engine.", + "mustache/mustache": "Install ^2.3 if you are using the Mustache template engine.", + "symfony/templating": "Install ^3.4|^4.4|^5.0 if you are using Symfony's PHP template component.", + "twig/twig": "Install ^1.34|^2.4|^3.0 if you are using the Twig template engine." + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Renderer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "description": "Joomla Renderer Package", + "homepage": "https://github.com/joomla-framework/renderer", + "keywords": [ + "framework", + "joomla", + "renderer" + ], + "support": { + "issues": "https://github.com/joomla-framework/renderer/issues", + "source": "https://github.com/joomla-framework/renderer/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-16T20:20:59+00:00" + }, + { + "name": "joomla/router", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/router.git", + "reference": "8dfb320fde8ed2c914c6e52df1e7266e9b25379a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/router/zipball/8dfb320fde8ed2c914c6e52df1e7266e9b25379a", + "reference": "8dfb320fde8ed2c914c6e52df1e7266e9b25379a", + "shasum": "" + }, + "require": { + "php": "^7.2.5|^8.0" + }, + "conflict": { + "jeremeamia/superclosure": "<2.4" + }, + "require-dev": { + "jeremeamia/superclosure": "^2.4", + "joomla/coding-standards": "^2.0@alpha", + "joomla/console": "^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "suggest": { + "jeremeamia/superclosure": "If you use Closure based controllers and want to be able to serialize the router, please install jeremeamia/superclosure", + "joomla/console": "If you want to use the DebugRouterCommand class, please install joomla/console" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Router\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Router Package", + "homepage": "https://github.com/joomla-framework/router", + "keywords": [ + "framework", + "joomla", + "router" + ], + "support": { + "issues": "https://github.com/joomla-framework/router/issues", + "source": "https://github.com/joomla-framework/router/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-16T20:04:57+00:00" + }, + { + "name": "joomla/session", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/session.git", + "reference": "a7bb708a988530ce90c95e33efbc56432cf56c07" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/session/zipball/a7bb708a988530ce90c95e33efbc56432cf56c07", + "reference": "a7bb708a988530ce90c95e33efbc56432cf56c07", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "joomla/database": "<2.0", + "joomla/event": "<2.0", + "joomla/input": "<2.0" + }, + "require-dev": { + "joomla/coding-standards": "^3.0@dev", + "joomla/console": "^2.0", + "joomla/database": "^2.0", + "joomla/event": "^2.0", + "joomla/input": "^2.0", + "joomla/test": "^2.0", + "joomla/utilities": "^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "suggest": { + "ext-apcu": "To use APCu cache as a session handler", + "ext-memcached": "To use a Memcached server as a session handler", + "ext-redis": "To use a Redis server as a session handler", + "ext-session": "To use the Joomla\\Session\\Storage\\NativeStorage storage class.", + "ext-wincache": "To use WinCache as a session handler", + "joomla/console": "Install joomla/console if you want to use the CreateSessionTableCommand class.", + "joomla/database": "Install joomla/database if you want to use a database connection managed with Joomla\\Database\\DatabaseDriver as a session handler.", + "joomla/event": "The joomla/event package is required to use Joomla\\Session\\Session.", + "joomla/input": "The joomla/input package is required to use Address and Forwarded session validators." + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Session\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Session Package", + "homepage": "https://github.com/joomla-framework/session", + "keywords": [ + "framework", + "joomla", + "session" + ], + "support": { + "issues": "https://github.com/joomla-framework/session/issues", + "source": "https://github.com/joomla-framework/session/tree/2.0.1" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-12-11T19:55:26+00:00" + }, + { + "name": "joomla/string", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/string.git", + "reference": "778682c04a1909323da6a453a5b3030d7a7a2fa9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/string/zipball/778682c04a1909323da6a453a5b3030d7a7a2fa9", + "reference": "778682c04a1909323da6a453a5b3030d7a7a2fa9", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "doctrine/inflector": "<1.2" + }, + "require-dev": { + "doctrine/inflector": "1.2", + "joomla/coding-standards": "^3.0@dev", + "joomla/test": "^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "suggest": { + "doctrine/inflector": "To use the string inflector", + "ext-mbstring": "For improved processing" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "files": [ + "src/phputf8/utf8.php", + "src/phputf8/ord.php", + "src/phputf8/str_ireplace.php", + "src/phputf8/str_pad.php", + "src/phputf8/str_split.php", + "src/phputf8/strcasecmp.php", + "src/phputf8/strcspn.php", + "src/phputf8/stristr.php", + "src/phputf8/strrev.php", + "src/phputf8/strspn.php", + "src/phputf8/trim.php", + "src/phputf8/ucfirst.php", + "src/phputf8/ucwords.php", + "src/phputf8/utils/ascii.php", + "src/phputf8/utils/validation.php" + ], + "psr-4": { + "Joomla\\String\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla String Package", + "homepage": "https://github.com/joomla-framework/string", + "keywords": [ + "framework", + "joomla", + "string" + ], + "support": { + "issues": "https://github.com/joomla-framework/string/issues", + "source": "https://github.com/joomla-framework/string/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-10T18:57:12+00:00" + }, + { + "name": "joomla/uri", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/uri.git", + "reference": "5046ea584b76e485ef84390c6d79bafb358fb605" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/uri/zipball/5046ea584b76e485ef84390c6d79bafb358fb605", + "reference": "5046ea584b76e485ef84390c6d79bafb358fb605", + "shasum": "" + }, + "require": { + "php": "^7.2.5|^8.0" + }, + "require-dev": { + "joomla/coding-standards": "^2.0@alpha", + "phpunit/phpunit": "^8.5|^9.0" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Uri\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Uri Package", + "homepage": "https://github.com/joomla-framework/uri", + "keywords": [ + "framework", + "joomla", + "uri" + ], + "support": { + "issues": "https://github.com/joomla-framework/uri/issues", + "source": "https://github.com/joomla-framework/uri/tree/2.0.1" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2022-01-25T12:04:01+00:00" + }, + { + "name": "joomla/utilities", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/utilities.git", + "reference": "f5d4fcf778abbbf1c099814297c87ef177e8b268" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/utilities/zipball/f5d4fcf778abbbf1c099814297c87ef177e8b268", + "reference": "f5d4fcf778abbbf1c099814297c87ef177e8b268", + "shasum": "" + }, + "require": { + "joomla/string": "^1.3|^2.0", + "php": "^7.2.5|^8.0" + }, + "require-dev": { + "joomla/coding-standards": "^2.0@alpha", + "phpunit/phpunit": "^8.5|^9.0" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\Utilities\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla Utilities Package", + "homepage": "https://github.com/joomla-framework/utilities", + "keywords": [ + "framework", + "joomla", + "utilities" + ], + "support": { + "issues": "https://github.com/joomla-framework/utilities/issues", + "source": "https://github.com/joomla-framework/utilities/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-16T20:13:00+00:00" + }, + { + "name": "joomla/view", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/view.git", + "reference": "3b43c84eba02c037190de3c796c81b31883694ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/view/zipball/3b43c84eba02c037190de3c796c81b31883694ef", + "reference": "3b43c84eba02c037190de3c796c81b31883694ef", + "shasum": "" + }, + "require": { + "php": "^7.2.5|^8.0" + }, + "require-dev": { + "joomla/coding-standards": "^2.0@alpha", + "joomla/renderer": "^2.0", + "phpunit/phpunit": "^8.5|^9.0" + }, + "suggest": { + "joomla/renderer": "Required to use Joomla\\View\\BaseHtmlView" + }, + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-2.0-dev": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Joomla\\View\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Joomla View Package", + "homepage": "https://github.com/joomla-framework/view", + "keywords": [ + "framework", + "joomla", + "view" + ], + "support": { + "issues": "https://github.com/joomla-framework/view/issues", + "source": "https://github.com/joomla-framework/view/tree/2.0.0" + }, + "funding": [ + { + "url": "https://community.joomla.org/sponsorship-campaigns.html", + "type": "custom" + }, + { + "url": "https://github.com/joomla", + "type": "github" + } + ], + "time": "2021-08-16T20:22:32+00:00" + }, + { + "name": "laminas/laminas-diactoros", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-diactoros.git", + "reference": "36ef09b73e884135d2059cc498c938e90821bb57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/36ef09b73e884135d2059cc498c938e90821bb57", + "reference": "36ef09b73e884135d2059cc498c938e90821bb57", + "shasum": "" + }, + "require": { + "laminas/laminas-zendframework-bridge": "^1.0", + "php": "^7.1", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0" + }, + "conflict": { + "phpspec/prophecy": "<1.9.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "replace": { + "zendframework/zend-diactoros": "^2.2.1" + }, + "require-dev": { + "ext-curl": "*", + "ext-dom": "*", + "ext-gd": "*", + "ext-libxml": "*", + "http-interop/http-factory-tests": "^0.5.0", + "laminas/laminas-coding-standard": "~1.0.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5.18" + }, + "type": "library", + "extra": { + "laminas": { + "config-provider": "Laminas\\Diactoros\\ConfigProvider", + "module": "Laminas\\Diactoros" + } + }, + "autoload": { + "files": [ + "src/functions/create_uploaded_file.php", + "src/functions/marshal_headers_from_sapi.php", + "src/functions/marshal_method_from_sapi.php", + "src/functions/marshal_protocol_version_from_sapi.php", + "src/functions/marshal_uri_from_sapi.php", + "src/functions/normalize_server.php", + "src/functions/normalize_uploaded_files.php", + "src/functions/parse_cookie_header.php", + "src/functions/create_uploaded_file.legacy.php", + "src/functions/marshal_headers_from_sapi.legacy.php", + "src/functions/marshal_method_from_sapi.legacy.php", + "src/functions/marshal_protocol_version_from_sapi.legacy.php", + "src/functions/marshal_uri_from_sapi.legacy.php", + "src/functions/normalize_server.legacy.php", + "src/functions/normalize_uploaded_files.legacy.php", + "src/functions/parse_cookie_header.legacy.php" + ], + "psr-4": { + "Laminas\\Diactoros\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "PSR HTTP Message implementations", + "homepage": "https://laminas.dev", + "keywords": [ + "http", + "laminas", + "psr", + "psr-17", + "psr-7" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-diactoros/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-diactoros/issues", + "rss": "https://github.com/laminas/laminas-diactoros/releases.atom", + "source": "https://github.com/laminas/laminas-diactoros" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2020-09-03T14:29:41+00:00" + }, + { + "name": "laminas/laminas-zendframework-bridge", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-zendframework-bridge.git", + "reference": "6ede70583e101030bcace4dcddd648f760ddf642" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/6ede70583e101030bcace4dcddd648f760ddf642", + "reference": "6ede70583e101030bcace4dcddd648f760ddf642", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1 || ^9.3", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "laminas": { + "module": "Laminas\\ZendFrameworkBridge" + } + }, + "autoload": { + "files": [ + "src/autoload.php" + ], + "psr-4": { + "Laminas\\ZendFrameworkBridge\\": "src//" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Alias legacy ZF class names to Laminas Project equivalents.", + "keywords": [ + "ZendFramework", + "autoloading", + "laminas", + "zf" + ], + "support": { + "forum": "https://discourse.laminas.dev/", + "issues": "https://github.com/laminas/laminas-zendframework-bridge/issues", + "rss": "https://github.com/laminas/laminas-zendframework-bridge/releases.atom", + "source": "https://github.com/laminas/laminas-zendframework-bridge" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2020-09-14T14:23:00+00:00" + }, + { + "name": "monolog/monolog", + "version": "2.5.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "4192345e260f1d51b365536199744b987e160edc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/4192345e260f1d51b365536199744b987e160edc", + "reference": "4192345e260f1d51b365536199744b987e160edc", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7", + "graylog2/gelf-php": "^1.4.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "php-console/php-console": "^3.1.3", + "phpspec/prophecy": "^1.6.1", + "phpstan/phpstan": "^0.12.91", + "phpunit/phpunit": "^8.5", + "predis/predis": "^1.1", + "rollbar/rollbar": "^1.3 || ^2 || ^3", + "ruflin/elastica": ">=0.90@dev", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.5.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2022-04-08T15:43:54+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2020-10-15T08:29:30+00:00" + }, + { + "name": "phpmailer/phpmailer", + "version": "v6.6.0", + "source": { + "type": "git", + "url": "https://github.com/PHPMailer/PHPMailer.git", + "reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e43bac82edc26ca04b36143a48bde1c051cfd5b1", + "reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", + "php": ">=5.5.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.2", + "php-parallel-lint/php-console-highlighter": "^0.5.0", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.6.2", + "yoast/phpunit-polyfills": "^1.0.0" + }, + "suggest": { + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-only" + ], + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "support": { + "issues": "https://github.com/PHPMailer/PHPMailer/issues", + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.0" + }, + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ], + "time": "2022-02-28T15:31:21+00:00" + }, + { + "name": "psr/container", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.1" + }, + "time": "2021-03-05T17:36:06+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2019-04-30T12:38:16+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/link", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/link.git", + "reference": "eea8e8662d5cd3ae4517c9b864493f59fca95562" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/link/zipball/eea8e8662d5cd3ae4517c9b864493f59fca95562", + "reference": "eea8e8662d5cd3ae4517c9b864493f59fca95562", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Link\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for HTTP links", + "keywords": [ + "http", + "http-link", + "link", + "psr", + "psr-13", + "rest" + ], + "support": { + "source": "https://github.com/php-fig/link/tree/master" + }, + "time": "2016-10-28T16:06:13+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "ramsey/collection", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "ab2237657ad99667a5143e32ba2683c8029563d4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/ab2237657ad99667a5143e32ba2683c8029563d4", + "reference": "ab2237657ad99667a5143e32ba2683c8029563d4", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8" + }, + "require-dev": { + "captainhook/captainhook": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "ergebnis/composer-normalize": "^2.6", + "fakerphp/faker": "^1.5", + "hamcrest/hamcrest-php": "^2", + "jangregor/phpstan-prophecy": "^0.8", + "mockery/mockery": "^1.3", + "phpstan/extension-installer": "^1", + "phpstan/phpstan": "^0.12.32", + "phpstan/phpstan-mockery": "^0.12.5", + "phpstan/phpstan-phpunit": "^0.12.11", + "phpunit/phpunit": "^8.5 || ^9", + "psy/psysh": "^0.10.4", + "slevomat/coding-standard": "^6.3", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP 7.2+ library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/1.1.4" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2021-07-30T00:58:27+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.2.3", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "shasum": "" + }, + "require": { + "brick/math": "^0.8 || ^0.9", + "ext-json": "*", + "php": "^7.2 || ^8.0", + "ramsey/collection": "^1.0", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php80": "^1.14" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "moontoast/math": "^1.1", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-mockery": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^8.5 || ^9", + "slevomat/coding-standard": "^7.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-ctype": "Enables faster processing of character classification using ctype functions.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.x-dev" + }, + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.2.3" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2021-09-25T23:10:38+00:00" + }, + { + "name": "robmorgan/phinx", + "version": "0.12.10", + "source": { + "type": "git", + "url": "https://github.com/cakephp/phinx.git", + "reference": "ad056cff354fc67fedf9bf96c441c2b428afad0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/phinx/zipball/ad056cff354fc67fedf9bf96c441c2b428afad0c", + "reference": "ad056cff354fc67fedf9bf96c441c2b428afad0c", + "shasum": "" + }, + "require": { + "cakephp/database": "^4.0", + "php": ">=7.2", + "psr/container": "^1.0 || ^2.0", + "symfony/config": "^3.4|^4.0|^5.0|^6.0", + "symfony/console": "^3.4|^4.0|^5.0|^6.0" + }, + "require-dev": { + "cakephp/cakephp-codesniffer": "^4.0", + "ext-json": "*", + "ext-pdo": "*", + "phpunit/phpunit": "^8.5|^9.3", + "sebastian/comparator": ">=1.2.3", + "symfony/yaml": "^3.4|^4.0|^5.0" + }, + "suggest": { + "ext-json": "Install if using JSON configuration format", + "ext-pdo": "PDO extension is needed", + "symfony/yaml": "Install if using YAML configuration format" + }, + "bin": [ + "bin/phinx" + ], + "type": "library", + "autoload": { + "psr-4": { + "Phinx\\": "src/Phinx/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rob Morgan", + "email": "robbym@gmail.com", + "homepage": "https://robmorgan.id.au", + "role": "Lead Developer" + }, + { + "name": "Woody Gilk", + "email": "woody.gilk@gmail.com", + "homepage": "https://shadowhand.me", + "role": "Developer" + }, + { + "name": "Richard Quadling", + "email": "rquadling@gmail.com", + "role": "Developer" + }, + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/phinx/graphs/contributors", + "role": "Developer" + } + ], + "description": "Phinx makes it ridiculously easy to manage the database migrations for your PHP app.", + "homepage": "https://phinx.org", + "keywords": [ + "database", + "database migrations", + "db", + "migrations", + "phinx" + ], + "support": { + "issues": "https://github.com/cakephp/phinx/issues", + "source": "https://github.com/cakephp/phinx/tree/0.12.10" + }, + "time": "2022-01-21T19:53:14+00:00" + }, + { + "name": "symfony/asset", + "version": "v5.4.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/asset.git", + "reference": "4affdca3da5f380caa27a338269b36ac288b3981" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/asset/zipball/4affdca3da5f380caa27a338269b36ac288b3981", + "reference": "4affdca3da5f380caa27a338269b36ac288b3981", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/http-foundation": "<5.3" + }, + "require-dev": { + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^5.3|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/http-foundation": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Asset\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/asset/tree/v5.4.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-18T16:00:30+00:00" + }, + { + "name": "symfony/config", + "version": "v5.4.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "05624c386afa1b4ccc1357463d830fade8d9d404" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/05624c386afa1b4ccc1357463d830fade8d9d404", + "reference": "05624c386afa1b4ccc1357463d830fade8d9d404", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22" + }, + "conflict": { + "symfony/finder": "<4.4" + }, + "require-dev": { + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/v5.4.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-21T13:42:03+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/900275254f0a1a2afff1ab0e11abd5587a10e1d6", + "reference": "900275254f0a1a2afff1ab0e11abd5587a10e1d6", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-31T17:09:19+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.4.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3a4442138d80c9f7b600fb297534ac718b61d37f", + "reference": "3a4442138d80c9f7b600fb297534ac718b61d37f", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-04-01T12:33:59+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "30885182c981ab175d4d034db0f6f469898070ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-10-20T20:35:02+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T21:10:46+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-30T18:21:41+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:17:38+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-05T21:20:04+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-04T08:16:47+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.25.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-13T13:58:11+00:00" + }, + { + "name": "symfony/process", + "version": "v5.4.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "38a44b2517b470a436e1c944bf9b9ba3961137fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/38a44b2517b470a436e1c944bf9b9ba3961137fb", + "reference": "38a44b2517b470a436e1c944bf9b9ba3961137fb", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-18T16:18:52+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "reference": "24d9dc654b83e91aa59f9d167b131bc3b5bea24c", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-03-13T20:07:29+00:00" + }, + { + "name": "symfony/string", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10", + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/web-link", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/web-link.git", + "reference": "8b9b073390359549fec5f5d797f23bbe9e2997a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/web-link/zipball/8b9b073390359549fec5f5d797f23bbe9e2997a5", + "reference": "8b9b073390359549fec5f5d797f23bbe9e2997a5", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/link": "^1.0", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/http-kernel": "<5.3" + }, + "provide": { + "psr/link-implementation": "1.0" + }, + "require-dev": { + "symfony/http-kernel": "^5.3|^6.0" + }, + "suggest": { + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\WebLink\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "dunglas@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Manages links between resources", + "homepage": "https://symfony.com", + "keywords": [ + "dns-prefetch", + "http", + "http2", + "link", + "performance", + "prefetch", + "preload", + "prerender", + "psr13", + "push" + ], + "support": { + "source": "https://github.com/symfony/web-link/tree/v5.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/yaml", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "e80f87d2c9495966768310fc531b487ce64237a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e80f87d2c9495966768310fc531b487ce64237a2", + "reference": "e80f87d2c9495966768310fc531b487ce64237a2", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<5.3" + }, + "require-dev": { + "symfony/console": "^5.3|^6.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v5.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-26T16:32:32+00:00" + }, + { + "name": "theiconic/php-ga-measurement-protocol", + "version": "v2.9.0", + "source": { + "type": "git", + "url": "https://github.com/theiconic/php-ga-measurement-protocol.git", + "reference": "6136c2f2ef159045402ef985843db0ad0f136125" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theiconic/php-ga-measurement-protocol/zipball/6136c2f2ef159045402ef985843db0ad0f136125", + "reference": "6136c2f2ef159045402ef985843db0ad0f136125", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0 || ^7.0", + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "4.7.*", + "satooshi/php-coveralls": "1.0.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "TheIconic\\Tracking\\GoogleAnalytics\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "THE ICONIC ENGINEERING TEAM", + "email": "engineering@theiconic.com.au" + } + ], + "description": "Send data to Google Analytics from the server using PHP. This library fully implements GA measurement protocol.", + "support": { + "issues": "https://github.com/theiconic/php-ga-measurement-protocol/issues", + "source": "https://github.com/theiconic/php-ga-measurement-protocol/tree/v2.9.0" + }, + "time": "2020-09-24T23:37:47+00:00" + }, + { + "name": "twig/twig", + "version": "v2.14.13", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "66856cd0459df3dc97d32077a98454dc2a0ee75a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/66856cd0459df3dc97d32077a98454dc2a0ee75a", + "reference": "66856cd0459df3dc97d32077a98454dc2a0ee75a", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.8" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.14-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v2.14.13" + }, + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2022-04-06T06:45:17+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7.2.5" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.2.5" + }, + "plugin-api-version": "2.1.0" +} diff --git a/week-04/project/htaccess.txt b/week-04/project/htaccess.txt new file mode 100644 index 0000000..b05371d --- /dev/null +++ b/week-04/project/htaccess.txt @@ -0,0 +1,196 @@ +## +# @copyright Copyright (C) 2014 - 2017 Open Source Matters, Inc. All rights reserved. +# @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License Version 2 or Later +## + +########################################### +# ======= Set basic Security header ======= + +# Just enable the rules on the live site and exclude the dev sites + + + # X-XSS-Protection + Header always set X-XSS-Protection "1; mode=block" + # X-Frame-Options + Header always set X-Frame-Options DENY + # X-Content-Type nosniff + Header always set X-Content-Type-Options nosniff + # Referrer Policy + Header always set Referrer-Policy "no-referrer-when-downgrade" + # Strict-Transport-Security + Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains" + # Cross-Origin-Opener-Policy + Header always set Cross-Origin-Opener-Policy "same-origin" + # Content-Security-Policy + Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'sha256-IxJ2MRv31XGmZD5ovlgSBrPmMjftYTJ3OM9/kLh6nBo=' 'sha256-QIsD5w9F5MPp3vlmsPHmbv0GZjN9ja3BuhcwpaWZuUw=' https://*.google-analytics.com https://www.googletagmanager.com https://*.pingdom.net; style-src 'self' 'sha256-4Su6mBWzEIFnH4pAGMOuaeBrstwJN4Z3pq/s1Kn4/KQ=' https://*.joomla.org https://fonts.googleapis.com; connect-src 'self' https://*.pingdom.net https://*.doubleclick.net https://*.google-analytics.com; frame-src 'self' https://*.googletagmanager.com; font-src 'self' https://fonts.gstatic.com https://*.joomla.org; img-src 'self' https://*.google-analytics.com https://*.googletagmanager.com https://*.joomla.org https://*.pingdom.net https://*.doubleclick.net https://*.githubusercontent.com https://*.travis-ci.org https://travis-ci.org; frame-ancestors 'self'; report-uri https://joomla.report-uri.com/r/t/csp/enforce" + + + +########################################### + +########################################### +# ======= Enable the Rewrite Engine ======= + +RewriteEngine On + +########################################### + + +########################################### +# ======= No directory listings ======= + +IndexIgnore * +Options +FollowSymLinks +Options -Indexes + +########################################### + + +########################################### +# === Optimal default expiration time === + + + # Enable expiration control + ExpiresActive On + + # Default expiration: 1 hour after request + ExpiresDefault "now plus 1 hour" + + # CSS and JS expiration: 1 week after request + ExpiresByType text/css "now plus 1 week" + ExpiresByType application/javascript "now plus 1 week" + ExpiresByType application/x-javascript "now plus 1 week" + + # Image files expiration: 1 month after request + ExpiresByType image/bmp "now plus 1 month" + ExpiresByType image/gif "now plus 1 month" + ExpiresByType image/jpeg "now plus 1 month" + ExpiresByType image/jp2 "now plus 1 month" + ExpiresByType image/pipeg "now plus 1 month" + ExpiresByType image/png "now plus 1 month" + ExpiresByType image/svg+xml "now plus 1 month" + ExpiresByType image/tiff "now plus 1 month" + ExpiresByType image/vnd.microsoft.icon "now plus 1 month" + ExpiresByType image/x-icon "now plus 1 month" + ExpiresByType image/ico "now plus 1 month" + ExpiresByType image/icon "now plus 1 month" + ExpiresByType text/ico "now plus 1 month" + ExpiresByType application/ico "now plus 1 month" + ExpiresByType image/vnd.wap.wbmp "now plus 1 month" + ExpiresByType application/vnd.wap.wbxml "now plus 1 month" + ExpiresByType application/smil "now plus 1 month" + + # Audio files expiration: 1 month after request + ExpiresByType audio/basic "now plus 1 month" + ExpiresByType audio/mid "now plus 1 month" + ExpiresByType audio/midi "now plus 1 month" + ExpiresByType audio/mpeg "now plus 1 month" + ExpiresByType audio/x-aiff "now plus 1 month" + ExpiresByType audio/x-mpegurl "now plus 1 month" + ExpiresByType audio/x-pn-realaudio "now plus 1 month" + ExpiresByType audio/x-wav "now plus 1 month" + + # Movie files expiration: 1 month after request + ExpiresByType application/x-shockwave-flash "now plus 1 month" + ExpiresByType x-world/x-vrml "now plus 1 month" + ExpiresByType video/x-msvideo "now plus 1 month" + ExpiresByType video/mpeg "now plus 1 month" + ExpiresByType video/mp4 "now plus 1 month" + ExpiresByType video/quicktime "now plus 1 month" + ExpiresByType video/x-la-asf "now plus 1 month" + ExpiresByType video/x-ms-asf "now plus 1 month" + +########################################### + + +########################################### +# == Automatic compression of resources == + + + AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript + + + mod_gzip_on Yes + mod_gzip_dechunk Yes + mod_gzip_keep_workfiles No + mod_gzip_can_negotiate Yes + mod_gzip_add_header_count Yes + mod_gzip_send_vary Yes + mod_gzip_min_http 1000 + mod_gzip_minimum_file_size 300 + mod_gzip_maximum_file_size 512000 + mod_gzip_maximum_inmem_size 60000 + mod_gzip_handle_methods GET + mod_gzip_item_include file \.(html?|txt|css|js|php|pl|xml|rb|py)$ + mod_gzip_item_include mime ^text/plain$ + mod_gzip_item_include mime ^text/html$ + mod_gzip_item_include mime ^text/xml$ + mod_gzip_item_include mime ^text/css$ + mod_gzip_item_include mime ^application/xml$ + mod_gzip_item_include mime ^application/xhtml+xml$ + mod_gzip_item_include mime ^application/rss+xml$ + mod_gzip_item_include mime ^application/javascript$ + mod_gzip_item_include mime ^application/x-javascript$ + mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* + mod_gzip_item_include handler ^cgi-script$ + mod_gzip_item_include handler ^server-status$ + mod_gzip_item_include handler ^server-info$ + mod_gzip_item_include handler ^application/x-httpd-php + mod_gzip_item_exclude mime ^image/.* + +########################################### + + +########################################### +# ======== Remove multiple slashes ======== + +RewriteCond %{HTTP_HOST} !="" +RewriteCond %{THE_REQUEST} ^[A-Z]+\s//+(.*)\sHTTP/[0-9.]+$ [OR] +RewriteCond %{THE_REQUEST} ^[A-Z]+\s(.*/)/+\sHTTP/[0-9.]+$ +RewriteRule .* http://%{HTTP_HOST}/%1 [R=301,L] + +########################################### + + +########################################### +# ======== Remove trailing slashes ======== + +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^(.*)/$ /$1 [R=301,L] + +########################################### + + +########################################### +# ======== Redirect HTTP to HTTPS ========= + +#RewriteCond %{HTTPS} off +#RewriteCond %{HTTP_HOST} ^framework.joomla.org$ [NC] +#RewriteRule ^(.*)$ https://framework.joomla.org/$1 [R=301,L,QSA] + +########################################### + + +########################################### +# ======== Redirect removed pages ========= + +#RewriteCond %{REQUEST_URI} ^/about +#RewriteRule ^(.*)$ /contributors [R=301,L,QSA] + +########################################### + + +########################################### +# ======== SEF URL Routing ======== + +# If the request is not for a static asset +RewriteCond %{REQUEST_URI} !^/media/ + +# Or for a file that exists in the web directory +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d + +# Rewrite the request to run the application +RewriteRule (.*) index.php + +########################################### \ No newline at end of file diff --git a/week-04/project/includes/app.php b/week-04/project/includes/app.php new file mode 100644 index 0000000..603becf --- /dev/null +++ b/week-04/project/includes/app.php @@ -0,0 +1,95 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +defined('_LEXEC') or die; + +// Option to override defines from root folder +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/app.php#L15 +if (file_exists(dirname(__DIR__) . '/defines.php')) +{ + include_once dirname(__DIR__) . '/defines.php'; +} + +// Load the default defines +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/app.php#L20 +if (!defined('_LDEFINES')) +{ + define('LPATH_BASE', dirname(__DIR__)); + require_once LPATH_BASE . '/includes/defines.php'; +} + +// Check for presence of vendor dependencies not included in the git repository +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/app.php#L26 +if (!file_exists(LPATH_LIBRARIES . '/vendor/autoload.php')) +{ + echo file_get_contents(LPATH_ROOT . '/templates/system/build_incomplete.html'); + + exit; +} + +// Load configuration (or install) +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/app.php#L34 +require_once LPATH_BASE . '/includes/framework.php'; + +// Wrap in a try/catch so we can display an error if need be +try +{ + $container = (new Joomla\DI\Container) + ->registerServiceProvider(new Octoleo\CMS\Service\SiteApplicationProvider) + ->registerServiceProvider(new Octoleo\CMS\Service\ConfigurationProvider(LPATH_CONFIGURATION . '/octoconfig.php')) + ->registerServiceProvider(new Joomla\Database\Service\DatabaseProvider) + ->registerServiceProvider(new Octoleo\CMS\Service\EventProvider) + ->registerServiceProvider(new Octoleo\CMS\Service\HttpProvider) + ->registerServiceProvider(new Octoleo\CMS\Service\LoggingProvider) + ->registerServiceProvider(new Joomla\Preload\Service\PreloadProvider) + ->registerServiceProvider(new Octoleo\CMS\Service\TemplatingProvider); + + // Alias the web application to Octoleo's base application class as this is the primary application for the environment + $container->alias(Joomla\Application\AbstractApplication::class, Joomla\Application\AbstractWebApplication::class); + + // Alias the web logger to the PSR-3 interface as this is the primary logger for the environment + $container->alias(Monolog\Logger::class, 'monolog.logger.application.web') + ->alias(Psr\Log\LoggerInterface::class, 'monolog.logger.application.web'); +} +catch (\Throwable $e) +{ + error_log($e); + + header('HTTP/1.1 500 Internal Server Error', null, 500); + echo 'Container Initialization Error

Container Initialization Error

An error occurred while creating the DI container: ' . $e->getMessage() . '

'; + + exit(1); +} + +// Execute the application +// source: https://github.com/joomla/framework.joomla.org/blob/master/www/index.php#L85 +try +{ + $app = $container->get(Joomla\Application\AbstractApplication::class); + // Set the application as global app + \Octoleo\CMS\Factory::$application = $app; + // Execute the application. + $app->execute(); +} +catch (\Throwable $e) +{ + error_log($e); + + if (!headers_sent()) + { + header('HTTP/1.1 500 Internal Server Error', null, 500); + header('Content-Type: text/html; charset=utf-8'); + } + + echo 'Application Error

Application Error

An error occurred while executing the application: ' . $e->getMessage() . '

'; + + exit(1); +} +// I am just playing around... ((ewɘ))yn purring \ No newline at end of file diff --git a/week-04/project/includes/defines.php b/week-04/project/includes/defines.php new file mode 100644 index 0000000..b95081f --- /dev/null +++ b/week-04/project/includes/defines.php @@ -0,0 +1,23 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +defined('_LEXEC') or die; + +// Global definitions +$parts = explode(DIRECTORY_SEPARATOR, LPATH_BASE); + +// Defines. +define('LPATH_ROOT', implode(DIRECTORY_SEPARATOR, $parts)); +define('LPATH_SITE', LPATH_ROOT); +define('LPATH_CONFIGURATION', LPATH_ROOT); +define('LPATH_ADMINISTRATOR', LPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator'); +define('LPATH_LIBRARIES', LPATH_ROOT . DIRECTORY_SEPARATOR . 'libraries'); +define('LPATH_INSTALLATION', LPATH_ROOT . DIRECTORY_SEPARATOR . 'installation'); +define('LPATH_TEMPLATES', LPATH_ROOT . DIRECTORY_SEPARATOR . 'templates/site'); diff --git a/week-04/project/includes/framework.php b/week-04/project/includes/framework.php new file mode 100644 index 0000000..1e4cbff --- /dev/null +++ b/week-04/project/includes/framework.php @@ -0,0 +1,35 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +defined('_LEXEC') or die; + +// System includes +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/framework.php#L14 +require_once LPATH_LIBRARIES . '/bootstrap.php'; + +// Installation check, and check on removal of the installation directory. +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/framework.php#L17 +if (!file_exists(LPATH_CONFIGURATION . '/octoconfig.php') + || (filesize(LPATH_CONFIGURATION . '/octoconfig.php') < 10) + || (file_exists(LPATH_INSTALLATION . '/index.php'))) +{ + if (file_exists(LPATH_INSTALLATION . '/index.php')) + { + header('Location: ' . substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'index.php')) . 'installation/index.php'); + + exit; + } + else + { + echo 'No configuration file found and no installation code available. Exiting...'; + + exit; + } +} diff --git a/week-04/project/includes/index.html b/week-04/project/includes/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/week-04/project/includes/index.html @@ -0,0 +1 @@ + diff --git a/week-04/project/index.php b/week-04/project/index.php new file mode 100644 index 0000000..e55461f --- /dev/null +++ b/week-04/project/index.php @@ -0,0 +1,35 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// NOTE: This file should remain compatible with PHP 5.2 to allow us to run our PHP minimum check and show a friendly error message +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/index.php#L9 + +// Define the application's minimum supported PHP version as a constant, so it can be referenced within the application. +define('OCTOLEO_MINIMUM_PHP', '7.2.5'); + +if (version_compare(PHP_VERSION, OCTOLEO_MINIMUM_PHP, '<')) +{ + die( + str_replace( + '{{phpversion}}', + OCTOLEO_MINIMUM_PHP, + file_get_contents(dirname(__FILE__) . '/templates/system/incompatible.html') + ) + ); +} + +/** + * Constant that is checked in included files to prevent direct access. + */ +define('_LEXEC', 1); + +// We must setup some house rules, since we can't have all +// this code just doing what it wants can we?... <>yn growling +require_once dirname(__FILE__) . '/includes/app.php'; diff --git a/week-04/project/installation/includes/app.php b/week-04/project/installation/includes/app.php new file mode 100644 index 0000000..9aa0219 --- /dev/null +++ b/week-04/project/installation/includes/app.php @@ -0,0 +1,31 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +defined('_LEXEC') or die; + +// Option to override defines from root folder +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/app.php#L15 +if (file_exists(dirname(__DIR__) . '/defines.php')) +{ + include_once dirname(__DIR__) . '/defines.php'; +} + +// Load the default defines +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/includes/app.php#L20 +if (!defined('_LDEFINES')) +{ + define('LPATH_BASE', dirname(__DIR__)); + require_once LPATH_BASE . '/includes/defines.php'; +} + +// I have not yet had time to finish this part of the application (CMS) +echo file_get_contents(LPATH_ROOT . '/templates/system/install_notice.html'); + +exit; diff --git a/week-04/project/installation/includes/defines.php b/week-04/project/installation/includes/defines.php new file mode 100644 index 0000000..20db660 --- /dev/null +++ b/week-04/project/installation/includes/defines.php @@ -0,0 +1,23 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +defined('_LEXEC') or die; + +// Global definitions +$parts = explode(DIRECTORY_SEPARATOR, LPATH_BASE); +array_pop($parts); + +// Defines. +define('LPATH_ROOT', implode(DIRECTORY_SEPARATOR, $parts)); +define('LPATH_SITE', LPATH_ROOT); +define('LPATH_CONFIGURATION', LPATH_ROOT); +define('LPATH_ADMINISTRATOR', LPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator'); +define('LPATH_LIBRARIES', LPATH_ROOT . DIRECTORY_SEPARATOR . 'libraries'); +define('LPATH_INSTALLATION', LPATH_ROOT . DIRECTORY_SEPARATOR . 'installation'); diff --git a/week-04/project/installation/includes/framework.php b/week-04/project/installation/includes/framework.php new file mode 100644 index 0000000..6643c3e --- /dev/null +++ b/week-04/project/installation/includes/framework.php @@ -0,0 +1,41 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +defined('_LEXEC') or die; + +// System includes +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/administrator/includes/framework.php#L14 +require_once LPATH_LIBRARIES . '/bootstrap.php'; + +// Installation check, and check on removal of the installation directory. +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/administrator/includes/framework.php#L17 +if (!file_exists(LPATH_CONFIGURATION . '/octoconfig.php') + || (filesize(LPATH_CONFIGURATION . '/octoconfig.php') < 10) + || (file_exists(LPATH_INSTALLATION . '/index.php'))) +{ + if (file_exists(LPATH_INSTALLATION . '/index.php')) + { + header('Location: ../installation/index.php'); + + exit; + } + else + { + echo 'No configuration file found and no installation code available. Exiting...'; + + exit; + } +} + +// Pre-Load configuration. Don't remove the Output Buffering due to BOM issues. +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/administrator/includes/framework.php#L36 +ob_start(); +require_once LPATH_CONFIGURATION . '/octoconfig.php'; +ob_end_clean(); diff --git a/week-04/project/installation/index.php b/week-04/project/installation/index.php new file mode 100644 index 0000000..50766b7 --- /dev/null +++ b/week-04/project/installation/index.php @@ -0,0 +1,35 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// NOTE: This file should remain compatible with PHP 5.2 to allow us to run our PHP minimum check and show a friendly error message +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/index.php#L9 + +// Define the application's minimum supported PHP version as a constant, so it can be referenced within the application. +define('OCTOLEO_MINIMUM_PHP', '7.2.5'); + +if (version_compare(PHP_VERSION, OCTOLEO_MINIMUM_PHP, '<')) +{ + die( + str_replace( + '{{phpversion}}', + OCTOLEO_MINIMUM_PHP, + file_get_contents(dirname(__FILE__) . '/../templates/system/incompatible.html') + ) + ); +} + +/** + * Constant that is checked in included files to prevent direct access. + */ +define('_LEXEC', 1); + +// We must setup some house rules, since we can't have all +// this code just doing what it wants can we.... <>yn growling +require_once dirname(__FILE__) . '/includes/app.php'; \ No newline at end of file diff --git a/week-04/project/libraries/.htaccess b/week-04/project/libraries/.htaccess new file mode 100644 index 0000000..9afb1a1 --- /dev/null +++ b/week-04/project/libraries/.htaccess @@ -0,0 +1,9 @@ +# Apache 2.4+ + + Require all denied + + +# Apache 2.0-2.2 + + Deny from all + diff --git a/week-04/project/libraries/bootstrap.php b/week-04/project/libraries/bootstrap.php new file mode 100644 index 0000000..2130e47 --- /dev/null +++ b/week-04/project/libraries/bootstrap.php @@ -0,0 +1,48 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +defined('_LEXEC') or die; + +// Set the platform root path as a constant if necessary. +// source: https://github.com/joomla/joomla-cms/blob/4.1-dev/libraries/bootstrap.php#L12 +defined('LPATH_PLATFORM') or define('LPATH_PLATFORM', __DIR__); + +// Detect the native operating system type. +$os = strtoupper(substr(PHP_OS, 0, 3)); + +defined('IS_WIN') or define('IS_WIN', ($os === 'WIN')); +defined('IS_UNIX') or define('IS_UNIX', (($os !== 'MAC') && ($os !== 'WIN'))); + +// Import the library loader if necessary. +if (!class_exists('LLoader')) +{ + require_once LPATH_PLATFORM . '/loader.php'; + + // If JLoader still does not exist panic. + if (!class_exists('LLoader')) + { + throw new RuntimeException('Octoleo Platform not loaded.'); + } +} + +// Setup the autoloaders. +LLoader::setup(); + +// Create the Composer autoloader +/** @var \Composer\Autoload\ClassLoader $loader */ +$loader = require LPATH_LIBRARIES . '/vendor/autoload.php'; + +// We need to pull our decorated class loader into memory before unregistering Composer's loader +class_exists('\\Octoleo\\CMS\\Autoload\\ClassLoader'); + +$loader->unregister(); + +// Decorate Composer autoloader +spl_autoload_register([new \Octoleo\CMS\Autoload\ClassLoader($loader), 'loadClass'], true, true); diff --git a/week-04/project/libraries/loader.php b/week-04/project/libraries/loader.php new file mode 100644 index 0000000..f04d40f --- /dev/null +++ b/week-04/project/libraries/loader.php @@ -0,0 +1,599 @@ + + * + * @copyright (C) 2005 Open Source Matters, Inc. + * @license GNU General Public License version 2 or later; see LICENSE.txt + **/ + +defined('LPATH_PLATFORM') or die; + +/** + * Static class to handle loading of libraries. + * + * @since 1.0.0 + */ +abstract class LLoader +{ + /** + * Container for already imported library paths. + * + * @var array + * @since 1.7.0 + */ + protected static $classes = array(); + + /** + * Container for already imported library paths. + * + * @var array + * @since 1.7.0 + */ + protected static $imported = array(); + + /** + * Container for registered library class prefixes and path lookups. + * + * @var array + * @since 3.0.0 + */ + protected static $prefixes = array(); + + /** + * Holds proxy classes and the class names the proxy. + * + * @var array + * @since 3.2 + */ + protected static $classAliases = array(); + + /** + * Holds the inverse lookup for proxy classes and the class names the proxy. + * + * @var array + * @since 3.4 + */ + protected static $classAliasesInverse = array(); + + /** + * Container for namespace => path map. + * + * @var array + * @since 3.1.4 + */ + protected static $namespaces = array(); + + /** + * Holds a reference for all deprecated aliases (mainly for use by a logging platform). + * + * @var array + * @since 3.6.3 + */ + protected static $deprecatedAliases = array(); + + /** + * The root folders where extensions can be found. + * + * @var array + * @since 4.0.0 + */ + protected static $extensionRootFolders = array(); + + /** + * Method to get the list of registered classes and their respective file paths for the autoloader. + * + * @return array The array of class => path values for the autoloader. + * + * @since 1.7.0 + */ + public static function getClassList() + { + return self::$classes; + } + + /** + * Method to get the list of deprecated class aliases. + * + * @return array An associative array with deprecated class alias data. + * + * @since 3.6.3 + */ + public static function getDeprecatedAliases() + { + return self::$deprecatedAliases; + } + + /** + * Method to get the list of registered namespaces. + * + * @return array The array of namespace => path values for the autoloader. + * + * @since 3.1.4 + */ + public static function getNamespaces() + { + return self::$namespaces; + } + + /** + * Load the file for a class. + * + * @param string $class The class to be loaded. + * + * @return boolean True on success + * + * @since 1.7.0 + */ + public static function load($class) + { + // Sanitize class name. + $key = strtolower($class); + + // If the class already exists do nothing. + if (class_exists($class, false)) + { + return true; + } + + // If the class is registered include the file. + if (isset(self::$classes[$key])) + { + $found = (bool) include_once self::$classes[$key]; + + if ($found) + { + self::loadAliasFor($class); + } + + // If the class doesn't exists, we probably have a class alias available + if (!class_exists($class, false)) + { + // Search the alias class, first none namespaced and then namespaced + $original = array_search($class, self::$classAliases) ? : array_search('\\' . $class, self::$classAliases); + + // When we have an original and the class exists an alias should be created + if ($original && class_exists($original, false)) + { + class_alias($original, $class); + } + } + + return true; + } + + return false; + } + + /** + * Register a class prefix with lookup path. This will allow developers to register library + * packages with different class prefixes to the system autoloader. More than one lookup path + * may be registered for the same class prefix, but if this method is called with the reset flag + * set to true then any registered lookups for the given prefix will be overwritten with the current + * lookup path. When loaded, prefix paths are searched in a "last in, first out" order. + * + * @param string $prefix The class prefix to register. + * @param string $path Absolute file path to the library root where classes with the given prefix can be found. + * @param boolean $reset True to reset the prefix with only the given lookup path. + * @param boolean $prepend If true, push the path to the beginning of the prefix lookup paths array. + * + * @return void + * + * @throws RuntimeException + * + * @since 3.0.0 + */ + public static function registerPrefix($prefix, $path, $reset = false, $prepend = false) + { + // Verify the library path exists. + if (!is_dir($path)) + { + $path = (str_replace(LPATH_ROOT, '', $path) == $path) ? basename($path) : str_replace(LPATH_ROOT, '', $path); + + throw new RuntimeException('Library path ' . $path . ' cannot be found.', 500); + } + + // If the prefix is not yet registered or we have an explicit reset flag then set set the path. + if ($reset || !isset(self::$prefixes[$prefix])) + { + self::$prefixes[$prefix] = array($path); + } + // Otherwise we want to simply add the path to the prefix. + else + { + if ($prepend) + { + array_unshift(self::$prefixes[$prefix], $path); + } + else + { + self::$prefixes[$prefix][] = $path; + } + } + } + + /** + * Offers the ability for "just in time" usage of `class_alias()`. + * You cannot overwrite an existing alias. + * + * @param string $alias The alias name to register. + * @param string $original The original class to alias. + * @param string|boolean $version The version in which the alias will no longer be present. + * + * @return boolean True if registration was successful. False if the alias already exists. + * + * @since 3.2 + */ + public static function registerAlias($alias, $original, $version = false) + { + // PHP is case insensitive so support all kind of alias combination + $lowercasedAlias = strtolower($alias); + + if (!isset(self::$classAliases[$lowercasedAlias])) + { + self::$classAliases[$lowercasedAlias] = $original; + + $original = self::stripFirstBackslash($original); + + if (!isset(self::$classAliasesInverse[$original])) + { + self::$classAliasesInverse[$original] = array($lowercasedAlias); + } + else + { + self::$classAliasesInverse[$original][] = $lowercasedAlias; + } + + // If given a version, log this alias as deprecated + if ($version) + { + self::$deprecatedAliases[] = array('old' => $alias, 'new' => $original, 'version' => $version); + } + + return true; + } + + return false; + } + + /** + * Register a namespace to the autoloader. When loaded, namespace paths are searched in a "last in, first out" order. + * + * @param string $namespace A case sensitive Namespace to register. + * @param string $path A case sensitive absolute file path to the library root where classes of the given namespace can be found. + * @param boolean $reset True to reset the namespace with only the given lookup path. + * @param boolean $prepend If true, push the path to the beginning of the namespace lookup paths array. + * + * @return void + * + * @throws RuntimeException + * + * @since 3.1.4 + */ + public static function registerNamespace($namespace, $path, $reset = false, $prepend = false) + { + // Verify the library path exists. + if (!is_dir($path)) + { + $path = (str_replace(LPATH_ROOT, '', $path) == $path) ? basename($path) : str_replace(LPATH_ROOT, '', $path); + + throw new RuntimeException('Library path ' . $path . ' cannot be found.', 500); + } + + // Trim leading and trailing backslashes from namespace, allowing "\Parent\Child", "Parent\Child\" and "\Parent\Child\" to be treated the same way. + $namespace = trim($namespace, '\\'); + + // If the namespace is not yet registered or we have an explicit reset flag then set the path. + if ($reset || !isset(self::$namespaces[$namespace])) + { + self::$namespaces[$namespace] = array($path); + } + + // Otherwise we want to simply add the path to the namespace. + else + { + if ($prepend) + { + array_unshift(self::$namespaces[$namespace], $path); + } + else + { + self::$namespaces[$namespace][] = $path; + } + } + } + + /** + * Method to setup the autoloaders for the Octoleo Platform. + * Since the SPL autoloaders are called in a queue we will add our explicit + * class-registration based loader first, then fall back on the autoloader based on conventions. + * This will allow people to register a class in a specific location and override platform libraries + * as was previously possible. + * + * @param boolean $enablePsr True to enable autoloading based on PSR-0. + * @param boolean $enablePrefixes True to enable prefix based class loading (needed to auto load the Octoleo core). + * @param boolean $enableClasses True to enable class map based class loading (needed to auto load the Octoleo core). + * + * @return void + * + * @since 3.1.4 + */ + public static function setup($enablePsr = true, $enablePrefixes = true, $enableClasses = true) + { + if ($enableClasses) + { + // Register the class map based autoloader. + spl_autoload_register(array('LLoader', 'load')); + } + + if ($enablePrefixes) + { + // Register the prefix autoloader. + spl_autoload_register(array('LLoader', '_autoload')); + } + + if ($enablePsr) + { + // Register the PSR based autoloader. + spl_autoload_register(array('LLoader', 'loadByPsr')); + spl_autoload_register(array('LLoader', 'loadByAlias')); + } + } + + /** + * Method to autoload classes that are namespaced to the PSR-4 standard. + * + * @param string $class The fully qualified class name to autoload. + * + * @return boolean True on success, false otherwise. + * + * @since 3.7.0 + * @deprecated 5.0 Use LLoader::loadByPsr instead + */ + public static function loadByPsr4($class) + { + return self::loadByPsr($class); + } + + /** + * Method to autoload classes that are namespaced to the PSR-4 standard. + * + * @param string $class The fully qualified class name to autoload. + * + * @return boolean True on success, false otherwise. + * + * @since 4.0.0 + */ + public static function loadByPsr($class) + { + $class = self::stripFirstBackslash($class); + + // Find the location of the last NS separator. + $pos = strrpos($class, '\\'); + + // If one is found, we're dealing with a NS'd class. + if ($pos !== false) + { + $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR; + $className = substr($class, $pos + 1); + } + // If not, no need to parse path. + else + { + $classPath = null; + $className = $class; + } + + $classPath .= $className . '.php'; + + // Loop through registered namespaces until we find a match. + foreach (self::$namespaces as $ns => $paths) + { + if (strpos($class, "{$ns}\\") === 0) + { + $nsPath = trim(str_replace('\\', DIRECTORY_SEPARATOR, $ns), DIRECTORY_SEPARATOR); + + // Loop through paths registered to this namespace until we find a match. + foreach ($paths as $path) + { + $classFilePath = realpath($path . DIRECTORY_SEPARATOR . substr_replace($classPath, '', 0, strlen($nsPath) + 1)); + + // We do not allow files outside the namespace root to be loaded + if (strpos($classFilePath, realpath($path)) !== 0) + { + continue; + } + + // We check for class_exists to handle case-sensitive file systems + if (is_file($classFilePath) && !class_exists($class, false)) + { + $found = (bool) include_once $classFilePath; + + if ($found) + { + self::loadAliasFor($class); + } + + return $found; + } + } + } + } + + return false; + } + + /** + * Method to autoload classes that have been aliased using the registerAlias method. + * + * @param string $class The fully qualified class name to autoload. + * + * @return boolean True on success, false otherwise. + * + * @since 3.2 + */ + public static function loadByAlias($class) + { + $class = strtolower(self::stripFirstBackslash($class)); + + if (isset(self::$classAliases[$class])) + { + // Force auto-load of the regular class + class_exists(self::$classAliases[$class], true); + + // Normally this shouldn't execute as the autoloader will execute applyAliasFor when the regular class is + // auto-loaded above. + if (!class_exists($class, false) && !interface_exists($class, false)) + { + class_alias(self::$classAliases[$class], $class); + } + } + } + + /** + * Applies a class alias for an already loaded class, if a class alias was created for it. + * + * @param string $class We'll look for and register aliases for this (real) class name + * + * @return void + * + * @since 3.4 + */ + public static function applyAliasFor($class) + { + $class = self::stripFirstBackslash($class); + + if (isset(self::$classAliasesInverse[$class])) + { + foreach (self::$classAliasesInverse[$class] as $alias) + { + class_alias($class, $alias); + } + } + } + + /** + * Autoload a class based on name. + * + * @param string $class The class to be loaded. + * + * @return boolean True if the class was loaded, false otherwise. + * + * @since 1.7.3 + */ + public static function _autoload($class) + { + foreach (self::$prefixes as $prefix => $lookup) + { + $chr = strlen($prefix) < strlen($class) ? $class[strlen($prefix)] : 0; + + if (strpos($class, $prefix) === 0 && ($chr === strtoupper($chr))) + { + return self::_load(substr($class, strlen($prefix)), $lookup); + } + } + + return false; + } + + /** + * Load a class based on name and lookup array. + * + * @param string $class The class to be loaded (without prefix). + * @param array $lookup The array of base paths to use for finding the class file. + * + * @return boolean True if the class was loaded, false otherwise. + * + * @since 3.0.0 + */ + private static function _load($class, $lookup) + { + // Split the class name into parts separated by camelCase. + $parts = preg_split('/(?<=[a-z0-9])(?=[A-Z])/x', $class); + $partsCount = count($parts); + + foreach ($lookup as $base) + { + // Generate the path based on the class name parts. + $path = realpath($base . '/' . implode('/', array_map('strtolower', $parts)) . '.php'); + + // Load the file if it exists and is in the lookup path. + if (strpos($path, realpath($base)) === 0 && is_file($path)) + { + $found = (bool) include_once $path; + + if ($found) + { + self::loadAliasFor($class); + } + + return $found; + } + + // Backwards compatibility patch + + // If there is only one part we want to duplicate that part for generating the path. + if ($partsCount === 1) + { + // Generate the path based on the class name parts. + $path = realpath($base . '/' . implode('/', array_map('strtolower', array($parts[0], $parts[0]))) . '.php'); + + // Load the file if it exists and is in the lookup path. + if (strpos($path, realpath($base)) === 0 && is_file($path)) + { + $found = (bool) include_once $path; + + if ($found) + { + self::loadAliasFor($class); + } + + return $found; + } + } + } + + return false; + } + + /** + * Loads the aliases for the given class. + * + * @param string $class The class. + * + * @return void + * + * @since 3.8.0 + */ + private static function loadAliasFor($class) + { + if (!array_key_exists($class, self::$classAliasesInverse)) + { + return; + } + + foreach (self::$classAliasesInverse[$class] as $alias) + { + // Force auto-load of the alias class + class_exists($alias, true); + } + } + + /** + * Strips the first backslash from the given class if present. + * + * @param string $class The class to strip the first prefix from. + * + * @return string The striped class name. + * + * @since 3.8.0 + */ + private static function stripFirstBackslash($class) + { + return $class && $class[0] === '\\' ? substr($class, 1) : $class; + } +} diff --git a/week-04/project/libraries/src/Application/AdminApplication.php b/week-04/project/libraries/src/Application/AdminApplication.php new file mode 100644 index 0000000..b1aaa64 --- /dev/null +++ b/week-04/project/libraries/src/Application/AdminApplication.php @@ -0,0 +1,90 @@ +controllerResolver = $controllerResolver; + $this->router = $router; + + // Call the constructor as late as possible (it runs `initialise`). + parent::__construct($input, $config, $client, $response); + } + + /** + * Method to run the application routines. + * + * @return void + */ + protected function doExecute(): void + { + $route = $this->router->parseRoute($this->get('uri.route'), $this->input->getMethod()); + + // Add variables to the input if not already set + foreach ($route->getRouteVariables() as $key => $value) + { + $this->input->def($key, $value); + } + + \call_user_func($this->controllerResolver->resolve($route)); + } +} \ No newline at end of file diff --git a/week-04/project/libraries/src/Application/IdentityAwareInterface.php b/week-04/project/libraries/src/Application/IdentityAwareInterface.php new file mode 100644 index 0000000..3c5147d --- /dev/null +++ b/week-04/project/libraries/src/Application/IdentityAwareInterface.php @@ -0,0 +1,57 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Application; + +use Octoleo\CMS\User\User; +use Octoleo\CMS\User\UserFactoryInterface; + +interface IdentityAwareInterface +{ + /** + * Get the application identity. + * + * @return User + * + * @since 1.0.0 + */ + public function getIdentity(): User; + + /** + * Allows the application to load a custom or default identity. + * + * @param User $identity An optional identity object. If omitted, a null user object is created. + * + * @return $this + * + * @since 1.0.0 + */ + public function loadIdentity(User $identity = null): IdentityAwareInterface; + + /** + * Set the user factory to use. + * + * @param UserFactoryInterface $userFactory The user factory to use + * + * @return void + * + * @since 1.0.0 + */ + public function setUserFactory(UserFactoryInterface $userFactory); + + /** + * Get the user factory to use. + * + * @return UserFactoryInterface + * + * @since 1.0.0 + */ + public function getUserFactory(): UserFactoryInterface; +} diff --git a/week-04/project/libraries/src/Application/IdentityAwareTrait.php b/week-04/project/libraries/src/Application/IdentityAwareTrait.php new file mode 100644 index 0000000..7f9e77b --- /dev/null +++ b/week-04/project/libraries/src/Application/IdentityAwareTrait.php @@ -0,0 +1,91 @@ + + * @license GNU General Public License version 2 or later; see LICENSE + */ + +namespace Octoleo\CMS\Application; + +use Octoleo\CMS\User\User; +use Octoleo\CMS\User\UserFactoryInterface; + +/** + * Trait for application classes which are identity (user) aware + * + * @since 1.0.0 + */ +trait IdentityAwareTrait +{ + /** + * The application identity object. + * + * @var User + * @since 1.0.0 + */ + protected $identity; + + /** + * UserFactoryInterface + * + * @var UserFactoryInterface + * @since 1.0.0 + */ + private $userFactory; + + /** + * Get the application identity. + * + * @return User + * + * @since 1.0.0 + */ + public function getIdentity(): User + { + return $this->identity; + } + + /** + * Allows the application to load a custom or default identity. + * + * @param User $identity An optional identity object. If omitted, a null user object is created. + * + * @return IdentityAwareInterface + * + * @since 1.0.0 + */ + public function loadIdentity(User $identity = null): IdentityAwareInterface + { + $this->identity = $identity ?: $this->userFactory->loadUserById(0); + + return $this; + } + + /** + * Set the user factory to use. + * + * @param UserFactoryInterface $userFactory The user factory to use + * + * @return void + * + * @since 1.0.0 + */ + public function setUserFactory(UserFactoryInterface $userFactory) + { + $this->userFactory = $userFactory; + } + + /** + * Get the user factory to use. + * + * @return UserFactoryInterface + * + * @since 1.0.0 + */ + public function getUserFactory(): UserFactoryInterface + { + return $this->userFactory; + } +} + diff --git a/week-04/project/libraries/src/Application/SessionMessageAwareInterface.php b/week-04/project/libraries/src/Application/SessionMessageAwareInterface.php new file mode 100644 index 0000000..ce418fc --- /dev/null +++ b/week-04/project/libraries/src/Application/SessionMessageAwareInterface.php @@ -0,0 +1,44 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Application; + +/** + * Application Session Message Aware Interface + * + * @since 1.0.0 + */ +interface SessionMessageAwareInterface +{ + const MSG_INFO = 'info'; + + /** + * Enqueue a system message. + * + * @param string $msg The message to enqueue. + * @param string $type The message type. Default is message. + * + * @return void + * + * @since 3.2 + */ + public function enqueueMessage(string $msg, string $type = self::MSG_INFO); + + /** + * Get the system message queue. + * + * @param boolean $clear Clear the messages currently attached to the application object + * + * @return array The system message queue. + * + * @since 3.2 + */ + public function getMessageQueue(bool $clear = false): array; +} diff --git a/week-04/project/libraries/src/Application/SessionMessageAwareTrait.php b/week-04/project/libraries/src/Application/SessionMessageAwareTrait.php new file mode 100644 index 0000000..a1eab3e --- /dev/null +++ b/week-04/project/libraries/src/Application/SessionMessageAwareTrait.php @@ -0,0 +1,88 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Application; + +use Joomla\Filter\InputFilter as InputFilterAlias; +use Octoleo\CMS\Filter\InputFilter; + +/** + * Trait for application classes which are identity (user) aware + * + * @since 1.0.0 + */ +trait SessionMessageAwareTrait +{ + /** + * Enqueue a system message. + * + * @param string $msg The message to enqueue. + * @param string $type The message type. Default is message. + * + * @return void + * + * @since 1.0.0 + */ + public function enqueueMessage(string $msg, string $type = self::MSG_INFO) + { + // Don't add empty messages. + if ($msg === null || trim($msg) === '') + { + return; + } + + $inputFilter = InputFilter::getInstance( + [], + [], + InputFilterAlias::ONLY_BLOCK_DEFINED_TAGS, + InputFilterAlias::ONLY_BLOCK_DEFINED_ATTRIBUTES + ); + + // Build the message array and apply the HTML InputFilter with the default blacklist to the message + $message = array( + 'message' => $inputFilter->clean($msg, 'html'), + 'type' => $inputFilter->clean(strtolower($type), 'cmd'), + ); + + // For empty queue, if messages exists in the session, enqueue them first. + $messages = $this->getMessageQueue(); + + if (!\in_array($message, $messages)) + { + // Enqueue the message. + $messages[] = $message; + + // update the session + $this->getSession()->set('application.queue', $messages); + } + } + + /** + * Get the system message queue. + * + * @param boolean $clear Clear the messages currently attached to the application object + * + * @return array The system message queue. + * + * @since 1.0.0 + */ + public function getMessageQueue(bool $clear = false): array + { + // Get messages from Session + $sessionQueue = $this->getSession()->get('application.queue', []); + + if ($clear) + { + $this->getSession()->set('application.queue', []); + } + + return $sessionQueue; + } +} diff --git a/week-04/project/libraries/src/Application/SiteApplication.php b/week-04/project/libraries/src/Application/SiteApplication.php new file mode 100644 index 0000000..c381173 --- /dev/null +++ b/week-04/project/libraries/src/Application/SiteApplication.php @@ -0,0 +1,86 @@ +controllerResolver = $controllerResolver; + $this->router = $router; + + // Call the constructor as late as possible (it runs `initialise`). + parent::__construct($input, $config, $client, $response); + } + + /** + * Method to run the application routines. + * + * @return void + */ + protected function doExecute(): void + { + $route = $this->router->parseRoute($this->get('uri.route'), $this->input->getMethod()); + + // Add variables to the input if not already set + foreach ($route->getRouteVariables() as $key => $value) + { + $this->input->def($key, $value); + } + + \call_user_func($this->controllerResolver->resolve($route)); + } +} \ No newline at end of file diff --git a/week-04/project/libraries/src/Asset/MixPathPackage.php b/week-04/project/libraries/src/Asset/MixPathPackage.php new file mode 100644 index 0000000..59af91d --- /dev/null +++ b/week-04/project/libraries/src/Asset/MixPathPackage.php @@ -0,0 +1,71 @@ +decoratedPackage = $decoratedPackage; + } + + /** + * Returns an absolute or root-relative public path. + * + * @param string $path A path + * + * @return string The public path + */ + public function getUrl($path) + { + if ($this->isAbsoluteUrl($path)) + { + return $path; + } + + $versionedPath = $this->getVersionStrategy()->applyVersion("/$path"); + + if ($versionedPath === $path) + { + return $this->decoratedPackage->getUrl($path); + } + + return $this->getBasePath() . ltrim($versionedPath, '/'); + } +} diff --git a/week-04/project/libraries/src/Autoload/ClassLoader.php b/week-04/project/libraries/src/Autoload/ClassLoader.php new file mode 100644 index 0000000..91f2399 --- /dev/null +++ b/week-04/project/libraries/src/Autoload/ClassLoader.php @@ -0,0 +1,63 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Autoload; + +\defined('_LEXEC') or die; + +use Composer\Autoload\ClassLoader as ComposerClassLoader; + +/** + * Decorate Composer ClassLoader for Octoleo! + * + * For backward compatibility due to class aliasing in the CMS, the loadClass() method was modified to call + * the LLoader::applyAliasFor() method. + * + * @since 3.4 + */ +class ClassLoader +{ + /** + * The Composer class loader + * + * @var ComposerClassLoader + * @since 3.4 + */ + private $loader; + + /** + * Constructor + * + * @param ComposerClassLoader $loader Composer autoloader + * + * @since 3.4 + */ + public function __construct(ComposerClassLoader $loader) + { + $this->loader = $loader; + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * + * @return boolean|null True if loaded, null otherwise + * + * @since 3.4 + */ + public function loadClass($class) + { + if ($result = $this->loader->loadClass($class)) + { + \LLoader::applyAliasFor($class); + } + + return $result; + } +} diff --git a/week-04/project/libraries/src/Controller/DashboardController.php b/week-04/project/libraries/src/Controller/DashboardController.php new file mode 100644 index 0000000..c324ad9 --- /dev/null +++ b/week-04/project/libraries/src/Controller/DashboardController.php @@ -0,0 +1,113 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Controller; + +use Joomla\Application\AbstractApplication; +use Joomla\Controller\AbstractController; +use Joomla\Input\Input; +use Joomla\Uri\Uri; +use Laminas\Diactoros\Response\RedirectResponse; +use Octoleo\CMS\View\Admin\DashboardHtmlView; +use Laminas\Diactoros\Response\HtmlResponse; + +/** + * Controller handling the site's homepage + * + * @method \Octoleo\CMS\Application\AdminApplication getApplication() Get the application object. + * @property-read \Octoleo\CMS\Application\AdminApplication $app Application object + */ +class DashboardController extends AbstractController +{ + /** + * The view object. + * + * @var DashboardHtmlView + */ + private $view; + + /** + * Constructor. + * + * @param DashboardHtmlView $view The view object. + * @param Input $user The user object. + * @param Input $input The input object. + * @param AbstractApplication $app The application object. + */ + public function __construct(DashboardHtmlView $view, Input $input = null, AbstractApplication $app = null) + { + parent::__construct($input, $app); + + $this->view = $view; + } + + /** + * Execute the controller. + * + * @return boolean + * @throws \Exception + */ + public function execute(): bool + { + // our little access controller TODO: we can do better + $has_access = false; + + // Enable browser caching + $this->getApplication()->allowCache(true); + + $dashboard = $this->getInput()->getString('dashboard', ''); + $id = $this->getInput()->getInt('id', 0); + + $this->view->setActiveDashboard($dashboard); + $this->view->setActiveId($id); + + /** @var \Octoleo\CMS\User\UserFactory $userFactory */ + $userFactory = $this->getApplication()->getUserFactory(); + + // user actions [access, signup] + if ('access' === $dashboard || 'signup' === $dashboard || 'logout' === $dashboard) + { + if ('access' === $dashboard && $userFactory->login()) + { + $has_access = true; + } + elseif ('signup' === $dashboard && $userFactory->create()) + { + $has_access = true; + } + elseif ('logout' === $dashboard && $userFactory->logout()) + { + $has_access = false; + } + + // we by default always load the dashboard + $this->view->setActiveDashboard('dashboard'); + } + elseif ($userFactory->active()) + { + $has_access = true; + } + + if ($has_access) + { + $this->getApplication()->setResponse(new HtmlResponse($this->view->render())); + } + else + { + // get uri request to get host + $uri = new Uri($this->getApplication()->get('uri.request')); + + // Redirect to the administrator area + $this->getApplication()->redirect($uri->getScheme() . '://' . $uri->getHost() . '/administrator/'); + } + + return true; + } +} diff --git a/week-04/project/libraries/src/Controller/HomepageController.php b/week-04/project/libraries/src/Controller/HomepageController.php new file mode 100644 index 0000000..fc90113 --- /dev/null +++ b/week-04/project/libraries/src/Controller/HomepageController.php @@ -0,0 +1,62 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Controller; + +use Joomla\Application\AbstractApplication; +use Joomla\Controller\AbstractController; +use Joomla\Input\Input; +use Joomla\Renderer\RendererInterface; +use Laminas\Diactoros\Response\HtmlResponse; + +/** + * Controller handling the site's homepage + * + * @method \Octoleo\CMS\Application\SiteApplication getApplication() Get the application object. + * @property-read \Octoleo\CMS\Application\SiteApplication $app Application object + */ +class HomepageController extends AbstractController +{ + /** + * The template renderer. + * + * @var RendererInterface + */ + private $renderer; + + /** + * Constructor. + * + * @param RendererInterface $renderer The template renderer. + * @param Input $input The input object. + * @param AbstractApplication $app The application object. + */ + public function __construct(RendererInterface $renderer, Input $input = null, AbstractApplication $app = null) + { + parent::__construct($input, $app); + + $this->renderer = $renderer; + } + + /** + * Execute the controller. + * + * @return boolean + */ + public function execute(): bool + { + // Enable browser caching + $this->getApplication()->allowCache(true); + + $this->getApplication()->setResponse(new HtmlResponse($this->renderer->render('homepage.twig'))); + + return true; + } +} diff --git a/week-04/project/libraries/src/Controller/LoginController.php b/week-04/project/libraries/src/Controller/LoginController.php new file mode 100644 index 0000000..5745503 --- /dev/null +++ b/week-04/project/libraries/src/Controller/LoginController.php @@ -0,0 +1,71 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Controller; + +use Joomla\Application\AbstractApplication; +use Joomla\Controller\AbstractController; +use Joomla\Input\Input; +use Joomla\Renderer\RendererInterface; +use Laminas\Diactoros\Response\HtmlResponse; + +/** + * Controller handling the site's homepage + * + * @method \Octoleo\CMS\Application\SiteApplication getApplication() Get the application object. + * @property-read \Octoleo\CMS\Application\SiteApplication $app Application object + */ +class LoginController extends AbstractController +{ + /** + * The template renderer. + * + * @var RendererInterface + */ + private $renderer; + + /** + * Constructor. + * + * @param RendererInterface $renderer The template renderer. + * @param Input $input The input object. + * @param AbstractApplication $app The application object. + */ + public function __construct(RendererInterface $renderer, Input $input = null, AbstractApplication $app = null) + { + parent::__construct($input, $app); + + $this->renderer = $renderer; + } + + /** + * Execute the controller. + * + * @return boolean + */ + public function execute(): bool + { + // Enable browser caching + $this->getApplication()->allowCache(true); + + $task = $this->getInput()->getString('account', null); + + if ('signup' === $task) + { + $this->getApplication()->setResponse(new HtmlResponse($this->renderer->render('signup.twig'))); + } + else + { + $this->getApplication()->setResponse(new HtmlResponse($this->renderer->render('login.twig'))); + } + + return true; + } +} diff --git a/week-04/project/libraries/src/Controller/PageController.php b/week-04/project/libraries/src/Controller/PageController.php new file mode 100644 index 0000000..ad246d3 --- /dev/null +++ b/week-04/project/libraries/src/Controller/PageController.php @@ -0,0 +1,82 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Controller; + +use Joomla\Application\AbstractApplication; +use Joomla\Controller\AbstractController; +use Joomla\Input\Input; +use Joomla\Uri\Uri; +use Octoleo\CMS\View\Page\PageHtmlView; +use Laminas\Diactoros\Response\HtmlResponse; +use Laminas\Diactoros\Response\RedirectResponse; + +/** + * Controller handling the site's simple text pages + * + * @method \Octoleo\CMS\Application\SiteApplication getApplication() Get the application object. + * @property-read \Octoleo\CMS\Application\SiteApplication $app Application object + */ +class PageController extends AbstractController +{ + /** + * The view object. + * + * @var PageHtmlView + */ + private $view; + + /** + * Constructor. + * + * @param PageHtmlView $view The view object. + * @param Input $input The input object. + * @param AbstractApplication $app The application object. + */ + public function __construct(PageHtmlView $view, Input $input = null, AbstractApplication $app = null) + { + parent::__construct($input, $app); + + $this->view = $view; + } + + /** + * Execute the controller. + * + * @return boolean + */ + public function execute(): bool + { + // Enable browser caching + $this->getApplication()->allowCache(true); + + $page = $this->getInput()->getString('view', ''); + $details = $this->getInput()->getString('details', ''); + + // if for some reason the view value is administrator + if ('administrator' === $page) + { + // get uri request to get host + $uri = new Uri($this->getApplication()->get('uri.request')); + + // Redirect to the administrator area + $this->getApplication()->setResponse(new RedirectResponse($uri->getScheme() . '://' . $uri->getHost() . '/administrator/', 301)); + } + else + { + $this->view->setPage($page); + $this->view->setDetails($details); + + $this->getApplication()->setResponse(new HtmlResponse($this->view->render())); + } + + return true; + } +} diff --git a/week-04/project/libraries/src/Controller/WrongCmsController.php b/week-04/project/libraries/src/Controller/WrongCmsController.php new file mode 100644 index 0000000..701e222 --- /dev/null +++ b/week-04/project/libraries/src/Controller/WrongCmsController.php @@ -0,0 +1,40 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Controller; + +use Joomla\Controller\AbstractController; +use Laminas\Diactoros\Response\TextResponse; + +/** + * Controller class to display a message to individuals looking for the wrong CMS + * + * @method \Octoleo\CMS\Application\SiteApplication getApplication() Get the application object. + * @property-read \Octoleo\CMS\Application\SiteApplication $app Application object + */ +class WrongCmsController extends AbstractController +{ + /** + * Execute the controller. + * + * @return boolean + */ + public function execute(): bool + { + // Enable browser caching + $this->getApplication()->allowCache(true); + + $response = new TextResponse("This isn't the CMS you're looking for.", 404); + + $this->getApplication()->setResponse($response); + + return true; + } +} diff --git a/week-04/project/libraries/src/Date/Date.php b/week-04/project/libraries/src/Date/Date.php new file mode 100644 index 0000000..7573d13 --- /dev/null +++ b/week-04/project/libraries/src/Date/Date.php @@ -0,0 +1,484 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Date; + +use Joomla\Database\DatabaseInterface; +use Octoleo\CMS\Factory; + +/** + * Date is a class that stores a date and provides logic to manipulate + * and render that date in a variety of formats. + * + * @method Date|bool add(\DateInterval $interval) Adds an amount of days, months, years, hours, minutes and seconds to a Date object. + * @method Date|bool sub(\DateInterval $interval) Subtracts an amount of days, months, years, hours, minutes and seconds from a Date object. + * @method Date|bool modify(string $modify) Alter the timestamp of this object by incre/decre-menting in a format accepted by strtotime(). + * + * @property-read string $daysinmonth t - Number of days in the given month. + * @property-read string $dayofweek N - ISO-8601 numeric representation of the day of the week. + * @property-read string $dayofyear z - The day of the year (starting from 0). + * @property-read boolean $isleapyear L - Whether it's a leap year. + * @property-read string $day d - Day of the month, 2 digits with leading zeros. + * @property-read string $hour H - 24-hour format of an hour with leading zeros. + * @property-read string $minute i - Minutes with leading zeros. + * @property-read string $second s - Seconds with leading zeros. + * @property-read string $microsecond u - Microseconds with leading zeros. + * @property-read string $month m - Numeric representation of a month, with leading zeros. + * @property-read string $ordinal S - English ordinal suffix for the day of the month, 2 characters. + * @property-read string $week W - ISO-8601 week number of year, weeks starting on Monday. + * @property-read string $year Y - A full numeric representation of a year, 4 digits. + * + * @since 1.7.0 + */ +class Date extends \DateTime +{ + const DAY_ABBR = "\x021\x03"; + const DAY_NAME = "\x022\x03"; + const MONTH_ABBR = "\x023\x03"; + const MONTH_NAME = "\x024\x03"; + + /** + * The format string to be applied when using the __toString() magic method. + * + * @var string + * @since 1.7.0 + */ + public static $format = 'Y-m-d H:i:s'; + + /** + * Placeholder for a \DateTimeZone object with GMT as the time zone. + * + * @var object + * @since 1.7.0 + * + * @deprecated 5.0 Without replacement + */ + protected static $gmt; + + /** + * Placeholder for a \DateTimeZone object with the default server + * time zone as the time zone. + * + * @var object + * @since 1.7.0 + * + * @deprecated 5.0 Without replacement + */ + protected static $stz; + + /** + * The \DateTimeZone object for usage in rending dates as strings. + * + * @var \DateTimeZone + * @since 3.0.0 + */ + protected $tz; + + /** + * Constructor. + * + * @param string $date String in a format accepted by strtotime(), defaults to "now". + * @param mixed $tz Time zone to be used for the date. Might be a string or a DateTimeZone object. + * + * @since 1.7.0 + */ + public function __construct($date = 'now', $tz = null) + { + // Create the base GMT and server time zone objects. + if (empty(self::$gmt) || empty(self::$stz)) + { + // @TODO: This code block stays here only for B/C, can be removed in 5.0 + self::$gmt = new \DateTimeZone('GMT'); + self::$stz = new \DateTimeZone(@date_default_timezone_get()); + } + + // If the time zone object is not set, attempt to build it. + if (!($tz instanceof \DateTimeZone)) + { + if (\is_string($tz)) + { + $tz = new \DateTimeZone($tz); + } + else + { + $tz = new \DateTimeZone('UTC'); + } + } + + // Backup active time zone + $activeTZ = date_default_timezone_get(); + + // Force UTC timezone for correct time handling + date_default_timezone_set('UTC'); + + // If the date is numeric assume a unix timestamp and convert it. + $date = is_numeric($date) ? date('c', $date) : $date; + + // Call the DateTime constructor. + parent::__construct($date, $tz); + + // Restore previously active timezone + date_default_timezone_set($activeTZ); + + // Set the timezone object for access later. + $this->tz = $tz; + } + + /** + * Magic method to access properties of the date given by class to the format method. + * + * @param string $name The name of the property. + * + * @return mixed A value if the property name is valid, null otherwise. + * + * @since 1.7.0 + */ + public function __get($name) + { + $value = null; + + switch ($name) + { + case 'daysinmonth': + $value = $this->format('t', true); + break; + + case 'dayofweek': + $value = $this->format('N', true); + break; + + case 'dayofyear': + $value = $this->format('z', true); + break; + + case 'isleapyear': + $value = (boolean) $this->format('L', true); + break; + + case 'day': + $value = $this->format('d', true); + break; + + case 'hour': + $value = $this->format('H', true); + break; + + case 'minute': + $value = $this->format('i', true); + break; + + case 'second': + $value = $this->format('s', true); + break; + + case 'month': + $value = $this->format('m', true); + break; + + case 'ordinal': + $value = $this->format('S', true); + break; + + case 'week': + $value = $this->format('W', true); + break; + + case 'year': + $value = $this->format('Y', true); + break; + + default: + $trace = debug_backtrace(); + trigger_error( + 'Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], + E_USER_NOTICE + ); + } + + return $value; + } + + /** + * Magic method to render the date object in the format specified in the public + * static member Date::$format. + * + * @return string The date as a formatted string. + * + * @since 1.7.0 + */ + public function __toString() + { + return (string) parent::format(self::$format); + } + + /** + * Proxy for new Date(). + * + * @param string $date String in a format accepted by strtotime(), defaults to "now". + * @param mixed $tz Time zone to be used for the date. + * + * @return Date + * + * @since 1.7.3 + */ + public static function getInstance($date = 'now', $tz = null) + { + return new static($date, $tz); + } + + /** + * Translates day of week number to a string. + * + * @param integer $day The numeric day of the week. + * @param boolean $abbr Return the abbreviated day string? + * + * @return string The day of the week. + * + * @since 1.7.0 + */ + public function dayToString($day, $abbr = false) + { + switch ($day) + { + case 0: + return $abbr ? 'Sun' : 'Sunday'; + case 1: + return $abbr ? 'Mon' : 'Monday'; + case 2: + return $abbr ? 'Tue' : 'Tuesday'; + case 3: + return $abbr ? 'Wed' : 'Wednesday'; + case 4: + return $abbr ? 'Thu' : 'Thursday'; + case 5: + return $abbr ? 'Fri' : 'Friday'; + case 6: + return $abbr ? 'Sat' : 'Saturday'; + } + } + + /** + * Gets the date as a formatted string in a local calendar. + * + * @param string $format The date format specification string (see {@link PHP_MANUAL#date}) + * @param boolean $local True to return the date string in the local time zone, false to return it in GMT. + * @param boolean $translate True to translate localised strings + * + * @return string The date string in the specified format format. + * + * @since 1.7.0 + */ + public function calendar($format, $local = false, $translate = true) + { + return $this->format($format, $local, $translate); + } + + /** + * Gets the date as a formatted string. + * + * @param string $format The date format specification string (see {@link PHP_MANUAL#date}) + * @param boolean $local True to return the date string in the local time zone, false to return it in GMT. + * @param boolean $translate True to translate localised strings + * + * @return string The date string in the specified format format. + * + * @since 1.7.0 + */ + #[\ReturnTypeWillChange] + public function format($format, $local = false, $translate = true) + { + if ($translate) + { + // Do string replacements for date format options that can be translated. + $format = preg_replace('/(^|[^\\\])D/', "\\1" . self::DAY_ABBR, $format); + $format = preg_replace('/(^|[^\\\])l/', "\\1" . self::DAY_NAME, $format); + $format = preg_replace('/(^|[^\\\])M/', "\\1" . self::MONTH_ABBR, $format); + $format = preg_replace('/(^|[^\\\])F/', "\\1" . self::MONTH_NAME, $format); + } + + // If the returned time should not be local use UTC. + if ($local == false) + { + parent::setTimezone(new \DateTimeZone('UTC')); + } + + // Format the date. + $return = parent::format($format); + + if ($translate) + { + // Manually modify the month and day strings in the formatted time. + if (strpos($return, self::DAY_ABBR) !== false) + { + $return = str_replace(self::DAY_ABBR, $this->dayToString(parent::format('w'), true), $return); + } + + if (strpos($return, self::DAY_NAME) !== false) + { + $return = str_replace(self::DAY_NAME, $this->dayToString(parent::format('w')), $return); + } + + if (strpos($return, self::MONTH_ABBR) !== false) + { + $return = str_replace(self::MONTH_ABBR, $this->monthToString(parent::format('n'), true), $return); + } + + if (strpos($return, self::MONTH_NAME) !== false) + { + $return = str_replace(self::MONTH_NAME, $this->monthToString(parent::format('n')), $return); + } + } + + if ($local == false && $this->tz !== null) + { + parent::setTimezone($this->tz); + } + + return $return; + } + + /** + * Get the time offset from GMT in hours or seconds. + * + * @param boolean $hours True to return the value in hours. + * + * @return float The time offset from GMT either in hours or in seconds. + * + * @since 1.7.0 + */ + public function getOffsetFromGmt($hours = false) + { + return (float) $hours ? ($this->tz->getOffset($this) / 3600) : $this->tz->getOffset($this); + } + + /** + * Translates month number to a string. + * + * @param integer $month The numeric month of the year. + * @param boolean $abbr If true, return the abbreviated month string + * + * @return string The month of the year. + * + * @since 1.7.0 + */ + public function monthToString($month, $abbr = false) + { + switch ($month) + { + case 1: + return $abbr ? 'Jan' : 'January'; // + case 2: + return $abbr ? 'Feb' : 'February'; + case 3: + return $abbr ? 'Mar' : 'March'; + case 4: + return $abbr ? 'Apr' : 'April'; + case 5: + return 'May'; + case 6: + return $abbr ? 'Jun' : 'June'; + case 7: + return $abbr ? 'Jul' : 'July'; + case 8: + return $abbr ? 'Aug' : 'August'; + case 9: + return $abbr ? 'Sep' : 'September'; + case 10: + return $abbr ? 'Oct' : 'October'; + case 11: + return $abbr ? 'Nov' : 'November'; + case 12: + return $abbr ? 'Dec' : 'December'; + } + } + + /** + * Method to wrap the setTimezone() function and set the internal time zone object. + * + * @param \DateTimeZone $tz The new \DateTimeZone object. + * + * @return Date + * + * @since 1.7.0 + * @note This method can't be type hinted due to a PHP bug: https://bugs.php.net/bug.php?id=61483 + */ + #[\ReturnTypeWillChange] + public function setTimezone($tz) + { + $this->tz = $tz; + + return parent::setTimezone($tz); + } + + /** + * Gets the date as an ISO 8601 string. IETF RFC 3339 defines the ISO 8601 format + * and it can be found at the IETF Web site. + * + * @param boolean $local True to return the date string in the local time zone, false to return it in GMT. + * + * @return string The date string in ISO 8601 format. + * + * @link http://www.ietf.org/rfc/rfc3339.txt + * @since 1.7.0 + */ + public function toISO8601($local = false) + { + return $this->format(\DateTimeInterface::RFC3339, $local, false); + } + + /** + * Gets the date as an SQL datetime string. + * + * @param boolean $local True to return the date string in the local time zone, false to return it in GMT. + * @param DatabaseInterface $db The database driver or null to use Factory::getDbo() + * + * @return string The date string in SQL datetime format. + * + * @throws \Exception + * @since 2.5.0 + * @link http://dev.mysql.com/doc/refman/5.0/en/datetime.html + */ + public function toSql($local = false, DatabaseInterface $db = null) + { + if ($db === null) + { + /** @var \Joomla\Database\DatabaseInterface $db */ + $db = Factory::getContainer()->get(DatabaseInterface::class); + } + + return $this->format($db->getDateFormat(), $local, false); + } + + /** + * Gets the date as an RFC 822 string. IETF RFC 2822 supercedes RFC 822 and its definition + * can be found at the IETF Web site. + * + * @param boolean $local True to return the date string in the local time zone, false to return it in GMT. + * + * @return string The date string in RFC 822 format. + * + * @link http://www.ietf.org/rfc/rfc2822.txt + * @since 1.7.0 + */ + public function toRFC822($local = false) + { + return $this->format(\DateTimeInterface::RFC2822, $local, false); + } + + /** + * Gets the date as UNIX time stamp. + * + * @return integer The date as a UNIX timestamp. + * + * @since 1.7.0 + */ + public function toUnix() + { + return (int) parent::format('U'); + } +} diff --git a/week-04/project/libraries/src/EventListener/ErrorSubscriber.php b/week-04/project/libraries/src/EventListener/ErrorSubscriber.php new file mode 100644 index 0000000..caef55e --- /dev/null +++ b/week-04/project/libraries/src/EventListener/ErrorSubscriber.php @@ -0,0 +1,195 @@ +renderer = $renderer; + } + + /** + * Returns an array of events this subscriber will listen to. + * + * @return array + */ + public static function getSubscribedEvents(): array + { + return [ + ApplicationEvents::ERROR => 'handleWebError', + ConsoleEvents::APPLICATION_ERROR => 'handleConsoleError', + ]; + } + + /** + * Handle console application errors. + * + * @param ConsoleApplicationErrorEvent $event Event object + * + * @return void + */ + public function handleConsoleError(ConsoleApplicationErrorEvent $event): void + { + $this->logError($event->getError()); + } + + /** + * Handle web application errors. + * + * @param ApplicationErrorEvent $event Event object + * + * @return void + */ + public function handleWebError(ApplicationErrorEvent $event): void + { + /** @var SiteApplication $app */ + $app = $event->getApplication(); + + switch (true) + { + case $event->getError() instanceof MethodNotAllowedException : + // Log the error for reference + $this->logger->error( + sprintf('Route `%s` not supported by method `%s`', $app->get('uri.route'), $app->input->getMethod()), + ['exception' => $event->getError()] + ); + + $this->prepareResponse($event); + + $app->setHeader('Allow', implode(', ', $event->getError()->getAllowedMethods())); + + break; + + case $event->getError() instanceof RouteNotFoundException : + // Log the error for reference + $this->logger->error( + sprintf('Route `%s` not found', $app->get('uri.route')), + ['exception' => $event->getError()] + ); + + $this->prepareResponse($event); + + break; + + default: + $this->logError($event->getError()); + + $this->prepareResponse($event); + + break; + } + } + + /** + * Log the error. + * + * @param \Throwable $throwable The error being processed + * + * @return void + */ + private function logError(\Throwable $throwable): void + { + $this->logger->error( + sprintf('Uncaught Throwable of type %s caught.', \get_class($throwable)), + ['exception' => $throwable] + ); + } + + /** + * Prepare the response for the event + * + * @param ApplicationErrorEvent $event Event object + * + * @return void + */ + private function prepareResponse(ApplicationErrorEvent $event): void + { + /** @var SiteApplication $app */ + $app = $event->getApplication(); + + $app->allowCache(false); + + switch (true) + { + case $app->input->getString('_format', 'html') === 'json' : + case $app->mimeType === 'application/json' : + case $app->getResponse() instanceof JsonResponse : + $data = [ + 'code' => $event->getError()->getCode(), + 'message' => $event->getError()->getMessage(), + 'error' => true, + ]; + + $response = new JsonResponse($data); + + break; + + default : + $response = new HtmlResponse( + $this->renderer->render('exception.twig', ['exception' => $event->getError()]) + ); + + break; + } + + switch ($event->getError()->getCode()) + { + case 404 : + $response = $response->withStatus(404); + + break; + + case 405 : + $response = $response->withStatus(405); + + break; + + case 500 : + default : + $response = $response->withStatus(500); + + break; + } + + $app->setResponse($response); + } +} diff --git a/week-04/project/libraries/src/Factory.php b/week-04/project/libraries/src/Factory.php new file mode 100644 index 0000000..042209d --- /dev/null +++ b/week-04/project/libraries/src/Factory.php @@ -0,0 +1,300 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS; + +\defined('LPATH_PLATFORM') or die; + +use Joomla\Application\WebApplicationInterface; +use Joomla\Database\Service\DatabaseProvider; +use Joomla\DI\Container; +use Joomla\Registry\Registry; +use PHPMailer\PHPMailer\Exception as phpmailerException; + +/** + * Octoleo Platform Factory class. + * + * @since 1.0.0 + * + * SOURCE: https://github.com/joomla/joomla-cms/blob/4.1-dev/libraries/src/Factory.php#L39 + */ +abstract class Factory +{ + /** + * Global application object + * + * @var WebApplicationInterface + * @since 1.0.0 + */ + public static $application = null; + + /** + * Global configuration object + * + * @var \LConfig + * @since 1.0.0 + */ + public static $config = null; + + /** + * Global container object + * + * @var Container + * @since 1.0.0 + */ + public static $container = null; + + /** + * Global mailer object + * + * @var Mail + * @since 1.0.0 + */ + public static $mailer = null; + + /** + * Get the global application object. When the global application doesn't exist, an exception is thrown. + * + * @return WebApplicationInterface object + * + * @since 1.0.0 + * @throws \Exception + */ + public static function getApplication() : WebApplicationInterface + { + if (!self::$application) + { + throw new \Exception('Failed to start application', 500); + } + + return self::$application; + } + + /** + * Get a container object + * + * Returns the global service container object, only creating it if it doesn't already exist. + * + * This method is only suggested for use in code whose responsibility is to create new services + * and needs to be able to resolve the dependencies, and should therefore only be used when the + * container is not accessible by other means. Valid uses of this method include: + * + * - A static `getInstance()` method calling a factory service from the container, + * see `Joomla\CMS\Toolbar\Toolbar::getInstance()` as an example + * - An application front controller loading and executing the Joomla application class, + * see the `cli/joomla.php` file as an example + * - Retrieving optional constructor dependencies when not injected into a class during a transitional + * period to retain backward compatibility, in this case a deprecation notice should also be emitted to + * notify developers of changes needed in their code + * + * This method is not suggested for use as a one-for-one replacement of static calls, such as + * replacing calls to `Factory::getDbo()` with calls to `Factory::getContainer()->get('db')`, code + * should be refactored to support dependency injection instead of making this change. + * + * @return Container + * + * @since 4.0.0 + */ + public static function getContainer(): Container + { + if (!self::$container) + { + self::$container = self::createContainer(); + } + + return self::$container; + } + + /** + * Get a mailer object. + * + * Returns the global {@link Mail} object, only creating it if it doesn't already exist. + * + * @return Mail object + * + * @see Mail + * @since 1.7.0 + */ + public static function getMailer() + { + if (!self::$mailer) + { + self::$mailer = self::createMailer(); + } + + $copy = clone self::$mailer; + + return $copy; + } + + /** + * Create a container object + * + * @return Container + * + * @since 4.0.0 + */ + protected static function createContainer(): Container + { + return (new Container) + ->registerServiceProvider(new Service\ConfigurationProvider(LPATH_CONFIGURATION . '/octoconfig.php')) + ->registerServiceProvider(new Service\SessionProvider) + ->registerServiceProvider(new Service\UserProvider) + ->registerServiceProvider(new DatabaseProvider) + ->registerServiceProvider(new Service\EventProvider) + ->registerServiceProvider(new Service\HttpProvider) + ->registerServiceProvider(new Service\LoggingProvider); + } + + /** + * Get a configuration object + * + * Returns the global {@link \JConfig} object, only creating it if it doesn't already exist. + * + * @param string $file The path to the configuration file + * @param string $type The type of the configuration file + * @param string $namespace The namespace of the configuration file + * + * @return Registry + * + * @see Registry + * @since 1.1.1 + */ + public static function getConfig($file = null, $type = 'PHP', $namespace = '') + { + /** + * If there is an application object, fetch the configuration from there. + * Check it's not null because LanguagesModel can make it null and if it's null + * we would want to re-init it from configuration.php. + */ + if (self::$application && self::$application->getConfig() !== null) + { + return self::$application->getConfig(); + } + + if (!self::$config) + { + if ($file === null) + { + $file = JPATH_CONFIGURATION . '/octoconfig.php'; + } + + self::$config = self::createConfig($file, $type, $namespace); + } + + return self::$config; + } + + /** + * Create a configuration object + * + * @param string $file The path to the configuration file. + * @param string $type The type of the configuration file. + * @param string $namespace The namespace of the configuration file. + * + * @return Registry + * + * @see Registry + * @since 1.0.0 + */ + protected static function createConfig($file, $type = 'PHP', $namespace = '') + { + if (is_file($file)) + { + include_once $file; + } + + // Create the registry with a default namespace of config + $registry = new Registry; + + // Sanitize the namespace. + $namespace = ucfirst((string) preg_replace('/[^A-Z_]/i', '', $namespace)); + + // Build the config name. + $name = 'LConfig' . $namespace; + + // Handle the PHP configuration type. + if ($type === 'PHP' && class_exists($name)) + { + // Create the LConfig object + $config = new $name; + + // Load the configuration values into the registry + $registry->loadObject($config); + } + + return $registry; + } + + /** + * Create a mailer object + * + * @return Mail object + * + * @see Mail + * @since 1.0.0 + */ + protected static function createMailer() + { +// $conf = self::getConfig(); +// +// $smtpauth = ($conf->get('smtpauth') == 0) ? null : 1; +// $smtpuser = $conf->get('smtpuser'); +// $smtppass = $conf->get('smtppass'); +// $smtphost = $conf->get('smtphost'); +// $smtpsecure = $conf->get('smtpsecure'); +// $smtpport = $conf->get('smtpport'); +// $mailfrom = $conf->get('mailfrom'); +// $fromname = $conf->get('fromname'); +// $mailer = $conf->get('mailer'); +// +// // Create a Mail object +// $mail = Mail::getInstance(); +// +// // Clean the email address +// $mailfrom = MailHelper::cleanLine($mailfrom); +// +// // Set default sender without Reply-to if the mailfrom is a valid address +// if (MailHelper::isEmailAddress($mailfrom)) +// { +// // Wrap in try/catch to catch phpmailerExceptions if it is throwing them +// try +// { +// // Check for a false return value if exception throwing is disabled +// if ($mail->setFrom($mailfrom, MailHelper::cleanLine($fromname), false) === false) +// { +// Log::add(__METHOD__ . '() could not set the sender data.', Log::WARNING, 'mail'); +// } +// } +// catch (phpmailerException $e) +// { +// Log::add(__METHOD__ . '() could not set the sender data.', Log::WARNING, 'mail'); +// } +// } +// +// // Default mailer is to use PHP's mail function +// switch ($mailer) +// { +// case 'smtp': +// $mail->useSmtp($smtpauth, $smtphost, $smtpuser, $smtppass, $smtpsecure, $smtpport); +// break; +// +// case 'sendmail': +// $mail->isSendmail(); +// break; +// +// default: +// $mail->isMail(); +// break; +// } +// +// return $mail; + } +} diff --git a/week-04/project/libraries/src/Filter/InputFilter.php b/week-04/project/libraries/src/Filter/InputFilter.php new file mode 100644 index 0000000..570db4f --- /dev/null +++ b/week-04/project/libraries/src/Filter/InputFilter.php @@ -0,0 +1,527 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Filter; + +use Octoleo\CMS\String\PunycodeHelper; +use Joomla\Filter\InputFilter as BaseInputFilter; + +/** + * InputFilter is a class for filtering input from any data source + * + * Forked from the php input filter library by: Daniel Morris + * Original Contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie. + * + * @since 1.7.0 + */ +class InputFilter extends BaseInputFilter +{ + /** + * An array containing a list of extensions for files that are typically + * executable directly in the webserver context, potentially resulting in code executions + * + * @since 4.0.0 + */ + public const FORBIDDEN_FILE_EXTENSIONS = [ + 'php', 'phps', 'pht', 'phtml', 'php3', 'php4', 'php5', 'php6', 'php7', 'asp', + 'php8', 'phar', 'inc', 'pl', 'cgi', 'fcgi', 'java', 'jar', 'py', 'aspx' + ]; + + /** + * A flag for Unicode Supplementary Characters (4-byte Unicode character) stripping. + * + * @var integer + * @since 3.5 + */ + private $stripUSC = 0; + + /** + * A container for InputFilter instances. + * + * @var InputFilter[] + * @since 4.0.0 + */ + protected static $instances = array(); + /** + * Constructor for inputFilter class. Only first parameter is required. + * + * @param array $tagsArray List of user-defined tags + * @param array $attrArray List of user-defined attributes + * @param integer $tagsMethod The constant static::ONLY_ALLOW_DEFINED_TAGS or static::BLOCK_DEFINED_TAGS + * @param integer $attrMethod The constant static::ONLY_ALLOW_DEFINED_ATTRIBUTES or static::BLOCK_DEFINED_ATTRIBUTES + * @param integer $xssAuto Only auto clean essentials = 0, Allow clean blocked tags/attributes = 1 + * @param integer $stripUSC Strip 4-byte unicode characters = 1, no strip = 0 + * + * @since 1.7.0 + */ + public function __construct($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1, $stripUSC = 0) + { + parent::__construct($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto); + + // Assign member variables + $this->stripUSC = $stripUSC; + } + + /** + * Returns an input filter object, only creating it if it doesn't already exist. + * + * @param array $tagsArray List of user-defined tags + * @param array $attrArray List of user-defined attributes + * @param integer $tagsMethod The constant static::ONLY_ALLOW_DEFINED_TAGS or static::BLOCK_DEFINED_TAGS + * @param integer $attrMethod The constant static::ONLY_ALLOW_DEFINED_ATTRIBUTES or static::BLOCK_DEFINED_ATTRIBUTES + * @param integer $xssAuto Only auto clean essentials = 0, Allow clean blocked tags/attributes = 1 + * @param integer $stripUSC Strip 4-byte unicode characters = 1, no strip = 0 + * + * @return InputFilter The InputFilter object. + * + * @since 1.7.0 + */ + public static function getInstance($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1, $stripUSC = 0) + { + $sig = md5(serialize(array($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto))); + + if (empty(self::$instances[$sig])) + { + self::$instances[$sig] = new InputFilter($tagsArray, $attrArray, $tagsMethod, $attrMethod, $xssAuto, $stripUSC); + } + + return self::$instances[$sig]; + } + + /** + * Method to be called by another php script. Processes for XSS and + * specified bad code. + * + * @param mixed $source Input string/array-of-string to be 'cleaned' + * @param string $type The return type for the variable: + * INT: An integer, or an array of integers, + * UINT: An unsigned integer, or an array of unsigned integers, + * FLOAT: A floating point number, or an array of floating point numbers, + * BOOLEAN: A boolean value, + * WORD: A string containing A-Z or underscores only (not case sensitive), + * ALNUM: A string containing A-Z or 0-9 only (not case sensitive), + * CMD: A string containing A-Z, 0-9, underscores, periods or hyphens (not case sensitive), + * BASE64: A string containing A-Z, 0-9, forward slashes, plus or equals (not case sensitive), + * STRING: A fully decoded and sanitised string (default), + * HTML: A sanitised string, + * ARRAY: An array, + * PATH: A sanitised file path, or an array of sanitised file paths, + * TRIM: A string trimmed from normal, non-breaking and multibyte spaces + * USERNAME: Do not use (use an application specific filter), + * RAW: The raw string is returned with no filtering, + * unknown: An unknown filter will act like STRING. If the input is an array it will return an + * array of fully decoded and sanitised strings. + * + * @return mixed 'Cleaned' version of input parameter + * + * @since 1.7.0 + */ + public function clean($source, $type = 'string') + { + // Strip Unicode Supplementary Characters when requested to do so + if ($this->stripUSC) + { + // Alternatively: preg_replace('/[\x{10000}-\x{10FFFF}]/u', "\xE2\xAF\x91", $source) but it'd be slower. + $source = $this->stripUSC($source); + } + + return parent::clean($source, $type); + } + + /** + * Function to punyencode utf8 mail when saving content + * + * @param string $text The strings to encode + * + * @return string The punyencoded mail + * + * @since 3.5 + */ + public function emailToPunycode($text) + { + $pattern = '/(("mailto:)+[\w\.\-\+]+\@[^"?]+\.+[^."?]+("|\?))/'; + + if (preg_match_all($pattern, $text, $matches)) + { + foreach ($matches[0] as $match) + { + $match = (string) str_replace(array('?', '"'), '', $match); + $text = (string) str_replace($match, PunycodeHelper::emailToPunycode($match), $text); + } + } + + return $text; + } + + /** + * Checks an uploaded for suspicious naming and potential PHP contents which could indicate a hacking attempt. + * + * The options you can define are: + * null_byte Prevent files with a null byte in their name (buffer overflow attack) + * forbidden_extensions Do not allow these strings anywhere in the file's extension + * php_tag_in_content Do not allow ` true, + + // Forbidden string in extension (e.g. php matched .php, .xxx.php, .php.xxx and so on) + 'forbidden_extensions' => self::FORBIDDEN_FILE_EXTENSIONS, + + // true, + + // true, + + // __HALT_COMPILER() + 'phar_stub_in_content' => true, + + // Which file extensions to scan for short tags + 'shorttag_extensions' => array( + 'inc', 'phps', 'class', 'php3', 'php4', 'php5', 'php6', 'php7', 'php8', 'txt', 'dat', 'tpl', 'tmpl', + ), + + // Forbidden extensions anywhere in the content + 'fobidden_ext_in_content' => true, + + // Which file extensions to scan for .php in the content + 'php_ext_content_extensions' => array('zip', 'rar', 'tar', 'gz', 'tgz', 'bz2', 'tbz', 'jpa'), + ); + + $options = array_merge($defaultOptions, $options); + + // Make sure we can scan nested file descriptors + $descriptors = $file; + + if (isset($file['name']) && isset($file['tmp_name'])) + { + $descriptors = static::decodeFileData( + array( + $file['name'], + $file['type'], + $file['tmp_name'], + $file['error'], + $file['size'], + ) + ); + } + + // Handle non-nested descriptors (single files) + if (isset($descriptors['name'])) + { + $descriptors = array($descriptors); + } + + // Scan all descriptors detected + foreach ($descriptors as $fileDescriptor) + { + if (!isset($fileDescriptor['name'])) + { + // This is a nested descriptor. We have to recurse. + if (!static::isSafeFile($fileDescriptor, $options)) + { + return false; + } + + continue; + } + + $tempNames = $fileDescriptor['tmp_name']; + $intendedNames = $fileDescriptor['name']; + + if (!\is_array($tempNames)) + { + $tempNames = array($tempNames); + } + + if (!\is_array($intendedNames)) + { + $intendedNames = array($intendedNames); + } + + $len = \count($tempNames); + + for ($i = 0; $i < $len; $i++) + { + $tempName = array_shift($tempNames); + $intendedName = array_shift($intendedNames); + + // 1. Null byte check + if ($options['null_byte']) + { + if (strstr($intendedName, "\x00")) + { + return false; + } + } + + // 2. PHP-in-extension check (.php, .php.xxx[.yyy[.zzz[...]]], .xxx[.yyy[.zzz[...]]].php) + if (!empty($options['forbidden_extensions'])) + { + $explodedName = explode('.', $intendedName); + $explodedName = array_reverse($explodedName); + array_pop($explodedName); + $explodedName = array_map('strtolower', $explodedName); + + /* + * DO NOT USE array_intersect HERE! array_intersect expects the two arrays to + * be set, i.e. they should have unique values. + */ + foreach ($options['forbidden_extensions'] as $ext) + { + if (\in_array($ext, $explodedName)) + { + return false; + } + } + } + + // 3. File contents scanner (PHP tag in file contents) + if ($options['php_tag_in_content'] + || $options['shorttag_in_content'] || $options['phar_stub_in_content'] + || ($options['fobidden_ext_in_content'] && !empty($options['forbidden_extensions']))) + { + $fp = strlen($tempName) ? @fopen($tempName, 'r') : false; + + if ($fp !== false) + { + $data = ''; + + while (!feof($fp)) + { + $data .= @fread($fp, 131072); + + if ($options['php_tag_in_content'] && stripos($data, ' $v) + { + $result[$k] = static::decodeFileData(array($data[0][$k], $data[1][$k], $data[2][$k], $data[3][$k], $data[4][$k])); + } + + return $result; + } + + return array('name' => $data[0], 'type' => $data[1], 'tmp_name' => $data[2], 'error' => $data[3], 'size' => $data[4]); + } + + /** + * Try to convert to plaintext + * + * @param string $source The source string. + * + * @return string Plaintext string + * + * @since 3.5 + */ + protected function decode($source) + { + static $ttr; + + if (!\is_array($ttr)) + { + // Entity decode + $trans_tbl = get_html_translation_table(HTML_ENTITIES, ENT_COMPAT, 'ISO-8859-1'); + + foreach ($trans_tbl as $k => $v) + { + $ttr[$v] = utf8_encode($k); + } + } + + $source = strtr($source, $ttr); + + // Convert decimal + $source = preg_replace_callback( + '/&#(\d+);/m', + function ($m) { + return utf8_encode(\chr($m[1])); + }, + $source + ); + + // Convert hex + $source = preg_replace_callback( + '/&#x([a-f0-9]+);/mi', + function ($m) { + return utf8_encode(\chr('0x' . $m[1])); + }, + $source + ); + + return $source; + } + + /** + * Recursively strip Unicode Supplementary Characters from the source. Not: objects cannot be filtered. + * + * @param mixed $source The data to filter + * + * @return mixed The filtered result + * + * @since 3.5 + */ + protected function stripUSC($source) + { + if (\is_object($source)) + { + return $source; + } + + if (\is_array($source)) + { + $filteredArray = array(); + + foreach ($source as $k => $v) + { + $filteredArray[$k] = $this->stripUSC($v); + } + + return $filteredArray; + } + + return preg_replace('/[\xF0-\xF7].../s', "\xE2\xAF\x91", $source); + } +} diff --git a/week-04/project/libraries/src/Model/DashboardModel.php b/week-04/project/libraries/src/Model/DashboardModel.php new file mode 100644 index 0000000..d942bdd --- /dev/null +++ b/week-04/project/libraries/src/Model/DashboardModel.php @@ -0,0 +1,67 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Model; + +use Joomla\Database\DatabaseDriver; +use Joomla\Database\ParameterType; +use Joomla\Model\DatabaseModelInterface; +use Joomla\Model\DatabaseModelTrait; + +/** + * Model class for pages + * source: https://github.com/joomla/framework.joomla.org/blob/master/src/Model/PackageModel.php + */ +class DashboardModel implements DatabaseModelInterface +{ + use DatabaseModelTrait; + + /** + * Array of legal dashboards + * + * @var array + */ + private $legalDashboards = [ + 'items' => 'items.twig', + 'item' => 'edit.twig', + 'menus' => 'menus.twig', + 'menu' => 'edit.twig', + 'users' => 'users.twig', + 'user' => 'edit.twig' + ]; + + /** + * Instantiate the model. + * + * @param DatabaseDriver $db The database adapter. + */ + public function __construct(DatabaseDriver $db) + { + $this->setDb($db); + } + + /** + * Get a active dashboard template name + * + * @param string $dashboardName The dashboard to lookup + * + * @return string + * + */ + public function getDashboard(string $dashboardName): string + { + if (!isset($this->legalDashboards[$dashboardName])) + { + return 'dashboard.twig'; + } + + return $this->legalDashboards[$dashboardName]; + } +} diff --git a/week-04/project/libraries/src/Model/PageModel.php b/week-04/project/libraries/src/Model/PageModel.php new file mode 100644 index 0000000..69eccbd --- /dev/null +++ b/week-04/project/libraries/src/Model/PageModel.php @@ -0,0 +1,87 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Model; + +use Joomla\Database\DatabaseDriver; +use Joomla\Database\ParameterType; +use Joomla\Model\DatabaseModelInterface; +use Joomla\Model\DatabaseModelTrait; + +/** + * Model class for pages + * source: https://github.com/joomla/framework.joomla.org/blob/master/src/Model/PackageModel.php + */ +class PageModel implements DatabaseModelInterface +{ + use DatabaseModelTrait; + + /** + * Array of legal pages + * + * @var array + */ + private $legalPages = ['products', 'blog', 'about-us', 'location', 'contact-us']; + + /** + * Array of legal details pages + * + * @var array + */ + private $legalDetailsPages = ['yachts', 'ski-boats', 'drones']; + + /** + * Instantiate the model. + * + * @param DatabaseDriver $db The database adapter. + */ + public function __construct(DatabaseDriver $db) + { + $this->setDb($db); + } + + /** + * Get a page's data + * + * @param string $pageName The page to lookup + * + * @return string + * + * @throws \RuntimeException + */ + public function getPage(string $pageName): string + { + if (!in_array($pageName, $this->legalPages)) + { + throw new \RuntimeException(sprintf('Unable to find page data for the `%s`', $pageName), 404); + } + + return $pageName; + } + + /** + * Get a page's details data + * + * @param string $detailsName The page details to lookup + * + * @return string + * + * @throws \RuntimeException + */ + public function getDetails(string $detailsName): string + { + if (strlen($detailsName) && !in_array($detailsName, $this->legalDetailsPages)) + { + throw new \RuntimeException(sprintf('Unable to find page details data for the `%s`', $detailsName), 404); + } + + return $detailsName; + } +} diff --git a/week-04/project/libraries/src/Renderer/ApplicationContext.php b/week-04/project/libraries/src/Renderer/ApplicationContext.php new file mode 100644 index 0000000..690268d --- /dev/null +++ b/week-04/project/libraries/src/Renderer/ApplicationContext.php @@ -0,0 +1,62 @@ +app = $app; + } + + /** + * Gets the base path. + * + * @return string The base path + */ + public function getBasePath() + { + return rtrim($this->app->get('uri.base.path'), '/'); + } + + /** + * Checks whether the request is secure or not. + * + * @return boolean + */ + public function isSecure() + { + if ($this->app instanceof AbstractWebApplication) + { + return $this->app->isSslConnection(); + } + + return false; + } +} \ No newline at end of file diff --git a/week-04/project/libraries/src/Renderer/FrameworkExtension.php b/week-04/project/libraries/src/Renderer/FrameworkExtension.php new file mode 100644 index 0000000..33c612e --- /dev/null +++ b/week-04/project/libraries/src/Renderer/FrameworkExtension.php @@ -0,0 +1,63 @@ + ['html']]), + new TwigFunction('url', [FrameworkTwigRuntime::class, 'getRouteUrl']), + ]; + } + + /** + * Removes the application root path defined by the constant "JPATH_ROOT" + * + * @param string $string The string to process + * + * @return string + */ + public function stripRootPath(string $string): string + { + return str_replace(JPATH_ROOT . DIRECTORY_SEPARATOR, '', $string); + } +} diff --git a/week-04/project/libraries/src/Renderer/FrameworkTwigRuntime.php b/week-04/project/libraries/src/Renderer/FrameworkTwigRuntime.php new file mode 100644 index 0000000..3db62bb --- /dev/null +++ b/week-04/project/libraries/src/Renderer/FrameworkTwigRuntime.php @@ -0,0 +1,161 @@ +app = $app; + $this->preloadManager = $preloadManager; + $this->sriManifestPath = $sriManifestPath; + } + + /** + * Retrieves the current URI + * + * @return string + */ + public function getRequestUri(): string + { + return $this->app->get('uri.request'); + } + + /** + * Get the URI for a route + * + * @param string $route Route to get the path for + * + * @return string + */ + public function getRouteUri(string $route = ''): string + { + return $this->app->get('uri.base.path') . $route; + } + + /** + * Get the full URL for a route + * + * @param string $route Route to get the URL for + * + * @return string + */ + public function getRouteUrl(string $route = ''): string + { + return $this->app->get('uri.base.host') . $this->getRouteUri($route); + } + + /** + * Get the SRI attributes for an asset + * + * @param string $path A public path + * + * @return string + */ + public function getSriAttributes(string $path): string + { + if ($this->sriManifestData === null) + { + if (!file_exists($this->sriManifestPath)) + { + throw new \RuntimeException(sprintf('SRI manifest file "%s" does not exist.', $this->sriManifestPath)); + } + + $sriManifestContents = file_get_contents($this->sriManifestPath); + + if ($sriManifestContents === false) + { + throw new \RuntimeException(sprintf('Could not read SRI manifest file "%s".', $this->sriManifestPath)); + } + + $this->sriManifestData = json_decode($sriManifestContents, true); + + if (0 < json_last_error()) + { + throw new \RuntimeException(sprintf('Error parsing JSON from SRI manifest file "%s" - %s', $this->sriManifestPath, json_last_error_msg())); + } + } + + $assetKey = "/$path"; + + if (!isset($this->sriManifestData[$assetKey])) + { + return ''; + } + + $attributes = ''; + + foreach ($this->sriManifestData[$assetKey] as $key => $value) + { + $attributes .= ' ' . $key . '="' . $value . '"'; + } + + return $attributes; + } + + /** + * Preload a resource + * + * @param string $uri The URI for the resource to preload + * @param string $linkType The preload method to apply + * @param array $attributes The attributes of this link (e.g. "array('as' => true)", "array('pr' => 0.5)") + * + * @return string + * + * @throws \InvalidArgumentException + */ + public function preloadAsset(string $uri, string $linkType = 'preload', array $attributes = []): string + { + $this->preloadManager->link($uri, $linkType, $attributes); + + return $uri; + } +} \ No newline at end of file diff --git a/week-04/project/libraries/src/Service/AdminApplicationProvider.php b/week-04/project/libraries/src/Service/AdminApplicationProvider.php new file mode 100644 index 0000000..b4202c0 --- /dev/null +++ b/week-04/project/libraries/src/Service/AdminApplicationProvider.php @@ -0,0 +1,270 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Service; + +use Joomla\Application\AbstractWebApplication; +use Joomla\Application\Controller\ContainerControllerResolver; +use Joomla\Application\Controller\ControllerResolverInterface; +use Joomla\Application\Web\WebClient; +use Joomla\Database\DatabaseInterface; +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use Joomla\Event\DispatcherInterface; + +use Joomla\Session\SessionInterface; +use Octoleo\CMS\Controller\DashboardController; +use Octoleo\CMS\Controller\LoginController; +use Octoleo\CMS\Controller\WrongCmsController; +use Octoleo\CMS\Model\DashboardModel; +use Octoleo\CMS\User\UserFactoryInterface; +use Octoleo\CMS\View\Admin\DashboardHtmlView; +use Octoleo\CMS\Application\AdminApplication; + +use Joomla\Input\Input; +use Joomla\Renderer\RendererInterface; +use Joomla\Router\Router; +use Joomla\Router\RouterInterface; +use Psr\Log\LoggerInterface; + +/** + * Application service provider + * source: https://github.com/joomla/framework.joomla.org/blob/master/src/Service/ApplicationProvider.php + */ +class AdminApplicationProvider implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + */ + public function register(Container $container): void + { + /* + * Application Classes + */ + + // This service cannot be protected as it is decorated when the debug bar is available + $container->alias(AdminApplication::class, AbstractWebApplication::class) + ->share(AbstractWebApplication::class, [$this, 'getAdminApplicationClassService']); + + /* + * Application Helpers and Dependencies + */ + + // This service cannot be protected as it is decorated when the debug bar is available + $container->alias(ContainerControllerResolver::class, ControllerResolverInterface::class) + ->share(ControllerResolverInterface::class, [$this, 'getControllerResolverService']); + + $container->share(WebClient::class, [$this, 'getWebClientService'], true); + + // This service cannot be protected as it is decorated when the debug bar is available + $container->alias(RouterInterface::class, 'application.router') + ->alias(Router::class, 'application.router') + ->share('application.router', [$this, 'getApplicationRouterService']); + + $container->share(Input::class, [$this, 'getInputClassService'], true); + + /* + * MVC Layer + */ + + // Controllers + $container->alias(DashboardController::class, 'controller.dashboard') + ->share('controller.dashboard', [$this, 'getControllerDashboardService'], true); + + $container->alias(LoginController::class, 'controller.login') + ->share('controller.login', [$this, 'getControllerLoginService'], true); + + $container->alias(WrongCmsController::class, 'controller.wrong.cms') + ->share('controller.wrong.cms', [$this, 'getControllerWrongCmsService'], true); + + // Models + $container->alias(DashboardModel::class, 'model.dashboard') + ->share('model.dashboard', [$this, 'getModelDashboardService'], true); + + // Views + $container->alias(DashboardHtmlView::class, 'view.dashboard.html') + ->share('view.dashboard.html', [$this, 'getViewDashboardHtmlService'], true); + } + + /** + * Get the `application.router` service + * + * @param Container $container The DI container. + * + * @return RouterInterface + */ + public function getApplicationRouterService(Container $container): RouterInterface + { + $router = new Router; + + /* + * CMS Admin Panels + */ + $router->all( + '/index.php?dashboard=*', + DashboardController::class + ); + $router->get( + '/*', + LoginController::class + ); + + return $router; + } + + /** + * Get the `controller.login` service + * + * @param Container $container The DI container. + * + * @return LoginController + */ + public function getControllerLoginService(Container $container): LoginController + { + return new LoginController( + $container->get(RendererInterface::class), + $container->get(Input::class), + $container->get(AdminApplication::class) + ); + } + + /** + * Get the `controller.dashboard` service + * + * @param Container $container The DI container. + * + * @return DashboardController + */ + public function getControllerDashboardService(Container $container): DashboardController + { + return new DashboardController( + $container->get(DashboardHtmlView::class), + $container->get(Input::class), + $container->get(AdminApplication::class) + ); + } + + /** + * Get the `controller.wrong.cms` service + * + * @param Container $container The DI container. + * + * @return WrongCmsController + */ + public function getControllerWrongCmsService(Container $container): WrongCmsController + { + return new WrongCmsController( + $container->get(Input::class), + $container->get(AdminApplication::class) + ); + } + + /** + * Get the Input class service + * + * @param Container $container The DI container. + * + * @return Input + */ + public function getInputClassService(Container $container): Input + { + return new Input($_REQUEST); + } + + /** + * Get the `model.dashboard` service + * + * @param Container $container The DI container. + * + * @return DashboardModel + */ + public function getModelDashboardService(Container $container): DashboardModel + { + return new DashboardModel($container->get(DatabaseInterface::class)); + } + + /** + * Get the WebApplication class service + * + * @param Container $container The DI container. + * + * @return AdminApplication + */ + public function getAdminApplicationClassService(Container $container): AdminApplication + { + /** @var \Octoleo\CMS\Application\AdminApplication $application */ + $application = new AdminApplication( + $container->get(ControllerResolverInterface::class), + $container->get(RouterInterface::class), + $container->get(Input::class), + $container->get('config'), + $container->get(WebClient::class) + ); + + $application->httpVersion = '2'; + + // Inject extra services + $application->setDispatcher($container->get(DispatcherInterface::class)); + $application->setLogger($container->get(LoggerInterface::class)); + $application->setSession($container->get(SessionInterface::class)); + $application->setUserFactory($container->get(UserFactoryInterface::class)); + + return $application; + } + + /** + * Get the controller resolver service + * + * @param Container $container The DI container. + * + * @return ControllerResolverInterface + */ + public function getControllerResolverService(Container $container): ControllerResolverInterface + { + return new ContainerControllerResolver($container); + } + + /** + * Get the `view.page.html` service + * + * @param Container $container The DI container. + * + * @return DashboardHtmlView + */ + public function getViewDashboardHtmlService(Container $container): DashboardHtmlView + { + return new DashboardHtmlView( + $container->get('model.dashboard'), + $container->get('renderer') + ); + } + + /** + * Get the web client service + * + * @param Container $container The DI container. + * + * @return WebClient + */ + public function getWebClientService(Container $container): WebClient + { + /** @var Input $input */ + $input = $container->get(Input::class); + $userAgent = $input->server->getString('HTTP_USER_AGENT', ''); + $acceptEncoding = $input->server->getString('HTTP_ACCEPT_ENCODING', ''); + $acceptLanguage = $input->server->getString('HTTP_ACCEPT_LANGUAGE', ''); + + return new WebClient($userAgent, $acceptEncoding, $acceptLanguage); + } +} diff --git a/week-04/project/libraries/src/Service/ConfigurationProvider.php b/week-04/project/libraries/src/Service/ConfigurationProvider.php new file mode 100644 index 0000000..f655f82 --- /dev/null +++ b/week-04/project/libraries/src/Service/ConfigurationProvider.php @@ -0,0 +1,76 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Service; + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use Joomla\Registry\Registry; + +class ConfigurationProvider implements ServiceProviderInterface +{ + /** + * Configuration instance + * + * @var Registry + */ + private $config; + + /** + * Constructor. + * + * @param string $file Path to the config file. + * + * @throws \RuntimeException + */ + public function __construct(string $file) + { + // Verify the configuration exists and is readable. + if (!is_readable($file)) + { + throw new \RuntimeException('Configuration file does not exist or is unreadable.'); + } + + // load the class + include_once $file; + $this->config = new Registry(new \LConfig()); + + // Set database values based on config values + $this->config->loadObject( (object) ['database' => [ + 'driver' => 'mysql', + 'host' => $this->config->get('host'), + 'port' => $this->config->get('port', ''), + 'user' => $this->config->get('user'), + 'password' => $this->config->get('password'), + 'database' => $this->config->get('db'), + 'prefix' => $this->config->get('dbprefix') + ] + ]); + } + + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + */ + public function register(Container $container): void + { + $container->share( + 'config', + function (): Registry + { + return $this->config; + }, + true + ); + } +} diff --git a/week-04/project/libraries/src/Service/EventProvider.php b/week-04/project/libraries/src/Service/EventProvider.php new file mode 100644 index 0000000..9940861 --- /dev/null +++ b/week-04/project/libraries/src/Service/EventProvider.php @@ -0,0 +1,75 @@ +alias(Dispatcher::class, DispatcherInterface::class) + ->share(DispatcherInterface::class, [$this, 'getDispatcherService']); + + $container->share(ErrorSubscriber::class, [$this, 'getErrorSubscriber'], true) + ->tag('event.subscriber', [ErrorSubscriber::class]); + } + + /** + * Get the DispatcherInterface service + * + * @param Container $container The DI container. + * + * @return DispatcherInterface + */ + public function getDispatcherService(Container $container): DispatcherInterface + { + $dispatcher = new Dispatcher; + + foreach ($container->getTagged('event.subscriber') as $subscriber) + { + $dispatcher->addSubscriber($subscriber); + } + + return $dispatcher; + } + + /** + * Get the ErrorSubscriber service + * + * @param Container $container The DI container. + * + * @return ErrorSubscriber + */ + public function getErrorSubscriber(Container $container): ErrorSubscriber + { + $subscriber = new ErrorSubscriber($container->get(RendererInterface::class)); + $subscriber->setLogger($container->get(LoggerInterface::class)); + + return $subscriber; + } +} diff --git a/week-04/project/libraries/src/Service/HttpProvider.php b/week-04/project/libraries/src/Service/HttpProvider.php new file mode 100644 index 0000000..bae59e8 --- /dev/null +++ b/week-04/project/libraries/src/Service/HttpProvider.php @@ -0,0 +1,64 @@ +alias(Http::class, 'http') + ->share('http', [$this, 'getHttpService'], true); + + $container->alias(HttpFactory::class, 'http.factory') + ->share('http.factory', [$this, 'getHttpFactoryService'], true); + } + + /** + * Get the `http` service + * + * @param Container $container The DI container. + * + * @return Http + */ + public function getHttpService(Container $container): Http + { + /** @var HttpFactory $factory */ + $factory = $container->get('http.factory'); + + return $factory->getHttp(); + } + + /** + * Get the `http.factory` service + * + * @param Container $container The DI container. + * + * @return HttpFactory + */ + public function getHttpFactoryService(Container $container): HttpFactory + { + return new HttpFactory; + } +} \ No newline at end of file diff --git a/week-04/project/libraries/src/Service/LoggingProvider.php b/week-04/project/libraries/src/Service/LoggingProvider.php new file mode 100644 index 0000000..29517b7 --- /dev/null +++ b/week-04/project/libraries/src/Service/LoggingProvider.php @@ -0,0 +1,132 @@ +share('monolog.handler.application', [$this, 'getMonologHandlerApplicationService'], true); + + /* + * Monolog Processors + */ + $container->share('monolog.processor.psr3', [$this, 'getMonologProcessorPsr3Service'], true); + $container->share('monolog.processor.web', [$this, 'getMonologProcessorWebService'], true); + + /* + * Application Loggers + */ + $container->share('monolog.logger.application.cli', [$this, 'getMonologLoggerApplicationCliService'], true); + $container->share('monolog.logger.application.web', [$this, 'getMonologLoggerApplicationWebService'], true); + } + + /** + * Get the `monolog.handler.application` service + * + * @param Container $container The DI container. + * + * @return StreamHandler + */ + public function getMonologHandlerApplicationService(Container $container): StreamHandler + { + /** @var \Joomla\Registry\Registry $config */ + $config = $container->get('config'); + + $level = strtoupper($config->get('log.application', $config->get('log.level', 'error'))); + + return new StreamHandler(LPATH_ROOT . '/logs/framework.log', \constant('\\Monolog\\Logger::' . $level)); + } + + /** + * Get the `monolog.logger.application.cli` service + * + * @param Container $container The DI container. + * + * @return Logger + */ + public function getMonologLoggerApplicationCliService(Container $container): Logger + { + return new Logger( + 'Framework', + [ + $container->get('monolog.handler.application'), + ], + [ + $container->get('monolog.processor.psr3'), + ] + ); + } + + /** + * Get the `monolog.logger.application.web` service + * + * @param Container $container The DI container. + * + * @return Logger + */ + public function getMonologLoggerApplicationWebService(Container $container): Logger + { + return new Logger( + 'Framework', + [ + $container->get('monolog.handler.application'), + ], + [ + $container->get('monolog.processor.psr3'), + $container->get('monolog.processor.web'), + ] + ); + } + + /** + * Get the `monolog.processor.psr3` service + * + * @param Container $container The DI container. + * + * @return PsrLogMessageProcessor + */ + public function getMonologProcessorPsr3Service(Container $container): PsrLogMessageProcessor + { + return new PsrLogMessageProcessor; + } + + /** + * Get the `monolog.processor.web` service + * + * @param Container $container The DI container. + * + * @return WebProcessor + */ + public function getMonologProcessorWebService(Container $container): WebProcessor + { + return new WebProcessor; + } +} \ No newline at end of file diff --git a/week-04/project/libraries/src/Service/SessionProvider.php b/week-04/project/libraries/src/Service/SessionProvider.php new file mode 100644 index 0000000..4ee6fda --- /dev/null +++ b/week-04/project/libraries/src/Service/SessionProvider.php @@ -0,0 +1,128 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Service; + +use Joomla\Application\AbstractWebApplication; +use Joomla\Database\DatabaseInterface; +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use Joomla\Event\Dispatcher; +use Joomla\Session\Session; +use Joomla\Session\SessionInterface; +use Joomla\Session\Storage\NativeStorage as SessionNativeStorage; +use Joomla\Session\StorageInterface; +use Joomla\Session\Handler\DatabaseHandler as SessionDatabaseHandler; +use Joomla\Session\HandlerInterface; +use Octoleo\CMS\Session\MetadataManager; + +/** + * Session service provider + */ +class SessionProvider implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + */ + public function register(Container $container): void + { + + $container->alias(SessionDatabaseHandler::class, HandlerInterface::class) + ->share(HandlerInterface::class, [$this, 'getSessionDatabaseHandlerClassService'], true); + + $container->alias(SessionNativeStorage::class, StorageInterface::class) + ->share(StorageInterface::class, [$this, 'getSessionNativeStorageClassService'], true); + + $container->alias(Session::class, SessionInterface::class) + ->share(SessionInterface::class, [$this, 'getSessionClassService'], true); + + $container->alias(MetadataManager::class, MetadataManager::class) + ->share(MetadataManager::class, [$this, 'getMetadataManagerClassService'], true); + } + + /** + * Get the session metadata manager service + * + * @param Container $container The DI container. + * + * @return MetadataManager + */ + public function getMetadataManagerClassService(Container $container): MetadataManager + { + return new MetadataManager( + $container->get(DatabaseInterface::class) + ); + } + + /** + * Get the `admin.session` service + * + * @param Container $container The DI container. + * + * @return SessionInterface + * @throws \Exception + */ + public function getSessionClassService(Container $container): SessionInterface + { + /** @var \Joomla\Session\Session; $session */ + $session = new Session($container->get(SessionNativeStorage::class), $container->get(Dispatcher::class)); + + // Start session if not already started + if (empty($session->getId())) + { + $session->start(); + } + + return $session; + } + + /** + * Get the Session Database Handler service + * + * @param Container $container The DI container. + * + * @return HandlerInterface + */ + public function getSessionDatabaseHandlerClassService(Container $container): HandlerInterface + { + return new SessionDatabaseHandler($container->get(DatabaseInterface::class)); + } + + /** + * Get the `admin.session` service + * + * @param Container $container The DI container. + * + * @return StorageInterface + */ + public function getSessionNativeStorageClassService(Container $container): StorageInterface + { + /** @var \Joomla\Registry\Registry $config */ + $config = $container->get('config'); + + // Generate a session name. (not secure enough) + $name = md5('octoleoAdmin'); + + // Calculate the session lifetime. + $lifetime = $config->get('lifetime') ? $config->get('lifetime') * 60 : 900; + + // Initialize the options for the Session object. + $options = [ + 'name' => $name, + 'expire' => $lifetime + ]; + + return new SessionNativeStorage($container->get(SessionDatabaseHandler::class), $options); + } +} diff --git a/week-04/project/libraries/src/Service/SiteApplicationProvider.php b/week-04/project/libraries/src/Service/SiteApplicationProvider.php new file mode 100644 index 0000000..01008e6 --- /dev/null +++ b/week-04/project/libraries/src/Service/SiteApplicationProvider.php @@ -0,0 +1,296 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Service; + +use Joomla\Application\AbstractWebApplication; +use Joomla\Application\Controller\ContainerControllerResolver; +use Joomla\Application\Controller\ControllerResolverInterface; +use Joomla\Application\Web\WebClient; +use Joomla\Database\DatabaseInterface; +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use Joomla\Event\DispatcherInterface; + +use Octoleo\CMS\Controller\HomepageController; +use Octoleo\CMS\Controller\WrongCmsController; +use Octoleo\CMS\Controller\PageController; +use Octoleo\CMS\Model\PageModel; +use Octoleo\CMS\View\Page\PageHtmlView; +use Octoleo\CMS\Application\SiteApplication; + +use Joomla\Input\Input; +use Joomla\Renderer\RendererInterface; +use Joomla\Router\Route; +use Joomla\Router\Router; +use Joomla\Router\RouterInterface; +use Psr\Log\LoggerInterface; + +/** + * Application service provider + * source: https://github.com/joomla/framework.joomla.org/blob/master/src/Service/ApplicationProvider.php + */ +class SiteApplicationProvider implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + */ + public function register(Container $container): void + { + /* + * Application Classes + */ + + // This service cannot be protected as it is decorated when the debug bar is available + $container->alias(SiteApplication::class, AbstractWebApplication::class) + ->share(AbstractWebApplication::class, [$this, 'getSiteApplicationClassService']); + + /* + * Application Helpers and Dependencies + */ + + // This service cannot be protected as it is decorated when the debug bar is available + $container->alias(ContainerControllerResolver::class, ControllerResolverInterface::class) + ->share(ControllerResolverInterface::class, [$this, 'getControllerResolverService']); + + $container->share(WebClient::class, [$this, 'getWebClientService'], true); + + // This service cannot be protected as it is decorated when the debug bar is available + $container->alias(RouterInterface::class, 'application.router') + ->alias(Router::class, 'application.router') + ->share('application.router', [$this, 'getApplicationRouterService']); + + $container->share(Input::class, [$this, 'getInputClassService'], true); + + /* + * MVC Layer + */ + + // Controllers + $container->alias(HomepageController::class, 'controller.homepage') + ->share('controller.homepage', [$this, 'getControllerHomepageService'], true); + + $container->alias(PageController::class, 'controller.page') + ->share('controller.page', [$this, 'getControllerPageService'], true); + + $container->alias(WrongCmsController::class, 'controller.wrong.cms') + ->share('controller.wrong.cms', [$this, 'getControllerWrongCmsService'], true); + + // Models + $container->alias(PageModel::class, 'model.page') + ->share('model.page', [$this, 'getModelPageService'], true); + + // Views + $container->alias(PageHtmlView::class, 'view.page.html') + ->share('view.page.html', [$this, 'getViewPageHtmlService'], true); + } + + /** + * Get the `application.router` service + * + * @param Container $container The DI container. + * + * @return RouterInterface + */ + public function getApplicationRouterService(Container $container): RouterInterface + { + $router = new Router; + + /* + * CMS Admin Panels + */ + $router->get( + '/wp-admin', + WrongCmsController::class + ); + + $router->get( + '/wp-admin/*', + WrongCmsController::class + ); + + $router->get( + 'wp-login.php', + WrongCmsController::class + ); + + /* + * Web routes + */ + $router->addRoute(new Route(['GET', 'HEAD'], '/', HomepageController::class)); + + $router->get( + '/:view', + PageController::class + ); + + $router->get( + '/:view', + PageController::class + ); + + $router->get( + '/:view/:details', + PageController::class + ); + + return $router; + } + + /** + * Get the `controller.homepage` service + * + * @param Container $container The DI container. + * + * @return HomepageController + */ + public function getControllerHomepageService(Container $container): HomepageController + { + return new HomepageController( + $container->get(RendererInterface::class), + $container->get(Input::class), + $container->get(SiteApplication::class) + ); + } + + /** + * Get the `controller.page` service + * + * @param Container $container The DI container. + * + * @return PageController + */ + public function getControllerPageService(Container $container): PageController + { + return new PageController( + $container->get(PageHtmlView::class), + $container->get(Input::class), + $container->get(SiteApplication::class) + ); + } + + /** + * Get the `controller.wrong.cms` service + * + * @param Container $container The DI container. + * + * @return WrongCmsController + */ + public function getControllerWrongCmsService(Container $container): WrongCmsController + { + return new WrongCmsController( + $container->get(Input::class), + $container->get(SiteApplication::class) + ); + } + + /** + * Get the Input class service + * + * @param Container $container The DI container. + * + * @return Input + */ + public function getInputClassService(Container $container): Input + { + return new Input($_REQUEST); + } + + /** + * Get the `model.page` service + * + * @param Container $container The DI container. + * + * @return PageModel + */ + public function getModelPageService(Container $container): PageModel + { + return new PageModel($container->get(DatabaseInterface::class)); + } + + /** + * Get the WebApplication class service + * + * @param Container $container The DI container. + * + * @return SiteApplication + */ + public function getSiteApplicationClassService(Container $container): SiteApplication + { + $application = new SiteApplication( + $container->get(ControllerResolverInterface::class), + $container->get(RouterInterface::class), + $container->get(Input::class), + $container->get('config'), + $container->get(WebClient::class) + ); + + $application->httpVersion = '2'; + + // Inject extra services + $application->setDispatcher($container->get(DispatcherInterface::class)); + $application->setLogger($container->get(LoggerInterface::class)); + + return $application; + } + + /** + * Get the controller resolver service + * + * @param Container $container The DI container. + * + * @return ControllerResolverInterface + */ + public function getControllerResolverService(Container $container): ControllerResolverInterface + { + return new ContainerControllerResolver($container); + } + + /** + * Get the `view.page.html` service + * + * @param Container $container The DI container. + * + * @return PageHtmlView + */ + public function getViewPageHtmlService(Container $container): PageHtmlView + { + $view = new PageHtmlView( + $container->get('model.page'), + $container->get('renderer') + ); + + $view->setLayout('page.twig'); + + return $view; + } + + /** + * Get the web client service + * + * @param Container $container The DI container. + * + * @return WebClient + */ + public function getWebClientService(Container $container): WebClient + { + /** @var Input $input */ + $input = $container->get(Input::class); + $userAgent = $input->server->getString('HTTP_USER_AGENT', ''); + $acceptEncoding = $input->server->getString('HTTP_ACCEPT_ENCODING', ''); + $acceptLanguage = $input->server->getString('HTTP_ACCEPT_LANGUAGE', ''); + + return new WebClient($userAgent, $acceptEncoding, $acceptLanguage); + } +} diff --git a/week-04/project/libraries/src/Service/TemplatingProvider.php b/week-04/project/libraries/src/Service/TemplatingProvider.php new file mode 100644 index 0000000..608681c --- /dev/null +++ b/week-04/project/libraries/src/Service/TemplatingProvider.php @@ -0,0 +1,312 @@ +alias(Packages::class, 'asset.packages') + ->share('asset.packages', [$this, 'getAssetPackagesService'], true); + + $container->alias(RendererInterface::class, 'renderer') + ->alias(TwigRenderer::class, 'renderer') + ->share('renderer', [$this, 'getRendererService'], true); + + $container->alias(CacheInterface::class, 'twig.cache') + ->alias(\Twig_CacheInterface::class, 'twig.cache') + ->share('twig.cache', [$this, 'getTwigCacheService'], true); + + $container->alias(Environment::class, 'twig.environment') + ->alias(\Twig_Environment::class, 'twig.environment') + ->share('twig.environment', [$this, 'getTwigEnvironmentService'], true); + + $container->alias(DebugExtension::class, 'twig.extension.debug') + ->alias(\Twig_Extension_Debug::class, 'twig.extension.debug') + ->share('twig.extension.debug', [$this, 'getTwigExtensionDebugService'], true); + + $container->alias(FrameworkExtension::class, 'twig.extension.framework') + ->share('twig.extension.framework', [$this, 'getTwigExtensionFrameworkService'], true); + + // This service cannot be protected as it is decorated when the debug bar is available + $container->alias(ProfilerExtension::class, 'twig.extension.profiler') + ->alias(\Twig_Extension_Profiler::class, 'twig.extension.profiler') + ->share('twig.extension.profiler', [$this, 'getTwigExtensionProfilerService']); + + $container->alias(LoaderInterface::class, 'twig.loader') + ->alias(\Twig_LoaderInterface::class, 'twig.loader') + ->share('twig.loader', [$this, 'getTwigLoaderService'], true); + + $container->alias(Profile::class, 'twig.profiler.profile') + ->alias(\Twig_Profiler_Profile::class, 'twig.profiler.profile') + ->share('twig.profiler.profile', [$this, 'getTwigProfilerProfileService'], true); + + $container->alias(FrameworkTwigRuntime::class, 'twig.runtime.framework') + ->share('twig.runtime.framework', [$this, 'getTwigRuntimeFrameworkService'], true); + + $container->alias(ContainerRuntimeLoader::class, 'twig.runtime.loader') + ->alias(\Twig_ContainerRuntimeLoader::class, 'twig.runtime.loader') + ->share('twig.runtime.loader', [$this, 'getTwigRuntimeLoaderService'], true); + + $this->tagTwigExtensions($container); + } + + /** + * Get the `asset.packages` service + * + * @param Container $container The DI container. + * + * @return Packages + */ + public function getAssetPackagesService(Container $container): Packages + { + /** @var AbstractApplication $app */ + $app = $container->get(AbstractApplication::class); + + $context = new ApplicationContext($app); + + $mediaPath = $app->get('uri.media.path', '/media/'); + + $defaultPackage = new PathPackage($mediaPath, new EmptyVersionStrategy, $context); + + $mixStrategy = new MixPathPackage( + $defaultPackage, + $mediaPath, + new JsonManifestVersionStrategy(LPATH_ROOT . '/media/mix-manifest.json'), + $context + ); + + return new Packages( + $defaultPackage, + [ + 'mix' => $mixStrategy, + ] + ); + } + + /** + * Get the `renderer` service + * + * @param Container $container The DI container. + * + * @return RendererInterface + */ + public function getRendererService(Container $container): RendererInterface + { + return new TwigRenderer($container->get('twig.environment')); + } + + /** + * Get the `twig.cache` service + * + * @param Container $container The DI container. + * + * @return \Twig_CacheInterface + */ + public function getTwigCacheService(Container $container): \Twig_CacheInterface + { + /** @var \Joomla\Registry\Registry $config */ + $config = $container->get('config'); + + // Pull down the renderer config + $cacheEnabled = $config->get('template.cache.enabled', false); + $cachePath = $config->get('template.cache.path', 'cache/twig'); + $debug = $config->get('template.debug', false); + + if ($debug === false && $cacheEnabled !== false) + { + return new FilesystemCache(LPATH_ROOT . '/' . $cachePath); + } + + return new NullCache; + } + + /** + * Get the `twig.environment` service + * + * @param Container $container The DI container. + * + * @return Environment + */ + public function getTwigEnvironmentService(Container $container): Environment + { + /** @var \Joomla\Registry\Registry $config */ + $config = $container->get('config'); + + $debug = $config->get('template.debug', false); + + $environment = new Environment( + $container->get('twig.loader'), + ['debug' => $debug] + ); + + // Add the runtime loader + $environment->addRuntimeLoader($container->get('twig.runtime.loader')); + + // Set up the environment's caching service + $environment->setCache($container->get('twig.cache')); + + // Add the Twig extensions + $environment->setExtensions($container->getTagged('twig.extension')); + + // Add a global tracking the debug states + $environment->addGlobal('appDebug', $config->get('debug', false)); + $environment->addGlobal('fwDebug', $debug); + + return $environment; + } + + /** + * Get the `twig.extension.debug` service + * + * @param Container $container The DI container. + * + * @return DebugExtension + */ + public function getTwigExtensionDebugService(Container $container): DebugExtension + { + return new DebugExtension; + } + + /** + * Get the `twig.extension.framework` service + * + * @param Container $container The DI container. + * + * @return FrameworkExtension + */ + public function getTwigExtensionFrameworkService(Container $container): FrameworkExtension + { + return new FrameworkExtension; + } + + /** + * Get the `twig.extension.profiler` service + * + * @param Container $container The DI container. + * + * @return ProfilerExtension + */ + public function getTwigExtensionProfilerService(Container $container): ProfilerExtension + { + return new ProfilerExtension($container->get('twig.profiler.profile')); + } + + /** + * Get the `twig.loader` service + * + * @param Container $container The DI container. + * + * @return \Twig_LoaderInterface + */ + public function getTwigLoaderService(Container $container): \Twig_LoaderInterface + { + return new FilesystemLoader([LPATH_TEMPLATES]); + } + + /** + * Get the `twig.profiler.profile` service + * + * @param Container $container The DI container. + * + * @return Profile + */ + public function getTwigProfilerProfileService(Container $container): Profile + { + return new Profile; + } + + /** + * Get the `twig.runtime.framework` service + * + * @param Container $container The DI container. + * + * @return FrameworkTwigRuntime + */ + public function getTwigRuntimeFrameworkService(Container $container): FrameworkTwigRuntime + { + return new FrameworkTwigRuntime( + $container->get(AbstractApplication::class), + $container->get(PreloadManager::class), + LPATH_ROOT . '/media/sri-manifest.json' + ); + } + + /** + * Get the `twig.runtime.loader` service + * + * @param Container $container The DI container. + * + * @return ContainerRuntimeLoader + */ + public function getTwigRuntimeLoaderService(Container $container): ContainerRuntimeLoader + { + return new ContainerRuntimeLoader($container); + } + + /** + * Tag services which are Twig extensions + * + * @param Container $container The DI container. + * + * @return void + */ + private function tagTwigExtensions(Container $container): void + { + /** @var \Joomla\Registry\Registry $config */ + $config = $container->get('config'); + + $debug = $config->get('template.debug', false); + + $twigExtensions = ['twig.extension.framework']; + + if ($debug) + { + $twigExtensions[] = 'twig.extension.debug'; + } + + $container->tag('twig.extension', $twigExtensions); + } +} \ No newline at end of file diff --git a/week-04/project/libraries/src/Service/UserProvider.php b/week-04/project/libraries/src/Service/UserProvider.php new file mode 100644 index 0000000..c6affef --- /dev/null +++ b/week-04/project/libraries/src/Service/UserProvider.php @@ -0,0 +1,79 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Service; + +use Joomla\Authentication\AuthenticationStrategyInterface; +use Joomla\Authentication\Strategies\DatabaseStrategy; +use Joomla\Input\Input; +use Octoleo\CMS\User\UserFactory; +use Octoleo\CMS\User\UserFactoryInterface; +use Joomla\Database\DatabaseInterface; +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; + +/** +* Service provider for the user dependency +* +* @since 1.0.0 +* source: https://github.com/joomla/joomla-cms/blob/4.2-dev/libraries/src/Service/Provider/User.php +*/ +class UserProvider implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * + * @since 4.0.0 + */ + public function register(Container $container) + { + $container->alias('user.factory', UserFactoryInterface::class) + ->alias(UserFactory::class, UserFactoryInterface::class) + ->share(UserFactoryInterface::class, [$this, 'getUserFactoryService'], true); + + $container->alias(DatabaseStrategy::class, AuthenticationStrategyInterface::class) + ->share(AuthenticationStrategyInterface::class, [$this, 'getAuthenticationStrategyService'], true); + } + + /** + * Get the UserFactoryInterface class service + * + * @param Container $container The DI container. + * + * @return UserFactoryInterface + * @throws \Exception + */ + public function getUserFactoryService(Container $container): UserFactoryInterface + { + return new UserFactory( + $container->get(DatabaseInterface::class), + $container->get(AuthenticationStrategyInterface::class) + ); + } + + /** + * Get the AuthenticationStrategyInterface class service + * + * @param Container $container The DI container. + * + * @return AuthenticationStrategyInterface + */ + public function getAuthenticationStrategyService(Container $container): AuthenticationStrategyInterface + { + return new DatabaseStrategy( + $container->get(Input::class), + $container->get(DatabaseInterface::class) + ); + } +} diff --git a/week-04/project/libraries/src/Session/MetadataManager.php b/week-04/project/libraries/src/Session/MetadataManager.php new file mode 100644 index 0000000..691fe29 --- /dev/null +++ b/week-04/project/libraries/src/Session/MetadataManager.php @@ -0,0 +1,326 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\Session; + +use Octoleo\CMS\User\User; +use Joomla\Database\DatabaseInterface; +use Joomla\Database\Exception\ExecutionFailureException; +use Joomla\Database\ParameterType; +use Joomla\Session\SessionInterface; + +/** + * Manager for optional session metadata. + * + * @since 3.8.6 + * @internal + */ +final class MetadataManager +{ + /** + * Internal variable indicating a session record exists. + * + * @var integer + * @since 4.0.0 + * @note Once PHP 7.1 is the minimum supported version this should become a private constant + */ + private static $sessionRecordExists = 1; + + /** + * Internal variable indicating a session record does not exist. + * + * @var integer + * @since 4.0.0 + * @note Once PHP 7.1 is the minimum supported version this should become a private constant + */ + private static $sessionRecordDoesNotExist = 0; + + /** + * Internal variable indicating an unknown session record statue. + * + * @var integer + * @since 4.0.0 + * @note Once PHP 7.1 is the minimum supported version this should become a private constant + */ + private static $sessionRecordUnknown = -1; + + /** + * Database driver. + * + * @var DatabaseInterface + * @since 3.8.6 + */ + private $db; + + /** + * MetadataManager constructor. + * + * @param DatabaseInterface $db Database driver. + * + * @since 3.8.6 + */ + public function __construct(DatabaseInterface $db) + { + $this->db = $db; + } + + /** + * Create the metadata record if it does not exist. + * + * @param SessionInterface $session The session to create the metadata record for. + * @param User $user The user to associate with the record. + * + * @return void + * + * @since 3.8.6 + * @throws \RuntimeException + */ + public function createRecordIfNonExisting(SessionInterface $session, User $user) + { + $exists = $this->checkSessionRecordExists($session->getId()); + + // Only touch the database if the record does not already exist + if ($exists !== self::$sessionRecordExists) + { + return; + } + + $this->createSessionRecord($session, $user); + } + + /** + * Create the metadata record if it does not exist. + * + * @param SessionInterface $session The session to create or update the metadata record for. + * @param User $user The user to associate with the record. + * + * @return void + * + * @since 4.0.0 + * @throws \RuntimeException + */ + public function createOrUpdateRecord(SessionInterface $session, User $user) + { + $exists = $this->checkSessionRecordExists($session->getId()); + + // Do not try to touch the database if we can't determine the record state + if ($exists === self::$sessionRecordUnknown) + { + return; + } + + if ($exists === self::$sessionRecordDoesNotExist) + { + $this->createSessionRecord($session, $user); + + return; + } + + $this->updateSessionRecord($session, $user); + } + + /** + * Delete records with a timestamp prior to the given time. + * + * @param integer $time The time records should be deleted if expired before. + * + * @return void + * + * @since 3.8.6 + */ + public function deletePriorTo($time) + { + $query = $this->db->getQuery(true) + ->delete($this->db->quoteName('#__session')) + ->where($this->db->quoteName('time') . ' < :time') + ->bind(':time', $time, ParameterType::INTEGER); + + $this->db->setQuery($query); + + try + { + $this->db->execute(); + } + catch (ExecutionFailureException $exception) + { + // Since garbage collection does not result in a fatal error when run in the session API, we don't allow it here either. + } + } + + /** + * Get session record exists + * + * @param string $sessionId The session ID to check + * + * @return mixed on success value for record presence + * + * @since 1.0.0 + */ + public function getSessionRecord(string $sessionId) + { + $query = $this->db->getQuery(true) + ->select('*') + ->from($this->db->quoteName('#__session')) + ->where($this->db->quoteName('session_id') . ' = :session_id') + ->bind(':session_id', $sessionId) + ->setLimit(1); + + $this->db->setQuery($query); + + return $this->db->loadObject(); + } + + /** + * Check if the session record exists + * + * @param string $sessionId The session ID to check + * + * @return integer Status value for record presence + * + * @since 4.0.0 + */ + private function checkSessionRecordExists(string $sessionId): int + { + $query = $this->db->getQuery(true) + ->select($this->db->quoteName('session_id')) + ->from($this->db->quoteName('#__session')) + ->where($this->db->quoteName('session_id') . ' = :session_id') + ->bind(':session_id', $sessionId) + ->setLimit(1); + + $this->db->setQuery($query); + + try + { + $exists = $this->db->loadResult(); + } + catch (ExecutionFailureException $e) + { + return self::$sessionRecordUnknown; + } + + if ($exists) + { + return self::$sessionRecordExists; + } + + return self::$sessionRecordDoesNotExist; + } + + /** + * Create the session record + * + * @param SessionInterface $session The session to create the metadata record for. + * @param User $user The user to associate with the record. + * + * @return void + * + * @since 4.0.0 + */ + private function createSessionRecord(SessionInterface $session, User $user) + { + $query = $this->db->getQuery(true); + + $time = $session->isNew() ? time() : $session->get('session.timer.start'); + + $columns = [ + $this->db->quoteName('session_id'), + $this->db->quoteName('guest'), + $this->db->quoteName('time'), + $this->db->quoteName('userid'), + $this->db->quoteName('username'), + ]; + + // Add query placeholders + $values = [ + ':session_id', + ':guest', + ':time', + ':user_id', + ':username', + ]; + + // Bind query values + $sessionId = $session->getId(); + $userIsGuest = $user->get('guest', 0); + $userId = $user->get('id', 0); + $username = $user->get('username', ''); + + $query->bind(':session_id', $sessionId) + ->bind(':guest', $userIsGuest, ParameterType::INTEGER) + ->bind(':time', $time) + ->bind(':user_id', $userId, ParameterType::INTEGER) + ->bind(':username', $username); + + $query->insert($this->db->quoteName('#__session')) + ->columns($columns) + ->values(implode(', ', $values)); + + $this->db->setQuery($query); + + try + { + $this->db->execute(); + } + catch (ExecutionFailureException $e) + { + // This failure isn't critical, we can go on without the metadata + } + } + + /** + * Update the session record + * + * @param SessionInterface $session The session to update the metadata record for. + * @param User $user The user to associate with the record. + * + * @return void + * + * @since 4.0.0 + */ + private function updateSessionRecord(SessionInterface $session, User $user) + { + $query = $this->db->getQuery(true); + + $time = time(); + + $setValues = [ + $this->db->quoteName('guest') . ' = :guest', + $this->db->quoteName('time') . ' = :time', + $this->db->quoteName('userid') . ' = :user_id', + $this->db->quoteName('username') . ' = :username', + ]; + + // Bind query values + $sessionId = $session->getId(); + $userIsGuest = $user->get('guest', 0); + $userId = $user->get('id', 0); + $username = $user->get('username', ''); + + $query->bind(':session_id', $sessionId) + ->bind(':guest', $userIsGuest, ParameterType::INTEGER) + ->bind(':time', $time) + ->bind(':user_id', $userId, ParameterType::INTEGER) + ->bind(':username', $username); + + $query->update($this->db->quoteName('#__session')) + ->set($setValues) + ->where($this->db->quoteName('session_id') . ' = :session_id'); + + $this->db->setQuery($query); + + try + { + $this->db->execute(); + } + catch (ExecutionFailureException $e) + { + // This failure isn't critical, we can go on without the metadata + } + } +} \ No newline at end of file diff --git a/week-04/project/libraries/src/String/PunycodeHelper.php b/week-04/project/libraries/src/String/PunycodeHelper.php new file mode 100644 index 0000000..5ece7c7 --- /dev/null +++ b/week-04/project/libraries/src/String/PunycodeHelper.php @@ -0,0 +1,260 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\String; + +use Algo26\IdnaConvert\ToIdn; +use Algo26\IdnaConvert\ToUnicode; +use Joomla\Uri\UriHelper; + +/** + * Joomla Platform String Punycode Class + * + * Class for handling UTF-8 URLs + * Wraps the Punycode library + * All functions assume the validity of utf-8 URLs. + * + * @since 3.1.2 + */ +abstract class PunycodeHelper +{ + /** + * Transforms a UTF-8 string to a Punycode string + * + * @param string $utfString The UTF-8 string to transform + * + * @return string The punycode string + * + * @since 3.1.2 + */ + public static function toPunycode($utfString) + { + return (new ToIdn)->convert($utfString); + } + + /** + * Transforms a Punycode string to a UTF-8 string + * + * @param string $punycodeString The Punycode string to transform + * + * @return string The UF-8 URL + * + * @since 3.1.2 + */ + public static function fromPunycode($punycodeString) + { + return (new ToUnicode)->convert($punycodeString); + } + + /** + * Transforms a UTF-8 URL to a Punycode URL + * + * @param string $uri The UTF-8 URL to transform + * + * @return string The punycode URL + * + * @since 3.1.2 + */ + public static function urlToPunycode($uri) + { + $parsed = UriHelper::parse_url($uri); + + if (!isset($parsed['host']) || $parsed['host'] == '') + { + // If there is no host we do not need to convert it. + return $uri; + } + + $host = $parsed['host']; + $hostExploded = explode('.', $host); + $newhost = ''; + + foreach ($hostExploded as $hostex) + { + $hostex = static::toPunycode($hostex); + $newhost .= $hostex . '.'; + } + + $newhost = substr($newhost, 0, -1); + $newuri = ''; + + if (!empty($parsed['scheme'])) + { + // Assume :// is required although it is not always. + $newuri .= $parsed['scheme'] . '://'; + } + + if (!empty($newhost)) + { + $newuri .= $newhost; + } + + if (!empty($parsed['port'])) + { + $newuri .= ':' . $parsed['port']; + } + + if (!empty($parsed['path'])) + { + $newuri .= $parsed['path']; + } + + if (!empty($parsed['query'])) + { + $newuri .= '?' . $parsed['query']; + } + + if (!empty($parsed['fragment'])) + { + $newuri .= '#' . $parsed['fragment']; + } + + return $newuri; + } + + /** + * Transforms a Punycode URL to a UTF-8 URL + * + * @param string $uri The Punycode URL to transform + * + * @return string The UTF-8 URL + * + * @since 3.1.2 + */ + public static function urlToUTF8($uri) + { + if (empty($uri)) + { + return ''; + } + + $parsed = UriHelper::parse_url($uri); + + if (!isset($parsed['host']) || $parsed['host'] == '') + { + // If there is no host we do not need to convert it. + return $uri; + } + + $host = $parsed['host']; + $hostExploded = explode('.', $host); + $newhost = ''; + + foreach ($hostExploded as $hostex) + { + $hostex = self::fromPunycode($hostex); + $newhost .= $hostex . '.'; + } + + $newhost = substr($newhost, 0, -1); + $newuri = ''; + + if (!empty($parsed['scheme'])) + { + // Assume :// is required although it is not always. + $newuri .= $parsed['scheme'] . '://'; + } + + if (!empty($newhost)) + { + $newuri .= $newhost; + } + + if (!empty($parsed['port'])) + { + $newuri .= ':' . $parsed['port']; + } + + if (!empty($parsed['path'])) + { + $newuri .= $parsed['path']; + } + + if (!empty($parsed['query'])) + { + $newuri .= '?' . $parsed['query']; + } + + if (!empty($parsed['fragment'])) + { + $newuri .= '#' . $parsed['fragment']; + } + + return $newuri; + } + + /** + * Transforms a UTF-8 email to a Punycode email + * This assumes a valid email address + * + * @param string $email The UTF-8 email to transform + * + * @return string The punycode email + * + * @since 3.1.2 + */ + public static function emailToPunycode($email) + { + $explodedAddress = explode('@', $email); + + // Not addressing UTF-8 user names + $newEmail = $explodedAddress[0]; + + if (!empty($explodedAddress[1])) + { + $domainExploded = explode('.', $explodedAddress[1]); + $newdomain = ''; + + foreach ($domainExploded as $domainex) + { + $domainex = static::toPunycode($domainex); + $newdomain .= $domainex . '.'; + } + + $newdomain = substr($newdomain, 0, -1); + $newEmail = $newEmail . '@' . $newdomain; + } + + return $newEmail; + } + + /** + * Transforms a Punycode email to a UTF-8 email + * This assumes a valid email address + * + * @param string $email The punycode email to transform + * + * @return string The punycode email + * + * @since 3.1.2 + */ + public static function emailToUTF8($email) + { + $explodedAddress = explode('@', $email); + + // Not addressing UTF-8 user names + $newEmail = $explodedAddress[0]; + + if (!empty($explodedAddress[1])) + { + $domainExploded = explode('.', $explodedAddress[1]); + $newdomain = ''; + + foreach ($domainExploded as $domainex) + { + $domainex = static::fromPunycode($domainex); + $newdomain .= $domainex . '.'; + } + + $newdomain = substr($newdomain, 0, -1); + $newEmail = $newEmail . '@' . $newdomain; + } + + return $newEmail; + } +} diff --git a/week-04/project/libraries/src/User/User.php b/week-04/project/libraries/src/User/User.php new file mode 100644 index 0000000..cb91d0d --- /dev/null +++ b/week-04/project/libraries/src/User/User.php @@ -0,0 +1,76 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\User; + +use Joomla\Registry\Registry; +use Joomla\Database\DatabaseInterface; +use Octoleo\CMS\Factory; + +/** + * User class. Handles all application interaction with a user + * + * @since 1.0.0 + */ +class User extends Registry +{ + /** + * Constructor activating the default information of the language + * + * @param integer $identifier The primary key of the user to load (optional). + * + * @throws \Exception + * @since 1.1.0 + */ + public function __construct($identifier = 0) + { + // Load the user if it exists + if (!empty($identifier)) + { + $data = $this->load($identifier); + // not a guest + $data->guest = 0; + } + else + { + // Initialise guest + $data = (object) ['id' => 0, 'sendEmail' => 0, 'aid' => 0, 'guest' => 1]; + } + // set the data + parent::__construct($data); + } + + /** + * Method to load a User object by user id number + * + * @param int $id The user id of the user to load + * + * @return Object on success + * + * @throws \Exception + * @since 1.0.0 + */ + protected function load( int $id): object + { + // Get the database + $db = Factory::getContainer()->get(DatabaseInterface::class); + + // Initialise some variables + $query = $db->getQuery(true) + ->select('*') + ->from($db->quoteName('#__users')) + ->where($db->quoteName('id') . ' = :id') + ->bind(':id', $id) + ->setLimit(1); + $db->setQuery($query); + + return $db->loadObject(); + } +} diff --git a/week-04/project/libraries/src/User/UserFactory.php b/week-04/project/libraries/src/User/UserFactory.php new file mode 100644 index 0000000..63043e8 --- /dev/null +++ b/week-04/project/libraries/src/User/UserFactory.php @@ -0,0 +1,481 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\User; + +use Joomla\Authentication\AuthenticationStrategyInterface; +use Joomla\Database\DatabaseInterface; +use Joomla\Authentication\Password\BCryptHandler; +use Joomla\Filter\InputFilter as InputFilterAlias; +use Joomla\String\StringHelper; +use Octoleo\CMS\Application\AdminApplication; +use Octoleo\CMS\Date\Date; +use Octoleo\CMS\Factory; +use Octoleo\CMS\Filter\InputFilter; +use Octoleo\CMS\Session\MetadataManager; + +/** + * Default factory for creating User objects + * + * @since 1.0.0 + * source: https://github.com/joomla/joomla-cms/blob/4.2-dev/libraries/src/User/UserFactory.php + */ +class UserFactory implements UserFactoryInterface +{ + /** + * The database. + * + * @var DatabaseInterface + */ + private $db; + + /** + * @var AuthenticationStrategyInterface + */ + private $authentication; + + /** + * @var InputFilter + */ + private $inputFilter; + + /** + * @var string[] + */ + private $userFilter = [ + 'name' => 'STRING', + 'username' => 'USERNAME', + 'email' => 'STRING', + 'password' => 'RAW', + 'password2' => 'RAW' + ]; + /** + * @var BCryptHandler + */ + private $secure; + + /** + * UserFactory constructor. + * + * @param DatabaseInterface|null $db The database + * @param AuthenticationStrategyInterface|null $authentication + * + * @throws \Exception + */ + public function __construct( + DatabaseInterface $db = null, + AuthenticationStrategyInterface $authentication = null, + BCryptHandler $secure = null) + { + $this->db = ($db) ?: Factory::getApplication()->get(DatabaseInterface::class); + $this->authentication = ($authentication) ?: Factory::getApplication()->get(AuthenticationStrategyInterface::class); + $this->secure = ($secure) ?: new BCryptHandler(); + } + + /** + * Method to get an instance of a user for the given id. + * + * @param int $id The id + * + * @return User + * + * @throws \Exception + * @since 1.0.0 + */ + public function loadUserById(int $id): User + { + return new User($id); + } + + /** + * Method to get an instance of a user for the given username. + * + * @param string $username The username + * + * @return User + * + * @throws \Exception + * @since 1.0.0 + */ + public function loadUserByUsername(string $username): User + { + // Initialise some variables + $query = $this->db->getQuery(true) + ->select($this->db->quoteName('id')) + ->from($this->db->quoteName('#__users')) + ->where($this->db->quoteName('username') . ' = :username') + ->bind(':username', $username) + ->setLimit(1); + $this->db->setQuery($query); + + return $this->loadUserById((int) $this->db->loadResult()); + } + + /** + * Check if user is active + * + * @return bool + * @throws \Exception + */ + public function active(): bool + { + /** @var \Octoleo\CMS\Application\AdminApplication $application */ + $application = Factory::getApplication(); + + $session = $application->getSession(); + + // Grab the current session ID + $sessionId = $session->getId(); + + /** @var \Octoleo\CMS\Session\MetadataManager $manager */ + $manager = Factory::getContainer()->get(MetadataManager::class); + + $active = $manager->getSessionRecord($sessionId); + + // if no active session is found... + if (!$active) + { + return false; + } + + // if user above 0 the active + if ($active->guest == 0 && $active->userid > 0) + { + return true; + } + + // Purge the session + $query = $this->db->getQuery(true) + ->delete($this->db->quoteName('#__session')) + ->where($this->db->quoteName('session_id') . ' = :sessionid') + ->bind(':sessionid', $sessionId); + try + { + $this->db->setQuery($query)->execute(); + } + catch (\RuntimeException $e) + { + // The old session is already invalidated, don't let this block logging in + } + + // destroy session + $session->destroy(); + + // very basic for now.... + return false; + } + + /** + * Check if a user exist based on give key value pair + * + * @param string $value + * @param string $key + * + * @return false|mixed on success return user ID + */ + public function exist(string $value, string $key = 'username') + { + try + { + $id = $this->db->setQuery( + $this->db->getQuery(true) + ->select($this->db->quoteName('id')) + ->from($this->db->quoteName('#__users')) + ->where($this->db->quoteName($key) . ' = ?') + ->bind(1, $value) + )->loadResult(); + } + catch (\RuntimeException $exception) + { + return false; + } + + if ($id > 0) + { + return $id; + } + return false; + } + + /** + * Attempt to authenticate the username and password pair. + * + * @return string|boolean A string containing a username if authentication is successful, false otherwise. + * + * @since 1.1.0 + */ + public function authenticate() + { + return $this->authentication->authenticate(); + } + + /** + * Attempt to login user + * + * @return boolean true on success + * + * @throws \Exception + * @since 1.0.0 + */ + public function login(): bool + { + /** @var \Octoleo\CMS\Application\AdminApplication $application */ + $application = Factory::getApplication(); + + if (($username = $this->authenticate()) !== false) + { + $user = $this->loadUserByUsername($username); + + // If loadUserByUsername returned an error, then pass it back. + if ($user instanceof \Exception) + { + $application->enqueueMessage('Login failure', 'Error'); + + return false; + } + + // If loadUserByUsername returned an error, then pass it back. + if ($user->get('block', true)) + { + $application->enqueueMessage('Login failure, user is blocked.', 'Warning'); + + return false; + } + + return $this->setUserSession($application, $user->toArray()); + } + // set authentication failure message + $application->enqueueMessage('Login failure, please try again.', 'Warning'); + + return false; + } + + /** + * Logout user + * + * @return bool + * @throws \Exception + */ + public function logout(): bool + { + /** @var \Octoleo\CMS\Application\AdminApplication $application */ + $application = Factory::getApplication(); + + $session = $application->getSession(); + + // Grab the current session ID + $sessionId = $session->getId(); + + // Purge the session + $query = $this->db->getQuery(true) + ->delete($this->db->quoteName('#__session')) + ->where($this->db->quoteName('session_id') . ' = :sessionid') + ->bind(':sessionid', $sessionId); + try + { + $this->db->setQuery($query)->execute(); + } + catch (\RuntimeException $e) + { + // The old session is already invalidated, don't let this block logging in + } + + // destroy session + $session->destroy(); + + // very basic for now.... + return true; + } + + /** + * Attempt to great user + * + * @param string|null $name + * @param string|null $username + * @param string|null $email + * @param string|null $password + * @param string|null $password2 + * + * @return boolean true on success + * + * @throws \Exception + * @since 1.0.0 + */ + public function create( + string $name = null, + string $username = null, + string $email = null, + string $password = null, + string $password2 = null): bool + { + /** @var \Octoleo\CMS\Application\AdminApplication $application */ + $application = Factory::getApplication(); + + /** @var \Joomla\Input\Input $input */ + $input = $application->getInput(); + + $user = []; + $user['name'] = ($name) ?: $input->getString('name', ''); + $user['username'] = ($username) ?: $input->getString('username', ''); + $user['email'] = ($email) ?: $input->getString('email', ''); + $user['password'] = ($password) ?: $input->getString('password', ''); + $user['password2'] = ($password2) ?: $input->getString('password2', ''); + + // check if username exist + if (!empty($user['username']) && $this->exist($user['username'])) + { + $application->enqueueMessage('Username already exist, try another username.', 'Warning'); + + return false; + } + // check if email exist + if (!empty($user['email']) && $this->exist($user['email'], 'email')) + { + $application->enqueueMessage('Email already exist, try another email.', 'Warning'); + + return false; + } + + // load our filter + $this->inputFilter = InputFilter::getInstance( + [], + [], + InputFilterAlias::ONLY_BLOCK_DEFINED_TAGS, + InputFilterAlias::ONLY_BLOCK_DEFINED_ATTRIBUTES + ); + + // check that we have all the values set + $valid = true; + foreach ($user as $key => $detail) + { + // check if its empty + if (empty($detail)) + { + $valid = false; + $application->enqueueMessage($key . ' is required', 'error'); + } + // check if its valid + if (!$this->valid($key, $detail)) + { + $valid = false; + $application->enqueueMessage($key . ' is not valid', 'error'); + } + } + + // check passwords TODO: check that we have a valid email + if (isset($user['password2']) && $user['password'] != $user['password2']) + { + $valid = false; + $application->enqueueMessage('Passwords do not match', 'error'); + } + unset ($user['password2']); + + // continue only if valid + if ($valid) + { + // hash the password + $user['password'] = $this->secure->hashPassword($user['password']); + + // set the registration date + $user['registerDate'] = (new Date())->toSql(); + + // set other defaults for now + $user['sendEmail'] = 1; + $user['block'] = 0; + $user['params'] = ''; + + $insert = (object) $user; + + try + { + // Insert the user + $result = $this->db->insertObject('#__users', $insert, 'id'); + } + catch (\RuntimeException $exception) + { + throw new \RuntimeException($exception->getMessage(), 404); + + return false; + } + + // only set session if success + if ($result) + { + $user['id'] = $this->db->insertid(); + return $this->setUserSession($application, $user); + } + } + return false; + } + + /** + * Attempt validate user input (BASIC) + * + * @param string $key + * @param string $detail + * + * @return bool + */ + private function valid(string $key, string $detail): bool + { + if (isset($this->userFilter[$key])) + { + $valid = $this->inputFilter->clean($detail, $this->userFilter[$key]); + + if (StringHelper::strcmp($valid, $detail) == 0) + { + return true; + } + } + return false; + } + + /** + * @param AdminApplication $application + * @param array $user + * + * @return bool + * @throws \Exception + */ + private function setUserSession(AdminApplication $application, array $user): bool + { + $session = $application->getSession(); + + // Grab the current session ID + $oldSessionId = $session->getId(); + + // Fork the session + $session->fork(); + + // Register the needed session variables + $session->set('user', $user); + + // Purge the old session + $query = $this->db->getQuery(true) + ->delete($this->db->quoteName('#__session')) + ->where($this->db->quoteName('session_id') . ' = :sessionid') + ->bind(':sessionid', $oldSessionId); + try + { + $this->db->setQuery($query)->execute(); + } + catch (\RuntimeException $e) + { + // The old session is already invalidated, don't let this block logging in + } + + /** @var \Octoleo\CMS\Session\MetadataManager $manager */ + $manager = Factory::getContainer()->get(MetadataManager::class); + + $manager->createOrUpdateRecord($session, $this->loadUserById($user['id'])); + + return true; + } +} diff --git a/week-04/project/libraries/src/User/UserFactoryInterface.php b/week-04/project/libraries/src/User/UserFactoryInterface.php new file mode 100644 index 0000000..3e20246 --- /dev/null +++ b/week-04/project/libraries/src/User/UserFactoryInterface.php @@ -0,0 +1,48 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\User; + +/** + * Interface defining a factory which can create User objects + * + * @since 1.0.0 + */ +interface UserFactoryInterface +{ + /** + * Method to get an instance of a user for the given id. + * + * @param int $id The id + * + * @return User + * + * @since 1.0.0 + */ + public function loadUserById(int $id): User; + + /** + * Method to get an instance of a user for the given username. + * + * @param string $username The username + * + * @return User + * + * @since 1.0.0 + */ + public function loadUserByUsername(string $username): User; + + /** + * Attempt to authenticate the username and password pair. + * + * @return string|boolean A string containing a username if authentication is successful, false otherwise. + * + * @since 1.1.0 + */ + public function authenticate(); +} diff --git a/week-04/project/libraries/src/View/Admin/DashboardHtmlView.php b/week-04/project/libraries/src/View/Admin/DashboardHtmlView.php new file mode 100644 index 0000000..89ddb30 --- /dev/null +++ b/week-04/project/libraries/src/View/Admin/DashboardHtmlView.php @@ -0,0 +1,83 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\View\Admin; + +use Octoleo\CMS\Model\DashboardModel; +use Joomla\Renderer\RendererInterface; +use Joomla\View\HtmlView; + +/** + * Dashboard HTML view class for the application + */ +class DashboardHtmlView extends HtmlView +{ + /** + * The id of item/user/menu + * + * @var int + */ + private $id; + + /** + * The page model object. + * + * @var DashboardModel + */ + private $dashboardModel; + + /** + * Instantiate the view. + * + * @param DashboardModel $dashboardModel The page model object. + * @param RendererInterface $renderer The renderer object. + */ + public function __construct(DashboardModel $dashboardModel, RendererInterface $renderer) + { + parent::__construct($renderer); + + $this->dashboardModel = $dashboardModel; + } + + /** + * Method to render the view + * + * @return string The rendered view + */ + public function render() + { + $this->setData(['page' => $this->id]); + return parent::render(); + } + + /** + * Set the active dashboard + * + * @param string $name The active page name + * + * @return void + */ + public function setActiveDashboard(string $name): void + { + $this->setLayout($this->dashboardModel->getDashboard($name)); + } + + /** + * Set the active page details + * + * @param int $id The selected item/user/menu + * + * @return void + */ + public function setActiveId(int $id): void + { + $this->id = $id; + } +} diff --git a/week-04/project/libraries/src/View/Page/PageHtmlView.php b/week-04/project/libraries/src/View/Page/PageHtmlView.php new file mode 100644 index 0000000..78dd647 --- /dev/null +++ b/week-04/project/libraries/src/View/Page/PageHtmlView.php @@ -0,0 +1,96 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Octoleo\CMS\View\Page; + +use Octoleo\CMS\Model\PageModel; +use Joomla\Renderer\RendererInterface; +use Joomla\View\HtmlView; + +/** + * Page HTML view class for the application + */ +class PageHtmlView extends HtmlView +{ + /** + * The active page + * + * @var string + */ + private $page = ''; + + /** + * The active page details + * + * @var string + */ + private $details; + + /** + * The page model object. + * + * @var PageModel + */ + private $pageModel; + + /** + * Instantiate the view. + * + * @param PageModel $pageModel The page model object. + * @param RendererInterface $renderer The renderer object. + */ + public function __construct(PageModel $pageModel, RendererInterface $renderer) + { + parent::__construct($renderer); + + $this->pageModel = $pageModel; + } + + /** + * Method to render the view + * + * @return string The rendered view + */ + public function render() + { + $this->setData( + [ + 'page' => $this->pageModel->getPage($this->page), + 'details' => $this->pageModel->getDetails($this->details) + ] + ); + + return parent::render(); + } + + /** + * Set the active page + * + * @param string $page The active page name + * + * @return void + */ + public function setPage(string $page): void + { + $this->page = $page; + } + + /** + * Set the active page details + * + * @param string $page The active page name + * + * @return void + */ + public function setDetails(string $details): void + { + $this->details = $details; + } +} diff --git a/week-04/project/libraries/web.config b/week-04/project/libraries/web.config new file mode 100644 index 0000000..f7a77db --- /dev/null +++ b/week-04/project/libraries/web.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/week-04/project/logs/framework.log b/week-04/project/logs/framework.log new file mode 100644 index 0000000..e69de29 diff --git a/week-04/project/logs/index.html b/week-04/project/logs/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/week-04/project/logs/index.html @@ -0,0 +1 @@ + diff --git a/week-04/project/media/css/index.html b/week-04/project/media/css/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/week-04/project/media/css/index.html @@ -0,0 +1 @@ + diff --git a/week-04/project/media/css/template.css b/week-04/project/media/css/template.css new file mode 100644 index 0000000..e69de29 diff --git a/week-04/project/media/index.html b/week-04/project/media/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/week-04/project/media/index.html @@ -0,0 +1 @@ + diff --git a/week-04/project/media/js/index.html b/week-04/project/media/js/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/week-04/project/media/js/index.html @@ -0,0 +1 @@ + diff --git a/week-04/project/media/js/template.js b/week-04/project/media/js/template.js new file mode 100644 index 0000000..e69de29 diff --git a/week-04/project/media/mix-manifest.json b/week-04/project/media/mix-manifest.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/week-04/project/media/mix-manifest.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/week-04/project/media/sri-manifest.json b/week-04/project/media/sri-manifest.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/week-04/project/media/sri-manifest.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/week-04/project/octoconfig.php.example b/week-04/project/octoconfig.php.example new file mode 100644 index 0000000..3f519f4 --- /dev/null +++ b/week-04/project/octoconfig.php.example @@ -0,0 +1,95 @@ + + * @git WEBD-325-45 + * @license GNU General Public License version 2 or later; see LICENSE.txt + * ------------------------------------------------------------------------- + * THIS SHOULD ONLY BE USED AS A LAST RESORT WHEN THE WEB INSTALLER FAILS + * + * If you are installing Octoleo! manually ie not using the web browser installer + * then rename this file to octoconfig.php eg + * + * UNIX -> mv octoconfig.php.example octoconfig.php + * Windows -> rename octoconfig.php.example octoconfig.php + * + * Now edit this file and configure the parameters for your site and + * database. + * + * Finally move this file to the root folder of your Octoleo installation eg + * + * UNIX -> mv octoconfig.php ../ + * Windows -> copy octoconfig.php ../ + * + * SOURCE: https://github.com/joomla/joomla-cms/blob/4.1-dev/installation/configuration.php-dist + * + */ +class LConfig +{ + public $sitename = 'Octoleo!'; // Name of Octoleo site + + /* Database Settings */ + public $dbtype = 'mysqli'; // Normally mysqli + public $host = 'localhost'; // This is normally set to localhost + public $user = ''; // Database username + public $password = ''; // Database password + public $db = ''; // Database name + public $dbprefix = 'llewellyn_'; // LEAVE THIS UNCHANGED FOR NOW + public $dbencryption = 0; + public $dbsslverifyservercert = false; + public $dbsslkey = ''; + public $dbsslcert = ''; + public $dbsslca = ''; + public $dbsslcipher = ''; + + /* Server Settings */ + public $secret = 'EiT9pmiqMycmQ6xx'; // Use something very secure. For example on linux the following command `cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-16} | head -n 1` + public $helpurl = 'https://help.octoleo.org/proxy?keyref=Help{major}{minor}:{keyref}&lang={langcode}'; + public $tmp_path = '/tmp'; // This path needs to be writable by Octoleo! + + /* Locale Settings */ + public $offset = 'UTC'; + + /* Session settings */ + public $lifetime = 15; // Session time + public $session_handler = 'database'; + public $session_filesystem_path = ''; + public $session_memcached_server_host = 'localhost'; + public $session_memcached_server_port = 11211; + public $session_metadata = true; + public $session_redis_persist = 1; + public $session_redis_server_auth = ''; + public $session_redis_server_db = 0; + public $session_redis_server_host = 'localhost'; + public $session_redis_server_port = 6379; + + /* Mail Settings */ + public $mailonline = true; + public $mailer = 'mail'; + public $mailfrom = ''; + public $fromname = ''; + public $massmailoff = false; + public $replyto = ''; + public $replytoname = ''; + public $sendmail = '/usr/sbin/sendmail'; + public $smtpauth = false; + public $smtpuser = ''; + public $smtppass = ''; + public $smtphost = 'localhost'; + public $smtpsecure = 'none'; + public $smtpport = 25; + + /* Meta Settings */ + public $MetaDesc = 'Octoleo! - the dynamic portal engine and content management system'; + public $MetaAuthor = true; + public $MetaVersion = false; + public $MetaRights = ''; + public $robots = ''; + public $sitename_pagetitles = 0; + + /* Cookie Settings */ + public $cookie_domain = ''; + public $cookie_path = ''; +} diff --git a/week-04/project/robots.txt.dist b/week-04/project/robots.txt.dist new file mode 100644 index 0000000..97b1244 --- /dev/null +++ b/week-04/project/robots.txt.dist @@ -0,0 +1,28 @@ +# If the Joomla site is installed within a folder +# eg www.example.com/joomla/ then the robots.txt file +# MUST be moved to the site root +# eg www.example.com/robots.txt +# AND the joomla folder name MUST be prefixed to all of the +# paths. +# eg the Disallow rule for the /administrator/ folder MUST +# be changed to read +# Disallow: /joomla/administrator/ +# +# For more information about the robots.txt standard, see: +# https://www.robotstxt.org/orig.html + +User-agent: * +Disallow: /administrator/ +Disallow: /bin/ +Disallow: /cache/ +Disallow: /cli/ +Disallow: /components/ +Disallow: /includes/ +Disallow: /installation/ +Disallow: /language/ +Disallow: /layouts/ +Disallow: /libraries/ +Disallow: /logs/ +Disallow: /modules/ +Disallow: /plugins/ +Disallow: /tmp/ diff --git a/week-04/project/sql/index.html b/week-04/project/sql/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/week-04/project/sql/index.html @@ -0,0 +1 @@ + diff --git a/week-04/project/sql/install.sql b/week-04/project/sql/install.sql new file mode 100644 index 0000000..9eaa39a --- /dev/null +++ b/week-04/project/sql/install.sql @@ -0,0 +1,141 @@ +-- +-- DATABASE STRUCTURE FOR GENERIC CMS (Adapted from Joomla!) +-- -- subject to change -- +-- + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET time_zone = "+00:00"; + +-- +-- Table structure for table `llewellyn_menu` +-- + +CREATE TABLE IF NOT EXISTS `llewellyn_menu` ( + `id` int NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL COMMENT 'The display title of the menu item.', + `alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'The SEF alias of the menu item.', + `path` varchar(1024) NOT NULL COMMENT 'The computed path of the menu item based on the alias field.', + `published` tinyint NOT NULL DEFAULT 0 COMMENT 'The published state of the menu link.', + `parent_id` int unsigned NOT NULL DEFAULT 1 COMMENT 'The parent menu item in the menu tree.', + `level` int unsigned NOT NULL DEFAULT 0 COMMENT 'The relative level in the tree.', + `item_id` int unsigned NOT NULL DEFAULT 0 COMMENT 'FK to llewellyn_item.id', + `checked_out` int unsigned COMMENT 'FK to llewellyn_users.id', + `checked_out_time` datetime COMMENT 'The time the menu item was checked out.', + `params` text NOT NULL COMMENT 'JSON encoded data for the menu item.', + `lft` int NOT NULL DEFAULT 0 COMMENT 'Nested set lft.', + `rgt` int NOT NULL DEFAULT 0 COMMENT 'Nested set rgt.', + `home` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Indicates if this menu item is the home or default page.', + `publish_up` datetime, + `publish_down` datetime, + PRIMARY KEY (`id`), + KEY `idx_item` (`item_id`), + KEY `idx_left_right` (`lft`,`rgt`), + KEY `idx_alias` (`alias`(100)), + KEY `idx_path` (`path`(100)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=102; + +-- +-- Table structure for table `llewellyn_session` +-- + +CREATE TABLE IF NOT EXISTS `llewellyn_session` ( + `session_id` varbinary(192) NOT NULL, + `guest` tinyint unsigned DEFAULT 1, + `time` int NOT NULL DEFAULT 0, + `data` mediumtext, + `userid` int DEFAULT 0, + `username` varchar(150) DEFAULT '', + PRIMARY KEY (`session_id`), + KEY `userid` (`userid`), + KEY `time` (`time`), + KEY `guest` (`guest`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +-- +-- Table structure for table `llewellyn_users` +-- + +CREATE TABLE IF NOT EXISTS `llewellyn_users` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(400) NOT NULL DEFAULT '', + `username` varchar(150) NOT NULL DEFAULT '', + `email` varchar(100) NOT NULL DEFAULT '', + `password` varchar(100) NOT NULL DEFAULT '', + `block` tinyint NOT NULL DEFAULT 0, + `sendEmail` tinyint DEFAULT 0, + `registerDate` datetime NOT NULL, + `lastvisitDate` datetime, + `activation` varchar(100) NOT NULL DEFAULT '', + `params` text NOT NULL, + `lastResetTime` datetime COMMENT 'Date of last password reset', + `resetCount` int NOT NULL DEFAULT 0 COMMENT 'Count of password resets since lastResetTime', + `requireReset` tinyint NOT NULL DEFAULT 0 COMMENT 'Require user to reset password on next login', + PRIMARY KEY (`id`), + KEY `idx_name` (`name`(100)), + KEY `idx_block` (`block`), + UNIQUE KEY `idx_username` (`username`), + KEY `email` (`email`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +-- +-- Table structure for table `llewellyn_usergroups` +-- + +CREATE TABLE IF NOT EXISTS `llewellyn_usergroups` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary Key', + `parent_id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Adjacency List Reference Id', + `lft` int NOT NULL DEFAULT 0 COMMENT 'Nested set lft.', + `rgt` int NOT NULL DEFAULT 0 COMMENT 'Nested set rgt.', + `title` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + UNIQUE KEY `idx_usergroup_parent_title_lookup` (`parent_id`,`title`), + KEY `idx_usergroup_title_lookup` (`title`), + KEY `idx_usergroup_adjacency_lookup` (`parent_id`), + KEY `idx_usergroup_nested_set_lookup` (`lft`,`rgt`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +-- +-- Table structure for table `llewellyn_user_usergroup_map` +-- + +CREATE TABLE IF NOT EXISTS `llewellyn_user_usergroup_map` ( + `user_id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Foreign Key to llewellyn_users.id', + `group_id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Foreign Key to llewellyn_usergroups.id', + PRIMARY KEY (`user_id`,`group_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +-- +-- Table structure for table `llewellyn_item` +-- + +CREATE TABLE IF NOT EXISTS `llewellyn_item` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL DEFAULT '', + `alias` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '', + `introtext` mediumtext NOT NULL, + `fulltext` mediumtext NOT NULL, + `state` tinyint NOT NULL DEFAULT 0, + `created` datetime NOT NULL, + `created_by` int unsigned NOT NULL DEFAULT 0, + `created_by_alias` varchar(255) NOT NULL DEFAULT '', + `modified` datetime NOT NULL, + `modified_by` int unsigned NOT NULL DEFAULT 0, + `checked_out` int unsigned, + `checked_out_time` datetime NULL DEFAULT NULL, + `publish_up` datetime NULL DEFAULT NULL, + `publish_down` datetime NULL DEFAULT NULL, + `version` int unsigned NOT NULL DEFAULT 1, + `ordering` int NOT NULL DEFAULT 0, + `metakey` text, + `metadesc` text NOT NULL, + `hits` int unsigned NOT NULL DEFAULT 0, + `metadata` text NOT NULL, + `featured` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Set if article is featured.', + PRIMARY KEY (`id`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_state` (`state`), + KEY `idx_createdby` (`created_by`), + KEY `idx_alias` (`alias`(191)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + + diff --git a/week-04/project/templates/admin/dashboard.twig b/week-04/project/templates/admin/dashboard.twig new file mode 100644 index 0000000..e88e51c --- /dev/null +++ b/week-04/project/templates/admin/dashboard.twig @@ -0,0 +1,20 @@ +{% extends "index.twig" %} + +{% block title %}Octoleo Dashboard{% endblock %} + +{% block content %} +
+

Octoleo CMS Dashboard

+
+
+ +
+
+ +
+
+ +
+
+
+{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/admin/edit.twig b/week-04/project/templates/admin/edit.twig new file mode 100644 index 0000000..50a748d --- /dev/null +++ b/week-04/project/templates/admin/edit.twig @@ -0,0 +1,37 @@ +{% extends "index.twig" %} + +{% block title %}Edit{% endblock %} + +{% block content %} +
+
+
+ Legend +
+ +
+
+ +
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/admin/exception.twig b/week-04/project/templates/admin/exception.twig new file mode 100644 index 0000000..b5488d1 --- /dev/null +++ b/week-04/project/templates/admin/exception.twig @@ -0,0 +1,29 @@ +{% extends 'index.twig' %} + +{% block bodyNavigation %}{% endblock %} + +{% block title %}Octoleo Error{% endblock %} + +{% block content %} +
+ {% if exception.code in [404, 405] %} +

We Couldn't Find It

+

Sorry, we couldn't find the page matching your request. Try using the navigation to find what you were looking for?

+ {% else %} +

Ouch, That's an Error

+

Well this is embarrassing, seems there was an error processing this request. Perhaps try again? Or file an issue so we can address it.

+ {% endif %} + + {% if appDebug %} +

{{ exception.code|default(0) }} {{ exception|get_class }}

+

{{ exception.message|strip_root_path }}

+ + {% if exception.previous %} + {% set _previous = exception.previous %} +

Previous Exception

+

{{ exception.code|default(0) }} {{ exception|get_class }}

+

{{ exception.message|strip_root_path }}

+ {% endif %} + {% endif %} +
+{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/admin/footer.twig b/week-04/project/templates/admin/footer.twig new file mode 100644 index 0000000..3da6797 --- /dev/null +++ b/week-04/project/templates/admin/footer.twig @@ -0,0 +1,9 @@ +{% macro load_footer() %} +
+
+
+ Copyright © Generic Company. All Rights Reserved. | Octoleo CMS +
+
+
+{% endmacro %} \ No newline at end of file diff --git a/week-04/project/templates/admin/header.twig b/week-04/project/templates/admin/header.twig new file mode 100644 index 0000000..6761f39 --- /dev/null +++ b/week-04/project/templates/admin/header.twig @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + {% block title %}Octoleo! Framework, a framework for developing PHP applications{% endblock %} + + + + + + + + + + + + + + {% block metadata %}{% endblock %} + + + + + + + {% block headCSS %}{% endblock %} + {% block headJavaScript %}{% endblock %} + +{% block body %}{% endblock %} + \ No newline at end of file diff --git a/week-04/project/templates/admin/index.html b/week-04/project/templates/admin/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/week-04/project/templates/admin/index.html @@ -0,0 +1 @@ + diff --git a/week-04/project/templates/admin/index.twig b/week-04/project/templates/admin/index.twig new file mode 100644 index 0000000..e43c158 --- /dev/null +++ b/week-04/project/templates/admin/index.twig @@ -0,0 +1,13 @@ +{% extends "header.twig" %} + +{% block body %} + +{% block bodyNavigation %}{% import 'nav.twig' as macros %}{{ macros.load_admin_navbar() }}{% endblock %} +
+ {% block content %}{% endblock %} +
+{% block footerContent %}{% import 'footer.twig' as macros %}{{ macros.load_footer() }}{% endblock %} +{% block bodyJavaScript %}{% endblock %} +{{ url }} + +{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/admin/items.twig b/week-04/project/templates/admin/items.twig new file mode 100644 index 0000000..3a35f38 --- /dev/null +++ b/week-04/project/templates/admin/items.twig @@ -0,0 +1,52 @@ +{% extends "index.twig" %} + +{% block title %}Items{% endblock %} + +{% block content %} +
+

Items

+ Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table HeadingTable HeadingTable Heading
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
+
+ +{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/admin/login.twig b/week-04/project/templates/admin/login.twig new file mode 100644 index 0000000..ef797cc --- /dev/null +++ b/week-04/project/templates/admin/login.twig @@ -0,0 +1,18 @@ +{% extends "index.twig" %} + +{% block bodyNavigation %}{% endblock %} + +{% block content %} +
+
+

Login Here

+
+ + + + Create Account +
+
+
+{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/admin/menus.twig b/week-04/project/templates/admin/menus.twig new file mode 100644 index 0000000..360699a --- /dev/null +++ b/week-04/project/templates/admin/menus.twig @@ -0,0 +1,50 @@ +{% extends "index.twig" %} + +{% block content %} +
+

Menus

+ Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table HeadingTable HeadingTable Heading
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
+
+ +{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/admin/nav.twig b/week-04/project/templates/admin/nav.twig new file mode 100644 index 0000000..c5f4609 --- /dev/null +++ b/week-04/project/templates/admin/nav.twig @@ -0,0 +1,19 @@ +{% macro load_admin_navbar() %} + +{% endmacro %} + \ No newline at end of file diff --git a/week-04/project/templates/admin/signup.twig b/week-04/project/templates/admin/signup.twig new file mode 100644 index 0000000..11cff72 --- /dev/null +++ b/week-04/project/templates/admin/signup.twig @@ -0,0 +1,21 @@ +{% extends "index.twig" %} + +{% block bodyNavigation %}{% endblock %} + +{% block content %} +
+
+

Create Account

+
+ + + + + + + Login +
+
+
+{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/admin/users.twig b/week-04/project/templates/admin/users.twig new file mode 100644 index 0000000..770f5d5 --- /dev/null +++ b/week-04/project/templates/admin/users.twig @@ -0,0 +1,32 @@ +{% extends "index.twig" %} + +{% block title %}Users{% endblock %} + +{% block content %} +
+

Users

+ Create + + + + + + + + + + + + + + + + + + + + +
Table HeadingTable HeadingTable Heading
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
Table DataLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Edit
+
+ +{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/index.html b/week-04/project/templates/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/week-04/project/templates/index.html @@ -0,0 +1 @@ + diff --git a/week-04/project/templates/site/exception.twig b/week-04/project/templates/site/exception.twig new file mode 100644 index 0000000..fc9de64 --- /dev/null +++ b/week-04/project/templates/site/exception.twig @@ -0,0 +1,27 @@ +{% extends 'index.twig' %} + +{% block title %}Octoleo Error{% endblock %} + +{% block content %} +
+ {% if exception.code in [404, 405] %} +

We Couldn't Find It

+

Sorry, we couldn't find the page matching your request. Try using the navigation to find what you were looking for?

+ {% else %} +

Ouch, That's an Error

+

Well this is embarrassing, seems there was an error processing this request. Perhaps try again? Or file an issue so we can address it.

+ {% endif %} + + {% if appDebug %} +

{{ exception.code|default(0) }} {{ exception|get_class }}

+

{{ exception.message|strip_root_path }}

+ + {% if exception.previous %} + {% set _previous = exception.previous %} +

Previous Exception

+

{{ exception.code|default(0) }} {{ exception|get_class }}

+

{{ exception.message|strip_root_path }}

+ {% endif %} + {% endif %} +
+{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/site/footer.twig b/week-04/project/templates/site/footer.twig new file mode 100644 index 0000000..3da6797 --- /dev/null +++ b/week-04/project/templates/site/footer.twig @@ -0,0 +1,9 @@ +{% macro load_footer() %} +
+
+
+ Copyright © Generic Company. All Rights Reserved. | Octoleo CMS +
+
+
+{% endmacro %} \ No newline at end of file diff --git a/week-04/project/templates/site/header.twig b/week-04/project/templates/site/header.twig new file mode 100644 index 0000000..6761f39 --- /dev/null +++ b/week-04/project/templates/site/header.twig @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + {% block title %}Octoleo! Framework, a framework for developing PHP applications{% endblock %} + + + + + + + + + + + + + + {% block metadata %}{% endblock %} + + + + + + + {% block headCSS %}{% endblock %} + {% block headJavaScript %}{% endblock %} + +{% block body %}{% endblock %} + \ No newline at end of file diff --git a/week-04/project/templates/site/homepage.twig b/week-04/project/templates/site/homepage.twig new file mode 100644 index 0000000..153f13c --- /dev/null +++ b/week-04/project/templates/site/homepage.twig @@ -0,0 +1,10 @@ +{% extends "index.twig" %} + +{% block content %} +
+
+

Welcome

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

+
+
+{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/site/index.html b/week-04/project/templates/site/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/week-04/project/templates/site/index.html @@ -0,0 +1 @@ + diff --git a/week-04/project/templates/site/index.twig b/week-04/project/templates/site/index.twig new file mode 100644 index 0000000..207d374 --- /dev/null +++ b/week-04/project/templates/site/index.twig @@ -0,0 +1,12 @@ +{% extends "header.twig" %} + +{% block body %} + +{% block bodyNavigation %}{% import 'nav.twig' as macros %}{{ macros.load_site_navbar() }}{% endblock %} +
+ {% block content %}{% endblock %} +
+{% block footerContent %}{% import 'footer.twig' as macros %}{{ macros.load_footer() }}{% endblock %} +{% block bodyJavaScript %}{% endblock %} + +{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/site/nav.twig b/week-04/project/templates/site/nav.twig new file mode 100644 index 0000000..38bee15 --- /dev/null +++ b/week-04/project/templates/site/nav.twig @@ -0,0 +1,28 @@ +{% macro load_site_navbar() %} + +{% endmacro %} + \ No newline at end of file diff --git a/week-04/project/templates/site/page.twig b/week-04/project/templates/site/page.twig new file mode 100644 index 0000000..92f6759 --- /dev/null +++ b/week-04/project/templates/site/page.twig @@ -0,0 +1,14 @@ +{% extends "index.twig" %} + +{% block content %} +
+
+

{{ page }}

+ {% if details == '' %} +

YOU ARE IN PAGES

+ {% else %} +

You are into {{ details }}

+ {% endif %} +
+
+{% endblock %} \ No newline at end of file diff --git a/week-04/project/templates/system/build_incomplete.html b/week-04/project/templates/system/build_incomplete.html new file mode 100644 index 0000000..48bd040 --- /dev/null +++ b/week-04/project/templates/system/build_incomplete.html @@ -0,0 +1,34 @@ + + + + + + + Octoleo: Environment Setup Incomplete + + + +
+
+
+

Environment Setup Incomplete

+

It looks like you are trying to run Octoleo! from our git repository. To do so requires you complete a couple of extra steps first.

+

+ 0. Make sure you have composer installed on your system. +
+ 1. In your terminal go to the root folder of your Octoleo website where you will find the composer.json file. +
+ 2. Run the following command composer install to install all PHP packages. +

+
+ +
+
+ + + diff --git a/week-04/project/templates/system/incompatible.html b/week-04/project/templates/system/incompatible.html new file mode 100644 index 0000000..fd33990 --- /dev/null +++ b/week-04/project/templates/system/incompatible.html @@ -0,0 +1,27 @@ + + + + + + + Octoleo: unsupported PHP version + + + +
+
+
+

Sorry, your PHP version is not supported

+

Your host needs to use PHP version {{phpversion}} or newer to run this version of Octoleo!

+
+ +
+
+ + + \ No newline at end of file diff --git a/week-04/project/templates/system/index.html b/week-04/project/templates/system/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/week-04/project/templates/system/index.html @@ -0,0 +1 @@ + diff --git a/week-04/project/templates/system/install_notice.html b/week-04/project/templates/system/install_notice.html new file mode 100644 index 0000000..d016616 --- /dev/null +++ b/week-04/project/templates/system/install_notice.html @@ -0,0 +1,36 @@ + + + + + + + Octoleo: Installation Instructions + + + +
+
+
+

Installation Instructions

+

You need to manually do the following few tasks.

+

+ 1. Import the SQL tables into your database found in /sql/install.sql +
+ 2. Copy the /octoconfig.php.example file to /octoconfig.php +
+ 3 .Update the /octoconfig.php to reflect your CMS details +
+ 4. Remove the installation folder from you root directory +

+
+ +
+
+ + + \ No newline at end of file diff --git a/week-04/project/tmp/index.html b/week-04/project/tmp/index.html new file mode 100644 index 0000000..2efb97f --- /dev/null +++ b/week-04/project/tmp/index.html @@ -0,0 +1 @@ + diff --git a/week-04/project/web.config.txt b/week-04/project/web.config.txt new file mode 100644 index 0000000..e15eb64 --- /dev/null +++ b/week-04/project/web.config.txt @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +